/** @file\r
\r
-Copyright (c) 2007, Intel Corporation\r
+Copyright (c) 2007 - 2008, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
HiiGetGlyph,\r
HiiGetFontInfo\r
},\r
-#ifndef DISABLE_UNUSED_HII_PROTOCOLS\r
+#ifndef _DISABLE_UNUSED_HII_PROTOCOLS_\r
{\r
HiiNewImage,\r
HiiGetImage,\r
{\r
HiiConfigRoutingExtractConfig,\r
HiiConfigRoutingExportConfig,\r
- HiiConfigRoutingRoutConfig,\r
+ HiiConfigRoutingRouteConfig,\r
HiiBlockToConfig,\r
HiiConfigToBlock,\r
HiiGetAltCfg\r
0x00000000,\r
0x0000,\r
0x0000,\r
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00\r
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}\r
},\r
NULL\r
};\r
\r
-//@MT: EFI_DRIVER_ENTRY_POINT (InitializeHiiDatabase)\r
+/**\r
+ The default event handler for gHiiKeyboardLayoutChanged\r
+ event group.\r
\r
-EFI_STATUS\r
+ This is internal function.\r
+\r
+ @param Event The event that triggered this notification function.\r
+ @param Context Pointer to the notification functions context.\r
+\r
+**/\r
+VOID\r
EFIAPI\r
-InitializeHiiDatabase (\r
- IN EFI_HANDLE ImageHandle,\r
- IN EFI_SYSTEM_TABLE *SystemTable\r
+KeyboardLayoutChangeNullEvent (\r
+ IN EFI_EVENT Event,\r
+ IN VOID *Context\r
)\r
-/*++\r
+{\r
+ return;\r
+}\r
+\r
+/**\r
+ Initialize HII Database.\r
\r
-Routine Description:\r
- Initialize HII Database\r
\r
-Arguments:\r
- (Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT)\r
+ @param ImageHandle The image handle.\r
+ @param SystemTable The system table.\r
\r
-Returns:\r
- EFI_SUCCESS -\r
- other -\r
+ @retval EFI_SUCCESS The Hii database is setup correctly.\r
+ @return Other value if failed to create the default event for\r
+ gHiiKeyboardLayoutChanged. Check gBS->CreateEventEx for\r
+ details. Or failed to insatll the protocols.\r
+ Check gBS->InstallMultipleProtocolInterfaces for details.\r
\r
---*/\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+InitializeHiiDatabase (\r
+ IN EFI_HANDLE ImageHandle,\r
+ IN EFI_SYSTEM_TABLE *SystemTable\r
+ )\r
{\r
EFI_STATUS Status;\r
EFI_HANDLE Handle;\r
- EFI_HANDLE *HandleBuffer;\r
- UINTN HandleCount;\r
-\r
- //@MT: EfiInitializeDriverLib (ImageHandle, SystemTable);\r
\r
//\r
// There will be only one HII Database in the system\r
// If there is another out there, someone is trying to install us\r
// again. Fail that scenario.\r
//\r
- Status = gBS->LocateHandleBuffer (\r
- ByProtocol,\r
- &gEfiHiiDatabaseProtocolGuid,\r
- NULL,\r
- &HandleCount,\r
- &HandleBuffer\r
- );\r
-\r
- //\r
- // If there was no error, assume there is an installation and fail to load\r
- //\r
- if (!EFI_ERROR (Status)) {\r
- if (HandleBuffer != NULL) {\r
- gBS->FreePool (HandleBuffer);\r
- }\r
- return EFI_DEVICE_ERROR;\r
- }\r
-\r
+ ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gEfiHiiDatabaseProtocolGuid);\r
+ ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gEfiHiiFontProtocolGuid);\r
+ ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gEfiHiiImageProtocolGuid);\r
+ ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gEfiHiiStringProtocolGuid);\r
+ ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gEfiHiiConfigRoutingProtocolGuid);\r
+ \r
InitializeListHead (&mPrivate.DatabaseList);\r
InitializeListHead (&mPrivate.DatabaseNotifyList);\r
InitializeListHead (&mPrivate.HiiHandleList);\r
// Create a event with EFI_HII_SET_KEYBOARD_LAYOUT_EVENT_GUID group type.\r
//\r
Status = gBS->CreateEventEx (\r
- 0,\r
- 0,\r
- NULL,\r
+ EFI_EVENT_NOTIFY_SIGNAL,\r
+ TPL_NOTIFY,\r
+ KeyboardLayoutChangeNullEvent,\r
NULL,\r
&gHiiSetKbdLayoutEventGuid,\r
&gHiiKeyboardLayoutChanged\r
&Handle,\r
&gEfiHiiFontProtocolGuid,\r
&mPrivate.HiiFont,\r
-#ifndef DISABLE_UNUSED_HII_PROTOCOLS\r
+#ifndef _DISABLE_UNUSED_HII_PROTOCOLS_\r
&gEfiHiiImageProtocolGuid,\r
&mPrivate.HiiImage,\r
#endif\r