3 Copyright (c) 2007, 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 HiiConfigRoutingRoutConfig
,
97 EFI_TEXT_ATTR (EFI_LIGHTGRAY
, EFI_BLACK
),
102 {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
109 InitializeHiiDatabase (
110 IN EFI_HANDLE ImageHandle
,
111 IN EFI_SYSTEM_TABLE
*SystemTable
116 Initialize HII Database
119 (Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT)
129 EFI_HANDLE
*HandleBuffer
;
133 // There will be only one HII Database in the system
134 // If there is another out there, someone is trying to install us
135 // again. Fail that scenario.
137 Status
= gBS
->LocateHandleBuffer (
139 &gEfiHiiDatabaseProtocolGuid
,
146 // If there was no error, assume there is an installation and fail to load
148 if (!EFI_ERROR (Status
)) {
149 if (HandleBuffer
!= NULL
) {
150 gBS
->FreePool (HandleBuffer
);
152 return EFI_DEVICE_ERROR
;
155 InitializeListHead (&mPrivate
.DatabaseList
);
156 InitializeListHead (&mPrivate
.DatabaseNotifyList
);
157 InitializeListHead (&mPrivate
.HiiHandleList
);
158 InitializeListHead (&mPrivate
.FontInfoList
);
161 // Create a event with EFI_HII_SET_KEYBOARD_LAYOUT_EVENT_GUID group type.
163 Status
= gBS
->CreateEventEx (
168 &gHiiSetKbdLayoutEventGuid
,
169 &gHiiKeyboardLayoutChanged
171 if (EFI_ERROR (Status
)) {
176 return gBS
->InstallMultipleProtocolInterfaces (
178 &gEfiHiiFontProtocolGuid
,
180 #ifndef DISABLE_UNUSED_HII_PROTOCOLS
181 &gEfiHiiImageProtocolGuid
,
184 &gEfiHiiStringProtocolGuid
,
186 &gEfiHiiDatabaseProtocolGuid
,
187 &mPrivate
.HiiDatabase
,
188 &gEfiHiiConfigRoutingProtocolGuid
,
189 &mPrivate
.ConfigRouting
,