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
107 //@MT: EFI_DRIVER_ENTRY_POINT (InitializeHiiDatabase)
111 InitializeHiiDatabase (
112 IN EFI_HANDLE ImageHandle
,
113 IN EFI_SYSTEM_TABLE
*SystemTable
118 Initialize HII Database
121 (Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT)
131 EFI_HANDLE
*HandleBuffer
;
134 //@MT: EfiInitializeDriverLib (ImageHandle, SystemTable);
137 // There will be only one HII Database in the system
138 // If there is another out there, someone is trying to install us
139 // again. Fail that scenario.
141 Status
= gBS
->LocateHandleBuffer (
143 &gEfiHiiDatabaseProtocolGuid
,
150 // If there was no error, assume there is an installation and fail to load
152 if (!EFI_ERROR (Status
)) {
153 if (HandleBuffer
!= NULL
) {
154 gBS
->FreePool (HandleBuffer
);
156 return EFI_DEVICE_ERROR
;
159 InitializeListHead (&mPrivate
.DatabaseList
);
160 InitializeListHead (&mPrivate
.DatabaseNotifyList
);
161 InitializeListHead (&mPrivate
.HiiHandleList
);
162 InitializeListHead (&mPrivate
.FontInfoList
);
165 // Create a event with EFI_HII_SET_KEYBOARD_LAYOUT_EVENT_GUID group type.
167 Status
= gBS
->CreateEventEx (
172 &gHiiSetKbdLayoutEventGuid
,
173 &gHiiKeyboardLayoutChanged
175 if (EFI_ERROR (Status
)) {
180 return gBS
->InstallMultipleProtocolInterfaces (
182 &gEfiHiiFontProtocolGuid
,
184 #ifndef DISABLE_UNUSED_HII_PROTOCOLS
185 &gEfiHiiImageProtocolGuid
,
188 &gEfiHiiStringProtocolGuid
,
190 &gEfiHiiDatabaseProtocolGuid
,
191 &mPrivate
.HiiDatabase
,
192 &gEfiHiiConfigRoutingProtocolGuid
,
193 &mPrivate
.ConfigRouting
,