xref: /reactos/hal/halx86/apic/halinit.c (revision aea948a7)
1 /*
2  * PROJECT:     ReactOS Hardware Abstraction Layer
3  * LICENSE:     GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4  * PURPOSE:     Initialize the x86 HAL
5  * COPYRIGHT:   Copyright 2011 Timo Kreuzer <timo.kreuzer@reactos.org>
6  */
7 
8 /* INCLUDES *****************************************************************/
9 
10 #include <hal.h>
11 #define NDEBUG
12 #include <debug.h>
13 #include "apic.h"
14 
15 VOID
16 NTAPI
17 ApicInitializeLocalApic(ULONG Cpu);
18 
19 /* GLOBALS ******************************************************************/
20 
21 const USHORT HalpBuildType = HAL_BUILD_TYPE;
22 
23 /* FUNCTIONS ****************************************************************/
24 
25 VOID
26 NTAPI
27 HalpInitProcessor(
28     IN ULONG ProcessorNumber,
29     IN PLOADER_PARAMETER_BLOCK LoaderBlock)
30 {
31     /* Initialize the local APIC for this cpu */
32     ApicInitializeLocalApic(ProcessorNumber);
33 
34     /* Initialize profiling data (but don't start it) */
35     HalInitializeProfiling();
36 
37     /* Initialize the timer */
38     //ApicInitializeTimer(ProcessorNumber);
39 
40 }
41 
42 VOID
43 HalpInitPhase0(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
44 {
45 
46     /* Enable clock interrupt handler */
47     HalpEnableInterruptHandler(IDT_INTERNAL,
48                                0,
49                                APIC_CLOCK_VECTOR,
50                                CLOCK2_LEVEL,
51                                HalpClockInterrupt,
52                                Latched);
53 }
54 
55 VOID
56 HalpInitPhase1(VOID)
57 {
58     /* Initialize DMA. NT does this in Phase 0 */
59     HalpInitDma();
60 }
61 
62 /* EOF */
63