X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdePkg%2FLibrary%2FDxeHobLib%2FHobLib.c;h=672dd3e46829c5ad2510512de550b331f11c9f27;hp=41baba2847714d457d7e1eef11f0a94d70e7618b;hb=d958721a06dce3aa0fc941c115db86e3f91254f7;hpb=5f10fa0140f7100aa04c12f87d63a66755d20d58 diff --git a/MdePkg/Library/DxeHobLib/HobLib.c b/MdePkg/Library/DxeHobLib/HobLib.c index 41baba2847..672dd3e468 100644 --- a/MdePkg/Library/DxeHobLib/HobLib.c +++ b/MdePkg/Library/DxeHobLib/HobLib.c @@ -1,7 +1,7 @@ /** @file HOB Library. - Copyright (c) 2006, Intel Corporation
+ Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -189,6 +189,30 @@ GetFirstGuidHob ( return GetNextGuidHob (Guid, HobList); } +/** + Get the Boot Mode from the HOB list. + + This function returns the system boot mode information from the + PHIT HOB in HOB list. + + @param VOID + + @return The Boot Mode. + +**/ +EFI_BOOT_MODE +EFIAPI +GetBootModeHob ( + VOID + ) +{ + EFI_HOB_HANDOFF_INFO_TABLE *HandOffHob; + + HandOffHob = (EFI_HOB_HANDOFF_INFO_TABLE *) GetHobList (); + + return HandOffHob->BootMode; +} + /** Builds a HOB for a loaded PE32 module. @@ -201,7 +225,7 @@ GetFirstGuidHob ( @param ModuleName The GUID File Name of the module. @param MemoryAllocationModule The 64 bit physical address of the module. @param ModuleLength The length of the module in bytes. - @param EntryPoint The 64 bit physical address of the module’s entry point. + @param EntryPoint The 64 bit physical address of the module's entry point. **/ VOID @@ -258,7 +282,7 @@ BuildResourceDescriptorHob ( for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. If Guid is NULL, then ASSERT(). If there is no additional space for HOB creation, then ASSERT(). - If DataLength > (0x10000 - sizeof (EFI_HOB_TYPE_GUID)), then ASSERT(). + If DataLength >= (0x10000 - sizeof (EFI_HOB_GUID_TYPE)), then ASSERT(). @param Guid The GUID to tag the customized HOB. @param DataLength The size of the data payload for the GUID HOB. @@ -291,7 +315,7 @@ BuildGuidHob ( If Guid is NULL, then ASSERT(). If Data is NULL and DataLength > 0, then ASSERT(). If there is no additional space for HOB creation, then ASSERT(). - If DataLength > (0x10000 - sizeof (EFI_HOB_TYPE_GUID)), then ASSERT(). + If DataLength >= (0x10000 - sizeof (EFI_HOB_GUID_TYPE)), then ASSERT(). @param Guid The GUID to tag the customized HOB. @param Data The data to be copied into the data field of the GUID HOB.