本文整理汇总了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;
}
示例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;
}