From: "Hsu, Roger" <roger.hsu@hpe.com>
To: devel@edk2.groups.io
Cc: Ray Ni <ray.ni@intel.com>, Zhichao Gao <zhichao.gao@intel.com>,
Abner Chang <abner.chang@hpe.com>
Subject: [PATCH 2/2] ShellPkg/SmbiosView: Print BIOS extension size
Date: Fri, 22 Apr 2022 14:55:53 +0800 [thread overview]
Message-ID: <20220422065553.73-1-roger.hsu@hpe.com> (raw)
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
next reply other threads:[~2022-04-22 7:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-22 6:55 Hsu, Roger [this message]
2022-04-26 0:37 ` [PATCH 2/2] ShellPkg/SmbiosView: Print BIOS extension size Abner Chang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220422065553.73-1-roger.hsu@hpe.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox