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}
110 KeyboardLayoutChangeNullEvent (
120 InitializeHiiDatabase (
121 IN EFI_HANDLE ImageHandle
,
122 IN EFI_SYSTEM_TABLE
*SystemTable
127 Initialize HII Database
130 (Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT)
140 EFI_HANDLE
*HandleBuffer
;
144 // There will be only one HII Database in the system
145 // If there is another out there, someone is trying to install us
146 // again. Fail that scenario.
148 Status
= gBS
->LocateHandleBuffer (
150 &gEfiHiiDatabaseProtocolGuid
,
157 // If there was no error, assume there is an installation and fail to load
159 if (!EFI_ERROR (Status
)) {
160 if (HandleBuffer
!= NULL
) {
161 gBS
->FreePool (HandleBuffer
);
163 return EFI_DEVICE_ERROR
;
166 InitializeListHead (&mPrivate
.DatabaseList
);
167 InitializeListHead (&mPrivate
.DatabaseNotifyList
);
168 InitializeListHead (&mPrivate
.HiiHandleList
);
169 InitializeListHead (&mPrivate
.FontInfoList
);
172 // Create a event with EFI_HII_SET_KEYBOARD_LAYOUT_EVENT_GUID group type.
174 Status
= gBS
->CreateEventEx (
175 EFI_EVENT_NOTIFY_SIGNAL
,
177 KeyboardLayoutChangeNullEvent
,
179 &gHiiSetKbdLayoutEventGuid
,
180 &gHiiKeyboardLayoutChanged
182 if (EFI_ERROR (Status
)) {
187 return gBS
->InstallMultipleProtocolInterfaces (
189 &gEfiHiiFontProtocolGuid
,
191 #ifndef DISABLE_UNUSED_HII_PROTOCOLS
192 &gEfiHiiImageProtocolGuid
,
195 &gEfiHiiStringProtocolGuid
,
197 &gEfiHiiDatabaseProtocolGuid
,
198 &mPrivate
.HiiDatabase
,
199 &gEfiHiiConfigRoutingProtocolGuid
,
200 &mPrivate
.ConfigRouting
,