From e90fa3274bed1fb432f4f3eab12a3ffaffcf8fe2 Mon Sep 17 00:00:00 2001 From: Florin9doi Date: Mon, 23 Dec 2019 18:46:07 +0200 Subject: [PATCH] Try to fix the issues with 32GB modules; 3rd try --- rEFIt_UEFI/Platform/smbios.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/rEFIt_UEFI/Platform/smbios.c b/rEFIt_UEFI/Platform/smbios.c index 79daa725c..0d077ff5d 100644 --- a/rEFIt_UEFI/Platform/smbios.c +++ b/rEFIt_UEFI/Platform/smbios.c @@ -1364,8 +1364,10 @@ VOID PatchTableType17() if (gRAM.User[UserIndex].ModuleSize > 0x7FFF) { newSmbiosTable.Type17->Size = 0x7FFF; newSmbiosTable.Type17->ExtendedSize = gRAM.User[UserIndex].ModuleSize; + mTotalSystemMemory += newSmbiosTable.Type17->ExtendedSize; //Mb } else { newSmbiosTable.Type17->Size = (UINT16)gRAM.User[UserIndex].ModuleSize; + mTotalSystemMemory += newSmbiosTable.Type17->Size; //Mb } newSmbiosTable.Type17->MemoryType = gRAM.User[UserIndex].Type; if ((newSmbiosTable.Type17->MemoryType != MemoryTypeDdr2) && @@ -1375,7 +1377,6 @@ VOID PatchTableType17() } DBG("%a %a %dMHz %dMB(Ext:%dMB)\n", bankLocator, deviceLocator, newSmbiosTable.Type17->Speed, newSmbiosTable.Type17->Size, newSmbiosTable.Type17->ExtendedSize); - mTotalSystemMemory += newSmbiosTable.Type17->Size; //Mb mMemory17[gRAMCount] = (UINT16)mTotalSystemMemory; // DBG("mTotalSystemMemory = %d\n", mTotalSystemMemory); } else { @@ -1632,7 +1633,12 @@ VOID PatchTableType17() } else { newSmbiosTable.Type17->Speed = (UINT16)gRAM.SPD[SPDIndex].Frequency; } - newSmbiosTable.Type17->Size = (UINT16)gRAM.SPD[SPDIndex].ModuleSize; + if (gRAM.SPD[SPDIndex].ModuleSize > 0x7FFF) { + newSmbiosTable.Type17->Size = 0x7FFF; + newSmbiosTable.Type17->ExtendedSize = gRAM.SPD[SPDIndex].ModuleSize; + } else { + newSmbiosTable.Type17->Size = (UINT16)gRAM.SPD[SPDIndex].ModuleSize; + } newSmbiosTable.Type17->MemoryType = gRAM.SPD[SPDIndex].Type; } if (trustSMBIOS && gRAM.SMBIOS[SMBIOSIndex].InUse && @@ -1676,8 +1682,13 @@ VOID PatchTableType17() newSmbiosTable.Type17->MemoryType = 0; //MemoryTypeUnknown; } else { insertingEmpty = FALSE; - DBG("%a %a %dMHz %dMB\n", bankLocator, deviceLocator, newSmbiosTable.Type17->Speed, newSmbiosTable.Type17->Size); - mTotalSystemMemory += newSmbiosTable.Type17->Size; //Mb + DBG("%a %a %dMHz %dMB(Ext:%dMB)\n", bankLocator, deviceLocator, newSmbiosTable.Type17->Speed, + newSmbiosTable.Type17->Size, newSmbiosTable.Type17->ExtendedSize); + if (newSmbiosTable.Type17->Size == 0x7FFF) { + mTotalSystemMemory += newSmbiosTable.Type17->ExtendedSize; //Mb + } else { + mTotalSystemMemory += newSmbiosTable.Type17->Size; //Mb + } mMemory17[gRAMCount] = (UINT16)mTotalSystemMemory; // DBG("mTotalSystemMemory = %d\n", mTotalSystemMemory); }