Merge pull request #42 from Florin9doi/p7

Use ExtendedSize when injecting memory modules from config
This commit is contained in:
Sergey 2019-11-26 16:57:36 +03:00 committed by GitHub
commit 67ad8a4e22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1361,14 +1361,20 @@ VOID PatchTableType17()
UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->PartNumber, "unknown");
}
newSmbiosTable.Type17->Speed = (UINT16)gRAM.User[UserIndex].Frequency;
newSmbiosTable.Type17->Size = (UINT16)gRAM.User[UserIndex].ModuleSize;
if (gRAM.User[UserIndex].ModuleSize > 0x7FFF) {
newSmbiosTable.Type17->Size = 0x7FFF;
newSmbiosTable.Type17->ExtendedSize = gRAM.User[UserIndex].ModuleSize;
} else {
newSmbiosTable.Type17->Size = (UINT16)gRAM.User[UserIndex].ModuleSize;
}
newSmbiosTable.Type17->MemoryType = gRAM.User[UserIndex].Type;
if ((newSmbiosTable.Type17->MemoryType != MemoryTypeDdr2) &&
(newSmbiosTable.Type17->MemoryType != MemoryTypeDdr4) &&
(newSmbiosTable.Type17->MemoryType != MemoryTypeDdr)) {
newSmbiosTable.Type17->MemoryType = MemoryTypeDdr3;
}
DBG("%a %a %dMHz %dMB\n", bankLocator, deviceLocator, newSmbiosTable.Type17->Speed, newSmbiosTable.Type17->Size);
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);