]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/DxeCoreHobLib/HobLib.c
1) Added BIT0, BIT1, …, BIT63 to the Base Defines
[mirror_edk2.git] / MdePkg / Library / DxeCoreHobLib / HobLib.c
index 45336c5e543ecff23610327bfee03e6b2641ffff..6bf6749bf7790a14075e36282d2f3e414b0cf02d 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
-\r
-extern VOID *gHobList;\r
-\r
+#include "HobLib.h"\r
 \r
 /**\r
   Returns the pointer to the HOB list.\r
@@ -163,6 +160,29 @@ 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
   Builds a HOB for a loaded PE32 module.\r
 \r
@@ -175,7 +195,7 @@ GetFirstGuidHob (
   @param  ModuleName              The GUID File Name of the module.\r
   @param  MemoryAllocationModule  The 64 bit physical address of the module.\r
   @param  ModuleLength            The length of the module in bytes.\r
-  @param  EntryPoint              The 64 bit physical address of the module\92s entry point.\r
+  @param  EntryPoint              The 64 bit physical address of the module's entry point.\r
 \r
 **/\r
 VOID\r
@@ -232,7 +252,7 @@ BuildResourceDescriptorHob (
   for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.\r
   If Guid is NULL, then ASSERT().\r
   If there is no additional space for HOB creation, then ASSERT().\r
-  If DataLength > (0x10000 - sizeof (EFI_HOB_TYPE_GUID)), then ASSERT().\r
+  If DataLength >= (0x10000 - sizeof (EFI_HOB_GUID_TYPE)), then ASSERT().\r
 \r
   @param  Guid          The GUID to tag the customized HOB.\r
   @param  DataLength    The size of the data payload for the GUID HOB.\r
@@ -265,7 +285,7 @@ BuildGuidHob (
   If Guid is NULL, then ASSERT().\r
   If Data is NULL and DataLength > 0, then ASSERT().\r
   If there is no additional space for HOB creation, then ASSERT().\r
-  If DataLength > (0x10000 - sizeof (EFI_HOB_TYPE_GUID)), then ASSERT().\r
+  If DataLength >= (0x10000 - sizeof (EFI_HOB_GUID_TYPE)), then ASSERT().\r
 \r
   @param  Guid          The GUID to tag the customized HOB.\r
   @param  Data          The data to be copied into the data field of the GUID HOB.\r