From 3472b448c75417424c92ebf0d6c6fc09e5bfefbf Mon Sep 17 00:00:00 2001 From: Aiken Harris Date: Sun, 10 Aug 2025 17:05:13 +0200 Subject: [PATCH] Fix broken AcGetApicBase implementation --- xtldr/modules/acpi/acpi.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/xtldr/modules/acpi/acpi.c b/xtldr/modules/acpi/acpi.c index 334e8b9..c5fee81 100644 --- a/xtldr/modules/acpi/acpi.c +++ b/xtldr/modules/acpi/acpi.c @@ -185,15 +185,13 @@ XTCDECL EFI_STATUS AcGetApicBase(OUT PVOID *ApicBase) { - PCPUID_REGISTERS CpuRegisters = NULL; + CPUID_REGISTERS CpuRegisters; - /* Get CPU features list */ - CpuRegisters->Leaf = CPUID_GET_CPU_FEATURES; - CpuRegisters->SubLeaf = 0; - CpuRegisters->Eax = 0; - CpuRegisters->Ebx = 0; - CpuRegisters->Ecx = 0; - CpuRegisters->Edx = 0; + /* Prepare CPUID registers to query for APIC support */ + RtlZeroMemory(&CpuRegisters, sizeof(CPUID_REGISTERS)); + CpuRegisters->Leaf = CPUID_GET_STANDARD1_FEATURES; + + /* Query CPUID */ ArCpuId(CpuRegisters); /* Check if APIC present */