Pyrogenesis  13997
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions | Variables
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"

Go to the source code of this file.

Functions

ApicId GetApicId ()
 
static Status GetAndValidateApicIds ()
 
static Status InitApicIds ()
 
bool AreApicIdsReliable ()
 
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
 

Function Documentation

ApicId ApicIdFromContiguousId ( size_t  contiguousId)

Definition at line 152 of file apic.cpp.

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

Definition at line 140 of file apic.cpp.

ApicId ApicIdFromProcessor ( size_t  processor)

Definition at line 147 of file apic.cpp.

bool AreApicIdsReliable ( )

Definition at line 105 of file apic.cpp.

size_t ContiguousIdFromApicId ( ApicId  apicId)

Definition at line 134 of file apic.cpp.

static Status GetAndValidateApicIds ( )
static

Definition at line 50 of file apic.cpp.

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 - mahaf_MapPhysicalMemory only works reliably on WinXP. we also don't want to interfere with the OS's constant use of the APIC registers.

Definition at line 33 of file apic.cpp.

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

Definition at line 114 of file apic.cpp.

static Status InitApicIds ( )
static

Definition at line 89 of file apic.cpp.

size_t ProcessorFromApicId ( ApicId  apicId)

Definition at line 129 of file apic.cpp.

Variable Documentation

ModuleInitState apicInitState
static

Definition at line 102 of file apic.cpp.

size_t numIds
static

Definition at line 46 of file apic.cpp.

ApicId processorApicIds[os_cpu_MaxProcessors]
static

Definition at line 47 of file apic.cpp.

ApicId sortedApicIds[os_cpu_MaxProcessors]
static

Definition at line 48 of file apic.cpp.