3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS kernel
5 * FILE: hal/halx86/mp/processor_mp.c
6 * PURPOSE: Intel MultiProcessor specification support
7 * PROGRAMMER: David Welch (welch@cwcom.net)
8 * Casper S. Hornstrup (chorns@users.sourceforge.net)
9 * NOTES: Parts adapted from linux SMP code
11 * 22/05/1998 DW Created
12 * 12/04/2001 CSH Added MultiProcessor specification support
15 /* INCLUDES *****************************************************************/
21 /* PRIVATE FUNCTIONS *********************************************************/
27 /* Disable interrupts and halt the CPU */
32 /* FUNCTIONS *****************************************************************/
35 HalInitializeProcessor(ULONG ProcessorNumber
,
36 PLOADER_PARAMETER_BLOCK LoaderBlock
)
40 DPRINT("HalInitializeProcessor(%x %x)\n", ProcessorNumber
, LoaderBlock
);
43 if (OnlineCPUs
& (1 << CPU
))
48 if (ProcessorNumber
== 0)
56 DPRINT("CPU %d says it is now booted.\n", CPU
);
58 APICCalibrateTimer(CPU
);
61 /* This processor is now booted */
62 CPUMap
[CPU
].Flags
|= CPU_ENABLED
;
63 OnlineCPUs
|= (1 << CPU
);
65 /* Setup busy waiting */
66 //HalpCalibrateStallExecution();
70 HalAllProcessorsStarted (VOID
)
74 DPRINT("HalAllProcessorsStarted()\n");
75 for (i
= 0; i
< 32; i
++)
77 if (OnlineCPUs
& (1 << i
))
86 else if (CPUs
== CPUCount
)
104 HalStartNextProcessor(
105 IN
struct _LOADER_PARAMETER_BLOCK
*LoaderBlock
,
106 IN PKPROCESSOR_STATE ProcessorState
)
110 DPRINT("HalStartNextProcessor(%x %x)\n", LoaderBlock
, ProcessorState
);
112 for (CPU
= 0; CPU
< CPUCount
; CPU
++)
114 if (!(OnlineCPUs
& (1<<CPU
)))
125 DPRINT1("Attempting to boot CPU %d\n", CPU
);
127 HaliStartApplicationProcessor(CPU
, (ULONG
)ProcessorState
);
134 HalProcessorIdle(VOID
)