ReactOS  0.4.15-dev-5452-g3c95c95
halinit.c
Go to the documentation of this file.
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 APIC HAL
5  * COPYRIGHT: Copyright 2011 Timo Kreuzer <timo.kreuzer@reactos.org>
6  */
7 
8 /* INCLUDES *****************************************************************/
9 
10 #include <hal.h>
11 #include "apicp.h"
12 #include <smp.h>
13 #define NDEBUG
14 #include <debug.h>
15 
16 VOID
17 NTAPI
19 
20 /* FUNCTIONS ****************************************************************/
21 
22 VOID
23 NTAPI
25  IN ULONG ProcessorNumber,
26  IN PLOADER_PARAMETER_BLOCK LoaderBlock)
27 {
28 #ifdef CONFIG_SMP
29  if (ProcessorNumber == 0)
30  {
31 #endif
32  HalpParseApicTables(LoaderBlock);
33 #ifdef CONFIG_SMP
34  }
35 
36  HalpSetupProcessorsTable(ProcessorNumber);
37 #endif
38 
39  /* Initialize the local APIC for this cpu */
40  ApicInitializeLocalApic(ProcessorNumber);
41 
42  /* Initialize profiling data (but don't start it) */
44 
45  /* Initialize the timer */
46  //ApicInitializeTimer(ProcessorNumber);
47 }
48 
49 VOID
51 {
52  DPRINT1("Using HAL: APIC %s %s\n",
53  (HalpBuildType & PRCB_BUILD_UNIPROCESSOR) ? "UP" : "SMP",
54  (HalpBuildType & PRCB_BUILD_DEBUG) ? "DBG" : "REL");
55 
57 
58  /* Enable clock interrupt handler */
60  0,
64  Latched);
65 }
66 
67 VOID
69 {
70  /* Initialize DMA. NT does this in Phase 0 */
71  HalpInitDma();
72 }
73 
74 /* EOF */
#define IN
Definition: typedefs.h:39
const USHORT HalpBuildType
Definition: buildtype.c:14
#define PRCB_BUILD_DEBUG
Definition: ketypes.h:247
VOID NTAPI HalInitializeProfiling(VOID)
Definition: apictimer.c:76
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
VOID HalpInitDma(VOID)
Definition: dma.c:185
#define APIC_CLOCK_VECTOR
Definition: apicp.h:44
VOID NTAPI HalpEnableInterruptHandler(IN UCHAR Flags, IN ULONG BusVector, IN ULONG SystemVector, IN KIRQL Irql, IN PVOID Handler, IN KINTERRUPT_MODE Mode)
Definition: usage.c:49
VOID HalpSetupProcessorsTable(_In_ UINT32 NTProcessorNumber)
Definition: smp.c:22
VOID HalpInitPhase1(VOID)
Definition: halinit.c:68
VOID HalpInitPhase0(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: halinit.c:50
#define CLOCK2_LEVEL
Definition: env_spec_w32.h:700
VOID HalpPrintApicTables(VOID)
Definition: madt.c:76
#define IDT_INTERNAL
Definition: halp.h:21
VOID HalpClockInterrupt(VOID)
Definition: timer.c:30
#define PRCB_BUILD_UNIPROCESSOR
Definition: ketypes.h:248
#define DPRINT1
Definition: precomp.h:8
VOID HalpParseApicTables(_In_ PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: madt.c:30
VOID NTAPI ApicInitializeLocalApic(ULONG Cpu)
Definition: apic.c:291
unsigned int ULONG
Definition: retypes.h:1
VOID NTAPI HalpInitProcessor(IN ULONG ProcessorNumber, IN PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: halinit.c:24