3 Copyright (c) 2007 - 2008, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 This file contains the entry code to the HII database, which is defined by
19 UEFI 2.1 specification.
27 #include "HiiDatabase.h"
32 EFI_EVENT gHiiKeyboardLayoutChanged
;
33 STATIC EFI_GUID gHiiSetKbdLayoutEventGuid
= EFI_HII_SET_KEYBOARD_LAYOUT_EVENT_GUID
;
35 STATIC HII_DATABASE_PRIVATE_DATA mPrivate
= {
36 HII_DATABASE_PRIVATE_DATA_SIGNATURE
,
51 #ifndef _DISABLE_UNUSED_HII_PROTOCOLS_
65 HiiGetSecondaryLanguages
72 HiiExportPackageLists
,
73 HiiRegisterPackageNotify
,
74 HiiUnregisterPackageNotify
,
75 HiiFindKeyboardLayouts
,
78 HiiGetPackageListHandle
81 HiiConfigRoutingExtractConfig
,
82 HiiConfigRoutingExportConfig
,
83 HiiConfigRoutingRouteConfig
,
97 EFI_TEXT_ATTR (EFI_LIGHTGRAY
, EFI_BLACK
),
102 {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
108 The default event handler for gHiiKeyboardLayoutChanged
111 This is internal function.
113 @param Event The event that triggered this notification function.
114 @param Context Pointer to the notification functions context.
119 KeyboardLayoutChangeNullEvent (
128 Initialize HII Database.
131 @param ImageHandle The image handle.
132 @param SystemTable The system table.
134 @retval EFI_SUCCESS The Hii database is setup correctly.
135 @return Other value if failed to create the default event for
136 gHiiKeyboardLayoutChanged. Check gBS->CreateEventEx for
137 details. Or failed to insatll the protocols.
138 Check gBS->InstallMultipleProtocolInterfaces for details.
143 InitializeHiiDatabase (
144 IN EFI_HANDLE ImageHandle
,
145 IN EFI_SYSTEM_TABLE
*SystemTable
152 // There will be only one HII Database in the system
153 // If there is another out there, someone is trying to install us
154 // again. Fail that scenario.
156 ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL
, &gEfiHiiDatabaseProtocolGuid
);
157 ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL
, &gEfiHiiFontProtocolGuid
);
158 ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL
, &gEfiHiiImageProtocolGuid
);
159 ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL
, &gEfiHiiStringProtocolGuid
);
160 ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL
, &gEfiHiiConfigRoutingProtocolGuid
);
162 InitializeListHead (&mPrivate
.DatabaseList
);
163 InitializeListHead (&mPrivate
.DatabaseNotifyList
);
164 InitializeListHead (&mPrivate
.HiiHandleList
);
165 InitializeListHead (&mPrivate
.FontInfoList
);
168 // Create a event with EFI_HII_SET_KEYBOARD_LAYOUT_EVENT_GUID group type.
170 Status
= gBS
->CreateEventEx (
171 EFI_EVENT_NOTIFY_SIGNAL
,
173 KeyboardLayoutChangeNullEvent
,
175 &gHiiSetKbdLayoutEventGuid
,
176 &gHiiKeyboardLayoutChanged
178 if (EFI_ERROR (Status
)) {
183 return gBS
->InstallMultipleProtocolInterfaces (
185 &gEfiHiiFontProtocolGuid
,
187 #ifndef _DISABLE_UNUSED_HII_PROTOCOLS_
188 &gEfiHiiImageProtocolGuid
,
191 &gEfiHiiStringProtocolGuid
,
193 &gEfiHiiDatabaseProtocolGuid
,
194 &mPrivate
.HiiDatabase
,
195 &gEfiHiiConfigRoutingProtocolGuid
,
196 &mPrivate
.ConfigRouting
,