]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/DxeHobLib/HobLib.c
Checked in part of MDE library instances following PI and UEFI. It includes:
[mirror_edk2.git] / MdePkg / Library / DxeHobLib / HobLib.c
index b4ad4ff2f0448d362ec3ab14ceb42436604241e3..b05f14386b4309d4dd0417133129d93e38dc1127 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   HOB Library.\r
 \r
-  Copyright (c) 2006, Intel Corporation<BR>\r
+  Copyright (c) 2006 - 2007, Intel Corporation<BR>\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
 **/\r
 \r
 \r
+//\r
+// The package level header files this module uses\r
+//\r
+#include <PiDxe.h>\r
+//\r
+// The protocols, PPI and GUID defintions for this module\r
+//\r
+#include <Guid/HobList.h>\r
+//\r
+// The Library classes this module consumes\r
+//\r
+#include <Library/HobLib.h>\r
+#include <Library/UefiLib.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/BaseMemoryLib.h>\r
 \r
 STATIC VOID  *mHobList = NULL;\r
 \r
@@ -189,6 +204,30 @@ GetFirstGuidHob (
   return GetNextGuidHob (Guid, HobList);\r
 }\r
 \r
+/**\r
+  Get the Boot Mode from the HOB list.\r
+\r
+  This function returns the system boot mode information from the \r
+  PHIT HOB in HOB list.\r
+\r
+  @param  VOID\r
+\r
+  @return The Boot Mode.\r
+\r
+**/\r
+EFI_BOOT_MODE\r
+EFIAPI\r
+GetBootModeHob (\r
+  VOID\r
+  )\r
+{\r
+  EFI_HOB_HANDOFF_INFO_TABLE    *HandOffHob;\r
+\r
+  HandOffHob = (EFI_HOB_HANDOFF_INFO_TABLE *) GetHobList ();\r
+\r
+  return  HandOffHob->BootMode;\r
+}\r
+\r
 /**\r
   Builds a HOB for a loaded PE32 module.\r
 \r