From 2c158e8068f31b032f338cbdbccda4f895965033 Mon Sep 17 00:00:00 2001 From: vit9696 Date: Thu, 7 Feb 2019 16:15:09 +0300 Subject: [PATCH] Fix CpuInfo reading --- Library/OcCpuLib/OcCpuLib.c | 1 + Library/OcSmbiosLib/SmbiosPatch.c | 16 +++++----------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/Library/OcCpuLib/OcCpuLib.c b/Library/OcCpuLib/OcCpuLib.c index 51c104c8..255c1573 100755 --- a/Library/OcCpuLib/OcCpuLib.c +++ b/Library/OcCpuLib/OcCpuLib.c @@ -63,6 +63,7 @@ OcCpuScanProcessor ( Status = EFI_INVALID_PARAMETER; if (Cpu != NULL) { + ZeroMem (Cpu, sizeof (*Cpu)); // Get vendor CPUID 0x00000000 AsmCpuid (CPUID_SIGNATURE, &CpuidEax, (UINT32 *)Cpu->Vendor, (UINT32 *)(Cpu->Vendor + 8), (UINT32 *)(Cpu->Vendor + 4)); diff --git a/Library/OcSmbiosLib/SmbiosPatch.c b/Library/OcSmbiosLib/SmbiosPatch.c index bf459424..5233151a 100755 --- a/Library/OcSmbiosLib/SmbiosPatch.c +++ b/Library/OcSmbiosLib/SmbiosPatch.c @@ -1315,17 +1315,11 @@ CreateSmBios ( if (Buffer != NULL) { - CPU_INFO *CpuInfo; - - UINT8 *Table; + CPU_INFO CpuInfo; + UINT8 *Table; if (!EFI_ERROR (Status)) { - CpuInfo = NULL; - //FIXME: - /*Status = PlatformInfo->GetProcessorInfo ( - PlatformInfo, - (VOID **)&CpuInfo - );*/ + Status = OcCpuScanProcessor (&CpuInfo); if (!EFI_ERROR (Status)) { @@ -1364,7 +1358,7 @@ CreateSmBios ( // Combine the following PatchCacheInformation (&Table, &Handle, &L1CacheHandle, &L2CacheHandle, &L3CacheHandle); - PatchProcessorInformation (&Table, &Handle, L1CacheHandle, L2CacheHandle, L3CacheHandle, CpuInfo); + PatchProcessorInformation (&Table, &Handle, L1CacheHandle, L2CacheHandle, L3CacheHandle, &CpuInfo); PatchSystemPorts (&Table, &Handle); PatchSystemSlots (&Table, &Handle); @@ -1422,7 +1416,7 @@ CreateSmBios ( PatchBootInformation (&Table, &Handle); - CreateAppleProcessorType (&Table, &Handle, CpuInfo); + CreateAppleProcessorType (&Table, &Handle, &CpuInfo); CreateAppleFirmwareVolume (&Table, &Handle);