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 18 ApicInitializeLocalApic(ULONG Cpu); 19 20 /* FUNCTIONS ****************************************************************/ 21 22 VOID 23 NTAPI 24 HalpInitProcessor( 25 IN ULONG ProcessorNumber, 26 IN PLOADER_PARAMETER_BLOCK LoaderBlock) 27 { 28 if (ProcessorNumber == 0) 29 { 30 HalpParseApicTables(LoaderBlock); 31 } 32 33 HalpSetupProcessorsTable(ProcessorNumber); 34 35 /* Initialize the local APIC for this cpu */ 36 ApicInitializeLocalApic(ProcessorNumber); 37 38 /* Initialize profiling data (but don't start it) */ 39 HalInitializeProfiling(); 40 41 /* Initialize the timer */ 42 //ApicInitializeTimer(ProcessorNumber); 43 } 44 45 VOID 46 HalpInitPhase0(IN PLOADER_PARAMETER_BLOCK LoaderBlock) 47 { 48 DPRINT1("Using HAL: APIC %s %s\n", 49 (HalpBuildType & PRCB_BUILD_UNIPROCESSOR) ? "UP" : "SMP", 50 (HalpBuildType & PRCB_BUILD_DEBUG) ? "DBG" : "REL"); 51 52 HalpPrintApicTables(); 53 54 /* Enable clock interrupt handler */ 55 HalpEnableInterruptHandler(IDT_INTERNAL, 56 0, 57 APIC_CLOCK_VECTOR, 58 CLOCK2_LEVEL, 59 HalpClockInterrupt, 60 Latched); 61 } 62 63 VOID 64 HalpInitPhase1(VOID) 65 { 66 /* Initialize DMA. NT does this in Phase 0 */ 67 HalpInitDma(); 68 } 69 70 /* EOF */ 71