public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Mars CC Lin <mars_cc_lin@phoenix.com>
To: <devel@edk2.groups.io>
Cc: "Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Ray Ni" <ray.ni@intel.com>,
	"Zhichao Gao" <zhichao.gao@intel.com>
Subject: [PATCH] * ShellPkg: add the support to show Contained Element Count, Contained Element Record Length and Contained Elements
Date: Thu, 21 Jan 2021 10:44:48 +0800	[thread overview]
Message-ID: <20210121024448.624-1-mars_cc_lin@phoenix.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 2992 bytes --]

Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3177
Signed-off-by: Mars CC Lin <mars_cc_lin@phoenix.com>
---
 .../SmbiosView/PrintInfo.c                       | 16 ++++++++++++++++
 .../SmbiosView/SmbiosViewStrings.uni             |  1 +
 2 files changed, 17 insertions(+)

diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
index a3dc7b68c4..36c743d45b 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
@@ -404,6 +404,22 @@ SmbiosPrintStructure (
       if (Struct->Hdr->Length > 0x12) {
         PRINT_STRUCT_VALUE (Struct, Type3, NumberofPowerCords);
       }
+      if (Struct->Hdr->Length > 0x13) {
+        PRINT_STRUCT_VALUE (Struct, Type3, ContainedElementCount);
+      }
+      if (Struct->Hdr->Length > 0x14) {
+        PRINT_STRUCT_VALUE (Struct, Type3, ContainedElementRecordLength);
+      }
+      for (Index = 0;Index < Struct->Type3->ContainedElementCount;Index++) {
+        UINT8 Index2 = 0;
+
+        ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CONTAINED_ELEMENT), gShellDebug1HiiHandle, Index+1);
+        for (Index2 = 0;Index2<Struct->Type3->ContainedElementRecordLength;Index2++) {
+          Print (L"%02X ", Buffer[0x15 + (Index * Struct->Type3->ContainedElementRecordLength) + Index2]);
+        }
+        Print (L"\n");
+      }
+
     }
     if (AE_SMBIOS_VERSION (0x2, 0x7) && (Struct->Hdr->Length > 0x13)) {
       if (Struct->Hdr->Length > (0x15 + (Struct->Type3->ContainedElementCount * Struct->Type3->ContainedElementRecordLength))) {
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStrings.uni b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStrings.uni
index 8bcba7ccf7..9433e8a25f 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStrings.uni
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStrings.uni
@@ -93,6 +93,7 @@
 #string STR_SMBIOSVIEW_PRINTINFO_POWER_SUPPLY_STATE             #language en-US "Power Supply State "
 #string STR_SMBIOSVIEW_PRINTINFO_THERMAL_STATE                  #language en-US "Thermal state "
 #string STR_SMBIOSVIEW_PRINTINFO_SECURITY_STATUS                #language en-US "Security Status "
+#string STR_SMBIOSVIEW_PRINTINFO_CONTAINED_ELEMENT              #language en-US "Contained Element %d: "
 #string STR_SMBIOSVIEW_PRINTINFO_SUPOPRT                        #language en-US "Support "
 #string STR_SMBIOSVIEW_PRINTINFO_CURRENT                        #language en-US "Current "
 #string STR_SMBIOSVIEW_PRINTINFO_INSTALLED                      #language en-US "Installed "
-- 
2.29.1.windows.1

[-- Attachment #2: Type: text/html, Size: 3660 bytes --]

             reply	other threads:[~2021-01-21  2:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-21  2:44 Mars CC Lin [this message]
2021-02-01  1:07 ` [PATCH] * ShellPkg: add the support to show Contained Element Count, Contained Element Record Length and Contained Elements Gao, Zhichao
2021-02-23  2:26   ` [edk2-devel] " mars_cc_lin
2021-02-23  7:33     ` Gao, Zhichao
2021-02-24  2:13     ` Mars CC Lin

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=20210121024448.624-1-mars_cc_lin@phoenix.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