reactos/hal/halx86/apic/halinit.c
Timo Kreuzer e452980e0e [HALX86/APIC] Change IRQL for x86 profile interrupt to HIGH_LEVEL
While PROFILE_LEVEL is defined as 27 on x86, this does not match the vector for the profiling interrupt, which is 0xFD (see https://community.osr.com/t/odd-ioapic-output/45216), implying IRQL 31.
Fixes boot with x86 APIC hal (CORE-20093)
2025-04-24 11:36:12 +00:00

78 lines
2 KiB
C

/*
* PROJECT: ReactOS Hardware Abstraction Layer
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
* PURPOSE: Initialize the APIC HAL
* COPYRIGHT: Copyright 2011 Timo Kreuzer <timo.kreuzer@reactos.org>
*/
/* INCLUDES *****************************************************************/
#include <hal.h>
#include "apicp.h"
#include <smp.h>
#define NDEBUG
#include <debug.h>
VOID
NTAPI
ApicInitializeLocalApic(ULONG Cpu);
/* FUNCTIONS ****************************************************************/
VOID
NTAPI
HalpInitProcessor(
IN ULONG ProcessorNumber,
IN PLOADER_PARAMETER_BLOCK LoaderBlock)
{
if (ProcessorNumber == 0)
{
HalpParseApicTables(LoaderBlock);
}
HalpSetupProcessorsTable(ProcessorNumber);
/* Initialize the local APIC for this cpu */
ApicInitializeLocalApic(ProcessorNumber);
/* Initialize profiling data (but don't start it) */
HalInitializeProfiling();
/* Initialize the timer */
//ApicInitializeTimer(ProcessorNumber);
}
VOID
HalpInitPhase0(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
{
DPRINT1("Using HAL: APIC %s %s\n",
(HalpBuildType & PRCB_BUILD_UNIPROCESSOR) ? "UP" : "SMP",
(HalpBuildType & PRCB_BUILD_DEBUG) ? "DBG" : "REL");
HalpPrintApicTables();
/* Enable clock interrupt handler */
HalpEnableInterruptHandler(IDT_INTERNAL,
0,
APIC_CLOCK_VECTOR,
CLOCK2_LEVEL,
HalpClockInterrupt,
Latched);
/* Enable profile interrupt handler */
HalpEnableInterruptHandler(IDT_DEVICE,
0,
APIC_PROFILE_VECTOR,
APIC_PROFILE_LEVEL,
HalpProfileInterrupt,
Latched);
}
VOID
HalpInitPhase1(VOID)
{
/* Initialize DMA. NT does this in Phase 0 */
HalpInitDma();
}
/* EOF */