• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetHobList函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GetHobList函数的典型用法代码示例。如果您正苦于以下问题:C++ GetHobList函数的具体用法?C++ GetHobList怎么用?C++ GetHobList使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GetHobList函数的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: 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


示例3: 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


示例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.
**/
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


示例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: GetPlatformInfoHob

EFI_STATUS
GetPlatformInfoHob (
  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,代码来源:PlatformInfoHob.c


示例7: 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


示例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_STATUS
EFIAPI
GenericMemoryTestEntryPoint (
  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,代码来源:LightMemoryTest.c


示例9: 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


示例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.

**/
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


示例11: AllocatePeiAccessiblePages

EFIAPI
AllocatePeiAccessiblePages (
  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,代码来源:Allocate.c


示例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
**/
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


示例13: GetFirstHob

EFIAPI
GetFirstHob (
  IN UINT16                 Type
  )
{
  VOID      *HobList;

  HobList = GetHobList ();
  return GetNextHob (Type, HobList);
}
开发者ID:B-Rich,项目名称:edk2,代码行数:10,代码来源:Hob.c


示例14: GetFirstGuidHob

EFIAPI
GetFirstGuidHob (
  IN CONST EFI_GUID         *Guid
  )
{
  VOID      *HobList;

  HobList = GetHobList ();
  return GetNextGuidHob (Guid, HobList);
}
开发者ID:B-Rich,项目名称:edk2,代码行数:10,代码来源:Hob.c


示例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_STATUS
EFIAPI
HobLibConstructor (
  IN EFI_HANDLE        ImageHandle,
  IN EFI_SYSTEM_TABLE  *SystemTable
  )
{
  GetHobList ();

  return EFI_SUCCESS;
}
开发者ID:baranee,项目名称:edk2,代码行数:21,代码来源:HobLib.c


示例16: SaveMemoryConfigDxeEntry

/****************************************************************************
 函 数 名  : SaveMemoryConfigDxeEntry
 功能描述  : 读取Memory相关配置hob数据,存入Flash
 输入参数  : IN EFI_HANDLE         ImageHandle,
             IN EFI_SYSTEM_TABLE  *SystemTable
 输出参数  : 无
 返 回 值  : EFI_STATUS
 修改历史  :
 1.日    期   : 2014年12月18日
  作    者   : l00228991
  修改内容   : 新生成函数
****************************************************************************/
EFI_STATUS
EFIAPI 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,代码来源:SaveMemoryConfigDxe.c


示例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_MODE
EFIAPI
GetBootMode (
  VOID
  )
{
  EFI_PEI_HOB_POINTERS  Hob;

  Hob.Raw = GetHobList ();
  return Hob.HandoffInformationTable->BootMode;
}
开发者ID:B-Rich,项目名称:edk2,代码行数:22,代码来源:Hob.c


示例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_MODE
EFIAPI
GetBootModeHob (
  VOID
  )
{
  EFI_HOB_HANDOFF_INFO_TABLE    *HandOffHob;

  HandOffHob = (EFI_HOB_HANDOFF_INFO_TABLE *) GetHobList ();

  return  HandOffHob->BootMode;
}
开发者ID:etiago,项目名称:vbox,代码行数:25,代码来源:HobLib.c


示例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_STATUS
EFIAPI
SetBootMode (
  IN  EFI_BOOT_MODE   BootMode
  )
{
  EFI_PEI_HOB_POINTERS  Hob;

  Hob.Raw = GetHobList ();
  Hob.HandoffInformationTable->BootMode = BootMode;
  return BootMode;
}
开发者ID:B-Rich,项目名称:edk2,代码行数:23,代码来源:Hob.c


示例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,代码来源:Hob.c



注:本文中的GetHobList函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetHordeFlagPickerGUID函数代码示例发布时间:2022-05-30
下一篇:
C++ GetHmenu函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap