xref: /reactos/hal/halx86/pic/halinit.c (revision 400af0cf)
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 1998 David Welch (welch@cwcom.net)
6  */
7 
8 /* INCLUDES *****************************************************************/
9 
10 #include <hal.h>
11 
12 #define NDEBUG
13 #include <debug.h>
14 
15 /* FUNCTIONS ****************************************************************/
16 
17 VOID
18 NTAPI
HalpInitProcessor(IN ULONG ProcessorNumber,IN PLOADER_PARAMETER_BLOCK LoaderBlock)19 HalpInitProcessor(
20     IN ULONG ProcessorNumber,
21     IN PLOADER_PARAMETER_BLOCK LoaderBlock)
22 {
23     /* Set default IDR */
24     KeGetPcr()->IDR = 0xFFFFFFFF & ~(1 << PIC_CASCADE_IRQ);
25 }
26 
27 VOID
HalpInitPhase0(IN PLOADER_PARAMETER_BLOCK LoaderBlock)28 HalpInitPhase0(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
29 {
30 
31 }
32 
33 VOID
HalpInitPhase1(VOID)34 HalpInitPhase1(VOID)
35 {
36         /* Enable timer interrupt handler */
37         HalpEnableInterruptHandler(IDT_DEVICE,
38                                    0,
39                                    PRIMARY_VECTOR_BASE + PIC_TIMER_IRQ,
40                                    CLOCK2_LEVEL,
41                                    HalpClockInterrupt,
42                                    Latched);
43 
44         /* Enable RTC interrupt handler */
45         HalpEnableInterruptHandler(IDT_DEVICE,
46                                    0,
47                                    PRIMARY_VECTOR_BASE + PIC_RTC_IRQ,
48                                    PROFILE_LEVEL,
49                                    HalpProfileInterrupt,
50                                    Latched);
51 
52         /* Initialize DMA. NT does this in Phase 0 */
53         HalpInitDma();
54 }
55 
56 /* EOF */
57