summaryrefslogtreecommitdiffstats
path: root/ShellPkg/Library
diff options
context:
space:
mode:
authorSainadh Nagolu <sainadhn@ami.com>2022-08-17 15:35:23 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2022-08-18 08:41:22 +0000
commit35d167ef3c17dde8f2c2338c7bae1d9290a07da3 (patch)
treeb92bc80772f8e90f0e8cb6dc8202c5a5495112d9 /ShellPkg/Library
parent9102518d297546d349e9dcbaf9a87706ec8529e0 (diff)
downloadedk2-35d167ef3c17dde8f2c2338c7bae1d9290a07da3.tar.gz
edk2-35d167ef3c17dde8f2c2338c7bae1d9290a07da3.tar.bz2
edk2-35d167ef3c17dde8f2c2338c7bae1d9290a07da3.zip
ShellPkg: Improved Smbios Type 9 table changes in PrintInfo.c
Since PeerGroups has a variable number of entries, new fields added after PeerGroups are defined in a extended structure. Done changes in PrintInfo.c to access those fields using SMBIOS_TABLE_TYPE9_EXTENDED structure from SmBios.h. Signed-off-by: Sainadh Nagolu <sainadhn@ami.com> Cc: Vasudevan Sambandan <vasudevans@ami.com> Cc: Sundaresan S <sundaresans@ami.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Diffstat (limited to 'ShellPkg/Library')
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
index 0ab9f5063a..bf5306205b 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
@@ -2,6 +2,7 @@
Module for clarifying the content of the smbios structure element information.
Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 1985 - 2022, American Megatrends International LLC.<BR>
(C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
(C) Copyright 2015-2019 Hewlett Packard Enterprise Development LP<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -597,8 +598,9 @@ SmbiosPrintStructure (
//
case 9:
{
- MISC_SLOT_PEER_GROUP *PeerGroupPtr;
- UINT8 PeerGroupCount;
+ MISC_SLOT_PEER_GROUP *PeerGroupPtr;
+ SMBIOS_TABLE_TYPE9_EXTENDED *Type9ExtendedStruct;
+ UINT8 PeerGroupCount;
PRINT_PENDING_STRING (Struct, Type9, SlotDesignation);
DisplaySystemSlotType (Struct->Type9->SlotType, Option);
@@ -636,9 +638,12 @@ SmbiosPrintStructure (
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DATA_BUS_WIDTH), gShellDebug1HiiHandle, PeerGroupPtr[Index].DataBusWidth);
}
- DisplaySystemSlotHeight (Struct->Type9->SlotHeight, Option);
- DisplaySystemSlotPhysicalWidth (Struct->Type9->SlotPhysicalWidth, Option);
- DisplaySystemSlotInformation (Struct->Type9->SlotInformation, Option);
+ // Since PeerGroups has a variable number of entries, new fields added after PeerGroups are defined in
+ // a extended structure. Those fields can be referenced using SMBIOS_TABLE_TYPE9_EXTENDED structure.
+ Type9ExtendedStruct = (SMBIOS_TABLE_TYPE9_EXTENDED *)((UINT8 *)PeerGroupPtr + (PeerGroupCount * sizeof (MISC_SLOT_PEER_GROUP)));
+ DisplaySystemSlotHeight (Type9ExtendedStruct->SlotHeight, Option);
+ DisplaySystemSlotPhysicalWidth (Type9ExtendedStruct->SlotPhysicalWidth, Option);
+ DisplaySystemSlotInformation (Type9ExtendedStruct->SlotInformation, Option);
}
}