* [PATCH] ShellPkg:Improved Smbios Type 9 table changes in PrintInfo.c
@ 2022-08-09 10:51 Sainadh Nagolu
2022-08-11 11:44 ` [edk2-devel] " Sainadh Nagolu
0 siblings, 1 reply; 3+ messages in thread
From: Sainadh Nagolu @ 2022-08-09 10:51 UTC (permalink / raw)
To: devel@edk2.groups.io, Sainadh Nagolu
Cc: Sundaresan S, Vasudevan Sambandan, gaoliming@byosoft.com.cn
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>
---
.../SmbiosView/PrintInfo.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
index a0ee286c9a..e1acb1e288 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);
}
}
--
2.36.0.windows.1
-The information contained in this message may be confidential and proprietary to American Megatrends (AMI). This communication is intended to be read only by the individual or entity to whom it is addressed or by their designee. If the reader of this message is not the intended recipient, you are on notice that any distribution of this message, in any form, is strictly prohibited. Please promptly notify the sender by reply e-mail or by telephone at 770-246-8600, and then delete or destroy all copies of the transmission.
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [edk2-devel] [PATCH] ShellPkg:Improved Smbios Type 9 table changes in PrintInfo.c
2022-08-09 10:51 [PATCH] ShellPkg:Improved Smbios Type 9 table changes in PrintInfo.c Sainadh Nagolu
@ 2022-08-11 11:44 ` Sainadh Nagolu
2022-08-12 4:47 ` 回复: " gaoliming
0 siblings, 1 reply; 3+ messages in thread
From: Sainadh Nagolu @ 2022-08-11 11:44 UTC (permalink / raw)
To: Sainadh Nagolu, devel
[-- Attachment #1: Type: text/plain, Size: 71 bytes --]
Please help to review the patch and include in edk2-stable202208 tag.
[-- Attachment #2: Type: text/html, Size: 453 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* 回复: [edk2-devel] [PATCH] ShellPkg:Improved Smbios Type 9 table changes in PrintInfo.c
2022-08-11 11:44 ` [edk2-devel] " Sainadh Nagolu
@ 2022-08-12 4:47 ` gaoliming
0 siblings, 0 replies; 3+ messages in thread
From: gaoliming @ 2022-08-12 4:47 UTC (permalink / raw)
To: devel, sainadhn
[-- Attachment #1: Type: text/plain, Size: 438 bytes --]
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Sainadh Nagolu via groups.io
发送时间: 2022年8月11日 19:44
收件人: Sainadh Nagolu <sainadhn@ami.com>; devel@edk2.groups.io
主题: Re: [edk2-devel] [PATCH] ShellPkg:Improved Smbios Type 9 table changes in PrintInfo.c
Please help to review the patch and include in edk2-stable202208 tag.
[-- Attachment #2: Type: text/html, Size: 3695 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-08-12 4:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-09 10:51 [PATCH] ShellPkg:Improved Smbios Type 9 table changes in PrintInfo.c Sainadh Nagolu
2022-08-11 11:44 ` [edk2-devel] " Sainadh Nagolu
2022-08-12 4:47 ` 回复: " gaoliming
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox