Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
apic.cpp File Reference
#include "precompiled.h"
#include "lib/sysdep/arch/x86_x64/apic.h"
#include "lib/bits.h"
#include "lib/module_init.h"
#include "lib/sysdep/cpu.h"
#include "lib/sysdep/os_cpu.h"
#include "lib/sysdep/arch/x86_x64/x86_x64.h"
#include <algorithm>
Include dependency graph for apic.cpp:

Functions

ApicId GetApicId ()
 
static Status GetAndValidateApicIds ()
 
static Status InitApicIds ()
 
bool AreApicIdsReliable ()
 
bool IsProcessorKnown (ApicId apicId)
 
static size_t IndexFromApicId (const ApicId *apicIds, ApicId apicId)
 
size_t ProcessorFromApicId (ApicId apicId)
 
size_t ContiguousIdFromApicId (ApicId apicId)
 
static ApicId ApicIdFromIndex (const ApicId *apicIds, size_t index)
 
ApicId ApicIdFromProcessor (size_t processor)
 
ApicId ApicIdFromContiguousId (size_t contiguousId)
 

Variables

static size_t numIds
 
static ApicId processorApicIds [os_cpu_MaxProcessors]
 
static ApicId sortedApicIds [os_cpu_MaxProcessors]
 
static ModuleInitState apicInitState { 0 }
 

Function Documentation

◆ ApicIdFromContiguousId()

ApicId ApicIdFromContiguousId ( size_t  contiguousId)

◆ ApicIdFromIndex()

static ApicId ApicIdFromIndex ( const ApicId apicIds,
size_t  index 
)
static

◆ ApicIdFromProcessor()

ApicId ApicIdFromProcessor ( size_t  processor)

◆ AreApicIdsReliable()

bool AreApicIdsReliable ( )

◆ ContiguousIdFromApicId()

size_t ContiguousIdFromApicId ( ApicId  apicId)

◆ GetAndValidateApicIds()

static Status GetAndValidateApicIds ( )
static

◆ GetApicId()

ApicId GetApicId ( )
Returns
APIC ID of the currently executing processor or zero if the platform does not have an xAPIC (i.e. 7th generation x86 or below).

rationale: the alternative of accessing the APIC mmio registers is not feasible. We also don't want to interfere with the OS's constant use of the APIC registers.

◆ IndexFromApicId()

static size_t IndexFromApicId ( const ApicId apicIds,
ApicId  apicId 
)
static

◆ InitApicIds()

static Status InitApicIds ( )
static

◆ IsProcessorKnown()

bool IsProcessorKnown ( ApicId  apicId)

◆ ProcessorFromApicId()

size_t ProcessorFromApicId ( ApicId  apicId)

Variable Documentation

◆ apicInitState

ModuleInitState apicInitState { 0 }
static

◆ numIds

size_t numIds
static

◆ processorApicIds

ApicId processorApicIds[os_cpu_MaxProcessors]
static

◆ sortedApicIds

ApicId sortedApicIds[os_cpu_MaxProcessors]
static