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 /* FUNCTIONS *****************************************************************/
24 HalInitializeProcessor(ULONG ProcessorNumber
,
25 PVOID
/*PLOADER_PARAMETER_BLOCK*/ LoaderBlock
)
29 DPRINT("HalInitializeProcessor(%x %x)\n", ProcessorNumber
, LoaderBlock
);
32 if (OnlineCPUs
& (1 << CPU
))
37 if (ProcessorNumber
== 0)
45 DPRINT("CPU %d says it is now booted.\n", CPU
);
47 APICCalibrateTimer(CPU
);
50 /* This processor is now booted */
51 CPUMap
[CPU
].Flags
|= CPU_ENABLED
;
52 OnlineCPUs
|= (1 << CPU
);
54 /* Setup busy waiting */
55 HalpCalibrateStallExecution();
59 HalAllProcessorsStarted (VOID
)
63 DPRINT("HalAllProcessorsStarted()\n");
64 for (i
= 0; i
< 32; i
++)
66 if (OnlineCPUs
& (1 << i
))
75 else if (CPUs
== CPUCount
)
92 HalStartNextProcessor(ULONG Unknown1
,
97 DPRINT("HalStartNextProcessor(%x %x)\n", Unknown1
, ProcessorStack
);
99 for (CPU
= 0; CPU
< CPUCount
; CPU
++)
101 if (!(OnlineCPUs
& (1<<CPU
)))
112 DPRINT1("Attempting to boot CPU %d\n", CPU
);
114 HaliStartApplicationProcessor(CPU
, ProcessorStack
);