Add in BuildFv2Hob in HobLib

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3693 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qwang12 2007-08-23 06:22:53 +00:00
parent 687a2e5f69
commit 07ad9b81e3
4 changed files with 87 additions and 0 deletions

View File

@ -247,6 +247,7 @@ typedef union {
EFI_HOB_RESOURCE_DESCRIPTOR *ResourceDescriptor;
EFI_HOB_GUID_TYPE *Guid;
EFI_HOB_FIRMWARE_VOLUME *FirmwareVolume;
EFI_HOB_FIRMWARE_VOLUME2 *FirmwareVolume2;
EFI_HOB_CPU *Cpu;
EFI_HOB_MEMORY_POOL *Pool;
UINT8 *Raw;

View File

@ -341,6 +341,32 @@ BuildFvHob (
ASSERT (FALSE);
}
/**
Builds a EFI_HOB_TYPE_FV2 HOB.
This function builds a EFI_HOB_TYPE_FV2 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 base address of the Firmware Volume.
@param Length The size of the Firmware Volume in bytes.
@param FvName The name of the Firmware Volume.
@param FileName The name of the file.
**/
VOID
EFIAPI
BuildFv2Hob (
IN EFI_PHYSICAL_ADDRESS BaseAddress,
IN UINT64 Length,
IN CONST EFI_GUID *FvName,
IN CONST EFI_GUID *FileName
)
{
ASSERT (FALSE);
}
/**
Builds a Capsule Volume HOB.

View File

@ -372,6 +372,33 @@ BuildFvHob (
ASSERT (FALSE);
}
/**
Builds a EFI_HOB_TYPE_FV2 HOB.
This function builds a EFI_HOB_TYPE_FV2 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 base address of the Firmware Volume.
@param Length The size of the Firmware Volume in bytes.
@param FvName The name of the Firmware Volume.
@param FileName The name of the file.
**/
VOID
EFIAPI
BuildFv2Hob (
IN EFI_PHYSICAL_ADDRESS BaseAddress,
IN UINT64 Length,
IN CONST EFI_GUID *FvName,
IN CONST EFI_GUID *FileName
)
{
ASSERT (FALSE);
}
/**
Builds a Capsule Volume HOB.

View File

@ -404,6 +404,39 @@ BuildFvHob (
Hob->Length = Length;
}
/**
Builds a EFI_HOB_TYPE_FV2 HOB.
This function builds a EFI_HOB_TYPE_FV2 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 base address of the Firmware Volume.
@param Length The size of the Firmware Volume in bytes.
@param FvName The name of the Firmware Volume.
@param FileName The name of the file.
**/
VOID
EFIAPI
BuildFv2Hob (
IN EFI_PHYSICAL_ADDRESS BaseAddress,
IN UINT64 Length,
IN CONST EFI_GUID *FvName,
IN CONST EFI_GUID *FileName
)
{
EFI_HOB_FIRMWARE_VOLUME2 *Hob;
Hob = InternalPeiCreateHob (EFI_HOB_TYPE_FV2, sizeof (EFI_HOB_FIRMWARE_VOLUME2));
Hob->BaseAddress = BaseAddress;
Hob->Length = Length;
CopyMem (&Hob->FvName, FvName, sizeof (EFI_GUID));
CopyMem (&Hob->FileName, FileName, sizeof (EFI_GUID));
}
/**
Builds a Capsule Volume HOB.