use a directory.rbuild for halx86
[reactos.git] / reactos / 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 #ifdef _M_IX86
41 KeGetPcr()->IDR = 0xFFFFFFFB;
42 #endif
43 KeGetPcr()->StallScaleFactor = INITIAL_STALL_COUNT;
44
45 /* Update the interrupt affinity and processor mask */
46 InterlockedBitTestAndSet(&HalpActiveProcessors, ProcessorNumber);
47 InterlockedBitTestAndSet((PLONG)&HalpDefaultInterruptAffinity,
48 ProcessorNumber);
49
50 /* Register routines for KDCOM */
51 HalpRegisterKdSupportFunctions();
52 }
53
54 /*
55 * @implemented
56 */
57 BOOLEAN
58 NTAPI
59 HalAllProcessorsStarted(VOID)
60 {
61 /* Do nothing */
62 return TRUE;
63 }
64
65 /*
66 * @implemented
67 */
68 BOOLEAN
69 NTAPI
70 HalStartNextProcessor(IN PLOADER_PARAMETER_BLOCK LoaderBlock,
71 IN PKPROCESSOR_STATE ProcessorState)
72 {
73 /* Ready to start */
74 return FALSE;
75 }
76
77 /*
78 * @implemented
79 */
80 VOID
81 NTAPI
82 HalProcessorIdle(VOID)
83 {
84 /* Enable interrupts and halt the processor */
85 _enable();
86 __halt();
87 }
88
89 /*
90 * @implemented
91 */
92 VOID
93 NTAPI
94 HalRequestIpi(KAFFINITY TargetProcessors)
95 {
96 /* Not implemented on UP */
97 __debugbreak();
98 }
99
100 /* EOF */