]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/PeiHobLib/HobLib.c
UEFI Capsule HOB updating includes:
[mirror_edk2.git] / MdePkg / Library / PeiHobLib / HobLib.c
index 5ffc8549b470b0e3eff44bd593ee8561e617c12b..f0cc665085bc46dc5a4b4143a0e6e7b3e67148b4 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Provide Hob Library functions for Pei phase.\r
 \r
-Copyright (c) 2007 - 2008, Intel Corporation<BR>\r
+Copyright (c) 2007 - 2009, 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
@@ -641,3 +641,30 @@ BuildMemoryAllocationHob (
   //\r
   ZeroMem (Hob->AllocDescriptor.Reserved, sizeof (Hob->AllocDescriptor.Reserved));\r
 }\r
+\r
+/**\r
+  Builds an UEFI Capsule HOB.\r
+\r
+  This function builds an UEFI Capsule 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
+  If there is no additional space for HOB creation, then ASSERT().\r
+\r
+  @param  BaseAddress   The physical memory-mapped base address of an UEFI capsule.\r
+  @param  Length        The length of the contiguous memory in bytes.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+BuildCapsuleHob (\r
+  IN EFI_PHYSICAL_ADDRESS        BaseAddress,\r
+  IN UINT64                      Length\r
+  )\r
+{\r
+  EFI_HOB_UEFI_CAPSULE  *Hob;\r
+\r
+  Hob = InternalPeiCreateHob (EFI_HOB_TYPE_UEFI_CAPSULE, sizeof (EFI_HOB_UEFI_CAPSULE));\r
+\r
+  Hob->BaseAddress  = BaseAddress;\r
+  Hob->Length       = Length;\r
+}\r