From 4641e70095e19616fe318d6753baf3dc11dbf569 Mon Sep 17 00:00:00 2001 From: andrewfish Date: Tue, 31 Jan 2012 00:18:25 +0000 Subject: [PATCH] Fix type 19 print to match SBMIOS 2.7. Note: Some one should port smbiosview to use the edk2 MdePkg/Include/IndustryStandard/SmBios.h and not carry it's own definitions, that are now out of date. signed-off-by:andrewfish git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12971 6f19259b-4bc3-4df7-8a09-765794883524 --- .../UefiShellDebug1CommandsLib/SmbiosView/LibSmbios.h | 5 +++++ .../UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbios.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbios.h index 5e146cde52..4960587254 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbios.h +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbios.h @@ -321,6 +321,11 @@ typedef struct { UINT32 EndingAddress; UINT16 MemoryArrayHandle; UINT8 PartitionWidth; + // + // Add for smbios 2.7 + // + UINT64 ExtendedStartingAddress; + UINT64 ExtendedEndingAddress; } SMBIOS_TYPE19; typedef struct { diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c index 7c081bdf8a..feaf91065f 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c @@ -58,6 +58,12 @@ ShellPrintEx(-1,-1,L": 0x%x\n", (pStruct->type->element)); \ } while (0); +#define PRINT_STRUCT_VALUE_LH(pStruct, type, element) \ + do { \ + ShellPrintEx(-1,-1,L"%a",#element); \ + ShellPrintEx(-1,-1,L": 0x%lx\n", (pStruct->type->element)); \ + } while (0); + #define PRINT_BIT_FIELD(pStruct, type, element, size) \ do { \ ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DUMP), gShellDebug1HiiHandle); \ @@ -630,6 +636,11 @@ SmbiosPrintStructure ( PRINT_STRUCT_VALUE_H (Struct, Type19, EndingAddress); PRINT_STRUCT_VALUE_H (Struct, Type19, MemoryArrayHandle); PRINT_STRUCT_VALUE_H (Struct, Type19, PartitionWidth); + if (Struct->Hdr->Length >= 0x19) { + // SMBIOS 2.7+ + PRINT_STRUCT_VALUE_LH (Struct, Type19, ExtendedStartingAddress); + PRINT_STRUCT_VALUE_LH (Struct, Type19, ExtendedEndingAddress); + } break; // -- 2.39.2