本文整理汇总了C++中GET_NEXT_HOB函数的典型用法代码示例。如果您正苦于以下问题:C++ GET_NEXT_HOB函数的具体用法?C++ GET_NEXT_HOB怎么用?C++ GET_NEXT_HOB使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GET_NEXT_HOB函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: InitCapsulePtr
/**
This function initializes the mCapsulePtr, mCapsuleStatusArray and mCapsuleTotalNumber.
**/
VOID
InitCapsulePtr (
VOID
)
{
EFI_PEI_HOB_POINTERS HobPointer;
UINTN Index;
//
// Find all capsule images from hob
//
HobPointer.Raw = GetHobList ();
while ((HobPointer.Raw = GetNextHob (EFI_HOB_TYPE_UEFI_CAPSULE, HobPointer.Raw)) != NULL) {
if (!IsValidCapsuleHeader((VOID *)(UINTN)HobPointer.Capsule->BaseAddress, HobPointer.Capsule->Length)) {
HobPointer.Header->HobType = EFI_HOB_TYPE_UNUSED; // Mark this hob as invalid
} else {
mCapsuleTotalNumber++;
}
HobPointer.Raw = GET_NEXT_HOB (HobPointer);
}
DEBUG ((DEBUG_INFO, "mCapsuleTotalNumber - 0x%x\n", mCapsuleTotalNumber));
if (mCapsuleTotalNumber == 0) {
return ;
}
//
// Init temp Capsule Data table.
//
mCapsulePtr = (VOID **) AllocateZeroPool (sizeof (VOID *) * mCapsuleTotalNumber);
if (mCapsulePtr == NULL) {
DEBUG ((DEBUG_ERROR, "Allocate mCapsulePtr fail!\n"));
mCapsuleTotalNumber = 0;
return ;
}
mCapsuleStatusArray = (EFI_STATUS *) AllocateZeroPool (sizeof (EFI_STATUS) * mCapsuleTotalNumber);
if (mCapsuleStatusArray == NULL) {
DEBUG ((DEBUG_ERROR, "Allocate mCapsuleStatusArray fail!\n"));
FreePool (mCapsulePtr);
mCapsulePtr = NULL;
mCapsuleTotalNumber = 0;
return ;
}
SetMemN (mCapsuleStatusArray, sizeof (EFI_STATUS) * mCapsuleTotalNumber, EFI_NOT_READY);
//
// Find all capsule images from hob
//
HobPointer.Raw = GetHobList ();
Index = 0;
while ((HobPointer.Raw = GetNextHob (EFI_HOB_TYPE_UEFI_CAPSULE, HobPointer.Raw)) != NULL) {
mCapsulePtr [Index++] = (VOID *) (UINTN) HobPointer.Capsule->BaseAddress;
HobPointer.Raw = GET_NEXT_HOB (HobPointer);
}
}
开发者ID:MattDevo,项目名称:edk2,代码行数:59,代码来源:DxeCapsuleProcessLib.c
示例2: CheckOverlapWithAllocatedBuffer
/**
Check if AP wakeup buffer is overlapped with existing allocated buffer.
@param[in] WakeupBufferStart AP wakeup buffer start address.
@param[in] WakeupBufferEnd AP wakeup buffer end address.
@retval TRUE There is overlap.
@retval FALSE There is no overlap.
**/
BOOLEAN
CheckOverlapWithAllocatedBuffer (
IN UINT64 WakeupBufferStart,
IN UINT64 WakeupBufferEnd
)
{
EFI_PEI_HOB_POINTERS Hob;
EFI_HOB_MEMORY_ALLOCATION *MemoryHob;
BOOLEAN Overlapped;
UINT64 MemoryStart;
UINT64 MemoryEnd;
Overlapped = FALSE;
//
// Get the HOB list for processing
//
Hob.Raw = GetHobList ();
//
// Collect memory ranges
//
while (!END_OF_HOB_LIST (Hob)) {
if (Hob.Header->HobType == EFI_HOB_TYPE_MEMORY_ALLOCATION) {
MemoryHob = Hob.MemoryAllocation;
MemoryStart = MemoryHob->AllocDescriptor.MemoryBaseAddress;
MemoryEnd = MemoryHob->AllocDescriptor.MemoryBaseAddress + MemoryHob->AllocDescriptor.MemoryLength;
if (!((WakeupBufferStart >= MemoryEnd) || (WakeupBufferEnd <= MemoryStart))) {
Overlapped = TRUE;
break;
}
}
Hob.Raw = GET_NEXT_HOB (Hob);
}
return Overlapped;
}
开发者ID:mdaniel,项目名称:virtualbox-org-svn-vbox-trunk,代码行数:43,代码来源:PeiMpLib.c
示例3: PrePeiCoreGetMpCoreInfo
//
// Return list of cores in the system
//
EFI_STATUS
PrePeiCoreGetMpCoreInfo (
OUT UINTN *ArmCoreCount,
OUT ARM_CORE_INFO **ArmCoreInfoTable
)
{
EFI_PEI_HOB_POINTERS Hob;
if (ArmIsMpCore()) {
// Iterate through the HOBs and find if there is ARM PROCESSOR ENTRY HOB
for (Hob.Raw = GetHobList (); !END_OF_HOB_LIST(Hob); Hob.Raw = GET_NEXT_HOB(Hob)) {
// Check for Correct HOB type
if ((GET_HOB_TYPE (Hob)) == EFI_HOB_TYPE_GUID_EXTENSION) {
// Check for correct GUID type
if (CompareGuid(&(Hob.Guid->Name), &gAmdStyxMpCoreInfoGuid)) {
*ArmCoreInfoTable = (ARM_CORE_INFO *) GET_GUID_HOB_DATA(Hob);
*ArmCoreCount = GET_GUID_HOB_DATA_SIZE(Hob)/sizeof(ARM_CORE_INFO);
return EFI_SUCCESS;
}
}
}
}
return EFI_UNSUPPORTED;
}
开发者ID:mangguo321,项目名称:edk2-platforms,代码行数:28,代码来源:Styx.c
示例4: install_e820_map
unsigned install_e820_map(unsigned max_entries, struct e820entry *entries)
{
unsigned num_entries = 0;
EFI_PEI_HOB_POINTERS hob;
hob.Raw = gd->arch.hob_list;
while (!END_OF_HOB_LIST(hob)) {
if (hob.Header->HobType == EFI_HOB_TYPE_RESOURCE_DESCRIPTOR) {
if (hob.ResourceDescriptor->ResourceType == EFI_RESOURCE_SYSTEM_MEMORY) {
entries[num_entries].addr = hob.ResourceDescriptor->PhysicalStart;
entries[num_entries].size = hob.ResourceDescriptor->ResourceLength;
entries[num_entries].type = E820_RAM;
} else if (hob.ResourceDescriptor->ResourceType == EFI_RESOURCE_MEMORY_RESERVED) {
entries[num_entries].addr = hob.ResourceDescriptor->PhysicalStart;
entries[num_entries].size = hob.ResourceDescriptor->ResourceLength;
entries[num_entries].type = E820_RESERVED;
}
}
hob.Raw = GET_NEXT_HOB(hob);
num_entries++;
}
return num_entries;
}
开发者ID:lbmeng,项目名称:ufsp,代码行数:27,代码来源:tnc_dram.c
示例5: GetHighMemorySize
void
GetHighMemorySize (
uint64_t *HighMemoryLength
)
{
EFI_PEI_HOB_POINTERS Hob;
*HighMemoryLength = 0x0;
//
// Get the HOB list for processing
//
Hob.Raw = GetHobList();
//
// Collect memory ranges
//
while (!END_OF_HOB_LIST (Hob)) {
if (Hob.Header->HobType == EFI_HOB_TYPE_RESOURCE_DESCRIPTOR) {
if (Hob.ResourceDescriptor->ResourceType == EFI_RESOURCE_SYSTEM_MEMORY) {
//
// Need memory above 4GB to be collected here
//
if (Hob.ResourceDescriptor->PhysicalStart >= (EFI_PHYSICAL_ADDRESS) 0x100000000) {
*HighMemoryLength += (uint64_t) (Hob.ResourceDescriptor->ResourceLength);
}
}
}
Hob.Raw = GET_NEXT_HOB (Hob);
}
return;
}
开发者ID:Jason-Lam,项目名称:coreboot,代码行数:33,代码来源:board_fsp.c
示例6: ProcessFspHobList
/**
Process FSP HOB list
@param[in] FspHobList Pointer to the HOB data structure produced by FSP.
**/
VOID
ProcessFspHobList (
IN VOID *FspHobList
)
{
EFI_PEI_HOB_POINTERS FspHob;
FspHob.Raw = FspHobList;
//
// Add all the HOBs from FSP binary to FSP wrapper
//
while (!END_OF_HOB_LIST (FspHob)) {
if (FspHob.Header->HobType == EFI_HOB_TYPE_GUID_EXTENSION) {
//
// Skip FSP binary creates PcdDataBaseHobGuid
//
if (!CompareGuid(&FspHob.Guid->Name, &gPcdDataBaseHobGuid)) {
BuildGuidDataHob (
&FspHob.Guid->Name,
GET_GUID_HOB_DATA(FspHob),
GET_GUID_HOB_DATA_SIZE(FspHob)
);
}
}
FspHob.Raw = GET_NEXT_HOB (FspHob);
}
}
开发者ID:EvanLloyd,项目名称:tianocore,代码行数:34,代码来源:FspHobProcessLibSample.c
示例7: UpdateStackHob
/**
Update the Stack Hob if the stack has been moved
@param BaseAddress The 64 bit physical address of the Stack.
@param Length The length of the stack in bytes.
**/
VOID
UpdateStackHob (
IN EFI_PHYSICAL_ADDRESS BaseAddress,
IN UINT64 Length
)
{
EFI_PEI_HOB_POINTERS Hob;
Hob.Raw = GetHobList ();
while ((Hob.Raw = GetNextHob (EFI_HOB_TYPE_MEMORY_ALLOCATION, Hob.Raw)) != NULL) {
if (CompareGuid (&gEfiHobMemoryAllocStackGuid, &(Hob.MemoryAllocationStack->AllocDescriptor.Name))) {
//
// Build a new memory allocation HOB with old stack info with EfiConventionalMemory type
// to be reclaimed by DXE core.
//
BuildMemoryAllocationHob (
Hob.MemoryAllocationStack->AllocDescriptor.MemoryBaseAddress,
Hob.MemoryAllocationStack->AllocDescriptor.MemoryLength,
EfiConventionalMemory
);
//
// Update the BSP Stack Hob to reflect the new stack info.
//
Hob.MemoryAllocationStack->AllocDescriptor.MemoryBaseAddress = BaseAddress;
Hob.MemoryAllocationStack->AllocDescriptor.MemoryLength = Length;
break;
}
Hob.Raw = GET_NEXT_HOB (Hob);
}
}
开发者ID:B-Rich,项目名称:edk2,代码行数:37,代码来源:Hob.c
示例8: UpdateStackHob
/**
Updates the Stack HOB passed to DXE phase.
This function traverses the whole HOB list and update the stack HOB to
reflect the real stack that is used by DXE core.
@param BaseAddress The lower address of stack used by DxeCore.
@param Length The length of stack used by DxeCore.
**/
VOID
UpdateStackHob (
IN EFI_PHYSICAL_ADDRESS BaseAddress,
IN UINT64 Length
)
{
EFI_PEI_HOB_POINTERS Hob;
Hob.Raw = GetHobList ();
while ((Hob.Raw = GetNextHob (EFI_HOB_TYPE_MEMORY_ALLOCATION, Hob.Raw)) != NULL) {
if (CompareGuid (&gEfiHobMemoryAllocStackGuid, &(Hob.MemoryAllocationStack->AllocDescriptor.Name))) {
//
// Build a new memory allocation HOB with old stack info with EfiBootServicesData type. Need to
// avoid this region be reclaimed by DXE core as the IDT built in SEC might be on stack, and some
// PEIMs may also keep key information on stack
//
BuildMemoryAllocationHob (
Hob.MemoryAllocationStack->AllocDescriptor.MemoryBaseAddress,
Hob.MemoryAllocationStack->AllocDescriptor.MemoryLength,
EfiBootServicesData
);
//
// Update the BSP Stack Hob to reflect the new stack info.
//
Hob.MemoryAllocationStack->AllocDescriptor.MemoryBaseAddress = BaseAddress;
Hob.MemoryAllocationStack->AllocDescriptor.MemoryLength = Length;
break;
}
Hob.Raw = GET_NEXT_HOB (Hob);
}
}
开发者ID:M1cha,项目名称:edk2,代码行数:41,代码来源:DxeLoad.c
示例9: FspGetResourceDescriptorByOwner
EFIAPI
FspGetResourceDescriptorByOwner (
IN EFI_GUID *OwnerGuid
)
{
EFI_PEI_HOB_POINTERS Hob;
//
// Get the HOB list for processing
//
Hob.Raw = GetHobList ();
//
// Collect memory ranges
//
while (!END_OF_HOB_LIST (Hob)) {
if (Hob.Header->HobType == EFI_HOB_TYPE_RESOURCE_DESCRIPTOR) {
if ((Hob.ResourceDescriptor->ResourceType == EFI_RESOURCE_MEMORY_RESERVED) && \
(CompareGuid (&Hob.ResourceDescriptor->Owner, OwnerGuid))) {
return Hob.ResourceDescriptor;
}
}
Hob.Raw = GET_NEXT_HOB (Hob);
}
return NULL;
}
开发者ID:EvanLloyd,项目名称:tianocore,代码行数:27,代码来源:FspPlatformMemory.c
示例10: HeapGetBaseAddressInTempMem
/**
*
* HeapGetBaseAddressInTempMem
*
* This function gets heap base address in HEAP_TEMP_MEM phase
*
* @param[in] StdHeader - Pointer to AMD_CONFIG_PARAMS struct.
*
* @retval UINT64 - Heap base address in HEAP_TEMP_MEM phase
*
*/
UINT64
HeapGetBaseAddressInTempMem (
IN AMD_CONFIG_PARAMS *StdHeader
)
{
EFI_PEI_SERVICES **PeiServices;
EFI_PEI_HOB_POINTERS Hob;
AGESA_STATUS IgnoredStatus;
UINT64 BaseAddress;
BaseAddress = UserOptions.CfgHeapDramAddress;
if (IsBsp (StdHeader, &IgnoredStatus) && (StdHeader->HeapStatus != HEAP_LOCAL_CACHE)) {
PeiServices = (EFI_PEI_SERVICES **) StdHeader->ImageBasePtr;
//
// Retrieve the new Heap Manager base in HOB and update StdHeader
//
(*PeiServices)->GetHobList (PeiServices, &Hob.Raw);
while (!END_OF_HOB_LIST (Hob)) {
if (Hob.Header->HobType == EFI_HOB_TYPE_GUID_EXTENSION &&
CompareGuid ( &Hob.Guid->Name, &gAmdHeapHobGuid)) {
BaseAddress = (UINT64) (VOID *) (Hob.Raw +
sizeof (EFI_HOB_GENERIC_HEADER) +
sizeof (EFI_GUID));
break;
}
Hob.Raw = GET_NEXT_HOB (Hob);
}
}
return BaseAddress;
}
开发者ID:fishbaoz,项目名称:edk2ml,代码行数:43,代码来源:HobTransferUefiPei.c
示例11: ReportStatusCode
/**
Remove a previously registered callback function from the notification list.
ReportStatusCode() messages will no longer be forwarded to the Callback function.
@param[in] Callback A pointer to a function of type EFI_PEI_RSC_HANDLER_CALLBACK that is to be
unregistered.
@retval EFI_SUCCESS The function was successfully unregistered.
@retval EFI_INVALID_PARAMETER The callback function was NULL.
@retval EFI_NOT_FOUND The callback function was not found to be unregistered.
**/
EFI_STATUS
EFIAPI
Unregister (
IN EFI_PEI_RSC_HANDLER_CALLBACK Callback
)
{
EFI_PEI_HOB_POINTERS Hob;
EFI_PEI_RSC_HANDLER_CALLBACK *CallbackEntry;
UINTN *NumberOfEntries;
UINTN Index;
if (Callback == NULL) {
return EFI_INVALID_PARAMETER;
}
Hob.Raw = GetFirstGuidHob (&gStatusCodeCallbackGuid);
while (Hob.Raw != NULL) {
NumberOfEntries = GET_GUID_HOB_DATA (Hob);
CallbackEntry = (EFI_PEI_RSC_HANDLER_CALLBACK *) (NumberOfEntries + 1);
for (Index = 0; Index < *NumberOfEntries; Index++) {
if (CallbackEntry[Index] == Callback) {
//
// Set removed entry as NULL.
//
CallbackEntry[Index] = NULL;
return EFI_SUCCESS;
}
}
Hob.Raw = GET_NEXT_HOB (Hob);
Hob.Raw = GetNextGuidHob (&gStatusCodeCallbackGuid, Hob.Raw);
}
return EFI_NOT_FOUND;
}
开发者ID:bhanug,项目名称:virtualbox,代码行数:47,代码来源:ReportStatusCodeRouterPei.c
示例12: GetFspReservedMemoryFromGuid
void
GetFspReservedMemoryFromGuid (
uint32_t *FspMemoryBase,
uint32_t *FspMemoryLength,
EFI_GUID FspReservedMemoryGuid
)
{
EFI_PEI_HOB_POINTERS Hob;
//
// Get the HOB list for processing
//
Hob.Raw = GetHobList();
*FspMemoryBase = 0;
*FspMemoryLength = 0;
//
// Collect memory ranges
//
while (!END_OF_HOB_LIST (Hob)) {
if (Hob.Header->HobType == EFI_HOB_TYPE_RESOURCE_DESCRIPTOR) {
if (Hob.ResourceDescriptor->ResourceType == EFI_RESOURCE_MEMORY_RESERVED) {
if (CompareGuid(&Hob.ResourceDescriptor->Owner, &FspReservedMemoryGuid)) {
*FspMemoryBase = (uint32_t) (Hob.ResourceDescriptor->PhysicalStart);
*FspMemoryLength = (uint32_t) (Hob.ResourceDescriptor->ResourceLength);
break;
}
}
}
Hob.Raw = GET_NEXT_HOB (Hob);
}
return;
}
开发者ID:Jason-Lam,项目名称:coreboot,代码行数:34,代码来源:board_fsp.c
示例13: FspGetSystemMemorySize
/**
Get system memory from HOB.
@param[in,out] LowMemoryLength less than 4G memory length
@param[in,out] HighMemoryLength greater than 4G memory length
**/
VOID
EFIAPI
FspGetSystemMemorySize (
IN OUT UINT64 *LowMemoryLength,
IN OUT UINT64 *HighMemoryLength
)
{
EFI_STATUS Status;
EFI_BOOT_MODE BootMode;
EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute;
EFI_PEI_HOB_POINTERS Hob;
ResourceAttribute = (
EFI_RESOURCE_ATTRIBUTE_PRESENT |
EFI_RESOURCE_ATTRIBUTE_INITIALIZED |
EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE |
EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE |
EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE |
EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE
);
Status = PeiServicesGetBootMode (&BootMode);
ASSERT_EFI_ERROR (Status);
if (BootMode != BOOT_ON_S3_RESUME) {
ResourceAttribute |= EFI_RESOURCE_ATTRIBUTE_TESTED;
}
*HighMemoryLength = 0;
*LowMemoryLength = SIZE_1MB;
//
// Get the HOB list for processing
//
Hob.Raw = GetHobList ();
//
// Collect memory ranges
//
while (!END_OF_HOB_LIST (Hob)) {
if (Hob.Header->HobType == EFI_HOB_TYPE_RESOURCE_DESCRIPTOR) {
if ((Hob.ResourceDescriptor->ResourceType == EFI_RESOURCE_SYSTEM_MEMORY) ||
((Hob.ResourceDescriptor->ResourceType == EFI_RESOURCE_MEMORY_RESERVED) &&
(Hob.ResourceDescriptor->ResourceAttribute == ResourceAttribute))) {
//
// Need memory above 1MB to be collected here
//
if (Hob.ResourceDescriptor->PhysicalStart >= BASE_1MB &&
Hob.ResourceDescriptor->PhysicalStart < (EFI_PHYSICAL_ADDRESS) BASE_4GB) {
*LowMemoryLength += (UINT64) (Hob.ResourceDescriptor->ResourceLength);
} else if (Hob.ResourceDescriptor->PhysicalStart >= (EFI_PHYSICAL_ADDRESS) BASE_4GB) {
*HighMemoryLength += (UINT64) (Hob.ResourceDescriptor->ResourceLength);
}
}
}
Hob.Raw = GET_NEXT_HOB (Hob);
}
}
开发者ID:EvanLloyd,项目名称:tianocore,代码行数:63,代码来源:FspPlatformMemory.c
示例14: GetDxeCoreHobInfo
EFI_STATUS
GetDxeCoreHobInfo (
IN VOID *HobStart,
OUT EFI_PHYSICAL_ADDRESS *BaseAddress,
OUT UINT64 *Length,
OUT VOID **EntryPoint,
OUT EFI_GUID **FileName
)
/*++
Routine Description:
Get memory allocation hob created for DXE core and extract its information
Arguments:
HobStart - Start pointer of the hob list
BaseAddress - Start address of memory allocated for DXE core
Length - Length of memory allocated for DXE core
EntryPoint - DXE core file name
FileName - File Name
Returns:
EFI_NOT_FOUND - DxeCoreHob not found
EFI_SUCCESS - DxeCoreHob found and information got
--*/
{
EFI_PEI_HOB_POINTERS DxeCoreHob;
DxeCoreHob.Raw = HobStart;
DxeCoreHob.Raw = GetHob (EFI_HOB_TYPE_MEMORY_ALLOCATION, DxeCoreHob.Raw);
while (DxeCoreHob.Header->HobType == EFI_HOB_TYPE_MEMORY_ALLOCATION &&
!EfiCompareGuid (&DxeCoreHob.MemoryAllocationModule->MemoryAllocationHeader.Name,
&gEfiHobMemeryAllocModuleGuid)) {
DxeCoreHob.Raw = GET_NEXT_HOB (DxeCoreHob);
DxeCoreHob.Raw = GetHob (EFI_HOB_TYPE_MEMORY_ALLOCATION, DxeCoreHob.Raw);
}
if (DxeCoreHob.Header->HobType != EFI_HOB_TYPE_MEMORY_ALLOCATION) {
return EFI_NOT_FOUND;
}
*BaseAddress = DxeCoreHob.MemoryAllocationModule->MemoryAllocationHeader.MemoryBaseAddress;
*Length = DxeCoreHob.MemoryAllocationModule->MemoryAllocationHeader.MemoryLength;
*EntryPoint = (VOID *) (UINTN) DxeCoreHob.MemoryAllocationModule->EntryPoint;
*FileName = &DxeCoreHob.MemoryAllocationModule->ModuleName;
return EFI_SUCCESS;
}
开发者ID:binsys,项目名称:VisualUefi,代码行数:54,代码来源:Hob.c
示例15: GetPeiProtocol
EFI_STATUS
GetPeiProtocol (
IN EFI_GUID *ProtocolGuid,
IN VOID **Interface
)
/*++
Routine Description:
Searches for a Protocol Interface passed from PEI through a HOB
Arguments:
ProtocolGuid - The Protocol GUID to search for in the HOB List
Interface - A pointer to the interface for the Protocol GUID
Returns:
EFI_SUCCESS - The Protocol GUID was found and its interface is returned in Interface
EFI_NOT_FOUND - The Protocol GUID was not found in the HOB List
--*/
{
EFI_STATUS Status;
EFI_PEI_HOB_POINTERS GuidHob;
//
// Get Hob list
//
Status = EfiLibGetSystemConfigurationTable (&gEfiHobListGuid, (VOID **) &GuidHob.Raw);
if (EFI_ERROR (Status)) {
return Status;
}
for (Status = EFI_NOT_FOUND; EFI_ERROR (Status);) {
if (END_OF_HOB_LIST (GuidHob)) {
Status = EFI_NOT_FOUND;
break;
}
if (GET_HOB_TYPE (GuidHob) == EFI_HOB_TYPE_GUID_EXTENSION) {
if (EfiCompareGuid (ProtocolGuid, &GuidHob.Guid->Name)) {
Status = EFI_SUCCESS;
*Interface = (VOID *) *(UINTN *) ((UINT8 *) (&GuidHob.Guid->Name) + sizeof (EFI_GUID));
}
}
GuidHob.Raw = GET_NEXT_HOB (GuidHob);
}
return Status;
}
开发者ID:AshleyDeSimone,项目名称:edk2,代码行数:54,代码来源:RuntimeLib.c
示例16: GetHob
VOID *
GetHob (
IN UINT16 Type,
IN VOID *HobStart
)
/*++
Routine Description:
This function returns the first instance of a HOB type in a HOB list.
Arguments:
Type The HOB type to return.
HobStart The first HOB in the HOB list.
Returns:
HobStart There were no HOBs found with the requested type.
else Returns the first HOB with the matching type.
--*/
{
EFI_PEI_HOB_POINTERS Hob;
Hob.Raw = HobStart;
//
// Return input if not found
//
if (HobStart == NULL) {
return HobStart;
}
//
// Parse the HOB list, stop if end of list or matching type found.
//
while (!END_OF_HOB_LIST (Hob)) {
if (Hob.Header->HobType == Type) {
break;
}
Hob.Raw = GET_NEXT_HOB (Hob);
}
//
// Return input if not found
//
if (END_OF_HOB_LIST (Hob)) {
return HobStart;
}
return (VOID *) (Hob.Raw);
}
开发者ID:binsys,项目名称:VisualUefi,代码行数:54,代码来源:Hob.c
示例17: S3ReadyThunkPlatform
/**
Hook point for AcpiVariableThunkPlatform for S3Ready.
@param AcpiS3Context ACPI s3 context
**/
VOID
S3ReadyThunkPlatform (
IN ACPI_S3_CONTEXT *AcpiS3Context
)
{
EFI_PHYSICAL_ADDRESS AcpiMemoryBase;
UINT32 AcpiMemorySize;
EFI_PEI_HOB_POINTERS Hob;
UINT64 MemoryLength;
DEBUG ((EFI_D_INFO, "S3ReadyThunkPlatform\n"));
if (mAcpiVariableSetCompatibility == NULL) {
return;
}
//
// Allocate ACPI reserved memory under 4G
//
AcpiMemoryBase = (EFI_PHYSICAL_ADDRESS)(UINTN)AllocateMemoryBelow4G (EfiReservedMemoryType, PcdGet32 (PcdS3AcpiReservedMemorySize));
ASSERT (AcpiMemoryBase != 0);
AcpiMemorySize = PcdGet32 (PcdS3AcpiReservedMemorySize);
//
// Calculate the system memory length by memory hobs
//
MemoryLength = 0x100000;
Hob.Raw = GetFirstHob (EFI_HOB_TYPE_RESOURCE_DESCRIPTOR);
ASSERT (Hob.Raw != NULL);
while ((Hob.Raw != NULL) && (!END_OF_HOB_LIST (Hob))) {
if (Hob.ResourceDescriptor->ResourceType == EFI_RESOURCE_SYSTEM_MEMORY) {
//
// Skip the memory region below 1MB
//
if (Hob.ResourceDescriptor->PhysicalStart >= 0x100000) {
MemoryLength += Hob.ResourceDescriptor->ResourceLength;
}
}
Hob.Raw = GET_NEXT_HOB (Hob);
Hob.Raw = GetNextHob (EFI_HOB_TYPE_RESOURCE_DESCRIPTOR, Hob.Raw);
}
mAcpiVariableSetCompatibility->AcpiReservedMemoryBase = AcpiMemoryBase;
mAcpiVariableSetCompatibility->AcpiReservedMemorySize = AcpiMemorySize;
mAcpiVariableSetCompatibility->SystemMemoryLength = MemoryLength;
DEBUG((EFI_D_INFO, "AcpiVariableThunkPlatform: AcpiMemoryBase is 0x%8x\n", mAcpiVariableSetCompatibility->AcpiReservedMemoryBase));
DEBUG((EFI_D_INFO, "AcpiVariableThunkPlatform: AcpiMemorySize is 0x%8x\n", mAcpiVariableSetCompatibility->AcpiReservedMemorySize));
DEBUG((EFI_D_INFO, "AcpiVariableThunkPlatform: SystemMemoryLength is 0x%8x\n", mAcpiVariableSetCompatibility->SystemMemoryLength));
return ;
}
开发者ID:hsienchieh,项目名称:uefilab,代码行数:57,代码来源:AcpiVariableThunkPlatform.c
示例18: while
/*
* Returns the next instance of the matching resource HOB from the starting HOB.
*/
void *get_next_resource_hob(const EFI_GUID *guid, const void *hob_start)
{
EFI_PEI_HOB_POINTERS hob;
hob.Raw = (UINT8 *)hob_start;
while ((hob.Raw = get_next_hob(EFI_HOB_TYPE_RESOURCE_DESCRIPTOR,
hob.Raw)) != NULL) {
if (compare_guid(guid, &hob.ResourceDescriptor->Owner))
break;
hob.Raw = GET_NEXT_HOB(hob.Raw);
}
return hob.Raw;
}
开发者ID:AdriDlu,项目名称:coreboot,代码行数:16,代码来源:hob.c
示例19: print_hob_type_structure
/*
* Print out a structure of all the HOBs
* that match a certain type:
* Print all types (0x0000)
* EFI_HOB_TYPE_HANDOFF (0x0001)
* EFI_HOB_TYPE_MEMORY_ALLOCATION (0x0002)
* EFI_HOB_TYPE_RESOURCE_DESCRIPTOR (0x0003)
* EFI_HOB_TYPE_GUID_EXTENSION (0x0004)
* EFI_HOB_TYPE_MEMORY_POOL (0x0007)
* EFI_HOB_TYPE_UNUSED (0xFFFE)
* EFI_HOB_TYPE_END_OF_HOB_LIST (0xFFFF)
*/
void print_hob_type_structure(u16 hob_type, void *hob_list_ptr)
{
u32 *current_hob;
u32 *next_hob = 0;
u8 last_hob = 0;
u32 current_type;
const char *current_type_str;
current_hob = hob_list_ptr;
/*
* Print out HOBs of our desired type until
* the end of the HOB list
*/
printk(BIOS_DEBUG, "\n=== FSP HOB Data Structure ===\n");
printk(BIOS_DEBUG, "0x%p: hob_list_ptr\n", hob_list_ptr);
do {
EFI_HOB_GENERIC_HEADER *current_header_ptr =
(EFI_HOB_GENERIC_HEADER *)current_hob;
/* Get the type of this HOB */
current_type = current_header_ptr->HobType;
current_type_str = get_hob_type_string(current_hob);
if (current_type == hob_type || hob_type == 0x0000) {
printk(BIOS_DEBUG, "HOB %p is an %s (type 0x%0x)\n",
current_hob, current_type_str,
current_type);
switch (current_type) {
case EFI_HOB_TYPE_MEMORY_ALLOCATION:
print_hob_mem_attributes(current_hob);
break;
case EFI_HOB_TYPE_RESOURCE_DESCRIPTOR:
print_hob_resource_attributes(current_hob);
break;
}
}
/* Check for end of HOB list */
last_hob = END_OF_HOB_LIST(current_hob);
if (!last_hob) {
/* Get next HOB pointer */
next_hob = GET_NEXT_HOB(current_hob);
/* Start on next HOB */
current_hob = next_hob;
}
} while (!last_hob);
printk(BIOS_DEBUG, "=== End of FSP HOB Data Structure ===\n\n");
}
开发者ID:AdriDlu,项目名称:coreboot,代码行数:62,代码来源:hob.c
示例20: GetNextFirmwareVolume2Hob
EFI_STATUS
GetNextFirmwareVolume2Hob (
IN OUT VOID **HobStart,
OUT EFI_PHYSICAL_ADDRESS *BaseAddress,
OUT UINT64 *Length,
OUT EFI_GUID *FileName
)
/*++
Routine Description:
Get next firmware volume2 hob from HobStart
Arguments:
HobStart - Start pointer of hob list
BaseAddress - Start address of next firmware volume
Length - Length of next firmware volume
Returns:
EFI_NOT_FOUND - Next firmware volume not found
EFI_SUCCESS - Next firmware volume found with address information
--*/
{
EFI_PEI_HOB_POINTERS FirmwareVolumeHob;
FirmwareVolumeHob.Raw = *HobStart;
if (END_OF_HOB_LIST (FirmwareVolumeHob)) {
return EFI_NOT_FOUND;
}
FirmwareVolumeHob.Raw = GetHob (EFI_HOB_TYPE_FV2, *HobStart);
if (FirmwareVolumeHob.Header->HobType != EFI_HOB_TYPE_FV2) {
return EFI_NOT_FOUND;
}
*BaseAddress = FirmwareVolumeHob.FirmwareVolume2->BaseAddress;
*Length = FirmwareVolumeHob.FirmwareVolume2->Length;
EfiCommonLibCopyMem(FileName,&FirmwareVolumeHob.FirmwareVolume2->FileName,sizeof(EFI_GUID));
*HobStart = GET_NEXT_HOB (FirmwareVolumeHob);
return EFI_SUCCESS;
}
开发者ID:binsys,项目名称:VisualUefi,代码行数:49,代码来源:Hob.c
注:本文中的GET_NEXT_HOB函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论