* [PATCH v1 1/1] ShellPkg: smbiosview - Change some type 17 field values format
@ 2020-07-20 19:32 Samer El-Haj-Mahmoud
2020-08-04 1:33 ` Gao, Zhichao
0 siblings, 1 reply; 2+ messages in thread
From: Samer El-Haj-Mahmoud @ 2020-07-20 19:32 UTC (permalink / raw)
To: devel; +Cc: Ray Ni, Zhichao Gao, Sami Mujawar
Change how some SMBIOS TYpe 17 field values are printed:
- TotalWidth, DataWidth, ConfiguredMemoryClockSpeed: Print as
hex values instead of decimal, since there are some special meanings
for certain values (e.g. 0xFFFF)
- VolatileSize, NonVolatileSize, CacheSize, and LogicalSize: Print
as "0x%lx" instead of "0x%x" to prevent truncating output when
printing these QWORD fields.
Cc: Ray Ni <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Cc: Sami Mujawar <Sami.Mujawar@arm.com>
Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@arm.com>
---
ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
index 1ea7b84bd0fa..7517465ddd49 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
@@ -746,8 +746,8 @@ SmbiosPrintStructure (
case 17:
PRINT_STRUCT_VALUE_H (Struct, Type17, MemoryArrayHandle);
PRINT_STRUCT_VALUE_H (Struct, Type17, MemoryErrorInformationHandle);
- PRINT_STRUCT_VALUE (Struct, Type17, TotalWidth);
- PRINT_STRUCT_VALUE (Struct, Type17, DataWidth);
+ PRINT_STRUCT_VALUE_H (Struct, Type17, TotalWidth);
+ PRINT_STRUCT_VALUE_H (Struct, Type17, DataWidth);
PRINT_STRUCT_VALUE (Struct, Type17, Size);
DisplayMemoryDeviceFormFactor (Struct->Type17->FormFactor, Option);
PRINT_STRUCT_VALUE_H (Struct, Type17, DeviceSet);
@@ -765,7 +765,7 @@ SmbiosPrintStructure (
}
if (AE_SMBIOS_VERSION (0x2, 0x7) && (Struct->Hdr->Length > 0x1C)) {
PRINT_STRUCT_VALUE (Struct, Type17, ExtendedSize);
- PRINT_STRUCT_VALUE (Struct, Type17, ConfiguredMemoryClockSpeed);
+ PRINT_STRUCT_VALUE_H (Struct, Type17, ConfiguredMemoryClockSpeed);
}
if (AE_SMBIOS_VERSION (0x2, 0x8) && (Struct->Hdr->Length > 0x22)) {
PRINT_STRUCT_VALUE (Struct, Type17, MinimumVoltage);
@@ -783,16 +783,16 @@ SmbiosPrintStructure (
PRINT_STRUCT_VALUE_H (Struct, Type17, MemorySubsystemControllerProductID);
}
if (Struct->Hdr->Length > 0x34) {
- PRINT_STRUCT_VALUE_H (Struct, Type17, NonVolatileSize);
+ PRINT_STRUCT_VALUE_LH (Struct, Type17, NonVolatileSize);
}
if (Struct->Hdr->Length > 0x3C) {
- PRINT_STRUCT_VALUE_H (Struct, Type17, VolatileSize);
+ PRINT_STRUCT_VALUE_LH (Struct, Type17, VolatileSize);
}
if (Struct->Hdr->Length > 0x44) {
- PRINT_STRUCT_VALUE_H (Struct, Type17, CacheSize);
+ PRINT_STRUCT_VALUE_LH (Struct, Type17, CacheSize);
}
if (Struct->Hdr->Length > 0x4C) {
- PRINT_STRUCT_VALUE_H (Struct, Type17, LogicalSize);
+ PRINT_STRUCT_VALUE_LH (Struct, Type17, LogicalSize);
}
}
break;
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v1 1/1] ShellPkg: smbiosview - Change some type 17 field values format
2020-07-20 19:32 [PATCH v1 1/1] ShellPkg: smbiosview - Change some type 17 field values format Samer El-Haj-Mahmoud
@ 2020-08-04 1:33 ` Gao, Zhichao
0 siblings, 0 replies; 2+ messages in thread
From: Gao, Zhichao @ 2020-08-04 1:33 UTC (permalink / raw)
To: Samer El-Haj-Mahmoud, devel@edk2.groups.io; +Cc: Ni, Ray, Sami Mujawar
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
Thanks,
Zhichao
> -----Original Message-----
> From: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
> Sent: Tuesday, July 21, 2020 3:33 AM
> To: devel@edk2.groups.io
> Cc: Ni, Ray <ray.ni@intel.com>; Gao, Zhichao <zhichao.gao@intel.com>; Sami
> Mujawar <Sami.Mujawar@arm.com>
> Subject: [PATCH v1 1/1] ShellPkg: smbiosview - Change some type 17 field values
> format
>
> Change how some SMBIOS TYpe 17 field values are printed:
>
> - TotalWidth, DataWidth, ConfiguredMemoryClockSpeed: Print as
> hex values instead of decimal, since there are some special meanings
> for certain values (e.g. 0xFFFF)
> - VolatileSize, NonVolatileSize, CacheSize, and LogicalSize: Print
> as "0x%lx" instead of "0x%x" to prevent truncating output when
> printing these QWORD fields.
>
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Zhichao Gao <zhichao.gao@intel.com>
> Cc: Sami Mujawar <Sami.Mujawar@arm.com>
> Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@arm.com>
> ---
> ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c | 14
> +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
> index 1ea7b84bd0fa..7517465ddd49 100644
> --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
> +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
> @@ -746,8 +746,8 @@ SmbiosPrintStructure (
> case 17:
> PRINT_STRUCT_VALUE_H (Struct, Type17, MemoryArrayHandle);
> PRINT_STRUCT_VALUE_H (Struct, Type17, MemoryErrorInformationHandle);
> - PRINT_STRUCT_VALUE (Struct, Type17, TotalWidth);
> - PRINT_STRUCT_VALUE (Struct, Type17, DataWidth);
> + PRINT_STRUCT_VALUE_H (Struct, Type17, TotalWidth);
> + PRINT_STRUCT_VALUE_H (Struct, Type17, DataWidth);
> PRINT_STRUCT_VALUE (Struct, Type17, Size);
> DisplayMemoryDeviceFormFactor (Struct->Type17->FormFactor, Option);
> PRINT_STRUCT_VALUE_H (Struct, Type17, DeviceSet); @@ -765,7 +765,7
> @@ SmbiosPrintStructure (
> }
> if (AE_SMBIOS_VERSION (0x2, 0x7) && (Struct->Hdr->Length > 0x1C)) {
> PRINT_STRUCT_VALUE (Struct, Type17, ExtendedSize);
> - PRINT_STRUCT_VALUE (Struct, Type17, ConfiguredMemoryClockSpeed);
> + PRINT_STRUCT_VALUE_H (Struct, Type17,
> + ConfiguredMemoryClockSpeed);
> }
> if (AE_SMBIOS_VERSION (0x2, 0x8) && (Struct->Hdr->Length > 0x22)) {
> PRINT_STRUCT_VALUE (Struct, Type17, MinimumVoltage); @@ -783,16
> +783,16 @@ SmbiosPrintStructure (
> PRINT_STRUCT_VALUE_H (Struct, Type17,
> MemorySubsystemControllerProductID);
> }
> if (Struct->Hdr->Length > 0x34) {
> - PRINT_STRUCT_VALUE_H (Struct, Type17, NonVolatileSize);
> + PRINT_STRUCT_VALUE_LH (Struct, Type17, NonVolatileSize);
> }
> if (Struct->Hdr->Length > 0x3C) {
> - PRINT_STRUCT_VALUE_H (Struct, Type17, VolatileSize);
> + PRINT_STRUCT_VALUE_LH (Struct, Type17, VolatileSize);
> }
> if (Struct->Hdr->Length > 0x44) {
> - PRINT_STRUCT_VALUE_H (Struct, Type17, CacheSize);
> + PRINT_STRUCT_VALUE_LH (Struct, Type17, CacheSize);
> }
> if (Struct->Hdr->Length > 0x4C) {
> - PRINT_STRUCT_VALUE_H (Struct, Type17, LogicalSize);
> + PRINT_STRUCT_VALUE_LH (Struct, Type17, LogicalSize);
> }
> }
> break;
> --
> 2.17.1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-08-04 1:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-20 19:32 [PATCH v1 1/1] ShellPkg: smbiosview - Change some type 17 field values format Samer El-Haj-Mahmoud
2020-08-04 1:33 ` Gao, Zhichao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox