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