2 This file contains the entry code to the HII database, which is defined by
3 UEFI 2.1 specification.
5 Copyright (c) 2007 - 2008, 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
,
84 EFI_TEXT_ATTR (EFI_LIGHTGRAY
, EFI_BLACK
),
89 {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
94 GLOBAL_REMOVE_IF_UNREFERENCED CONST EFI_HII_IMAGE_PROTOCOL mImageProtocol
= {
103 The default event handler for gHiiKeyboardLayoutChanged
106 This is internal function.
108 @param Event The event that triggered this notification function.
109 @param Context Pointer to the notification functions context.
114 KeyboardLayoutChangeNullEvent (
123 Initialize HII Database.
126 @param ImageHandle The image handle.
127 @param SystemTable The system table.
129 @retval EFI_SUCCESS The Hii database is setup correctly.
130 @return Other value if failed to create the default event for
131 gHiiKeyboardLayoutChanged. Check gBS->CreateEventEx for
132 details. Or failed to insatll the protocols.
133 Check gBS->InstallMultipleProtocolInterfaces for details.
138 InitializeHiiDatabase (
139 IN EFI_HANDLE ImageHandle
,
140 IN EFI_SYSTEM_TABLE
*SystemTable
147 // There will be only one HII Database in the system
148 // If there is another out there, someone is trying to install us
149 // again. Fail that scenario.
151 ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL
, &gEfiHiiDatabaseProtocolGuid
);
152 ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL
, &gEfiHiiFontProtocolGuid
);
153 ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL
, &gEfiHiiImageProtocolGuid
);
154 ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL
, &gEfiHiiStringProtocolGuid
);
155 ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL
, &gEfiHiiConfigRoutingProtocolGuid
);
157 InitializeListHead (&mPrivate
.DatabaseList
);
158 InitializeListHead (&mPrivate
.DatabaseNotifyList
);
159 InitializeListHead (&mPrivate
.HiiHandleList
);
160 InitializeListHead (&mPrivate
.FontInfoList
);
163 // Create a event with EFI_HII_SET_KEYBOARD_LAYOUT_EVENT_GUID group type.
165 Status
= gBS
->CreateEventEx (
168 KeyboardLayoutChangeNullEvent
,
170 &gEfiHiiKeyBoardLayoutGuid
,
171 &gHiiKeyboardLayoutChanged
173 if (EFI_ERROR (Status
)) {
178 Status
= gBS
->InstallMultipleProtocolInterfaces (
180 &gEfiHiiFontProtocolGuid
,
182 &gEfiHiiStringProtocolGuid
,
184 &gEfiHiiDatabaseProtocolGuid
,
185 &mPrivate
.HiiDatabase
,
186 &gEfiHiiConfigRoutingProtocolGuid
,
187 &mPrivate
.ConfigRouting
,
191 if (EFI_ERROR (Status
)) {
195 if (FeaturePcdGet (PcdSupportHiiImageProtocol
)) {
196 CopyMem (&mPrivate
.HiiImage
, &mImageProtocol
, sizeof (mImageProtocol
));
198 Status
= gBS
->InstallMultipleProtocolInterfaces (
200 &gEfiHiiImageProtocolGuid
,