]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
ShellPkg: update smbiosview for SMBIOS 3.0.
[mirror_edk2.git] / ShellPkg / Library / UefiShellDebug1CommandsLib / SmbiosView / PrintInfo.c
index 3aea96b6e09ac49a6d9962d06ef0db0cf5ce381d..1494c47e3709825f2799dd7cab5e7e14163b16a8 100644 (file)
@@ -1,7 +1,8 @@
 /** @file\r
   Module for clarifying the content of the smbios structure element information.\r
 \r
-  Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved.<BR>\r
+  (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -198,6 +199,75 @@ SmbiosPrintEPSInfo (
   Print (L"\n");\r
 }\r
 \r
+/**\r
+  Print the info of 64-bit EPS(Entry Point Structure).\r
+\r
+  @param[in] SmbiosTable    Pointer to the SMBIOS table entry point.\r
+  @param[in] Option         Display option.\r
+**/\r
+VOID\r
+Smbios64BitPrintEPSInfo (\r
+  IN  SMBIOS_TABLE_3_0_ENTRY_POINT  *SmbiosTable,\r
+  IN  UINT8                         Option\r
+  )\r
+{\r
+  UINT8 Anchor[5];\r
+\r
+  if (SmbiosTable == NULL) {\r
+    ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SMBIOSTABLE_NULL), gShellDebug1HiiHandle);\r
+    return ;\r
+  }\r
+\r
+  if (Option == SHOW_NONE) {\r
+    return ;\r
+  }\r
+\r
+  if (Option >= SHOW_NORMAL) {\r
+    ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_64_BIT_ENTRY_POINT_SIGN), gShellDebug1HiiHandle);\r
+\r
+    MemToString (Anchor, SmbiosTable->AnchorString, 5);\r
+    ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ANCHOR_STR), gShellDebug1HiiHandle, Anchor);\r
+\r
+    ShellPrintHiiEx(-1,-1,NULL,\r
+      STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_EPS_CHECKSUM),\r
+      gShellDebug1HiiHandle,\r
+      SmbiosTable->EntryPointStructureChecksum\r
+     );\r
+\r
+    ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ENTRY_POINT_LEN), gShellDebug1HiiHandle, SmbiosTable->EntryPointLength);\r
+\r
+    ShellPrintHiiEx(-1,-1,NULL,\r
+      STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_VERSION),\r
+      gShellDebug1HiiHandle,\r
+      SmbiosTable->MajorVersion,\r
+      SmbiosTable->MinorVersion\r
+     );\r
+\r
+    ShellPrintHiiEx(-1,-1,NULL,\r
+      STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DOCREV),\r
+      gShellDebug1HiiHandle,\r
+      SmbiosTable->DocRev\r
+     );\r
+\r
+    ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_TABLE_MAX_SIZE), gShellDebug1HiiHandle, SmbiosTable->TableMaximumSize);\r
+\r
+    ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_TABLE_ADDR), gShellDebug1HiiHandle, SmbiosTable->TableAddress);\r
+\r
+  }\r
+  //\r
+  // If SHOW_ALL, also print followings.\r
+  //\r
+  if (Option >= SHOW_DETAIL) {\r
+    ShellPrintHiiEx(-1,-1,NULL,\r
+      STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ENTRY_POINT_REVISION),\r
+      gShellDebug1HiiHandle,\r
+      SmbiosTable->EntryPointRevision\r
+     );\r
+  }\r
+\r
+  Print (L"\n");\r
+}\r
+\r
 /**\r
   This function print the content of the structure pointed by Struct.\r
 \r
@@ -249,7 +319,7 @@ SmbiosPrintStructure (
     PRINT_PENDING_STRING (Struct, Type0, BiosReleaseDate);\r
     ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIOS_SIZE), gShellDebug1HiiHandle, 64 * (Struct->Type0->BiosSize + 1));\r
 \r
-    DisplayBiosCharacteristics (*(UINT64 *) &(Struct->Type0->BiosCharacteristics), Option);\r
+    DisplayBiosCharacteristics (ReadUnaligned64 ((UINT64 *) (UINTN) &(Struct->Type0->BiosCharacteristics)), Option);\r
 \r
     if (Struct->Hdr->Length > 0x12) {\r
       DisplayBiosCharacteristicsExt1 (Struct->Type0->BIOSCharacteristicsExtensionBytes[0], Option);\r
@@ -362,6 +432,11 @@ SmbiosPrintStructure (
       PRINT_STRUCT_VALUE (Struct, Type4, ThreadCount);\r
       DisplayProcessorCharacteristics (Struct->Type4->ProcessorCharacteristics, Option);\r
     }\r
+    if ((SmbiosMajorVersion >= 0x3) && (Struct->Hdr->Length > 0x2A)) {\r
+      PRINT_STRUCT_VALUE (Struct, Type4, CoreCount2);\r
+      PRINT_STRUCT_VALUE (Struct, Type4, EnabledCoreCount2);\r
+      PRINT_STRUCT_VALUE (Struct, Type4, ThreadCount2);\r
+    }\r
     break;\r
 \r
   //\r
@@ -416,7 +491,7 @@ SmbiosPrintStructure (
     PRINT_STRUCT_VALUE_H (Struct, Type7, InstalledSize);\r
     PRINT_STRUCT_VALUE_H (Struct, Type7, SupportedSRAMType);\r
     PRINT_STRUCT_VALUE_H (Struct, Type7, CurrentSRAMType);\r
-    DisplayCacheSRAMType (*(UINT16 *) &(Struct->Type7->CurrentSRAMType), Option);\r
+    DisplayCacheSRAMType (ReadUnaligned16 ((UINT16 *) (UINTN) &(Struct->Type7->CurrentSRAMType)), Option);\r
     PRINT_STRUCT_VALUE_H (Struct, Type7, CacheSpeed);\r
     DisplayCacheErrCorrectingType (Struct->Type7->ErrorCorrectionType, Option);\r
     DisplayCacheSystemCacheType (Struct->Type7->SystemCacheType, Option);\r
@@ -633,7 +708,7 @@ SmbiosPrintStructure (
     PRINT_PENDING_STRING (Struct, Type17, DeviceLocator);\r
     PRINT_PENDING_STRING (Struct, Type17, BankLocator);\r
     DisplayMemoryDeviceType (Struct->Type17->MemoryType, Option);\r
-    DisplayMemoryDeviceTypeDetail (*(UINT16 *) &(Struct->Type17->TypeDetail), Option);\r
+    DisplayMemoryDeviceTypeDetail (ReadUnaligned16 ((UINT16 *) (UINTN) &(Struct->Type17->TypeDetail)), Option);\r
     PRINT_STRUCT_VALUE_H (Struct, Type17, Speed);\r
     PRINT_PENDING_STRING (Struct, Type17, Manufacturer);\r
     PRINT_PENDING_STRING (Struct, Type17, SerialNumber);\r
@@ -1532,6 +1607,10 @@ DisplayProcessorFamily (
     Print (L"AMD Opteron 4200 Series Processor\n");\r
     break;\r
 \r
+  case 0x3F:\r
+    ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_FX_SERIES), gShellDebug1HiiHandle);\r
+    break;\r
+\r
   case 0x40:\r
     ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MIPS_FAMILY), gShellDebug1HiiHandle);\r
     break;\r
@@ -1565,13 +1644,37 @@ DisplayProcessorFamily (
     break;\r
 \r
   case 0x48:\r
-    Print (L"AMD S-Series Processor\n");\r
+    Print (L"AMD A-Series Processor\n");\r
     break;\r
 \r
   case 0x49:\r
     Print (L"AMD G-Series Processor\n");\r
     break;\r
 \r
+  case 0x4A:\r
+    ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_Z_SERIES), gShellDebug1HiiHandle);\r
+    break;\r
+\r
+  case 0x4B:\r
+    ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_R_SERIES), gShellDebug1HiiHandle);\r
+    break;\r
+\r
+  case 0x4C:\r
+    ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_OPTERON_4300_SERIES), gShellDebug1HiiHandle);\r
+    break;\r
+\r
+  case 0x4D:\r
+    ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_OPTERON_6300_SERIES), gShellDebug1HiiHandle);\r
+    break;\r
+\r
+  case 0x4E:\r
+    ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_OPTERON_3300_SERIES), gShellDebug1HiiHandle);\r
+    break;\r
+\r
+  case 0x4F:\r
+    ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_OPTERON_FIREPRO_SERIES), gShellDebug1HiiHandle);\r
+    break;\r
+\r
   case 0x50:\r
     ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SPARC_FAMILY), gShellDebug1HiiHandle);\r
     break;\r
@@ -1909,7 +2012,7 @@ DisplayProcessorFamily (
     break;\r
 \r
   case 0xCC:\r
-    Print (L"zArchitectur\n");\r
+    Print (L"zArchitecture\n");\r
     break;\r
 \r
   case 0xCD:\r
@@ -1972,6 +2075,15 @@ DisplayProcessorFamily (
     Print (L"Multi-Core Intel Xeon processor 3400 Series\n");\r
     break;\r
 \r
+  case 0xE4:\r
+    ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_OPTERON_3000_SERIES), gShellDebug1HiiHandle);\r
+    break;\r
+\r
+  case 0xE5:\r
+    ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_SEMPRON_II), gShellDebug1HiiHandle);\r
+    break;\r
+\r
+\r
   case 0xE6:\r
     ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_EMBEDDED_OPTERON_QUAD_CORE), gShellDebug1HiiHandle);\r
     break;\r