diff options
-rw-r--r-- | IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c index 0a9238c2e7..6958979cdc 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c @@ -720,7 +720,6 @@ UpdateFrontPageStrings ( {
UINT8 StrIndex;
CHAR16 *NewString;
- BOOLEAN Find[5];
EFI_STATUS Status;
EFI_STRING_ID TokenToUpdate;
EFI_SMBIOS_HANDLE SmbiosHandle;
@@ -730,8 +729,9 @@ UpdateFrontPageStrings ( SMBIOS_TABLE_TYPE4 *Type4Record;
SMBIOS_TABLE_TYPE19 *Type19Record;
EFI_SMBIOS_TABLE_HEADER *Record;
-
- ZeroMem (Find, sizeof (Find));
+ UINT64 InstalledMemory;
+
+ InstalledMemory = 0;
//
// Update Front Page strings
@@ -743,12 +743,8 @@ UpdateFrontPageStrings ( );
if (!EFI_ERROR (Status)) {
SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;
- do {
- Status = Smbios->GetNext (Smbios, &SmbiosHandle, NULL, &Record, NULL);
- if (EFI_ERROR(Status)) {
- break;
- }
-
+ Status = Smbios->GetNext (Smbios, &SmbiosHandle, NULL, &Record, NULL);
+ while (!EFI_ERROR(Status)) {
if (Record->Type == EFI_SMBIOS_TYPE_BIOS_INFORMATION) {
Type0Record = (SMBIOS_TABLE_TYPE0 *) Record;
StrIndex = Type0Record->BiosVersion;
@@ -756,7 +752,6 @@ UpdateFrontPageStrings ( TokenToUpdate = STRING_TOKEN (STR_FRONT_PAGE_BIOS_VERSION);
HiiSetString (gFrontPagePrivate.HiiHandle, TokenToUpdate, NewString, NULL);
FreePool (NewString);
- Find[0] = TRUE;
}
if (Record->Type == EFI_SMBIOS_TYPE_SYSTEM_INFORMATION) {
@@ -766,7 +761,6 @@ UpdateFrontPageStrings ( TokenToUpdate = STRING_TOKEN (STR_FRONT_PAGE_COMPUTER_MODEL);
HiiSetString (gFrontPagePrivate.HiiHandle, TokenToUpdate, NewString, NULL);
FreePool (NewString);
- Find[1] = TRUE;
}
if (Record->Type == EFI_SMBIOS_TYPE_PROCESSOR_INFORMATION) {
@@ -776,7 +770,6 @@ UpdateFrontPageStrings ( TokenToUpdate = STRING_TOKEN (STR_FRONT_PAGE_CPU_MODEL);
HiiSetString (gFrontPagePrivate.HiiHandle, TokenToUpdate, NewString, NULL);
FreePool (NewString);
- Find[2] = TRUE;
}
if (Record->Type == EFI_SMBIOS_TYPE_PROCESSOR_INFORMATION) {
@@ -785,22 +778,29 @@ UpdateFrontPageStrings ( TokenToUpdate = STRING_TOKEN (STR_FRONT_PAGE_CPU_SPEED);
HiiSetString (gFrontPagePrivate.HiiHandle, TokenToUpdate, NewString, NULL);
FreePool (NewString);
- Find[3] = TRUE;
}
if ( Record->Type == EFI_SMBIOS_TYPE_MEMORY_ARRAY_MAPPED_ADDRESS ) {
Type19Record = (SMBIOS_TABLE_TYPE19 *) Record;
- ConvertMemorySizeToString (
- (UINT32)(RShiftU64((Type19Record->EndingAddress - Type19Record->StartingAddress + 1), 10)),
- &NewString
- );
- TokenToUpdate = STRING_TOKEN (STR_FRONT_PAGE_MEMORY_SIZE);
- HiiSetString (gFrontPagePrivate.HiiHandle, TokenToUpdate, NewString, NULL);
- FreePool (NewString);
- Find[4] = TRUE;
+ if (Type19Record->StartingAddress != 0xFFFFFFFF ) {
+ InstalledMemory += RShiftU64(Type19Record->EndingAddress -
+ Type19Record->StartingAddress + 1, 10);
+ } else {
+ InstalledMemory += RShiftU64(Type19Record->ExtendedEndingAddress -
+ Type19Record->ExtendedStartingAddress + 1, 20);
+ }
}
- } while ( !(Find[0] && Find[1] && Find[2] && Find[3] && Find[4]));
+
+ Status = Smbios->GetNext (Smbios, &SmbiosHandle, NULL, &Record, NULL);
+ }
+
+ // now update the total installed RAM size
+ ConvertMemorySizeToString ((UINT32)InstalledMemory, &NewString );
+ TokenToUpdate = STRING_TOKEN (STR_FRONT_PAGE_MEMORY_SIZE);
+ HiiSetString (gFrontPagePrivate.HiiHandle, TokenToUpdate, NewString, NULL);
+ FreePool (NewString);
}
+
return ;
}
|