]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
ShellPkg: Update header file including style
[mirror_edk2.git] / ShellPkg / Library / UefiShellDebug1CommandsLib / SmbiosView / PrintInfo.c
index 000bbe53a71d2710ae448e34b4cd6f9e53b11f4b..7a75554d7952464aee784a5a038bc289f21d512a 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Module for clarifying the content of the smbios structure element information.\r
 \r
-  Copyright (c) 2005 - 2016, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.<BR>\r
   (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>  \r
   (C) Copyright 2015-2017 Hewlett Packard Enterprise Development LP<BR>\r
   This program and the accompanying materials\r
@@ -14,7 +14,7 @@
 \r
 **/\r
 \r
-#include "../UefiShellDebug1CommandsLib.h"\r
+#include "UefiShellDebug1CommandsLib.h"\r
 #include "PrintInfo.h"\r
 #include "LibSmbiosView.h"\r
 #include "QueryTable.h"\r
@@ -316,7 +316,7 @@ SmbiosPrintStructure (
   case 0:\r
     PRINT_PENDING_STRING (Struct, Type0, Vendor);\r
     PRINT_PENDING_STRING (Struct, Type0, BiosVersion);\r
-    PRINT_STRUCT_VALUE (Struct, Type0, BiosSegment);\r
+    PRINT_STRUCT_VALUE_H (Struct, Type0, BiosSegment);\r
     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
@@ -335,7 +335,17 @@ SmbiosPrintStructure (
       PRINT_STRUCT_VALUE (Struct, Type0, EmbeddedControllerFirmwareMajorRelease);\r
       PRINT_STRUCT_VALUE (Struct, Type0, EmbeddedControllerFirmwareMinorRelease);\r
     }\r
-\r
+    if (AE_SMBIOS_VERSION (0x3, 0x1) && (Struct->Hdr->Length > 0x18)) {\r
+      ShellPrintHiiEx (\r
+        -1,\r
+        -1,\r
+        NULL,\r
+        STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_EXTENDED_BIOS_SIZE),\r
+        gShellDebug1HiiHandle,\r
+        Struct->Type0->ExtendedBiosSize.Size,\r
+        (Struct->Type0->ExtendedBiosSize.Unit == 0x0) ? L"MB": L"GB"\r
+        );\r
+    }\r
     break;\r
 \r
   //\r
@@ -510,6 +520,10 @@ SmbiosPrintStructure (
     DisplayCacheErrCorrectingType (Struct->Type7->ErrorCorrectionType, Option);\r
     DisplayCacheSystemCacheType (Struct->Type7->SystemCacheType, Option);\r
     DisplayCacheAssociativity (Struct->Type7->Associativity, Option);\r
+    if (AE_SMBIOS_VERSION (0x3, 0x1) && (Struct->Hdr->Length > 0x13)) {\r
+      PRINT_STRUCT_VALUE_H (Struct, Type7, MaximumCacheSize2);\r
+      PRINT_STRUCT_VALUE_H (Struct, Type7, InstalledSize2);\r
+    }\r
     break;\r
 \r
   //\r
@@ -556,7 +570,8 @@ SmbiosPrintStructure (
       UINTN NumOfDevice;\r
       NumOfDevice = (Struct->Type10->Hdr.Length - sizeof (SMBIOS_STRUCTURE)) / (2 * sizeof (UINT8));\r
       for (Index = 0; Index < NumOfDevice; Index++) {\r
-        DisplayOnboardDeviceTypes (Struct->Type10->Device[Index].DeviceType, Option);\r
+        ShellPrintEx(-1,-1,(((Struct->Type10->Device[Index].DeviceType) & 0x80) != 0) ? L"Device Enabled\n": L"Device Disabled\n");\r
+        DisplayOnboardDeviceTypes ((Struct->Type10->Device[Index].DeviceType) & 0x7F, Option);\r
         ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DESC_STRING), gShellDebug1HiiHandle);\r
         ShellPrintEx(-1,-1,L"%a\n",LibGetSmbiosString (Struct, Struct->Type10->Device[Index].DescriptionString));\r
       }\r
@@ -1092,7 +1107,21 @@ SmbiosPrintStructure (
   // Management Controller Host Interface (Type 42)\r
   //\r
   case 42:\r
-    PRINT_STRUCT_VALUE_H (Struct, Type42, InterfaceType);\r
+    DisplayMCHostInterfaceType (Struct->Type42->InterfaceType, Option);\r
+    break;\r
+\r
+  //\r
+  // TPM Device (Type 43)\r
+  //\r
+  case 43:\r
+    PRINT_BIT_FIELD (Struct, Type43, VendorID, 4);\r
+    PRINT_STRUCT_VALUE_H (Struct, Type43, MajorSpecVersion);\r
+    PRINT_STRUCT_VALUE_H (Struct, Type43, MinorSpecVersion);\r
+    PRINT_STRUCT_VALUE_H (Struct, Type43, FirmwareVersion1);\r
+    PRINT_STRUCT_VALUE_H (Struct, Type43, FirmwareVersion2);\r
+    PRINT_PENDING_STRING (Struct, Type43, Description);\r
+    DisplayTpmDeviceCharacteristics (ReadUnaligned64 ((UINT64 *) (UINTN) &(Struct->Type43->Characteristics)), Option);\r
+    PRINT_STRUCT_VALUE_H (Struct, Type43, OemDefined);\r
     break;\r
 \r
   //\r
@@ -1566,6 +1595,22 @@ DisplayProcessorFamily (
     ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_ATOM), gShellDebug1HiiHandle);\r
     break;\r
 \r
+  case 0x2C:\r
+    Print (L"Intel(R) Core(TM) M processor\n");\r
+    break;\r
+\r
+  case 0x2D:\r
+    Print (L"Intel(R) Core(TM) m3 processor\n");\r
+    break;\r
+\r
+  case 0x2E:\r
+    Print (L"Intel(R) Core(TM) m5 processor\n");\r
+    break;\r
+\r
+  case 0x2F:\r
+    Print (L"Intel(R) Core(TM) m7 processor\n");\r
+    break;\r
+\r
   case 0x30:\r
     ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ALPHA_FAMILY_2), gShellDebug1HiiHandle);\r
     break;\r
@@ -1754,6 +1799,30 @@ DisplayProcessorFamily (
     Print (L"68030\n");\r
     break;\r
 \r
+  case 0x66:\r
+    Print (L"AMD Athlon(TM) X4 Quad-Core Processor Family\n");\r
+    break;\r
+\r
+  case 0x67:\r
+    Print (L"AMD Opteron(TM) X1000 Series Processor\n");\r
+    break;\r
+\r
+  case 0x68:\r
+    Print (L"AMD Opteron(TM) X2000 Series APU\n");\r
+    break;\r
+\r
+  case 0x69:\r
+    Print (L"AMD Opteron(TM) A-Series Processor\n");\r
+    break;\r
+\r
+  case 0x6A:\r
+    Print (L"AMD Opteron(TM) X3000 Series APU\n");\r
+    break;\r
+\r
+  case 0x6B:\r
+    Print (L"AMD Zen Processor Family\n");\r
+    break;\r
+\r
   case 0x70:\r
     ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_HOBBIT_FAMILY), gShellDebug1HiiHandle);\r
     break;\r
@@ -2185,6 +2254,14 @@ DisplayProcessorFamily2 (
   // Use switch to check\r
   //\r
   switch (Family2) {\r
+    case 0x100:\r
+      Print (L"ARMv7\n");\r
+      break;\r
+\r
+    case 0x101:\r
+      Print (L"ARMv8\n");\r
+      break;\r
+\r
     case 0x104:\r
       Print (L"SH-3\n");\r
       break;\r
@@ -3238,3 +3315,59 @@ DisplaySPSCharacteristics (
     ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_POWER_SUPPLY_NOT_REPLACE), gShellDebug1HiiHandle);\r
   }\r
 }\r
+\r
+/**\r
+  Display TPM Device (Type 43) Characteristics.\r
+\r
+  @param[in] Chara    The information bits.\r
+  @param[in] Option   The optional information.\r
+**/\r
+VOID\r
+DisplayTpmDeviceCharacteristics (\r
+  IN UINT64  Chara,\r
+  IN UINT8   Option\r
+  )\r
+{\r
+  //\r
+  // Print header\r
+  //\r
+  ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_TPM_DEVICE_CHAR), gShellDebug1HiiHandle);\r
+  //\r
+  // print option\r
+  //\r
+  PRINT_INFO_OPTION (Chara, Option);\r
+\r
+  //\r
+  // Check all the bits and print information\r
+  // This function does not use Table because table of bits\r
+  //   are designed not to deal with UINT64\r
+  //\r
+  if (BIT (Chara, 0) != 0) {\r
+    ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_RESERVED_BIT), gShellDebug1HiiHandle);\r
+  }\r
+\r
+  if (BIT (Chara, 1) != 0) {\r
+    ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_RESERVED_BIT), gShellDebug1HiiHandle);\r
+  }\r
+  if (BIT (Chara, 2) != 0) {\r
+    ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_TPM_DEVICE_CHAR_NOT_SUPPORTED), gShellDebug1HiiHandle);\r
+  }\r
+\r
+  if (BIT (Chara, 3) != 0) {\r
+    ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_TPM_DEVICE_CONFIG_FWU), gShellDebug1HiiHandle);\r
+  }\r
+\r
+  if (BIT (Chara, 4) != 0) {\r
+    ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_TPM_DEVICE_CONFIG_PLAT_SW), gShellDebug1HiiHandle);\r
+  }\r
+\r
+  if (BIT (Chara, 5) != 0) {\r
+    ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_TPM_DEVICE_CONFIG_OEM), gShellDebug1HiiHandle);\r
+  }\r
+\r
+  //\r
+  // Just print the Reserved\r
+  //\r
+  ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BITS_06_63), gShellDebug1HiiHandle);\r
+\r
+}\r