2 This file contains the entry code to the HII database, which is defined by
3 UEFI 2.1 specification.
5 Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR>
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17 #include "HiiDatabase.h"
22 EFI_EVENT gHiiKeyboardLayoutChanged
;
24 HII_DATABASE_PRIVATE_DATA mPrivate
= {
25 HII_DATABASE_PRIVATE_DATA_SIGNATURE
,
52 HiiGetSecondaryLanguages
59 HiiExportPackageLists
,
60 HiiRegisterPackageNotify
,
61 HiiUnregisterPackageNotify
,
62 HiiFindKeyboardLayouts
,
65 HiiGetPackageListHandle
68 HiiConfigRoutingExtractConfig
,
69 HiiConfigRoutingExportConfig
,
70 HiiConfigRoutingRouteConfig
,
76 EfiConfigKeywordHandlerSetData
,
77 EfiConfigKeywordHandlerGetData
88 EFI_TEXT_ATTR (EFI_LIGHTGRAY
, EFI_BLACK
),
93 {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
98 GLOBAL_REMOVE_IF_UNREFERENCED CONST EFI_HII_IMAGE_PROTOCOL mImageProtocol
= {
107 The default event handler for gHiiKeyboardLayoutChanged
110 This is internal function.
112 @param Event The event that triggered this notification function.
113 @param Context Pointer to the notification functions context.
118 KeyboardLayoutChangeNullEvent (
127 Initialize HII Database.
130 @param ImageHandle The image handle.
131 @param SystemTable The system table.
133 @retval EFI_SUCCESS The Hii database is setup correctly.
134 @return Other value if failed to create the default event for
135 gHiiKeyboardLayoutChanged. Check gBS->CreateEventEx for
136 details. Or failed to insatll the protocols.
137 Check gBS->InstallMultipleProtocolInterfaces for details.
142 InitializeHiiDatabase (
143 IN EFI_HANDLE ImageHandle
,
144 IN EFI_SYSTEM_TABLE
*SystemTable
151 // There will be only one HII Database in the system
152 // If there is another out there, someone is trying to install us
153 // again. Fail that scenario.
155 ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL
, &gEfiHiiDatabaseProtocolGuid
);
156 ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL
, &gEfiHiiFontProtocolGuid
);
157 ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL
, &gEfiHiiImageProtocolGuid
);
158 ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL
, &gEfiHiiStringProtocolGuid
);
159 ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL
, &gEfiHiiConfigRoutingProtocolGuid
);
160 ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL
, &gEfiConfigKeywordHandlerProtocolGuid
);
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 (
173 KeyboardLayoutChangeNullEvent
,
175 &gEfiHiiKeyBoardLayoutGuid
,
176 &gHiiKeyboardLayoutChanged
178 if (EFI_ERROR (Status
)) {
183 Status
= gBS
->InstallMultipleProtocolInterfaces (
185 &gEfiHiiFontProtocolGuid
,
187 &gEfiHiiStringProtocolGuid
,
189 &gEfiHiiDatabaseProtocolGuid
,
190 &mPrivate
.HiiDatabase
,
191 &gEfiHiiConfigRoutingProtocolGuid
,
192 &mPrivate
.ConfigRouting
,
193 &gEfiConfigKeywordHandlerProtocolGuid
,
194 &mPrivate
.ConfigKeywordHandler
,
198 if (EFI_ERROR (Status
)) {
202 if (FeaturePcdGet (PcdSupportHiiImageProtocol
)) {
203 CopyMem (&mPrivate
.HiiImage
, &mImageProtocol
, sizeof (mImageProtocol
));
205 Status
= gBS
->InstallMultipleProtocolInterfaces (
207 &gEfiHiiImageProtocolGuid
,