From d61b48740f65f631f8e2eb32b36e6dd786078905 Mon Sep 17 00:00:00 2001 From: Aiken Harris Date: Wed, 30 Jul 2025 16:53:07 +0200 Subject: [PATCH] Declare CpuRegisters as a local structure instead of a pointer --- xtldr/modules/xtos_o/i686/memory.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/xtldr/modules/xtos_o/i686/memory.c b/xtldr/modules/xtos_o/i686/memory.c index d6ccdee..83681c0 100644 --- a/xtldr/modules/xtos_o/i686/memory.c +++ b/xtldr/modules/xtos_o/i686/memory.c @@ -79,22 +79,18 @@ XTCDECL EFI_STATUS XtEnablePaging(IN PXTBL_PAGE_MAPPING PageMap) { - PCPUID_REGISTERS CpuRegisters = NULL; + CPUID_REGISTERS CpuRegisters; EFI_STATUS Status; /* Prepare CPUID registers */ - CpuRegisters->Leaf = CPUID_GET_CPU_FEATURES; - CpuRegisters->SubLeaf = 0; - CpuRegisters->Eax = 0; - CpuRegisters->Ebx = 0; - CpuRegisters->Ecx = 0; - CpuRegisters->Edx = 0; + RtlZeroMemory(&CpuRegisters, sizeof(CPUID_REGISTERS)); + CpuRegisters.Leaf = CPUID_GET_CPU_FEATURES; /* Get CPUID */ - ArCpuId(CpuRegisters); + ArCpuId(&CpuRegisters); /* Store PAE status from the CPUID results */ - if(!(CpuRegisters->Edx & CPUID_FEATURES_EDX_PAE)) + if(!(CpuRegisters.Edx & CPUID_FEATURES_EDX_PAE)) { /* No PAE support */ XtLdrProtocol->Debug.Print(L"ERROR: PAE extension not supported by the CPU\n");