]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseEntry.c
Clean up HiiDatabase for Doxygen comments requirement.
[mirror_edk2.git] / MdeModulePkg / Universal / HiiDatabaseDxe / HiiDatabaseEntry.c
index 3d13777883cf73c1603c05a3f13d42f088cfe1c5..c7ffdfe77c0ab550ef8addb5f4b47c7c9830add5 100644 (file)
@@ -1,6 +1,6 @@
 /** @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
@@ -48,7 +48,7 @@ STATIC HII_DATABASE_PRIVATE_DATA mPrivate = {
     HiiGetGlyph,\r
     HiiGetFontInfo\r
   },\r
-#ifndef DISABLE_UNUSED_HII_PROTOCOLS\r
+#ifndef _DISABLE_UNUSED_HII_PROTOCOLS_\r
   {\r
     HiiNewImage,\r
     HiiGetImage,\r
@@ -80,7 +80,7 @@ STATIC HII_DATABASE_PRIVATE_DATA mPrivate = {
   {\r
     HiiConfigRoutingExtractConfig,\r
     HiiConfigRoutingExportConfig,\r
-    HiiConfigRoutingRoutConfig,\r
+    HiiConfigRoutingRouteConfig,\r
     HiiBlockToConfig,\r
     HiiConfigToBlock,\r
     HiiGetAltCfg\r
@@ -99,59 +99,66 @@ STATIC HII_DATABASE_PRIVATE_DATA mPrivate = {
     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
-EFI_STATUS\r
+/**\r
+  The default event handler for gHiiKeyboardLayoutChanged\r
+  event group.\r
+\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
-Routine Description:\r
-  Initialize HII Database\r
+/**\r
+  Initialize HII Database.\r
 \r
-Arguments:\r
-  (Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT)\r
 \r
-Returns:\r
-  EFI_SUCCESS -\r
-  other       -\r
+  @param ImageHandle     The image handle.\r
+  @param SystemTable     The system table.\r
 \r
---*/\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
+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
   //\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
@@ -161,9 +168,9 @@ Returns:
   // 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
@@ -177,7 +184,7 @@ Returns:
                 &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