2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * FILE: hal/halx86/mp/processor_mp.c
5 * PURPOSE: Intel MultiProcessor specification support
6 * PROGRAMMER: David Welch (welch@cwcom.net)
7 * Casper S. Hornstrup (chorns@users.sourceforge.net)
8 * NOTES: Parts adapted from linux SMP code
10 * 22/05/1998 DW Created
11 * 12/04/2001 CSH Added MultiProcessor specification support
14 /* INCLUDES *****************************************************************/
20 KAFFINITY HalpActiveProcessors
, HalpDefaultInterruptAffinity
;
22 /* PRIVATE FUNCTIONS *********************************************************/
28 /* Disable interrupts and halt the CPU */
33 /* FUNCTIONS *****************************************************************/
36 HalInitializeProcessor(ULONG ProcessorNumber
,
37 PLOADER_PARAMETER_BLOCK LoaderBlock
)
41 DPRINT("HalInitializeProcessor(%x %x)\n", ProcessorNumber
, LoaderBlock
);
44 if (OnlineCPUs
& (1 << CPU
))
49 if (ProcessorNumber
== 0)
57 DPRINT("CPU %d says it is now booted.\n", CPU
);
59 APICCalibrateTimer(CPU
);
62 /* This processor is now booted */
63 CPUMap
[CPU
].Flags
|= CPU_ENABLED
;
64 OnlineCPUs
|= (1 << CPU
);
66 /* Setup busy waiting */
67 //HalpCalibrateStallExecution();
71 HalAllProcessorsStarted (VOID
)
75 DPRINT("HalAllProcessorsStarted()\n");
76 for (i
= 0; i
< 32; i
++)
78 if (OnlineCPUs
& (1 << i
))
87 else if (CPUs
== CPUCount
)
105 HalStartNextProcessor(
106 IN
struct _LOADER_PARAMETER_BLOCK
*LoaderBlock
,
107 IN PKPROCESSOR_STATE ProcessorState
)
111 DPRINT("HalStartNextProcessor(%x %x)\n", LoaderBlock
, ProcessorState
);
113 for (CPU
= 0; CPU
< CPUCount
; CPU
++)
115 if (!(OnlineCPUs
& (1<<CPU
)))
126 DPRINT1("Attempting to boot CPU %d\n", CPU
);
128 HaliStartApplicationProcessor(CPU
, (ULONG
)ProcessorState
);
135 HalProcessorIdle(VOID
)