]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Library/HobLib.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdePkg / Include / Library / HobLib.h
index c6b15961714d5b71441f4a849197e0a6ef189936..3cc0ea6a36eb2bbc1ca87ccecb942484c6f93897 100644 (file)
@@ -6,16 +6,10 @@
   defined in the PI Specification.\r
   A HOB is a Hand-Off Block, defined in the Framework architecture, that\r
   allows the PEI phase to pass information to the DXE phase. HOBs are position\r
-  independent and can be relocated easily to different memory memory locations.\r
+  independent and can be relocated easily to different memory locations.\r
 \r
-Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
-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
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -64,8 +58,8 @@ GetHobList (
 VOID *\r
 EFIAPI\r
 GetNextHob (\r
-  IN UINT16                 Type,\r
-  IN CONST VOID             *HobStart\r
+  IN UINT16      Type,\r
+  IN CONST VOID  *HobStart\r
   );\r
 \r
 /**\r
@@ -84,7 +78,7 @@ GetNextHob (
 VOID *\r
 EFIAPI\r
 GetFirstHob (\r
-  IN UINT16                 Type\r
+  IN UINT16  Type\r
   );\r
 \r
 /**\r
@@ -112,8 +106,8 @@ GetFirstHob (
 VOID *\r
 EFIAPI\r
 GetNextGuidHob (\r
-  IN CONST EFI_GUID         *Guid,\r
-  IN CONST VOID             *HobStart\r
+  IN CONST EFI_GUID  *Guid,\r
+  IN CONST VOID      *HobStart\r
   );\r
 \r
 /**\r
@@ -137,7 +131,7 @@ GetNextGuidHob (
 VOID *\r
 EFIAPI\r
 GetFirstGuidHob (\r
-  IN CONST EFI_GUID         *Guid\r
+  IN CONST EFI_GUID  *Guid\r
   );\r
 \r
 /**\r
@@ -178,10 +172,10 @@ GetBootModeHob (
 VOID\r
 EFIAPI\r
 BuildModuleHob (\r
-  IN CONST EFI_GUID         *ModuleName,\r
-  IN EFI_PHYSICAL_ADDRESS   MemoryAllocationModule,\r
-  IN UINT64                 ModuleLength,\r
-  IN EFI_PHYSICAL_ADDRESS   EntryPoint\r
+  IN CONST EFI_GUID        *ModuleName,\r
+  IN EFI_PHYSICAL_ADDRESS  MemoryAllocationModule,\r
+  IN UINT64                ModuleLength,\r
+  IN EFI_PHYSICAL_ADDRESS  EntryPoint\r
   );\r
 \r
 /**\r
@@ -190,7 +184,7 @@ BuildModuleHob (
   This function builds a HOB that describes a chunk of system memory.\r
   It can only be invoked during PEI phase;\r
   for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.\r
-  \r
+\r
   If there is no additional space for HOB creation, then ASSERT().\r
 \r
   @param  ResourceType        The type of resource described by this HOB.\r
@@ -259,8 +253,8 @@ BuildResourceDescriptorHob (
 VOID *\r
 EFIAPI\r
 BuildGuidHob (\r
-  IN CONST EFI_GUID              *Guid,\r
-  IN UINTN                       DataLength\r
+  IN CONST EFI_GUID  *Guid,\r
+  IN UINTN           DataLength\r
   );\r
 \r
 /**\r
@@ -291,9 +285,9 @@ BuildGuidHob (
 VOID *\r
 EFIAPI\r
 BuildGuidDataHob (\r
-  IN CONST EFI_GUID              *Guid,\r
-  IN VOID                        *Data,\r
-  IN UINTN                       DataLength\r
+  IN CONST EFI_GUID  *Guid,\r
+  IN VOID            *Data,\r
+  IN UINTN           DataLength\r
   );\r
 \r
 /**\r
@@ -304,6 +298,7 @@ BuildGuidDataHob (
   for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.\r
 \r
   If there is no additional space for HOB creation, then ASSERT().\r
+  If the FvImage buffer is not at its required alignment, then ASSERT().\r
 \r
   @param  BaseAddress   The base address of the Firmware Volume.\r
   @param  Length        The size of the Firmware Volume in bytes.\r
@@ -312,8 +307,8 @@ BuildGuidDataHob (
 VOID\r
 EFIAPI\r
 BuildFvHob (\r
-  IN EFI_PHYSICAL_ADDRESS        BaseAddress,\r
-  IN UINT64                      Length\r
+  IN EFI_PHYSICAL_ADDRESS  BaseAddress,\r
+  IN UINT64                Length\r
   );\r
 \r
 /**\r
@@ -324,6 +319,7 @@ BuildFvHob (
   for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.\r
 \r
   If there is no additional space for HOB creation, then ASSERT().\r
+  If the FvImage buffer is not at its required alignment, then ASSERT().\r
 \r
   @param  BaseAddress   The base address of the Firmware Volume.\r
   @param  Length        The size of the Firmware Volume in bytes.\r
@@ -334,10 +330,42 @@ BuildFvHob (
 VOID\r
 EFIAPI\r
 BuildFv2Hob (\r
-  IN          EFI_PHYSICAL_ADDRESS        BaseAddress,\r
-  IN          UINT64                      Length,\r
-  IN CONST    EFI_GUID                    *FvName,\r
-  IN CONST    EFI_GUID                    *FileName\r
+  IN          EFI_PHYSICAL_ADDRESS  BaseAddress,\r
+  IN          UINT64                Length,\r
+  IN CONST    EFI_GUID              *FvName,\r
+  IN CONST    EFI_GUID              *FileName\r
+  );\r
+\r
+/**\r
+  Builds a EFI_HOB_TYPE_FV3 HOB.\r
+\r
+  This function builds a EFI_HOB_TYPE_FV3 HOB.\r
+  It can only be invoked during PEI phase;\r
+  for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.\r
+\r
+  If there is no additional space for HOB creation, then ASSERT().\r
+  If the FvImage buffer is not at its required alignment, then ASSERT().\r
+\r
+  @param BaseAddress            The base address of the Firmware Volume.\r
+  @param Length                 The size of the Firmware Volume in bytes.\r
+  @param AuthenticationStatus   The authentication status.\r
+  @param ExtractedFv            TRUE if the FV was extracted as a file within\r
+                                another firmware volume. FALSE otherwise.\r
+  @param FvName                 The name of the Firmware Volume.\r
+                                Valid only if IsExtractedFv is TRUE.\r
+  @param FileName               The name of the file.\r
+                                Valid only if IsExtractedFv is TRUE.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+BuildFv3Hob (\r
+  IN          EFI_PHYSICAL_ADDRESS  BaseAddress,\r
+  IN          UINT64                Length,\r
+  IN          UINT32                AuthenticationStatus,\r
+  IN          BOOLEAN               ExtractedFv,\r
+  IN CONST    EFI_GUID              *FvName  OPTIONAL,\r
+  IN CONST    EFI_GUID              *FileName OPTIONAL\r
   );\r
 \r
 /**\r
@@ -357,8 +385,8 @@ BuildFv2Hob (
 VOID\r
 EFIAPI\r
 BuildCvHob (\r
-  IN EFI_PHYSICAL_ADDRESS        BaseAddress,\r
-  IN UINT64                      Length\r
+  IN EFI_PHYSICAL_ADDRESS  BaseAddress,\r
+  IN UINT64                Length\r
   );\r
 \r
 /**\r
@@ -377,8 +405,8 @@ BuildCvHob (
 VOID\r
 EFIAPI\r
 BuildCpuHob (\r
-  IN UINT8                       SizeOfMemorySpace,\r
-  IN UINT8                       SizeOfIoSpace\r
+  IN UINT8  SizeOfMemorySpace,\r
+  IN UINT8  SizeOfIoSpace\r
   );\r
 \r
 /**\r
@@ -397,8 +425,8 @@ BuildCpuHob (
 VOID\r
 EFIAPI\r
 BuildStackHob (\r
-  IN EFI_PHYSICAL_ADDRESS        BaseAddress,\r
-  IN UINT64                      Length\r
+  IN EFI_PHYSICAL_ADDRESS  BaseAddress,\r
+  IN UINT64                Length\r
   );\r
 \r
 /**\r
@@ -418,9 +446,9 @@ BuildStackHob (
 VOID\r
 EFIAPI\r
 BuildBspStoreHob (\r
-  IN EFI_PHYSICAL_ADDRESS        BaseAddress,\r
-  IN UINT64                      Length,\r
-  IN EFI_MEMORY_TYPE             MemoryType\r
+  IN EFI_PHYSICAL_ADDRESS  BaseAddress,\r
+  IN UINT64                Length,\r
+  IN EFI_MEMORY_TYPE       MemoryType\r
   );\r
 \r
 /**\r
@@ -440,9 +468,9 @@ BuildBspStoreHob (
 VOID\r
 EFIAPI\r
 BuildMemoryAllocationHob (\r
-  IN EFI_PHYSICAL_ADDRESS        BaseAddress,\r
-  IN UINT64                      Length,\r
-  IN EFI_MEMORY_TYPE             MemoryType\r
+  IN EFI_PHYSICAL_ADDRESS  BaseAddress,\r
+  IN UINT64                Length,\r
+  IN EFI_MEMORY_TYPE       MemoryType\r
   );\r
 \r
 /**\r