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

Go to the source code of this file.

Functions

SHELL_STATUS EFIAPI ShellCommandRunSmbiosView (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 
EFI_STATUS SMBiosView (IN UINT8 QueryType, IN UINT16 QueryHandle, IN UINT8 Option, IN BOOLEAN RandomView)
 
EFI_STATUS SMBios64View (IN UINT8 QueryType, IN UINT16 QueryHandle, IN UINT8 Option, IN BOOLEAN RandomView)
 
EFI_STATUS InitSmbiosTableStatistics (VOID)
 
EFI_STATUS CalculateSmbios64BitStructureCountAndLength (SMBIOS_TABLE_3_0_ENTRY_POINT *Smbios64EntryPoint, UINTN *NumberOfSmbios64Structures, UINTN *Smbios64TableLength)
 
EFI_STATUS InitSmbios64BitTableStatistics (VOID)
 
EFI_STATUS DisplayStatisticsTable (IN UINT8 Option)
 
EFI_STATUS DisplaySmbios64BitStatisticsTable (IN UINT8 Option)
 
CHAR16 * GetShowTypeString (UINT8 ShowType)
 

Variables

UINT8 gShowType = SHOW_DETAIL
 
STATIC STRUCTURE_STATISTICSmStatisticsTable = NULL
 
STATIC STRUCTURE_STATISTICSmSmbios64BitStatisticsTable = NULL
 
UINT8 SmbiosMajorVersion
 
UINT8 SmbiosMinorVersion
 
UINTN mNumberOfSmbios64BitStructures
 
UINTN mSmbios64BitTableLength
 
STATIC CONST SHELL_PARAM_ITEM ParamList []
 

Detailed Description

Tools of clarify the content of the smbios table.

(C) Copyright 2015 Hewlett-Packard Development Company, L.P.
Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
Copyright (c) 2023 Apple Inc. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file SmbiosView.c.

Function Documentation

◆ CalculateSmbios64BitStructureCountAndLength()

EFI_STATUS CalculateSmbios64BitStructureCountAndLength ( SMBIOS_TABLE_3_0_ENTRY_POINT Smbios64EntryPoint,
UINTN NumberOfSmbios64Structures,
UINTN Smbios64TableLength 
)
Parameters
[in]Smbios64EntryPointSMBIOS 64-bit entry point.
[out]NumberOfSmbios64StructuresThe number of structures in 64-bit SMBIOS table.
[out]Smbios64TableLengthThe total length of 64-bit SMBIOS table.
Return values
EFI_SUCCESSCalculation was successful.

Definition at line 686 of file SmbiosView.c.

◆ DisplaySmbios64BitStatisticsTable()

EFI_STATUS DisplaySmbios64BitStatisticsTable ( IN UINT8  Option)

Function to display the global mSmbios64BitStatisticsTable object.

Parameters
[in]OptionECHO, NORMAL, or DETAIL control the amount of detail displayed.
Return values
EFI_SUCCESSprint is successful.

Definition at line 917 of file SmbiosView.c.

◆ DisplayStatisticsTable()

EFI_STATUS DisplayStatisticsTable ( IN UINT8  Option)

Function to display the global mStatisticsTable object.

Parameters
[in]OptionECHO, NORMAL, or DETAIL control the amount of detail displayed.
Return values
EFI_SUCCESSprint is successful.

Definition at line 835 of file SmbiosView.c.

◆ GetShowTypeString()

CHAR16 * GetShowTypeString ( UINT8  ShowType)

function to return a string of the detail level.

Parameters
[in]ShowTypeThe detail level whose name is desired in clear text.
Returns
A pointer to a string representing the ShowType (or 'undefined type' if not known).

Definition at line 999 of file SmbiosView.c.

◆ InitSmbios64BitTableStatistics()

EFI_STATUS InitSmbios64BitTableStatistics ( VOID  )

Function to initialize the global mSmbios64BitStatisticsTable object.

Return values
EFI_SUCCESSprint is successful.

Definition at line 736 of file SmbiosView.c.

◆ InitSmbiosTableStatistics()

EFI_STATUS InitSmbiosTableStatistics ( VOID  )

Function to initialize the global mStatisticsTable object.

Return values
EFI_SUCCESSprint is successful.

Definition at line 595 of file SmbiosView.c.

◆ ShellCommandRunSmbiosView()

SHELL_STATUS EFIAPI ShellCommandRunSmbiosView ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

Function for 'smbiosview' command.

Parameters
[in]ImageHandleHandle to the Image (NULL if Internal).
[in]SystemTablePointer to the System Table (NULL if Internal).

Definition at line 43 of file SmbiosView.c.

◆ SMBios64View()

EFI_STATUS SMBios64View ( IN UINT8  QueryType,
IN UINT16  QueryHandle,
IN UINT8  Option,
IN BOOLEAN  RandomView 
)

Query all structures Data from SMBIOS table and Display the information to users as required display option.

Parameters
[in]QueryTypeStructure type to view.
[in]QueryHandleStructure handle to view.
[in]OptionDisplay option: none,outline,normal,detail.
[in]RandomViewSupport for -h parameter.
Return values
EFI_SUCCESSprint is successful.
EFI_BAD_BUFFER_SIZEstructure is out of the range of SMBIOS table.

Definition at line 424 of file SmbiosView.c.

◆ SMBiosView()

EFI_STATUS SMBiosView ( IN UINT8  QueryType,
IN UINT16  QueryHandle,
IN UINT8  Option,
IN BOOLEAN  RandomView 
)

Query all structures Data from SMBIOS table and Display the information to users as required display option.

Parameters
[in]QueryTypeStructure type to view.
[in]QueryHandleStructure handle to view.
[in]OptionDisplay option: none,outline,normal,detail.
[in]RandomViewSupport for -h parameter.
Return values
EFI_SUCCESSprint is successful.
EFI_BAD_BUFFER_SIZEstructure is out of the range of SMBIOS table.

Definition at line 245 of file SmbiosView.c.

Variable Documentation

◆ gShowType

UINT8 gShowType = SHOW_DETAIL

Definition at line 17 of file SmbiosView.c.

◆ mNumberOfSmbios64BitStructures

UINTN mNumberOfSmbios64BitStructures

Definition at line 24 of file SmbiosView.c.

◆ mSmbios64BitStatisticsTable

STATIC STRUCTURE_STATISTICS* mSmbios64BitStatisticsTable = NULL

Definition at line 19 of file SmbiosView.c.

◆ mSmbios64BitTableLength

UINTN mSmbios64BitTableLength

Definition at line 25 of file SmbiosView.c.

◆ mStatisticsTable

STATIC STRUCTURE_STATISTICS* mStatisticsTable = NULL

Definition at line 18 of file SmbiosView.c.

◆ ParamList

Initial value:
= {
{ L"-t", TypeValue },
{ L"-h", TypeValue },
{ L"-s", TypeFlag },
{ L"-a", TypeFlag },
{ NULL, TypeMax }
}
#define NULL
Definition: Base.h:319
@ TypeValue
A flag that has some data following it with a space (IE "-a 1").
Definition: ShellLib.h:700
@ TypeFlag
A flag that is present or not present only (IE "-a").
Definition: ShellLib.h:699

Definition at line 27 of file SmbiosView.c.

◆ SmbiosMajorVersion

UINT8 SmbiosMajorVersion

Definition at line 21 of file SmbiosView.c.

◆ SmbiosMinorVersion

UINT8 SmbiosMinorVersion

Definition at line 22 of file SmbiosView.c.