TianoCore EDK2 master
Loading...
Searching...
No Matches
PrintInfo.c File Reference
#include "UefiShellDebug1CommandsLib.h"
#include "PrintInfo.h"
#include "LibSmbiosView.h"
#include "QueryTable.h"
#include "EventLogInfo.h"

Go to the source code of this file.

Macros

#define BIT(value, bit)   ((value) & ((UINT64) 1) << (bit))
 
#define AE_SMBIOS_VERSION(MajorVersion, MinorVersion)    (SmbiosMajorVersion > (MajorVersion) || (SmbiosMajorVersion == (MajorVersion) && SmbiosMinorVersion >= (MinorVersion)))
 
#define PRINT_PENDING_STRING(pStruct, type, element)
 
#define PRINT_SMBIOS_STRING(pStruct, stringnumber, element)
 
#define PRINT_STRUCT_VALUE(pStruct, type, element)
 
#define PRINT_STRUCT_VALUE_H(pStruct, type, element)
 
#define PRINT_STRUCT_VALUE_LH(pStruct, type, element)
 
#define PRINT_BIT_FIELD(pStruct, type, element, size)
 
#define PRINT_SMBIOS_BIT_FIELD(pStruct, startaddress, element, size)
 

Functions

VOID MemToString (IN OUT VOID *Dest, IN VOID *Src, IN UINTN Length)
 
VOID SmbiosPrintEPSInfo (IN SMBIOS_TABLE_ENTRY_POINT *SmbiosTable, IN UINT8 Option)
 
VOID Smbios64BitPrintEPSInfo (IN SMBIOS_TABLE_3_0_ENTRY_POINT *SmbiosTable, IN UINT8 Option)
 
EFI_STATUS SmbiosPrintStructure (IN SMBIOS_STRUCTURE_POINTER *Struct, IN UINT8 Option)
 
VOID DisplayBiosCharacteristics (IN UINT64 Chara, IN UINT8 Option)
 
VOID DisplayBiosCharacteristicsExt1 (IN UINT8 Byte1, IN UINT8 Option)
 
VOID DisplayBiosCharacteristicsExt2 (IN UINT8 byte2, IN UINT8 Option)
 
VOID DisplayProcessorFamily (UINT8 Family, UINT8 Option)
 
VOID DisplayProcessorFamily2 (IN UINT16 Family2, IN UINT8 Option)
 
VOID DisplayProcessorVoltage (IN UINT8 Voltage, IN UINT8 Option)
 
VOID DisplayProcessorStatus (IN UINT8 Status, IN UINT8 Option)
 
VOID DisplayMaxMemoryModuleSize (IN UINT8 Size, IN UINT8 SlotNum, IN UINT8 Option)
 
VOID DisplayMemoryModuleConfigHandles (IN UINT16 *Handles, IN UINT8 SlotNum, IN UINT8 Option)
 
VOID DisplayMmBankConnections (IN UINT8 BankConnections, IN UINT8 Option)
 
VOID DisplayMmMemorySize (IN UINT8 Size, IN UINT8 Option)
 
VOID DisplayCacheConfiguration (IN UINT16 CacheConfiguration, IN UINT8 Option)
 
VOID DisplaySystemSlotId (IN UINT16 SlotId, IN UINT8 SlotType, IN UINT8 Option)
 
VOID DisplaySystemBootStatus (IN UINT8 Parameter, IN UINT8 Option)
 
VOID DisplaySBDSManufactureDate (IN UINT16 Date, IN UINT8 Option)
 
VOID DisplaySystemResetCapabilities (IN UINT8 Reset, IN UINT8 Option)
 
VOID DisplayHardwareSecuritySettings (IN UINT8 Settings, IN UINT8 Option)
 
VOID DisplayOBRAConnections (IN UINT8 Connections, IN UINT8 Option)
 
VOID DisplaySPSCharacteristics (IN UINT16 Characteristics, IN UINT8 Option)
 
VOID DisplayTpmDeviceCharacteristics (IN UINT64 Chara, IN UINT8 Option)
 

Detailed Description

Module for clarifying the content of the smbios structure element information.

Copyright (c) 2005 - 2024, Intel Corporation. All rights reserved.
Copyright (c) 1985 - 2022, American Megatrends International LLC.
(C) Copyright 2014 Hewlett-Packard Development Company, L.P.
(C) Copyright 2015-2019 Hewlett Packard Enterprise Development LP
Copyright (c) 2023 Apple Inc. All rights reserved.
Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file PrintInfo.c.

Macro Definition Documentation

◆ AE_SMBIOS_VERSION

#define AE_SMBIOS_VERSION (   MajorVersion,
  MinorVersion 
)     (SmbiosMajorVersion > (MajorVersion) || (SmbiosMajorVersion == (MajorVersion) && SmbiosMinorVersion >= (MinorVersion)))

Definition at line 28 of file PrintInfo.c.

◆ BIT

#define BIT (   value,
  bit 
)    ((value) & ((UINT64) 1) << (bit))

Definition at line 23 of file PrintInfo.c.

◆ PRINT_BIT_FIELD

#define PRINT_BIT_FIELD (   pStruct,
  type,
  element,
  size 
)
Value:
do { \
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DUMP), gShellDebug1HiiHandle); \
ShellPrintEx(-1,-1,L"%a",#element); \
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SIZE), gShellDebug1HiiHandle, size); \
DumpHex (0, 0, size, &(pStruct->type->element)); \
} while (0);
#define NULL
Definition: Base.h:319
#define STRING_TOKEN(t)

Definition at line 69 of file PrintInfo.c.

◆ PRINT_PENDING_STRING

#define PRINT_PENDING_STRING (   pStruct,
  type,
  element 
)
Value:
do { \
CHAR8 *StringBuf; \
StringBuf = LibGetSmbiosString ((pStruct), (pStruct->type->element)); \
ShellPrintEx(-1,-1,L"%a",#element); \
ShellPrintEx(-1,-1,L": %a\n", (StringBuf != NULL) ? StringBuf: ""); \
} while (0);
CHAR8 * LibGetSmbiosString(IN SMBIOS_STRUCTURE_POINTER *Smbios, IN UINT16 StringNumber)

Definition at line 35 of file PrintInfo.c.

◆ PRINT_SMBIOS_BIT_FIELD

#define PRINT_SMBIOS_BIT_FIELD (   pStruct,
  startaddress,
  element,
  size 
)
Value:
do { \
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DUMP), gShellDebug1HiiHandle); \
ShellPrintEx(-1,-1,L"%a",#element); \
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SIZE), gShellDebug1HiiHandle, size); \
DumpHex (0, 0, size, startaddress); \
} while (0);

Definition at line 77 of file PrintInfo.c.

◆ PRINT_SMBIOS_STRING

#define PRINT_SMBIOS_STRING (   pStruct,
  stringnumber,
  element 
)
Value:
do { \
CHAR8 *StringBuf; \
StringBuf = LibGetSmbiosString ((pStruct), (stringnumber)); \
ShellPrintEx(-1,-1,L"%a",#element); \
ShellPrintEx(-1,-1,L": %a\n", (StringBuf != NULL) ? StringBuf: ""); \
} while (0);

Definition at line 43 of file PrintInfo.c.

◆ PRINT_STRUCT_VALUE

#define PRINT_STRUCT_VALUE (   pStruct,
  type,
  element 
)
Value:
do { \
ShellPrintEx(-1,-1,L"%a",#element); \
ShellPrintEx(-1,-1,L": %u\n", (pStruct->type->element)); \
} while (0);

Definition at line 51 of file PrintInfo.c.

◆ PRINT_STRUCT_VALUE_H

#define PRINT_STRUCT_VALUE_H (   pStruct,
  type,
  element 
)
Value:
do { \
ShellPrintEx(-1,-1,L"%a",#element); \
ShellPrintEx(-1,-1,L": 0x%x\n", (pStruct->type->element)); \
} while (0);

Definition at line 57 of file PrintInfo.c.

◆ PRINT_STRUCT_VALUE_LH

#define PRINT_STRUCT_VALUE_LH (   pStruct,
  type,
  element 
)
Value:
do { \
ShellPrintEx(-1,-1,L"%a",#element); \
ShellPrintEx(-1,-1,L": 0x%lx\n", (pStruct->type->element)); \
} while (0);

Definition at line 63 of file PrintInfo.c.

Function Documentation

◆ DisplayBiosCharacteristics()

VOID DisplayBiosCharacteristics ( IN UINT64  Chara,
IN UINT8  Option 
)

Display BIOS Information (Type 0) information.

Parameters
[in]CharaThe information bits.
[in]OptionThe optional information.

Definition at line 1456 of file PrintInfo.c.

◆ DisplayBiosCharacteristicsExt1()

VOID DisplayBiosCharacteristicsExt1 ( IN UINT8  Byte1,
IN UINT8  Option 
)

Display Bios Characteristice extensions1 information.

Parameters
[in]Byte1The information.
[in]OptionThe optional information.

Definition at line 1617 of file PrintInfo.c.

◆ DisplayBiosCharacteristicsExt2()

VOID DisplayBiosCharacteristicsExt2 ( IN UINT8  byte2,
IN UINT8  Option 
)

Display Bios Characteristice extensions2 information.

Parameters
[in]byte2The information.
[in]OptionThe optional information.

Definition at line 1671 of file PrintInfo.c.

◆ DisplayCacheConfiguration()

VOID DisplayCacheConfiguration ( IN UINT16  CacheConfiguration,
IN UINT8  Option 
)

Display Cache Configuration.

Parameters
[in]CacheConfigurationCache Configuration. Bits 15:10 Reserved, must be 0 Bits 9:8 Operational Mode 0h - Write Through 1h - Write Back 2h - Varies with Memory Address 3h - Unknown Bit 7 Enabled/Disabled 1 - Enabled 0 - Disabled Bits 6:5 Location 0h - Internal 1h - External 2h - Reserved 3h - Unknown Bit 4 Reserved, must be zero Bit 3 Cache Socketed 1 - Socketed 0 - Unsocketed Bits 2:0 Cache Level 1 through 8 (For example, an L1 cache would use value 000b and an L3 cache would use 010b.)
[in]OptionThe option

Definition at line 3069 of file PrintInfo.c.

◆ DisplayHardwareSecuritySettings()

VOID DisplayHardwareSecuritySettings ( IN UINT8  Settings,
IN UINT8  Option 
)

Display Hardware Security (Type 24) information.

Identifies the password and reset status for the system:

Bits 7:6 Power-on Password Status, one of: 00b Disabled 01b Enabled 10b Not Implemented 11b Unknown Bits 5:4 Keyboard Password Status, one of: 00b Disabled 01b Enabled 10b Not Implemented 11b Unknown Bits 3:2 Administrator Password Status, one of: 00b Disabled 01b Enabled 10b Not Implemented 11b Unknown Bits 1:0 Front Panel Reset Status, one of: 00b Disabled 01b Enabled 10b Not Implemented 11b Unknown

Parameters
[in]SettingsThe device settings.
[in]OptionThe device options.

Definition at line 3457 of file PrintInfo.c.

◆ DisplayMaxMemoryModuleSize()

VOID DisplayMaxMemoryModuleSize ( IN UINT8  Size,
IN UINT8  SlotNum,
IN UINT8  Option 
)

Display information about Memory Controller Information (Type 5).

Parameters
[in]SizeMemory size.
[in]SlotNumWhich slot is this about.
[in]OptionOption for the level of detail output required.

Definition at line 2896 of file PrintInfo.c.

◆ DisplayMemoryModuleConfigHandles()

VOID DisplayMemoryModuleConfigHandles ( IN UINT16 *  Handles,
IN UINT8  SlotNum,
IN UINT8  Option 
)

Display information about memory configuration handles.

Parameters
[in]HandlesThe buffer of handles to output info on.
[in]SlotNumThe number of handles in the above buffer.
[in]OptionOption for the level of detail output required.

Definition at line 2925 of file PrintInfo.c.

◆ DisplayMmBankConnections()

VOID DisplayMmBankConnections ( IN UINT8  BankConnections,
IN UINT8  Option 
)

Display Memory Module Information (Type 6).

Parameters
[in]BankConnections
[in]Option

Definition at line 2957 of file PrintInfo.c.

◆ DisplayMmMemorySize()

VOID DisplayMmMemorySize ( IN UINT8  Size,
IN UINT8  Option 
)

Display memory informcation.

Bits 0:6 Size (n), where 2**n is the size in MB with three special-case values: 7Dh Not determinable (Installed Size only) 7Eh Module is installed, but no memory has been enabled 7Fh Not installed Bit 7 Defines whether the memory module has a single- (0) or double-bank (1) connection.

Parameters
[in]Size- The size
[in]Option- The option

Definition at line 3006 of file PrintInfo.c.

◆ DisplayOBRAConnections()

VOID DisplayOBRAConnections ( IN UINT8  Connections,
IN UINT8  Option 
)

Display Out-of-Band Remote Access (Type 30) information.

Parameters
[in]ConnectionsThe device characteristics.
[in]OptionThe device options.

Definition at line 3567 of file PrintInfo.c.

◆ DisplayProcessorFamily()

VOID DisplayProcessorFamily ( UINT8  Family,
UINT8  Option 
)

Display Processor Information (Type 4) information.

Parameters
[in]FamilyThe family value.
[in]OptionThe option value.

Definition at line 1728 of file PrintInfo.c.

◆ DisplayProcessorFamily2()

VOID DisplayProcessorFamily2 ( IN UINT16  Family2,
IN UINT8  Option 
)

Display processor family information.

Parameters
[in]Family2The family value.
[in]OptionThe option value.

Definition at line 2558 of file PrintInfo.c.

◆ DisplayProcessorStatus()

VOID DisplayProcessorStatus ( IN UINT8  Status,
IN UINT8  Option 
)

Display processor information.

Parameters
[in]StatusThe status. Bit 7 Reserved, must be 0 Bit 6 CPU Socket Populated 1 - CPU Socket Populated 0 - CPU Socket Unpopulated Bits 5:3 Reserved, must be zero Bits 2:0 CPU Status 0h - Unknown 1h - CPU Enabled 2h - CPU Disabled by User via BIOS Setup 3h - CPU Disabled By BIOS (POST Error) 4h - CPU is Idle, waiting to be enabled. 5-6h - Reserved 7h - Other
[in]OptionThe option

Definition at line 2828 of file PrintInfo.c.

◆ DisplayProcessorVoltage()

VOID DisplayProcessorVoltage ( IN UINT8  Voltage,
IN UINT8  Option 
)

Display processor voltage information.

Parameters
[in]VoltageThe Voltage. Bit 7 Set to 0, indicating 'legacy' mode for processor voltage Bits 6:4 Reserved, must be zero Bits 3:0 Voltage Capability. A Set bit indicates that the voltage is supported. Bit 0 - 5V Bit 1 - 3.3V Bit 2 - 2.9V Bit 3 - Reserved, must be zero.

Note: Setting of multiple bits indicates the socket is configurable If bit 7 is set to 1, the remaining seven bits of the field are set to contain the processor's current voltage times 10. For example, the field value for a processor voltage of 1.8 volts would be 92h = 80h + (1.8 * 10) = 80h + 18 = 80h +12h.

Parameters
[in]OptionThe option.

Definition at line 2760 of file PrintInfo.c.

◆ DisplaySBDSManufactureDate()

VOID DisplaySBDSManufactureDate ( IN UINT16  Date,
IN UINT8  Option 
)

Display Portable Battery (Type 22) information.

The date the cell pack was manufactured, in packed format: Bits 15:9 Year, biased by 1980, in the range 0 to 127. Bits 8:5 Month, in the range 1 to 12. Bits 4:0 Date, in the range 1 to 31. For example, 01 February 2000 would be identified as 0010 1000 0100 0001b (0x2841).

Parameters
[in]DateThe date
[in]OptionThe option

Definition at line 3298 of file PrintInfo.c.

◆ DisplaySPSCharacteristics()

VOID DisplaySPSCharacteristics ( IN UINT16  Characteristics,
IN UINT8  Option 
)

Display System Power Supply (Type 39) information.

Parameters
[in]CharacteristicsThe device characteristics.
[in]OptionThe device options.

Definition at line 3608 of file PrintInfo.c.

◆ DisplaySystemBootStatus()

VOID DisplaySystemBootStatus ( IN UINT8  Parameter,
IN UINT8  Option 
)

Display System Boot Information (Type 32) information.

Parameters
[in]ParameterThe parameter.
[in]OptionThe options.

Definition at line 3241 of file PrintInfo.c.

◆ DisplaySystemResetCapabilities()

VOID DisplaySystemResetCapabilities ( IN UINT8  Reset,
IN UINT8  Option 
)

Display System Reset (Type 23) information.

Identifies the system-reset capabilities for the system. Bits 7:6 Reserved for future assignment via this specification, set to 00b. Bit 5 System contains a watchdog timer, either True (1) or False (0). Bits 4:3 Boot Option on Limit. Identifies the system action to be taken when the Reset Limit is reached, one of: 00b Reserved, do not use. 01b Operating system 10b System utilities 11b Do not rebootBits 2:1 Boot Option. Indicates the action to be taken following a watchdog reset, one of: 00b Reserved, do not use. 01b Operating system 10b System utilities 11b Do not reboot Bit 0 Status. 1b The system reset is enabled by the user 0b The system reset is not enabled by the user

Parameters
[in]ResetReset
[in]OptionThe option

Definition at line 3344 of file PrintInfo.c.

◆ DisplaySystemSlotId()

VOID DisplaySystemSlotId ( IN UINT16  SlotId,
IN UINT8  SlotType,
IN UINT8  Option 
)

The Slot ID field of the System Slot structure provides a mechanism to correlate the physical attributes of the slot to its logical access method (which varies based on the Slot Type field).

Parameters
[in]SlotId- The slot ID
[in]SlotType- The slot type
[in]Option- The Option

Definition at line 3166 of file PrintInfo.c.

◆ DisplayTpmDeviceCharacteristics()

VOID DisplayTpmDeviceCharacteristics ( IN UINT64  Chara,
IN UINT8  Option 
)

Display TPM Device (Type 43) Characteristics.

Parameters
[in]CharaThe information bits.
[in]OptionThe optional information.

Definition at line 3767 of file PrintInfo.c.

◆ MemToString()

VOID MemToString ( IN OUT VOID *  Dest,
IN VOID *  Src,
IN UINTN  Length 
)

Copy Length of Src buffer to Dest buffer, add a NULL termination to Dest buffer.

Parameters
[in,out]DestDestination buffer head.
[in]SrcSource buffer head.
[in]LengthLength of buffer to be copied.

Definition at line 98 of file PrintInfo.c.

◆ Smbios64BitPrintEPSInfo()

VOID Smbios64BitPrintEPSInfo ( IN SMBIOS_TABLE_3_0_ENTRY_POINT SmbiosTable,
IN UINT8  Option 
)

Print the info of 64-bit EPS(Entry Point Structure).

Parameters
[in]SmbiosTablePointer to the SMBIOS table entry point.
[in]OptionDisplay option.

Definition at line 220 of file PrintInfo.c.

◆ SmbiosPrintEPSInfo()

VOID SmbiosPrintEPSInfo ( IN SMBIOS_TABLE_ENTRY_POINT SmbiosTable,
IN UINT8  Option 
)

Print the info of EPS(Entry Point Structure).

Parameters
[in]SmbiosTablePointer to the SMBIOS table entry point.
[in]OptionDisplay option.

Definition at line 135 of file PrintInfo.c.

◆ SmbiosPrintStructure()

EFI_STATUS SmbiosPrintStructure ( IN SMBIOS_STRUCTURE_POINTER Struct,
IN UINT8  Option 
)

This function print the content of the structure pointed by Struct.

Parameters
[in]StructPoint to the structure to be printed.
[in]OptionPrint option of information detail.
Return values
EFI_SUCCESSSuccessfully Printing this function.
EFI_INVALID_PARAMETERInvalid Structure.
EFI_UNSUPPORTEDUnsupported.

Definition at line 305 of file PrintInfo.c.