svn will drive me nuts, part 1/x
[reactos.git] / hal / halx86 / up / processor.c
1 /*
2 * PROJECT: ReactOS HAL
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: hal/halx86/up/processor.c
5 * PURPOSE: HAL Processor Routines
6 * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
7 */
8
9 /* INCLUDES ******************************************************************/
10
11 #include <hal.h>
12 #define NDEBUG
13 #include <debug.h>
14
15 LONG HalpActiveProcessors;
16 KAFFINITY HalpDefaultInterruptAffinity;
17
18 /* PRIVATE FUNCTIONS *********************************************************/
19
20 VOID
21 NTAPI
22 HaliHaltSystem(VOID)
23 {
24 /* Disable interrupts and halt the CPU */
25 _disable();
26 __halt();
27 }
28
29 /* FUNCTIONS *****************************************************************/
30
31 /*
32 * @implemented
33 */
34 VOID
35 NTAPI
36 HalInitializeProcessor(IN ULONG ProcessorNumber,
37 IN PLOADER_PARAMETER_BLOCK LoaderBlock)
38 {
39 /* Set default IDR and stall count */
40 KeGetPcr()->IDR = 0xFFFFFFFB;
41 KeGetPcr()->StallScaleFactor = INITIAL_STALL_COUNT;
42
43 /* Update the interrupt affinity and processor mask */
44 InterlockedBitTestAndSet(&HalpActiveProcessors, ProcessorNumber);
45 InterlockedBitTestAndSet((PLONG)&HalpDefaultInterruptAffinity,
46 ProcessorNumber);
47
48 /* Register routines for KDCOM */
49 HalpRegisterKdSupportFunctions();
50 }
51
52 /*
53 * @implemented
54 */
55 BOOLEAN
56 NTAPI
57 HalAllProcessorsStarted(VOID)
58 {
59 /* Do nothing */
60 return TRUE;
61 }
62
63 /*
64 * @implemented
65 */
66 BOOLEAN
67 NTAPI
68 HalStartNextProcessor(IN PLOADER_PARAMETER_BLOCK LoaderBlock,
69 IN PKPROCESSOR_STATE ProcessorState)
70 {
71 /* Ready to start */
72 return FALSE;
73 }
74
75 /*
76 * @implemented
77 */
78 VOID
79 NTAPI
80 HalProcessorIdle(VOID)
81 {
82 /* Enable interrupts and halt the processor */
83 _enable();
84 __halt();
85 }
86
87 /*
88 * @implemented
89 */
90 VOID
91 NTAPI
92 HalRequestIpi(KAFFINITY TargetProcessors)
93 {
94 /* Not implemented on UP */
95 __debugbreak();
96 }
97
98 /* EOF */