Pyrogenesis  trunk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Functions | Variables
topology Namespace Reference

Classes

struct  ApicField
 
class  CacheRelations
 
struct  CacheTopology
 
struct  CpuTopology
 

Functions

static size_t MaxCoresPerPackage ()
 
static size_t MaxLogicalPerCore ()
 
static size_t MaxLogicalPerCache ()
 
static Status InitCpuTopology ()
 
size_t NumPackages ()
 
size_t CoresPerPackage ()
 
size_t LogicalPerCore ()
 
size_t LogicalFromApicId (ApicId apicId)
 
size_t CoreFromApicId (ApicId apicId)
 
size_t PackageFromApicId (ApicId apicId)
 
ApicId ApicIdFromIndices (size_t idxPackage, size_t idxCore, size_t idxLogical)
 
static void DetermineCachesProcessorMask (uintptr_t *cachesProcessorMask, size_t &numCaches)
 
static void DetermineProcessorsCache (const uintptr_t *cachesProcessorMask, size_t numCaches, size_t *processorsCache, size_t numProcessors)
 
static Status InitCacheTopology ()
 
size_t NumCaches ()
 
size_t CacheFromProcessor (size_t processor)
 
uintptr_t ProcessorMaskFromCache (size_t cache)
 

Variables

static CpuTopology cpuTopology
 
static ModuleInitState cpuInitState
 
static CacheTopology cacheTopology
 
static ModuleInitState cacheInitState
 

Function Documentation

LIB_API ApicId topology::ApicIdFromIndices ( size_t  idxPackage,
size_t  idxCore,
size_t  idxLogical 
)
Parameters
idxPackage,idxCore,idxLogicalreturn values of *FromApicId
Returns
APIC ID (see note at AreApicIdsReliable)
LIB_API size_t topology::CacheFromProcessor ( size_t  processor)
Returns
L2 cache number (zero-based) to which the given processor belongs.
LIB_API size_t topology::CoreFromApicId ( ApicId  apicId)
Returns
index of processor core in [0, CoresPerPackage())
LIB_API size_t topology::CoresPerPackage ( )
Returns
number of enabled CPU cores per package. (2 on dual-core systems)
static void topology::DetermineCachesProcessorMask ( uintptr_t *  cachesProcessorMask,
size_t &  numCaches 
)
static
static void topology::DetermineProcessorsCache ( const uintptr_t *  cachesProcessorMask,
size_t  numCaches,
size_t *  processorsCache,
size_t  numProcessors 
)
static
static Status topology::InitCacheTopology ( )
static
static Status topology::InitCpuTopology ( )
static
LIB_API size_t topology::LogicalFromApicId ( ApicId  apicId)
Returns
index of logical processor in [0, LogicalPerCore())
LIB_API size_t topology::LogicalPerCore ( )
Returns
number of enabled logical processors (aka Hyperthreads) per core. (2 on P4 EE)
static size_t topology::MaxCoresPerPackage ( )
static
static size_t topology::MaxLogicalPerCache ( )
static
static size_t topology::MaxLogicalPerCore ( )
static
LIB_API size_t topology::NumCaches ( )
Returns
number of distinct L2 caches.
LIB_API size_t topology::NumPackages ( )
Returns
number of enabled CPU packages / sockets.
LIB_API size_t topology::PackageFromApicId ( ApicId  apicId)
Returns
index of processor package/socket in [0, NumPackages())
LIB_API uintptr_t topology::ProcessorMaskFromCache ( size_t  cache)
Returns
bit-mask of all processors sharing the given cache.

Variable Documentation

ModuleInitState topology::cacheInitState
static
CacheTopology topology::cacheTopology
static
ModuleInitState topology::cpuInitState
static
CpuTopology topology::cpuTopology
static