TianoCore EDK2 master
Loading...
Searching...
No Matches
HiiDatabaseEntry.c
Go to the documentation of this file.
1
10#include "HiiDatabase.h"
11
12//
13// Global variables
14//
15EFI_EVENT gHiiKeyboardLayoutChanged;
16BOOLEAN gExportAfterReadyToBoot = FALSE;
17
19 HII_DATABASE_PRIVATE_DATA_SIGNATURE,
20 {
23 },
24 {
27 },
28 {
33 },
34 {
40 },
41 {
48 },
49 {
55 },
56 {
68 },
69 {
76 },
77 {
80 },
81 {
84 },
85 0,
86 {
89 },
90 EFI_TEXT_ATTR (EFI_LIGHTGRAY, EFI_BLACK),
91 {
92 0x00000000,
93 0x0000,
94 0x0000,
95 { 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00 }
96 },
97 NULL
98};
99
110VOID
111EFIAPI
113 IN EFI_EVENT Event,
114 IN VOID *Context
115 )
116{
117 return;
118}
119
129VOID
130EFIAPI
132 IN EFI_EVENT Event,
133 IN VOID *Context
134 )
135{
136 //
137 // When ready to boot, we begin to export the HiiDatabase date.
138 // And hook all the possible HiiDatabase change actions to export data.
139 //
140 HiiGetDatabaseInfo (&mPrivate.HiiDatabase);
141 HiiGetConfigRespInfo (&mPrivate.HiiDatabase);
142 gExportAfterReadyToBoot = TRUE;
143
144 gBS->CloseEvent (Event);
145}
146
164EFIAPI
166 IN EFI_HANDLE ImageHandle,
167 IN EFI_SYSTEM_TABLE *SystemTable
168 )
169{
170 EFI_STATUS Status;
171 EFI_HANDLE Handle;
172 EFI_EVENT ReadyToBootEvent;
173
174 //
175 // There will be only one HII Database in the system
176 // If there is another out there, someone is trying to install us
177 // again. Fail that scenario.
178 //
179 ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gEfiHiiDatabaseProtocolGuid);
180 ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gEfiHiiFontProtocolGuid);
181 ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gEfiHiiImageProtocolGuid);
182 ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gEfiHiiStringProtocolGuid);
183 ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gEfiHiiConfigRoutingProtocolGuid);
184 ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gEfiConfigKeywordHandlerProtocolGuid);
185
186 InitializeListHead (&mPrivate.DatabaseList);
187 InitializeListHead (&mPrivate.DatabaseNotifyList);
188 InitializeListHead (&mPrivate.HiiHandleList);
189 InitializeListHead (&mPrivate.FontInfoList);
190
191 //
192 // Create a event with EFI_HII_SET_KEYBOARD_LAYOUT_EVENT_GUID group type.
193 //
194 Status = gBS->CreateEventEx (
195 EVT_NOTIFY_SIGNAL,
196 TPL_NOTIFY,
198 NULL,
199 &gEfiHiiKeyBoardLayoutGuid,
200 &gHiiKeyboardLayoutChanged
201 );
202 if (EFI_ERROR (Status)) {
203 return Status;
204 }
205
206 Handle = NULL;
207 Status = gBS->InstallMultipleProtocolInterfaces (
208 &Handle,
209 &gEfiHiiFontProtocolGuid,
210 &mPrivate.HiiFont,
211 &gEfiHiiStringProtocolGuid,
212 &mPrivate.HiiString,
213 &gEfiHiiDatabaseProtocolGuid,
214 &mPrivate.HiiDatabase,
215 &gEfiHiiConfigRoutingProtocolGuid,
216 &mPrivate.ConfigRouting,
217 &gEfiConfigKeywordHandlerProtocolGuid,
218 &mPrivate.ConfigKeywordHandler,
219 NULL
220 );
221
222 if (EFI_ERROR (Status)) {
223 return Status;
224 }
225
226 if (FeaturePcdGet (PcdSupportHiiImageProtocol)) {
227 Status = gBS->InstallMultipleProtocolInterfaces (
228 &Handle,
229 &gEfiHiiImageProtocolGuid,
230 &mPrivate.HiiImage,
231 &gEfiHiiImageExProtocolGuid,
232 &mPrivate.HiiImageEx,
233 NULL
234 );
235 }
236
237 if (FeaturePcdGet (PcdHiiOsRuntimeSupport)) {
239 TPL_CALLBACK,
241 NULL,
242 &ReadyToBootEvent
243 );
244 if (EFI_ERROR (Status)) {
245 return Status;
246 }
247 }
248
249 return Status;
250}
LIST_ENTRY *EFIAPI InitializeListHead(IN OUT LIST_ENTRY *ListHead)
Definition: LinkedList.c:182
EFI_STATUS EFIAPI EfiConfigKeywordHandlerGetData(IN EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL *This, IN CONST EFI_STRING NameSpaceId OPTIONAL, IN CONST EFI_STRING KeywordString OPTIONAL, OUT EFI_STRING *Progress, OUT UINT32 *ProgressErr, OUT EFI_STRING *Results)
EFI_STATUS EFIAPI EfiConfigKeywordHandlerSetData(IN EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL *This, IN CONST EFI_STRING KeywordString, OUT EFI_STRING *Progress, OUT UINT32 *ProgressErr)
EFI_STATUS EFIAPI HiiConfigRoutingExportConfig(IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, OUT EFI_STRING *Results)
EFI_STATUS EFIAPI HiiGetAltCfg(IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, IN CONST EFI_STRING Configuration, IN CONST EFI_GUID *Guid, IN CONST EFI_STRING Name, IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN CONST UINT16 *AltCfgId, OUT EFI_STRING *AltCfgResp)
EFI_STATUS EFIAPI HiiConfigRoutingRouteConfig(IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, IN CONST EFI_STRING Configuration, OUT EFI_STRING *Progress)
EFI_STATUS EFIAPI HiiConfigRoutingExtractConfig(IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, IN CONST EFI_STRING Request, OUT EFI_STRING *Progress, OUT EFI_STRING *Results)
EFI_STATUS EFIAPI HiiBlockToConfig(IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, IN CONST EFI_STRING ConfigRequest, IN CONST UINT8 *Block, IN CONST UINTN BlockSize, OUT EFI_STRING *Config, OUT EFI_STRING *Progress)
EFI_STATUS EFIAPI HiiConfigToBlock(IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, IN CONST EFI_STRING ConfigResp, IN OUT UINT8 *Block, IN OUT UINTN *BlockSize, OUT EFI_STRING *Progress)
EFI_STATUS HiiGetConfigRespInfo(IN CONST EFI_HII_DATABASE_PROTOCOL *This)
Definition: Database.c:3485
EFI_STATUS EFIAPI HiiRegisterPackageNotify(IN CONST EFI_HII_DATABASE_PROTOCOL *This, IN UINT8 PackageType, IN CONST EFI_GUID *PackageGuid, IN CONST EFI_HII_DATABASE_NOTIFY PackageNotifyFn, IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType, OUT EFI_HANDLE *NotifyHandle)
Definition: Database.c:4331
EFI_STATUS EFIAPI HiiGetPackageListHandle(IN CONST EFI_HII_DATABASE_PROTOCOL *This, IN EFI_HII_HANDLE PackageListHandle, OUT EFI_HANDLE *DriverHandle)
Definition: Database.c:4775
EFI_STATUS HiiGetDatabaseInfo(IN CONST EFI_HII_DATABASE_PROTOCOL *This)
Definition: Database.c:3549
EFI_STATUS EFIAPI HiiGetKeyboardLayout(IN CONST EFI_HII_DATABASE_PROTOCOL *This, IN CONST EFI_GUID *KeyGuid, IN OUT UINT16 *KeyboardLayoutLength, OUT EFI_HII_KEYBOARD_LAYOUT *KeyboardLayout)
Definition: Database.c:4594
EFI_STATUS EFIAPI HiiFindKeyboardLayouts(IN CONST EFI_HII_DATABASE_PROTOCOL *This, IN OUT UINT16 *KeyGuidBufferLength, OUT EFI_GUID *KeyGuidBuffer)
Definition: Database.c:4487
EFI_STATUS EFIAPI HiiExportPackageLists(IN CONST EFI_HII_DATABASE_PROTOCOL *This, IN EFI_HII_HANDLE Handle, IN OUT UINTN *BufferSize, OUT EFI_HII_PACKAGE_LIST_HEADER *Buffer)
Definition: Database.c:4219
EFI_STATUS EFIAPI HiiSetKeyboardLayout(IN CONST EFI_HII_DATABASE_PROTOCOL *This, IN CONST EFI_GUID *KeyGuid)
Definition: Database.c:4696
EFI_STATUS EFIAPI HiiUpdatePackageList(IN CONST EFI_HII_DATABASE_PROTOCOL *This, IN EFI_HII_HANDLE Handle, IN CONST EFI_HII_PACKAGE_LIST_HEADER *PackageList)
Definition: Database.c:3898
EFI_STATUS EFIAPI HiiNewPackageList(IN CONST EFI_HII_DATABASE_PROTOCOL *This, IN CONST EFI_HII_PACKAGE_LIST_HEADER *PackageList, IN CONST EFI_HANDLE DriverHandle OPTIONAL, OUT EFI_HII_HANDLE *Handle)
Definition: Database.c:3622
EFI_STATUS EFIAPI HiiListPackageLists(IN CONST EFI_HII_DATABASE_PROTOCOL *This, IN UINT8 PackageType, IN CONST EFI_GUID *PackageGuid, IN OUT UINTN *HandleBufferLength, OUT EFI_HII_HANDLE *Handle)
Definition: Database.c:4052
EFI_STATUS EFIAPI HiiRemovePackageList(IN CONST EFI_HII_DATABASE_PROTOCOL *This, IN EFI_HII_HANDLE Handle)
Definition: Database.c:3743
EFI_STATUS EFIAPI HiiUnregisterPackageNotify(IN CONST EFI_HII_DATABASE_PROTOCOL *This, IN EFI_HANDLE NotificationHandle)
Definition: Database.c:4406
EFI_STATUS EFIAPI HiiGetGlyph(IN CONST EFI_HII_FONT_PROTOCOL *This, IN CHAR16 Char, IN CONST EFI_FONT_DISPLAY_INFO *StringInfo, OUT EFI_IMAGE_OUTPUT **Blt, OUT UINTN *Baseline OPTIONAL)
Definition: Font.c:2642
EFI_STATUS EFIAPI HiiStringToImage(IN CONST EFI_HII_FONT_PROTOCOL *This, IN EFI_HII_OUT_FLAGS Flags, IN CONST EFI_STRING String, IN CONST EFI_FONT_DISPLAY_INFO *StringInfo OPTIONAL, IN OUT EFI_IMAGE_OUTPUT **Blt, IN UINTN BltX, IN UINTN BltY, OUT EFI_HII_ROW_INFO **RowInfoArray OPTIONAL, OUT UINTN *RowInfoArraySize OPTIONAL, OUT UINTN *ColumnInfoArray OPTIONAL)
Definition: Font.c:1624
EFI_STATUS EFIAPI HiiStringIdToImage(IN CONST EFI_HII_FONT_PROTOCOL *This, IN EFI_HII_OUT_FLAGS Flags, IN EFI_HII_HANDLE PackageList, IN EFI_STRING_ID StringId, IN CONST CHAR8 *Language, IN CONST EFI_FONT_DISPLAY_INFO *StringInfo OPTIONAL, IN OUT EFI_IMAGE_OUTPUT **Blt, IN UINTN BltX, IN UINTN BltY, OUT EFI_HII_ROW_INFO **RowInfoArray OPTIONAL, OUT UINTN *RowInfoArraySize OPTIONAL, OUT UINTN *ColumnInfoArray OPTIONAL)
Definition: Font.c:2403
EFI_STATUS EFIAPI HiiGetFontInfo(IN CONST EFI_HII_FONT_PROTOCOL *This, IN OUT EFI_FONT_HANDLE *FontHandle, IN CONST EFI_FONT_DISPLAY_INFO *StringInfoIn OPTIONAL, OUT EFI_FONT_DISPLAY_INFO **StringInfoOut, IN CONST EFI_STRING String OPTIONAL)
Definition: Font.c:2836
EFI_STATUS EFIAPI InitializeHiiDatabase(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
VOID EFIAPI OnReadyToBoot(IN EFI_EVENT Event, IN VOID *Context)
VOID EFIAPI KeyboardLayoutChangeNullEvent(IN EFI_EVENT Event, IN VOID *Context)
EFI_STRING EFIAPI HiiGetString(IN EFI_HII_HANDLE HiiHandle, IN EFI_STRING_ID StringId, IN CONST CHAR8 *Language OPTIONAL)
Definition: HiiString.c:211
EFI_STRING_ID EFIAPI HiiSetString(IN EFI_HII_HANDLE HiiHandle, IN EFI_STRING_ID StringId OPTIONAL, IN CONST EFI_STRING String, IN CONST CHAR8 *SupportedLanguages OPTIONAL)
Definition: HiiString.c:52
EFI_STATUS EFIAPI HiiGetImageEx(IN CONST EFI_HII_IMAGE_EX_PROTOCOL *This, IN EFI_HII_HANDLE PackageList, IN EFI_IMAGE_ID ImageId, OUT EFI_IMAGE_INPUT *Image)
Definition: ImageEx.c:70
EFI_STATUS EFIAPI HiiDrawImageIdEx(IN CONST EFI_HII_IMAGE_EX_PROTOCOL *This, IN EFI_HII_DRAW_FLAGS Flags, IN EFI_HII_HANDLE PackageList, IN EFI_IMAGE_ID ImageId, IN OUT EFI_IMAGE_OUTPUT **Blt, IN UINTN BltX, IN UINTN BltY)
Definition: ImageEx.c:200
EFI_STATUS EFIAPI HiiGetSecondaryLanguages(IN CONST EFI_HII_STRING_PROTOCOL *This, IN EFI_HII_HANDLE PackageList, IN CONST CHAR8 *PrimaryLanguage, IN OUT CHAR8 *SecondaryLanguages, IN OUT UINTN *SecondaryLanguagesSize)
Definition: String.c:1954
EFI_STATUS EFIAPI HiiDrawImage(IN CONST EFI_HII_IMAGE_PROTOCOL *This, IN EFI_HII_DRAW_FLAGS Flags, IN CONST EFI_IMAGE_INPUT *Image, IN OUT EFI_IMAGE_OUTPUT **Blt, IN UINTN BltX, IN UINTN BltY)
Definition: Image.c:1274
EFI_STATUS EFIAPI HiiGetLanguages(IN CONST EFI_HII_STRING_PROTOCOL *This, IN EFI_HII_HANDLE PackageList, IN OUT CHAR8 *Languages, IN OUT UINTN *LanguagesSize)
Definition: String.c:1847
EFI_STATUS EFIAPI HiiSetImageEx(IN CONST EFI_HII_IMAGE_EX_PROTOCOL *This, IN EFI_HII_HANDLE PackageList, IN EFI_IMAGE_ID ImageId, IN CONST EFI_IMAGE_INPUT *Image)
Definition: ImageEx.c:104
EFI_STATUS EFIAPI HiiNewString(IN CONST EFI_HII_STRING_PROTOCOL *This, IN EFI_HII_HANDLE PackageList, OUT EFI_STRING_ID *StringId, IN CONST CHAR8 *Language, IN CONST CHAR16 *LanguageName OPTIONAL, IN CONST EFI_STRING String, IN CONST EFI_FONT_INFO *StringFontInfo OPTIONAL)
Definition: String.c:1156
EFI_STATUS EFIAPI HiiDrawImageId(IN CONST EFI_HII_IMAGE_PROTOCOL *This, IN EFI_HII_DRAW_FLAGS Flags, IN EFI_HII_HANDLE PackageList, IN EFI_IMAGE_ID ImageId, IN OUT EFI_IMAGE_OUTPUT **Blt, IN UINTN BltX, IN UINTN BltY)
Definition: Image.c:1547
EFI_STATUS EFIAPI HiiNewImage(IN CONST EFI_HII_IMAGE_PROTOCOL *This, IN EFI_HII_HANDLE PackageList, OUT EFI_IMAGE_ID *ImageId, IN CONST EFI_IMAGE_INPUT *Image)
Definition: Image.c:620
EFI_STATUS EFIAPI HiiGetImageInfo(IN CONST EFI_HII_IMAGE_EX_PROTOCOL *This, IN EFI_HII_HANDLE PackageList, IN EFI_IMAGE_ID ImageId, OUT EFI_IMAGE_OUTPUT *Image)
Definition: ImageEx.c:326
EFI_STATUS EFIAPI HiiNewImageEx(IN CONST EFI_HII_IMAGE_EX_PROTOCOL *This, IN EFI_HII_HANDLE PackageList, OUT EFI_IMAGE_ID *ImageId, IN CONST EFI_IMAGE_INPUT *Image)
Definition: ImageEx.c:30
EFI_STATUS EFIAPI HiiGetImage(IN CONST EFI_HII_IMAGE_PROTOCOL *This, IN EFI_HII_HANDLE PackageList, IN EFI_IMAGE_ID ImageId, OUT EFI_IMAGE_INPUT *Image)
Definition: Image.c:1048
EFI_STATUS EFIAPI HiiDrawImageEx(IN CONST EFI_HII_IMAGE_EX_PROTOCOL *This, IN EFI_HII_DRAW_FLAGS Flags, IN CONST EFI_IMAGE_INPUT *Image, IN OUT EFI_IMAGE_OUTPUT **Blt, IN UINTN BltX, IN UINTN BltY)
Definition: ImageEx.c:147
EFI_STATUS EFIAPI HiiSetImage(IN CONST EFI_HII_IMAGE_PROTOCOL *This, IN EFI_HII_HANDLE PackageList, IN EFI_IMAGE_ID ImageId, IN CONST EFI_IMAGE_INPUT *Image)
Definition: Image.c:1079
#define NULL
Definition: Base.h:319
#define TRUE
Definition: Base.h:301
#define FALSE
Definition: Base.h:307
#define IN
Definition: Base.h:279
#define ASSERT_PROTOCOL_ALREADY_INSTALLED(Handle, Guid)
Definition: DebugLib.h:535
#define FeaturePcdGet(TokenName)
Definition: PcdLib.h:50
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_EVENT
Definition: UefiBaseType.h:37
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
EFI_BOOT_SERVICES * gBS
EFI_STATUS EFIAPI EfiCreateEventReadyToBootEx(IN EFI_TPL NotifyTpl, IN EFI_EVENT_NOTIFY NotifyFunction OPTIONAL, IN VOID *NotifyContext OPTIONAL, OUT EFI_EVENT *ReadyToBootEvent)
Definition: UefiNotTiano.c:164