当前位置: 首页>>代码示例>>C++>>正文


C++ CPU_SPECIFIC_SERVICES::GetApCoreNumber方法代码示例

本文整理汇总了C++中CPU_SPECIFIC_SERVICES::GetApCoreNumber方法的典型用法代码示例。如果您正苦于以下问题:C++ CPU_SPECIFIC_SERVICES::GetApCoreNumber方法的具体用法?C++ CPU_SPECIFIC_SERVICES::GetApCoreNumber怎么用?C++ CPU_SPECIFIC_SERVICES::GetApCoreNumber使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CPU_SPECIFIC_SERVICES的用法示例。


在下文中一共展示了CPU_SPECIFIC_SERVICES::GetApCoreNumber方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetCpuServicesOfCurrentCore

/**
 * Determines the base address of the executing core's heap.
 *
 * This function uses the executing core's socket/core numbers to determine
 * where it's heap should be located.
 *
 * @param[in]      StdHeader      Config handle for library and services.
 *
 * @return         A pointer to the executing core's heap.
 *
 */
UINT64
STATIC
HeapGetCurrentBase (
  IN       AMD_CONFIG_PARAMS *StdHeader
  )
{
  UINT32      SystemCoreNumber;
  UINT64      ReturnPtr;
  AGESA_STATUS          IgnoredStatus;
  CPU_SPECIFIC_SERVICES *FamilyServices;

  if (IsBsp (StdHeader, &IgnoredStatus)) {
    ReturnPtr = AMD_HEAP_START_ADDRESS;
  } else {
    GetCpuServicesOfCurrentCore ((CONST CPU_SPECIFIC_SERVICES **)&FamilyServices, StdHeader);
    ASSERT (FamilyServices != NULL);

    SystemCoreNumber = FamilyServices->GetApCoreNumber (FamilyServices, StdHeader);
    ASSERT (SystemCoreNumber != 0);
    ASSERT (SystemCoreNumber < 64);
    ReturnPtr = ((SystemCoreNumber * AMD_HEAP_SIZE_PER_CORE) + AMD_HEAP_START_ADDRESS);
  }
  ASSERT (ReturnPtr <= ((AMD_HEAP_REGION_END_ADDRESS + 1) - AMD_HEAP_SIZE_PER_CORE));
  return ReturnPtr;
}
开发者ID:MikeeHawk,项目名称:coreboot,代码行数:36,代码来源:heapManager.c

示例2: AgesaHeapRebase

/**
 * Determines the base address of the executing core's heap.
 *
 * This function uses the executing core's socket/core numbers to determine
 * where it's heap should be located.
 *
 * @param[in]      StdHeader      Config handle for library and services.
 *
 * @return         A pointer to the executing core's heap.
 *
 */
UINT64
STATIC
HeapGetCurrentBase (
  IN       AMD_CONFIG_PARAMS *StdHeader
  )
{
  UINT32      SystemCoreNumber;
  UINT64      ReturnPtr;
  UINTN       FcnData;
  AGESA_STATUS          IgnoredStatus;
  AGESA_REBASE_PARAMS   HeapRebaseParams;
  CPU_SPECIFIC_SERVICES *FamilyServices;

  HeapRebaseParams.HeapAddress = AMD_HEAP_START_ADDRESS;
  HeapRebaseParams.StdHeader = *StdHeader;
  FcnData = 0;
  AgesaHeapRebase (FcnData, &HeapRebaseParams);

  if (IsBsp (StdHeader, &IgnoredStatus)) {
    ReturnPtr = HeapRebaseParams.HeapAddress;
  } else {
    GetCpuServicesOfCurrentCore (&FamilyServices, StdHeader);
    ASSERT (FamilyServices != NULL);

    SystemCoreNumber = FamilyServices->GetApCoreNumber (FamilyServices, StdHeader);
    ASSERT (SystemCoreNumber != 0);
    ASSERT (SystemCoreNumber < 64);
    ReturnPtr = ((SystemCoreNumber * AMD_HEAP_SIZE_PER_CORE) + HeapRebaseParams.HeapAddress);
  }
  // Normally, HeapRebaseParams.HeapAddress = AMD_HEAP_START_ADDRESS
  // But due to SecureS3, HeapAddress would be changed during run-time
  // So below checking for ReturnPtr needs to be run only if HeapRebaseParams.HeapAddress = AMD_HEAP_START_ADDRESS
  if (HeapRebaseParams.HeapAddress == AMD_HEAP_START_ADDRESS) {
    ASSERT (ReturnPtr <= ((AMD_HEAP_REGION_END_ADDRESS + 1) - AMD_HEAP_SIZE_PER_CORE));
  }
  return ReturnPtr;
}
开发者ID:fishbaoz,项目名称:edk2ml,代码行数:48,代码来源:heapManager.c


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