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 KAFFINITY HalpActiveProcessors
;
23 /* PRIVATE FUNCTIONS *********************************************************/
29 /* Disable interrupts and halt the CPU */
34 /* FUNCTIONS *****************************************************************/
37 HalInitializeProcessor(ULONG ProcessorNumber
,
38 PLOADER_PARAMETER_BLOCK LoaderBlock
)
42 DPRINT("HalInitializeProcessor(%x %x)\n", ProcessorNumber
, LoaderBlock
);
45 if (OnlineCPUs
& (1 << CPU
))
50 if (ProcessorNumber
== 0)
58 DPRINT("CPU %d says it is now booted.\n", CPU
);
60 APICCalibrateTimer(CPU
);
63 /* This processor is now booted */
64 CPUMap
[CPU
].Flags
|= CPU_ENABLED
;
65 OnlineCPUs
|= (1 << CPU
);
67 /* Setup busy waiting */
68 //HalpCalibrateStallExecution();
72 HalAllProcessorsStarted (VOID
)
76 DPRINT("HalAllProcessorsStarted()\n");
77 for (i
= 0; i
< 32; i
++)
79 if (OnlineCPUs
& (1 << i
))
88 else if (CPUs
== CPUCount
)
106 HalStartNextProcessor(
107 IN
struct _LOADER_PARAMETER_BLOCK
*LoaderBlock
,
108 IN PKPROCESSOR_STATE ProcessorState
)
112 DPRINT("HalStartNextProcessor(%x %x)\n", LoaderBlock
, ProcessorState
);
114 for (CPU
= 0; CPU
< CPUCount
; CPU
++)
116 if (!(OnlineCPUs
& (1<<CPU
)))
127 DPRINT1("Attempting to boot CPU %d\n", CPU
);
129 HaliStartApplicationProcessor(CPU
, (ULONG
)ProcessorState
);
136 HalProcessorIdle(VOID
)