public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 2/2] ShellPkg/SmbiosView: Print BIOS extension size
@ 2022-04-22  6:55 Hsu, Roger
  2022-04-26  0:37 ` Abner Chang
  0 siblings, 1 reply; 2+ messages in thread
From: Hsu, Roger @ 2022-04-22  6:55 UTC (permalink / raw)
  To: devel; +Cc: Ray Ni, Zhichao Gao, Abner Chang

Update for printing BIOS extension size information.

Signed-off-by: Roger Hsu <roger.hsu@hpe.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Cc: Abner Chang <abner.chang@hpe.com>
---
 .../SmbiosView/PrintInfo.c                           | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
index b144600a25..ee0dbc19be 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
@@ -3,7 +3,7 @@
 
   Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>
   (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
-  (C) Copyright 2015-2019 Hewlett Packard Enterprise Development LP<BR>
+  (C) Copyright 2015-2022 Hewlett Packard Enterprise Development LP<BR>
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -338,7 +338,15 @@ SmbiosPrintStructure (
       PRINT_PENDING_STRING (Struct, Type0, BiosVersion);
       PRINT_STRUCT_VALUE_H (Struct, Type0, BiosSegment);
       PRINT_PENDING_STRING (Struct, Type0, BiosReleaseDate);
-      ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIOS_SIZE), gShellDebug1HiiHandle, 64 * (Struct->Type0->BiosSize + 1));
+      if (Struct->Type0->BiosSize == EXCEED_BIOS_ROM_SIZE) {
+        if (Struct->Type0->ExtendedBiosSize.Unit == BIOS_ROM_SIZE_IN_MEGABYTES) {
+          ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIOS_SIZE), gShellDebug1HiiHandle, (BYTES_IN_MEGABYTES * (Struct->Type0->ExtendedBiosSize.Size)) / BYTES_IN_KILOBYTES);
+        } else if (Struct->Type0->ExtendedBiosSize.Unit == BIOS_ROM_SIZE_IN_GIGABYTES) {
+          ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIOS_SIZE), gShellDebug1HiiHandle, (BYTES_IN_GIGABYTES *(Struct->Type0->ExtendedBiosSize.Size)) / BYTES_IN_KILOBYTES);
+        }
+      } else {
+        ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIOS_SIZE), gShellDebug1HiiHandle, 64 * (Struct->Type0->BiosSize + 1));
+      }
 
       DisplayBiosCharacteristics (ReadUnaligned64 ((UINT64 *)(UINTN)&(Struct->Type0->BiosCharacteristics)), Option);
 
-- 
2.28.0.windows.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-04-26  0:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-22  6:55 [PATCH 2/2] ShellPkg/SmbiosView: Print BIOS extension size Hsu, Roger
2022-04-26  0:37 ` Abner Chang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox