summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MdePkg/Include/Library/HobLib.h19
-rw-r--r--MdePkg/Library/DxeCoreHobLib/HobLib.c25
-rw-r--r--MdePkg/Library/DxeHobLib/HobLib.c27
-rw-r--r--MdePkg/Library/PeiHobLib/HobLib.c29
4 files changed, 98 insertions, 2 deletions
diff --git a/MdePkg/Include/Library/HobLib.h b/MdePkg/Include/Library/HobLib.h
index d17de0b35e..dcb4080d48 100644
--- a/MdePkg/Include/Library/HobLib.h
+++ b/MdePkg/Include/Library/HobLib.h
@@ -416,6 +416,25 @@ BuildMemoryAllocationHob (
);
/**
+ Builds an UEFI Capsule HOB.
+
+ This function builds an UEFI Capsule HOB.
+ It can only be invoked during PEI phase;
+ for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
+ If there is no additional space for HOB creation, then ASSERT().
+
+ @param BaseAddress The physical memory-mapped base address of an UEFI capsule.
+ @param Length The length of the contiguous memory in bytes.
+
+**/
+VOID
+EFIAPI
+BuildCapsuleHob (
+ IN EFI_PHYSICAL_ADDRESS BaseAddress,
+ IN UINT64 Length
+ );
+
+/**
Returns the type of a HOB.
This macro returns the HobType field from the HOB header for the
diff --git a/MdePkg/Library/DxeCoreHobLib/HobLib.c b/MdePkg/Library/DxeCoreHobLib/HobLib.c
index 8bc346e620..2bbc04a313 100644
--- a/MdePkg/Library/DxeCoreHobLib/HobLib.c
+++ b/MdePkg/Library/DxeCoreHobLib/HobLib.c
@@ -528,3 +528,28 @@ BuildMemoryAllocationHob (
//
ASSERT (FALSE);
}
+
+/**
+ Builds an UEFI Capsule HOB.
+
+ This function builds an UEFI Capsule HOB.
+ It can only be invoked during PEI phase;
+ for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
+ If there is no additional space for HOB creation, then ASSERT().
+
+ @param BaseAddress The physical memory-mapped base address of an UEFI capsule.
+ @param Length The length of the contiguous memory in bytes.
+
+**/
+VOID
+EFIAPI
+BuildCapsuleHob (
+ IN EFI_PHYSICAL_ADDRESS BaseAddress,
+ IN UINT64 Length
+ )
+{
+ //
+ // PEI HOB is read only for DXE phase
+ //
+ ASSERT (FALSE);
+}
diff --git a/MdePkg/Library/DxeHobLib/HobLib.c b/MdePkg/Library/DxeHobLib/HobLib.c
index 677f91d06d..9de92ef3be 100644
--- a/MdePkg/Library/DxeHobLib/HobLib.c
+++ b/MdePkg/Library/DxeHobLib/HobLib.c
@@ -1,7 +1,7 @@
/** @file
HOB Library implemenation for Dxe Phase.
-Copyright (c) 2006 - 2008, Intel Corporation<BR>
+Copyright (c) 2006 - 2009, Intel Corporation<BR>
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
@@ -562,3 +562,28 @@ BuildMemoryAllocationHob (
//
ASSERT (FALSE);
}
+
+/**
+ Builds an UEFI Capsule HOB.
+
+ This function builds an UEFI Capsule HOB.
+ It can only be invoked during PEI phase;
+ for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
+ If there is no additional space for HOB creation, then ASSERT().
+
+ @param BaseAddress The physical memory-mapped base address of an UEFI capsule.
+ @param Length The length of the contiguous memory in bytes.
+
+**/
+VOID
+EFIAPI
+BuildCapsuleHob (
+ IN EFI_PHYSICAL_ADDRESS BaseAddress,
+ IN UINT64 Length
+ )
+{
+ //
+ // PEI HOB is read only for DXE phase
+ //
+ ASSERT (FALSE);
+}
diff --git a/MdePkg/Library/PeiHobLib/HobLib.c b/MdePkg/Library/PeiHobLib/HobLib.c
index 5ffc8549b4..f0cc665085 100644
--- a/MdePkg/Library/PeiHobLib/HobLib.c
+++ b/MdePkg/Library/PeiHobLib/HobLib.c
@@ -1,7 +1,7 @@
/** @file
Provide Hob Library functions for Pei phase.
-Copyright (c) 2007 - 2008, Intel Corporation<BR>
+Copyright (c) 2007 - 2009, Intel Corporation<BR>
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
@@ -641,3 +641,30 @@ BuildMemoryAllocationHob (
//
ZeroMem (Hob->AllocDescriptor.Reserved, sizeof (Hob->AllocDescriptor.Reserved));
}
+
+/**
+ Builds an UEFI Capsule HOB.
+
+ This function builds an UEFI Capsule HOB.
+ It can only be invoked during PEI phase;
+ for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
+ If there is no additional space for HOB creation, then ASSERT().
+
+ @param BaseAddress The physical memory-mapped base address of an UEFI capsule.
+ @param Length The length of the contiguous memory in bytes.
+
+**/
+VOID
+EFIAPI
+BuildCapsuleHob (
+ IN EFI_PHYSICAL_ADDRESS BaseAddress,
+ IN UINT64 Length
+ )
+{
+ EFI_HOB_UEFI_CAPSULE *Hob;
+
+ Hob = InternalPeiCreateHob (EFI_HOB_TYPE_UEFI_CAPSULE, sizeof (EFI_HOB_UEFI_CAPSULE));
+
+ Hob->BaseAddress = BaseAddress;
+ Hob->Length = Length;
+}