这篇教程C++ GetHobList函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetHobList函数的典型用法代码示例。如果您正苦于以下问题:C++ GetHobList函数的具体用法?C++ GetHobList怎么用?C++ GetHobList使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetHobList函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: InitCapsulePtr/** This function initializes the mCapsulePtr, mCapsuleStatusArray and mCapsuleTotalNumber.**/VOIDInitCapsulePtr ( 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,
示例2: 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.**/VOIDUpdateStackHob ( 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,
示例3: FspGetResourceDescriptorByOwnerEFIAPIFspGetResourceDescriptorByOwner ( 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,
示例4: 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.**/BOOLEANCheckOverlapWithAllocatedBuffer ( 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,
示例5: GetHighMemorySizevoidGetHighMemorySize ( 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,
示例6: GetPlatformInfoHobEFI_STATUSGetPlatformInfoHob ( IN CONST EFI_PEI_SERVICES **PeiServices, OUT EFI_PLATFORM_INFO_HOB **PlatformInfoHob ){ EFI_PEI_HOB_POINTERS GuidHob; // // Find the PlatformInfo HOB // GuidHob.Raw = GetHobList (); if (GuidHob.Raw == NULL) { return EFI_NOT_FOUND; } if ((GuidHob.Raw = GetNextGuidHob (&gEfiPlatformInfoGuid, GuidHob.Raw)) != NULL) { *PlatformInfoHob = GET_GUID_HOB_DATA (GuidHob.Guid); } // // PlatformInfo PEIM should provide this HOB data, if not ASSERT and return error. // ASSERT (*PlatformInfoHob != NULL); if (!(*PlatformInfoHob)) { return EFI_NOT_FOUND; } return EFI_SUCCESS;}
开发者ID:shijunjing,项目名称:edk2,代码行数:30,
示例7: GetFspReservedMemoryFromGuidvoidGetFspReservedMemoryFromGuid ( 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,
示例8: GenericMemoryTestEntryPoint/** The generic memory test driver's entry point. It initializes private data to default value. @param[in] ImageHandle The firmware allocated handle for the EFI image. @param[in] SystemTable A pointer to the EFI System Table. @retval EFI_SUCCESS The entry point is executed successfully. @retval EFI_NOT_FOUND Can't find HandOff Hob in HobList. @retval other Some error occurs when executing this entry point.**/EFI_STATUSEFIAPIGenericMemoryTestEntryPoint ( IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable ){ EFI_STATUS Status; VOID *HobList; EFI_BOOT_MODE BootMode; EFI_PEI_HOB_POINTERS Hob; // // Use the generic pattern to test compatible memory range // mGenericMemoryTestPrivate.MonoPattern = GenericMemoryTestMonoPattern; mGenericMemoryTestPrivate.MonoTestSize = GENERIC_CACHELINE_SIZE; // // Get the platform boot mode // HobList = GetHobList (); Hob.Raw = HobList; if (Hob.Header->HobType != EFI_HOB_TYPE_HANDOFF) { return EFI_NOT_FOUND; } BootMode = Hob.HandoffInformationTable->BootMode; // // Get the platform boot mode and create the default memory test coverage // level and span size for compatible memory test using // switch (BootMode) { case BOOT_WITH_FULL_CONFIGURATION: case BOOT_WITH_DEFAULT_SETTINGS: mGenericMemoryTestPrivate.CoverageSpan = SPARSE_SPAN_SIZE; break; case BOOT_WITH_FULL_CONFIGURATION_PLUS_DIAGNOSTICS: mGenericMemoryTestPrivate.CoverageSpan = GENERIC_CACHELINE_SIZE; break; default: mGenericMemoryTestPrivate.CoverageSpan = QUICK_SPAN_SIZE; break; } // // Install the protocol // Status = gBS->InstallProtocolInterface ( &mGenericMemoryTestPrivate.Handle, &gEfiGenericMemTestProtocolGuid, EFI_NATIVE_INTERFACE, &mGenericMemoryTestPrivate.GenericMemoryTest ); return Status;}
开发者ID:etiago,项目名称:vbox,代码行数:73,
示例9: PrePeiCoreGetMpCoreInfo//// Return list of cores in the system//EFI_STATUSPrePeiCoreGetMpCoreInfo ( 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,
示例10: 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.**/VOIDUpdateStackHob ( 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,
示例11: AllocatePeiAccessiblePagesEFIAPIAllocatePeiAccessiblePages ( IN EFI_MEMORY_TYPE MemoryType, IN UINTN Pages ){ EFI_STATUS Status; EFI_ALLOCATE_TYPE AllocType; EFI_PHYSICAL_ADDRESS Memory; EFI_HOB_HANDOFF_INFO_TABLE *PhitHob; if (Pages == 0) { return NULL; } AllocType = AllocateAnyPages; // // A X64 build of DXE may be combined with a 32-bit build of PEI, and so we // need to check the memory limit set by PEI, and allocate below 4 GB if the // limit is set to 4 GB or lower. // PhitHob = (EFI_HOB_HANDOFF_INFO_TABLE *)GetHobList (); if (PhitHob->EfiFreeMemoryTop <= MAX_UINT32) { AllocType = AllocateMaxAddress; Memory = MAX_UINT32; } Status = gBS->AllocatePages (AllocType, MemoryType, Pages, &Memory); if (EFI_ERROR (Status)) { return NULL; } return (VOID *)(UINTN)Memory;}
开发者ID:MattDevo,项目名称:edk2,代码行数:33,
示例12: FspGetSystemMemorySize/** Get system memory from HOB. @param[in,out] LowMemoryLength less than 4G memory length @param[in,out] HighMemoryLength greater than 4G memory length**/VOIDEFIAPIFspGetSystemMemorySize ( 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,
示例13: GetFirstHobEFIAPIGetFirstHob ( IN UINT16 Type ){ VOID *HobList; HobList = GetHobList (); return GetNextHob (Type, HobList);}
开发者ID:B-Rich,项目名称:edk2,代码行数:10,
示例14: GetFirstGuidHobEFIAPIGetFirstGuidHob ( IN CONST EFI_GUID *Guid ){ VOID *HobList; HobList = GetHobList (); return GetNextGuidHob (Guid, HobList);}
开发者ID:B-Rich,项目名称:edk2,代码行数:10,
示例15: GetHobList/** The constructor function caches the pointer to HOB list by calling GetHobList() and will always return EFI_SUCCESS. @param ImageHandle The firmware allocated handle for the EFI image. @param SystemTable A pointer to the EFI System Table. @retval EFI_SUCCESS The constructor successfully gets HobList.**/EFI_STATUSEFIAPIHobLibConstructor ( IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable ){ GetHobList (); return EFI_SUCCESS;}
开发者ID:baranee,项目名称:edk2,代码行数:21,
示例16: SaveMemoryConfigDxeEntry/**************************************************************************** 函 数 名 : SaveMemoryConfigDxeEntry 功能描述 : 读取Memory相关配置hob数据,存入Flash 输入参数 : IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable 输出参数 : 无 返 回 值 : EFI_STATUS 修改历史 : 1.日 期 : 2014年12月18日 作 者 : l00228991 修改内容 : 新生成函数****************************************************************************/EFI_STATUSEFIAPI SaveMemoryConfigDxeEntry ( IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable){ EFI_STATUS Status = EFI_SUCCESS; NVRAM *Nvram; GBL_DATA *Gbl_Data; SPI_FLASH_PROTOCOL *Flash; VOID* HobList; UINT32 NvramCrc; HobList = GetHobList(); Gbl_Data = (GBL_DATA*)GetNextGuidHob(&gEfiMemoryMapGuid, HobList); Gbl_Data = GET_GUID_HOB_DATA(Gbl_Data); Nvram = &(Gbl_Data->nvram); Status = gBS->CalculateCrc32(((UINT8 *)Nvram+sizeof(UINT32)),(sizeof(NVRAM)-sizeof(UINT32)),&NvramCrc); if(EFI_ERROR(Status)) { DEBUG((EFI_D_ERROR,"Nvram CalculateCrc32 Failed/n")); return Status; } if( Nvram->NvramCrc != NvramCrc) { Nvram->NvramCrc = NvramCrc; Status = gBS->LocateProtocol (&gSpiFlashProtocolGuid, NULL, (VOID *) &Flash); if (EFI_ERROR(Status)) { DEBUG((EFI_D_ERROR, "%a - %d Status=%r/n", __FILE__, __LINE__, Status)); return Status; } Status = Flash->Erase(Flash,NVRAM_ADDR,sizeof(NVRAM)); if (EFI_ERROR(Status)) { DEBUG((EFI_D_ERROR, "%a - %d SpiFlash Erase Error,Status=%r/n", __FILE__, __LINE__,Status)); return Status; } Status = Flash->Write(Flash, NVRAM_ADDR, (UINT8*)(Nvram), sizeof(NVRAM)); if (EFI_ERROR(Status)) { DEBUG((EFI_D_ERROR, "%a - %d Flash Write Error,Status=%r/n", __FILE__, __LINE__,Status)); return Status; } } return EFI_SUCCESS;}
开发者ID:hzhuang1,项目名称:uefi,代码行数:66,
示例17: GetBootMode/** Get the Boot Mode from the HOB list. This function returns the system boot mode information from the PHIT HOB in HOB list. @param VOID @return The Boot Mode.**/EFI_BOOT_MODEEFIAPIGetBootMode ( VOID ){ EFI_PEI_HOB_POINTERS Hob; Hob.Raw = GetHobList (); return Hob.HandoffInformationTable->BootMode;}
开发者ID:B-Rich,项目名称:edk2,代码行数:22,
示例18: ASSERT/** Get the system boot mode from the HOB list. This function returns the system boot mode information from the PHIT HOB in HOB list. If the pointer to the HOB list is NULL, then ASSERT(). @param VOID @return The Boot Mode.**/EFI_BOOT_MODEEFIAPIGetBootModeHob ( VOID ){ EFI_HOB_HANDOFF_INFO_TABLE *HandOffHob; HandOffHob = (EFI_HOB_HANDOFF_INFO_TABLE *) GetHobList (); return HandOffHob->BootMode;}
开发者ID:etiago,项目名称:vbox,代码行数:25,
示例19: SetBootMode/** Get the Boot Mode from the HOB list. This function returns the system boot mode information from the PHIT HOB in HOB list. @param VOID @return The Boot Mode.**/EFI_STATUSEFIAPISetBootMode ( IN EFI_BOOT_MODE BootMode ){ EFI_PEI_HOB_POINTERS Hob; Hob.Raw = GetHobList (); Hob.HandoffInformationTable->BootMode = BootMode; return BootMode;}
开发者ID:B-Rich,项目名称:edk2,代码行数:23,
示例20: testHotKey EFI_STATUS testHotKey(){ EFI_STATUS Status = 0; EFI_HOB_GENERIC_HEADER *Hob; UINT16 HobType; UINT16 HobLength; for(Hob = GetHobList();!END_OF_HOB_LIST(Hob);Hob = GET_NEXT_HOB(Hob)) { HobType = GET_HOB_TYPE (Hob); HobLength = GET_HOB_LENGTH (Hob); Print((CONST CHAR16*)L"Hob %x %x/n", HobType, HobLength); } return Status;}
开发者ID:WittyTan,项目名称:uefi-programming,代码行数:15,
示例21: CpuMpEndOfPeiCallback/** Notify function on End Of PEI PPI. On S3 boot, this function will restore wakeup buffer data. On normal boot, this function will flag wakeup buffer to be un-used type. @param[in] PeiServices The pointer to the PEI Services Table. @param[in] NotifyDescriptor Address of the notification descriptor data structure. @param[in] Ppi Address of the PPI that was installed. @retval EFI_SUCCESS When everything is OK.**/EFI_STATUSEFIAPICpuMpEndOfPeiCallback ( IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor, IN VOID *Ppi ){ EFI_STATUS Status; EFI_BOOT_MODE BootMode; CPU_MP_DATA *CpuMpData; EFI_PEI_HOB_POINTERS Hob; EFI_HOB_MEMORY_ALLOCATION *MemoryHob; DEBUG ((DEBUG_INFO, "PeiMpInitLib: CpuMpEndOfPeiCallback () invoked/n")); Status = PeiServicesGetBootMode (&BootMode); ASSERT_EFI_ERROR (Status); CpuMpData = GetCpuMpData (); if (BootMode != BOOT_ON_S3_RESUME) { // // 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; if (MemoryHob->AllocDescriptor.MemoryBaseAddress == CpuMpData->WakeupBuffer) { // // Flag this HOB type to un-used // GET_HOB_TYPE (Hob) = EFI_HOB_TYPE_UNUSED; break; } } Hob.Raw = GET_NEXT_HOB (Hob); } } else { CpuMpData->SaveRestoreFlag = TRUE; RestoreWakeupBuffer (CpuMpData); } return EFI_SUCCESS;}
开发者ID:EvanLloyd,项目名称:tianocore,代码行数:59,
示例22: DxeSmbiosDataHobLibConstructor/** Adds SMBIOS records to tables @param[in] ImageHandle Image handle of this driver. @param[in] SystemTable Global system service table. @retval EFI_UNSUPPORTED - Could not locate SMBIOS protocol @retval EFI_OUT_OF_RESOURCES - Failed to allocate memory for SMBIOS HOB type. @retval EFI_SUCCESS - Successfully added SMBIOS records based on HOB.**/EFI_STATUSEFIAPIDxeSmbiosDataHobLibConstructor ( IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable ){ EFI_PEI_HOB_POINTERS Hob; EFI_SMBIOS_HANDLE SmbiosHandle; EFI_SMBIOS_PROTOCOL *Smbios; EFI_STATUS Status; UINT8 *RecordPtr; UINT16 RecordCount; RecordCount = 0; DEBUG ((DEBUG_INFO, "Adding SMBIOS records from HOB../n")); Status = gBS->LocateProtocol (&gEfiSmbiosProtocolGuid, NULL, (VOID **)&Smbios); if (Smbios == NULL) { DEBUG ((DEBUG_WARN, "Can't locate SMBIOS protocol/n")); return EFI_UNSUPPORTED; } /// /// Get SMBIOS HOB data (each hob contains one SMBIOS record) /// for (Hob.Raw = GetHobList (); !END_OF_HOB_LIST(Hob); Hob.Raw = GET_NEXT_HOB (Hob)) { if ((GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_GUID_EXTENSION) && (CompareGuid (&Hob.Guid->Name, &gIntelSmbiosDataHobGuid))) { RecordPtr = GET_GUID_HOB_DATA (Hob.Raw); /// /// Add generic SMBIOS HOB to SMBIOS table /// DEBUG ((DEBUG_VERBOSE, "Add SMBIOS record type: %x/n", ((EFI_SMBIOS_TABLE_HEADER *) RecordPtr)->Type)); SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED; Status = Smbios->Add (Smbios, NULL, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEADER *) RecordPtr); if (!EFI_ERROR (Status)) { RecordCount++; } } } DEBUG ((DEBUG_INFO, "Found %d Records and added to SMBIOS table./n", RecordCount)); return EFI_SUCCESS;}
开发者ID:lersek,项目名称:edk2,代码行数:56,
示例23: FspInitDone/** This function transfer control to the ContinuationFunc passed in by the BootLoader.**/VOIDEFIAPIFspInitDone ( VOID ){ FSP_INIT_PARAMS *FspInitParams; if (GetFspApiCallingMode() == 0) { // // FspInit API is used, so jump into the ContinuationFunc // FspInitParams = (FSP_INIT_PARAMS *)GetFspApiParameter (); // // Modify the parameters for ContinuationFunc // SetFspContinuationFuncParameter(EFI_SUCCESS, 0); SetFspContinuationFuncParameter((UINT32)GetHobList(), 1); // // Modify the return address to ContinuationFunc // SetFspApiReturnAddress((UINT32)FspInitParams->ContinuationFunc); // // Give control back to the boot loader framework caller after FspInit is done // It is done throught the continuation function // SetFspMeasurePoint (FSP_PERF_ID_API_FSPINIT_EXIT); } else { // // FspMemoryInit API is used, so return directly // // // This is the end of the FspSiliconInit API // Give control back to the boot loader // DEBUG ((DEBUG_INFO | DEBUG_INIT, "FspSiliconInitApi() - End/n")); SetFspApiReturnStatus (EFI_SUCCESS); } Pei2LoaderSwitchStack();}
开发者ID:lersek,项目名称:edk2,代码行数:50,
示例24: FspMemoryInitDone/** This function returns control to BootLoader after MemoryInitApi. @param[in,out] HobListPtr The address of HobList pointer.**/VOIDEFIAPIFspMemoryInitDone ( IN OUT VOID **HobListPtr ){ // // Calling use FspMemoryInit API // Update HOB and return the control directly // if (HobListPtr != NULL) { *HobListPtr = (VOID *) GetHobList (); } // // This is the end of the FspMemoryInit API // Give control back to the boot loader // SetFspMeasurePoint (FSP_PERF_ID_API_FSP_MEMORY_INIT_EXIT); DEBUG ((DEBUG_INFO | DEBUG_INIT, "FspMemoryInitApi() - End/n")); REPORT_STATUS_CODE (EFI_PROGRESS_CODE, FSP_STATUS_CODE_MEMORY_INIT | FSP_STATUS_CODE_COMMON_CODE | FSP_STATUS_CODE_API_EXIT); SetFspApiReturnStatus (EFI_SUCCESS); Pei2LoaderSwitchStack (); // // The TempRamExitApi is called // if (GetFspApiCallingIndex () == TempRamExitApiIndex) { SetPhaseStatusCode (FSP_STATUS_CODE_TEMP_RAM_EXIT); REPORT_STATUS_CODE (EFI_PROGRESS_CODE, FSP_STATUS_CODE_TEMP_RAM_EXIT | FSP_STATUS_CODE_COMMON_CODE | FSP_STATUS_CODE_API_ENTRY); SetFspMeasurePoint (FSP_PERF_ID_API_TEMP_RAM_EXIT_ENTRY); DEBUG ((DEBUG_INFO | DEBUG_INIT, "TempRamExitApi() - Begin/n")); } else { SetFspMeasurePoint (FSP_PERF_ID_API_FSP_SILICON_INIT_ENTRY); DEBUG ((DEBUG_INFO | DEBUG_INIT, "FspSiliconInitApi() - Begin/n")); SetPhaseStatusCode (FSP_STATUS_CODE_SILICON_INIT); REPORT_STATUS_CODE (EFI_PROGRESS_CODE, FSP_STATUS_CODE_SILICON_INIT | FSP_STATUS_CODE_COMMON_CODE | FSP_STATUS_CODE_API_ENTRY); }}
开发者ID:Gshoe2006,项目名称:edk2,代码行数:44,
示例25: AllocatePoolEFIAPIAllocatePool ( IN UINTN AllocationSize ){ EFI_HOB_MEMORY_POOL *Hob; Hob = GetHobList (); // // Verify that there is sufficient memory to satisfy the allocation // if (AllocationSize > 0x10000) { // Please call AllcoatePages for big allocations return 0; } else { Hob = (EFI_HOB_MEMORY_POOL *)CreateHob (EFI_HOB_TYPE_MEMORY_POOL, (UINT16)(sizeof (EFI_HOB_TYPE_MEMORY_POOL) + AllocationSize)); return (VOID *)(Hob + 1); }}
开发者ID:MattDevo,项目名称:edk2,代码行数:22,
示例26: PlatformCpuInfoInitEFI_STATUSEFIAPIPlatformCpuInfoInit ( IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable ){ EFI_STATUS Status; EFI_PLATFORM_CPU_INFO *PlatformCpuInfoPtr; EFI_PEI_HOB_POINTERS GuidHob; // // Get Platform Cpu Info HOB // GuidHob.Raw = GetHobList (); while ((GuidHob.Raw = GetNextGuidHob (&gEfiPlatformCpuInfoGuid, GuidHob.Raw)) != NULL) { PlatformCpuInfoPtr = GET_GUID_HOB_DATA (GuidHob.Guid); GuidHob.Raw = GET_NEXT_HOB (GuidHob); // // Write the Platform CPU Info to volatile memory for runtime purposes. // This must be done in its own driver because SetVariable protocol is dependent on chipset, // which is dependent on CpuIo, PlatformInfo, and Metronome. // Status = gRT->SetVariable( EfiPlatformCpuInfoVariable, &gEfiVlv2VariableGuid, EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, sizeof(EFI_PLATFORM_CPU_INFO), PlatformCpuInfoPtr ); if (EFI_ERROR(Status)) { return Status; } } return EFI_SUCCESS;}
开发者ID:FishYu1222,项目名称:edk2,代码行数:38,
示例27: CreatePlatformSmbiosMemoryRecordsVOIDCreatePlatformSmbiosMemoryRecords ( VOID ){ EFI_PEI_HOB_POINTERS HobPtr; SMBIOS_STRUCTURE_POINTER Smbios16; SMBIOS_STRUCTURE_POINTER Smbios17; EFI_SMBIOS_HANDLE PhyscialMemoryArrayHandle; EFI_SMBIOS_HANDLE SmbiosHandle; Smbios16.Hdr = SmbiosLibGetRecord (EFI_SMBIOS_TYPE_PHYSICAL_MEMORY_ARRAY, 0, &PhyscialMemoryArrayHandle); if (Smbios16.Hdr == NULL) { // Only make a Type19 entry if a Type16 entry exists. return; } Smbios17.Hdr = SmbiosLibGetRecord (EFI_SMBIOS_TYPE_MEMORY_DEVICE, 0, &SmbiosHandle); if (Smbios17.Hdr == NULL) { // if type17 exits update with type16 Smbios handle Smbios17.Type17->MemoryArrayHandle = PhyscialMemoryArrayHandle; } // Generate Type16 records gSmbiosType19Template.MemoryArrayHandle = PhyscialMemoryArrayHandle; HobPtr.Raw = GetHobList (); while ((HobPtr.Raw = GetNextHob (EFI_HOB_TYPE_RESOURCE_DESCRIPTOR, HobPtr.Raw)) != NULL) { if (HobPtr.ResourceDescriptor->ResourceType == EFI_RESOURCE_SYSTEM_MEMORY) { gSmbiosType19Template.ExtendedStartingAddress = HobPtr.ResourceDescriptor->PhysicalStart; gSmbiosType19Template.ExtendedEndingAddress = HobPtr.ResourceDescriptor->PhysicalStart + HobPtr.ResourceDescriptor->ResourceLength - 1; SmbiosLibCreateEntry ((SMBIOS_STRUCTURE *)&gSmbiosType19Template, NULL); } HobPtr.Raw = GET_NEXT_HOB (HobPtr); }}
开发者ID:AshleyDeSimone,项目名称:edk2,代码行数:38,
示例28: CreateHobVOID *CreateHob ( IN UINT16 HobType, IN UINT16 HobLength ){ EFI_HOB_HANDOFF_INFO_TABLE *HandOffHob; EFI_HOB_GENERIC_HEADER *HobEnd; EFI_PHYSICAL_ADDRESS FreeMemory; VOID *Hob; HandOffHob = GetHobList (); HobLength = (UINT16)((HobLength + 0x7) & (~0x7)); FreeMemory = HandOffHob->EfiFreeMemoryTop - HandOffHob->EfiFreeMemoryBottom; if (FreeMemory < HobLength) { return NULL; } Hob = (VOID*) (UINTN) HandOffHob->EfiEndOfHobList; ((EFI_HOB_GENERIC_HEADER*) Hob)->HobType = HobType; ((EFI_HOB_GENERIC_HEADER*) Hob)->HobLength = HobLength; ((EFI_HOB_GENERIC_HEADER*) Hob)->Reserved = 0; HobEnd = (EFI_HOB_GENERIC_HEADER*) ((UINTN)Hob + HobLength); HandOffHob->EfiEndOfHobList = (EFI_PHYSICAL_ADDRESS) (UINTN) HobEnd; HobEnd->HobType = EFI_HOB_TYPE_END_OF_HOB_LIST; HobEnd->HobLength = sizeof(EFI_HOB_GENERIC_HEADER); HobEnd->Reserved = 0; HobEnd++; HandOffHob->EfiFreeMemoryBottom = (EFI_PHYSICAL_ADDRESS) (UINTN) HobEnd; return Hob;}
开发者ID:B-Rich,项目名称:edk2,代码行数:37,
示例29: FspGetSystemMemorySize/** Get system memory from HOB. @param[in,out] LowMemoryLength less than 4G memory length @param[in,out] HighMemoryLength greater than 4G memory length**/VOIDEFIAPIFspGetSystemMemorySize ( IN OUT UINT64 *LowMemoryLength, IN OUT UINT64 *HighMemoryLength ){ EFI_PEI_HOB_POINTERS Hob; *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) { // // 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:Gshoe2006,项目名称:edk2,代码行数:42,
注:本文中的GetHobList函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ GetHordeFlagPickerGUID函数代码示例 C++ GetHmenu函数代码示例 |