Simplify active processor bit setting
This commit is contained in:
@@ -24,7 +24,6 @@ VOID
|
|||||||
HL::Cpu::InitializeProcessor(VOID)
|
HL::Cpu::InitializeProcessor(VOID)
|
||||||
{
|
{
|
||||||
PKPROCESSOR_BLOCK ProcessorBlock;
|
PKPROCESSOR_BLOCK ProcessorBlock;
|
||||||
ULONG BlockIndex, BitIndex;
|
|
||||||
|
|
||||||
/* Get current processor block */
|
/* Get current processor block */
|
||||||
ProcessorBlock = KE::Processor::GetCurrentProcessorBlock();
|
ProcessorBlock = KE::Processor::GetCurrentProcessorBlock();
|
||||||
@@ -33,12 +32,8 @@ HL::Cpu::InitializeProcessor(VOID)
|
|||||||
ProcessorBlock->StallScaleFactor = INITIAL_STALL_FACTOR;
|
ProcessorBlock->StallScaleFactor = INITIAL_STALL_FACTOR;
|
||||||
ProcessorBlock->Idr = 0xFFFFFFFF;
|
ProcessorBlock->Idr = 0xFFFFFFFF;
|
||||||
|
|
||||||
/* Calculate the precise block and bit index for the affinity map */
|
/* Register this CPU in the global active processors map */
|
||||||
BlockIndex = ProcessorBlock->CpuNumber / 64;
|
KE::Affinity::AtomicSetProcessorAffinity(&ActiveProcessors, ProcessorBlock->CpuNumber);
|
||||||
BitIndex = ProcessorBlock->CpuNumber % 64;
|
|
||||||
|
|
||||||
/* Apply affinity to a set of processors */
|
|
||||||
RTL::Atomic::Or64((PLONG_PTR)&ActiveProcessors.Bitmap[BlockIndex], ((KAFFINITY)1 << BitIndex));
|
|
||||||
|
|
||||||
/* Initialize APIC for this processor */
|
/* Initialize APIC for this processor */
|
||||||
HL::Pic::InitializePic();
|
HL::Pic::InitializePic();
|
||||||
|
|||||||
Reference in New Issue
Block a user