本文整理汇总了C++中CPU_SPECIFIC_SERVICES::GetApMailboxFromHardware方法的典型用法代码示例。如果您正苦于以下问题:C++ CPU_SPECIFIC_SERVICES::GetApMailboxFromHardware方法的具体用法?C++ CPU_SPECIFIC_SERVICES::GetApMailboxFromHardware怎么用?C++ CPU_SPECIFIC_SERVICES::GetApMailboxFromHardware使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPU_SPECIFIC_SERVICES
的用法示例。
在下文中一共展示了CPU_SPECIFIC_SERVICES::GetApMailboxFromHardware方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetCpuServicesOfCurrentCore
/**
* Returns the family specific properties of the cache, and its usage.
*
* @CpuServiceMethod{::F_CPU_GET_FAMILY_SPECIFIC_ARRAY}.
*
* @param[in] FamilySpecificServices The current Family Specific Services.
* @param[out] CacheInfoPtr Points to the cache info properties on exit.
* @param[out] NumberOfElements Will be one to indicate one entry.
* @param[in] StdHeader Header for library and services.
*
*/
VOID
GetF15CacheInfo (
IN CPU_SPECIFIC_SERVICES *FamilySpecificServices,
OUT CONST VOID **CacheInfoPtr,
OUT UINT8 *NumberOfElements,
IN AMD_CONFIG_PARAMS *StdHeader
)
{
UINT32 Enabled;
UINT32 DualCore;
UINT32 Node;
PCI_ADDR PciAddress;
CPU_SPECIFIC_SERVICES *FamilyServices;
AP_MAILBOXES ApMailboxes;
CORE_PAIR_MAP *CorePairMap;
AGESA_STATUS IgnoredStatus;
if (!IsBsp (StdHeader, &IgnoredStatus)) {
GetCpuServicesOfCurrentCore ((CONST CPU_SPECIFIC_SERVICES **)&FamilyServices, StdHeader);
ASSERT (FamilyServices != NULL);
FamilyServices->GetApMailboxFromHardware (FamilyServices, &ApMailboxes, StdHeader);
Node = ApMailboxes.ApMailInfo.Fields.Node;
// Since pre-heap, get compute unit status from hardware, using mailbox info.
PciAddress.AddressValue = MAKE_SBDFO (0, 0, 24, 0, 0);
PciAddress.Address.Device = PciAddress.Address.Device + Node;
PciAddress.Address.Function = FUNC_5;
PciAddress.Address.Register = COMPUTE_UNIT_STATUS;
LibAmdPciReadBits (PciAddress, 3, 0, &Enabled, StdHeader);
LibAmdPciReadBits (PciAddress, 19, 16, &DualCore, StdHeader);
// Find the core to compute unit mapping for this node.
CorePairMap = FamilyServices->CorePairMap;
if ((Enabled != 0) && (CorePairMap != NULL)) {
while (CorePairMap->Enabled != 0xFF) {
if ((Enabled == CorePairMap->Enabled) && (DualCore == CorePairMap->DualCore)) {
break;
}
CorePairMap++;
}
// The assert is for finding a processor configured in a way the core pair map doesn't support.
ASSERT (CorePairMap->Enabled != 0xFF);
switch (CorePairMap->Mapping) {
case AllCoresMapping:
// No cores are sharing a compute unit
*CacheInfoPtr = &CpuF15CacheInfo;
break;
case EvenCoresMapping:
// Cores are paired into compute units
*CacheInfoPtr = &CpuF15CacheInfoCP;
break;
default:
ASSERT (FALSE);
}
}
} else {
// the BSC is always just the first slice, we could return either one. Return the non for safest.
*CacheInfoPtr = &CpuF15CacheInfo;
}
*NumberOfElements = 1;
}