add comments to function declarations and definitions and updated to match coding style document.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11505 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jcarsey
2011-04-05 20:55:45 +00:00
parent c5981e3c3d
commit a1d4bfcc3f
47 changed files with 3680 additions and 3361 deletions

View File

@ -1,7 +1,7 @@
/**
/** @file
Module for clarifying the content of the smbios structure element info.
Copyright (c) 2005-2010, Intel Corporation. All rights reserved. <BR>
Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@ -141,6 +141,12 @@ DisplaySysEventLogHeaderFormat (
}
}
/**
Display the header information for SEL log items.
@param[in] Key The information key.
@param[in] Option The option index.
**/
VOID
DisplaySELLogHeaderLen (
UINT8 Key,
@ -163,9 +169,14 @@ DisplaySELLogHeaderLen (
}
}
/**
Display the header information for type 1 items.
@param[in] LogHeader The buffer with the information.
**/
VOID
DisplaySysEventLogHeaderType1 (
UINT8 *LogHeader
IN UINT8 *LogHeader
)
{
LOG_HEADER_TYPE1_FORMAT *Header;
@ -186,8 +197,8 @@ DisplaySysEventLogHeaderType1 (
Header->OEMReserved[3],
Header->OEMReserved[4]
);
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_MULTIPLE_EVENT_TIME), gShellDebug1HiiHandle, Header->METW);
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_MULTIPLE_EVENT_COUNT), gShellDebug1HiiHandle, Header->MECI);
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_MULTIPLE_EVENT_TIME), gShellDebug1HiiHandle, Header->Metw);
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_MULTIPLE_EVENT_COUNT), gShellDebug1HiiHandle, Header->Meci);
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_PREBOOT_ADDRESS), gShellDebug1HiiHandle, Header->CMOSAddress);
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_PREBOOT_INDEX), gShellDebug1HiiHandle, Header->CMOSBitIndex);
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_CHECKSUM_STARTING_OFF), gShellDebug1HiiHandle, Header->StartingOffset);
@ -235,6 +246,12 @@ DisplaySysEventLogHeader (
}
}
/**
Display the El Vdf information.
@param[in] ElVdfType The information type.
@param[in] VarData The information buffer.
**/
VOID
DisplayElVdfInfo (
UINT8 ElVdfType,

View File

@ -1,7 +1,7 @@
/**
/** @file
Module to clarify system event log of smbios structure.
Copyright (c) 2005-2010, Intel Corporation. All rights reserved. <BR>
Copyright (c) 2005-2011, Intel Corporation. All rights reserved. <BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@ -12,8 +12,8 @@
**/
#ifndef _SMBIOS_EVENT_LOG_INFO_H
#define _SMBIOS_EVENT_LOG_INFO_H
#ifndef _SMBIOS_EVENT_LOG_INFO_H_
#define _SMBIOS_EVENT_LOG_INFO_H_
#define END_OF_LOG 0xFF
@ -33,8 +33,8 @@ typedef struct {
typedef struct {
UINT8 OEMReserved[5];
UINT8 METW; // Multiple Event Time Window
UINT8 MECI; // Multiple Event Count Increment
UINT8 Metw; // Multiple Event Time Window
UINT8 Meci; // Multiple Event Count Increment
UINT8 CMOSAddress; // Pre-boot Event Log Reset - CMOS Address
UINT8 CMOSBitIndex; // Pre-boot Event Log Reset - CMOS Bit Index
UINT8 StartingOffset; // CMOS Checksum - Starting Offset

View File

@ -1,7 +1,7 @@
/** @file
Lib include for SMBIOS services. Used to get system serial number and GUID
Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@ -12,8 +12,8 @@
**/
#ifndef _LIB_SMBIOS_H
#define _LIB_SMBIOS_H
#ifndef _LIB_SMBIOS_H_
#define _LIB_SMBIOS_H_
//
// Define SMBIOS tables.
@ -215,14 +215,14 @@ typedef struct {
UINT8 DevFuncNum;
} SMBIOS_TYPE9;
typedef struct DeviceStruct {
typedef struct _DEVICE_STRUCTURE {
UINT8 DeviceType;
SMBIOS_STRING DescriptionString;
} DeviceStruct;
} DEVICE_STRUCTURE;
typedef struct {
SMBIOS_HEADER Hdr;
DeviceStruct Device[1];
DEVICE_STRUCTURE Device[1];
} SMBIOS_TYPE10;
typedef struct {
@ -239,7 +239,7 @@ typedef struct {
SMBIOS_HEADER Hdr;
UINT8 InstallableLanguages;
UINT8 Flags;
UINT8 reserved[15];
UINT8 Reserved[15];
SMBIOS_STRING CurrentLanguages;
} SMBIOS_TYPE13;
@ -622,17 +622,19 @@ typedef union {
#pragma pack()
CHAR8 *
/**
Return SMBIOS string given the string number.
@param[in] Smbios Pointer to SMBIOS structure.
@param[in] StringNumber String number to return. -1 is used to skip all strings and
point to the next SMBIOS structure.
@return Pointer to string, or pointer to next SMBIOS strcuture if StringNumber == -1
**/
CHAR8*
LibGetSmbiosString (
IN SMBIOS_STRUCTURE_POINTER *Smbios,
IN UINT16 StringNumber
IN SMBIOS_STRUCTURE_POINTER *Smbios,
IN UINT16 StringNumber
);
EFI_STATUS
LibGetSmbiosSystemGuidAndSerialNumber (
IN EFI_GUID *SystemGuid,
OUT CHAR8 **SystemSerialNumber
);
#endif

View File

@ -1,7 +1,7 @@
/** @file
API for SMBIOS table.
Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@ -17,30 +17,22 @@
#include <Guid/Smbios.h>
#include "LIbSmbios.h"
#include "LibSmbiosView.h"
#include "smbiosview.h"
#include "SmbiosView.h"
STATIC UINT8 mInit = 0;
STATIC SMBIOS_STRUCTURE_TABLE *mSmbiosTable = NULL;
STATIC SMBIOS_STRUCTURE_POINTER m_SmbiosStruct;
STATIC SMBIOS_STRUCTURE_POINTER *mSmbiosStruct = &m_SmbiosStruct;
/**
Init the SMBIOS VIEW API's environment.
@retval EFI_SUCCESS Successful to init the SMBIOS VIEW Lib.
**/
EFI_STATUS
LibSmbiosInit (
VOID
)
/*++
Routine Description:
Init the SMBIOS VIEW API's environment.
Arguments:
None
Returns:
EFI_SUCCESS - Successful to init the SMBIOS VIEW Lib
Others - Cannot get SMBIOS Table
**/
{
EFI_STATUS Status;
@ -73,6 +65,9 @@ Returns:
return EFI_SUCCESS;
}
/**
Cleanup the Smbios information.
**/
VOID
LibSmbiosCleanup (
VOID
@ -88,98 +83,46 @@ LibSmbiosCleanup (
mInit = 0;
}
/**
Get the entry point structure for the table.
@param[out] EntryPointStructure The pointer to populate.
**/
VOID
LibSmbiosGetEPS (
SMBIOS_STRUCTURE_TABLE **pEntryPointStructure
OUT SMBIOS_STRUCTURE_TABLE **EntryPointStructure
)
{
//
// return SMBIOS Table address
//
*pEntryPointStructure = mSmbiosTable;
*EntryPointStructure = mSmbiosTable;
}
VOID
LibSmbiosGetStructHead (
SMBIOS_STRUCTURE_POINTER *pHead
)
{
//
// return SMBIOS structure table address
//
pHead = mSmbiosStruct;
}
/**
Get SMBIOS structure given the Handle,copy data to the Buffer,
Handle is changed to the next handle or 0xFFFF when the end is
reached or the handle is not found.
EFI_STATUS
LibGetSmbiosInfo (
OUT CHAR8 *dmiBIOSRevision,
OUT UINT16 *NumStructures,
OUT UINT16 *StructureSize,
OUT UINT32 *dmiStorageBase,
OUT UINT16 *dmiStorageSize
)
/*++
@param[in,out] Handle 0xFFFF: get the first structure
Others: get a structure according to this value.
@param[in,out] Buffer The pointer to the caller's memory buffer.
@param[out] Length Length of return buffer in bytes.
Routine Description:
Get SMBIOS Information.
Arguments:
dmiBIOSRevision - Revision of the SMBIOS Extensions.
NumStructures - Max. Number of Structures the BIOS will return.
StructureSize - Size of largest SMBIOS Structure.
dmiStorageBase - 32-bit physical base address for memory mapped SMBIOS data.
dmiStorageSize - Size of the memory-mapped SMBIOS data.
Returns:
DMI_SUCCESS - successful.
DMI_FUNCTION_NOT_SUPPORTED - Does not support SMBIOS calling interface capability.
@retval DMI_SUCCESS Buffer contains the required structure data
Handle is updated with next structure handle or
0xFFFF(end-of-list).
@retval DMI_INVALID_HANDLE Buffer not contain the requiring structure data.
Handle is updated with next structure handle or
0xFFFF(end-of-list).
**/
{
//
// If no SMIBOS table, unsupported.
//
if (mSmbiosTable == NULL) {
return DMI_FUNCTION_NOT_SUPPORTED;
}
*dmiBIOSRevision = mSmbiosTable->SmbiosBcdRevision;
*NumStructures = mSmbiosTable->NumberOfSmbiosStructures;
*StructureSize = mSmbiosTable->MaxStructureSize;
*dmiStorageBase = mSmbiosTable->TableAddress;
*dmiStorageSize = mSmbiosTable->TableLength;
return DMI_SUCCESS;
}
EFI_STATUS
LibGetSmbiosStructure (
IN OUT UINT16 *Handle,
IN OUT UINT8 *Buffer,
OUT UINT16 *Length
)
/*++
Routine Description:
Get SMBIOS structure given the Handle,copy data to the Buffer,
Handle is changed to the next handle or 0xFFFF when the end is
reached or the handle is not found.
Arguments:
Handle: - 0xFFFF: get the first structure
- Others: get a structure according to this value.
Buffter: - The pointer to the caller's memory buffer.
Length: - Length of return buffer in bytes.
Returns:
DMI_SUCCESS - Buffer contains the required structure data
- Handle is updated with next structure handle or
0xFFFF(end-of-list).
DMI_INVALID_HANDLE - Buffer not contain the requiring structure data
- Handle is updated with next structure handle or
0xFFFF(end-of-list).
**/
{
SMBIOS_STRUCTURE_POINTER Smbios;
SMBIOS_STRUCTURE_POINTER SmbiosEnd;
@ -230,23 +173,18 @@ LibGetSmbiosStructure (
return DMI_INVALID_HANDLE;
}
/**
Check the structure to see if it is legal.
@param[in] Smbios - Pointer to the structure that will be checked.
@retval DMI_SUCCESS Structure data is legal.
@retval DMI_BAD_PARAMETER Structure data contains bad parameter.
**/
EFI_STATUS
SmbiosCheckStructure (
IN SMBIOS_STRUCTURE_POINTER *Smbios
)
/*++
Routine Description:
Check the structure to see if it is legal.
Arguments:
Smbios - Pointer to the structure that will be checked.
Returns:
DMI_SUCCESS - Structure data is legal.
DMI_BAD_PARAMETER - Structure data contains bad parameter
**/
{
//
// If key != value, then error.
@ -324,6 +262,13 @@ SmbiosCheckStructure (
return Status;
}
/**
Get a string from the smbios information.
@param[in] Smbios The pointer to the smbios information.
@param[in] StringNumber The index to the string to get.
@param[out] Buffer The buffer to fill with the string when retrieved.
**/
VOID
SmbiosGetPendingString (
IN SMBIOS_STRUCTURE_POINTER *Smbios,

View File

@ -1,7 +1,7 @@
/** @file
API for SMBIOS Plug and Play functions, access to SMBIOS table and structures.
Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@ -12,8 +12,8 @@
**/
#ifndef _LIB_SMBIOS_VIEW_H
#define _LIB_SMBIOS_VIEW_H
#ifndef _LIB_SMBIOS_VIEW_H_
#define _LIB_SMBIOS_VIEW_H_
#include "LibSmbios.h"
@ -39,49 +39,51 @@
#define EFI_SMBIOSERR_TYPE_UNKNOWN EFI_SMBIOSERR (3)
#define EFI_SMBIOSERR_UNSUPPORTED EFI_SMBIOSERR (4)
/**
Init the SMBIOS VIEW API's environment.
@retval EFI_SUCCESS Successful to init the SMBIOS VIEW Lib.
**/
EFI_STATUS
LibSmbiosInit (
VOID
);
/**
Cleanup the Smbios information.
**/
VOID
LibSmbiosCleanup (
VOID
);
/**
Get the entry point structure for the table.
@param[out] EntryPointStructure The pointer to populate.
**/
VOID
LibSmbiosGetEPS (
SMBIOS_STRUCTURE_TABLE **pEntryPointStructure
OUT SMBIOS_STRUCTURE_TABLE **EntryPointStructure
);
VOID
LibSmbiosGetStructHead (
SMBIOS_STRUCTURE_POINTER *pHead
);
/**
Get SMBIOS structure given the Handle,copy data to the Buffer,
Handle is changed to the next handle or 0xFFFF when the end is
reached or the handle is not found.
EFI_STATUS
LibGetSmbiosInfo (
OUT CHAR8 *dmiBIOSRevision,
OUT UINT16 *NumStructures,
OUT UINT16 *StructureSize,
OUT UINT32 *dmiStorageBase,
OUT UINT16 *dmiStorageSize
);
@param[in,out] Handle 0xFFFF: get the first structure
Others: get a structure according to this value.
@param[in,out] Buffer The pointer to the caller's memory buffer.
@param[out] Length Length of return buffer in bytes.
/*++
Description:
Get SMBIOS Information.
@retval DMI_SUCCESS Buffer contains the required structure data
Handle is updated with next structure handle or
0xFFFF(end-of-list).
Arguments:
dmiBIOSRevision - Revision of the SMBIOS Extensions.
NumStructures - Max. Number of Structures the BIOS will return.
StructureSize - Size of largest SMBIOS Structure.
dmiStorageBase - 32-bit physical base address for memory mapped SMBIOS data.
dmiStorageSize - Size of the memory-mapped SMBIOS data.
Returns:
DMI_SUCCESS - successful.
DMI_FUNCTION_NOT_SUPPORTED - Does not support SMBIOS calling interface capability.
@retval DMI_INVALID_HANDLE Buffer not contain the requiring structure data.
Handle is updated with next structure handle or
0xFFFF(end-of-list).
**/
EFI_STATUS
LibGetSmbiosStructure (
@ -90,20 +92,12 @@ LibGetSmbiosStructure (
OUT UINT16 *Length
);
/*++
Description:
Get SMBIOS structure given the Handle,copy data to the Buffer,Handle is then the next.
/**
Get a string from the smbios information.
Arguments:
Handle: - 0x0: get the first structure
- Others: get a certain structure according to this value.
Buffter: - contains the pointer to the caller's memory buffer.
Returns:
DMI_SUCCESS - Buffer contains the required structure data
- Handle is updated with next structure handle or 0xFFFF(end-of-list).
DMI_INVALID_HANDLE - Buffer not contain the requiring structure data
- Handle is updated with next structure handle or 0xFFFF(end-of-list).
@param[in] Smbios The pointer to the smbios information.
@param[in] StringNumber The index to the string to get.
@param[out] Buffer The buffer to fill with the string when retrieved.
**/
VOID
SmbiosGetPendingString (
@ -112,9 +106,17 @@ SmbiosGetPendingString (
OUT CHAR8 *Buffer
);
/**
Check the structure to see if it is legal.
@param[in] Smbios - Pointer to the structure that will be checked.
@retval DMI_SUCCESS Structure data is legal.
@retval DMI_BAD_PARAMETER Structure data contains bad parameter.
**/
EFI_STATUS
SmbiosCheckStructure (
IN SMBIOS_STRUCTURE_POINTER *Smbios
IN SMBIOS_STRUCTURE_POINTER *Smbios
);
#endif

View File

@ -1,7 +1,7 @@
/** @file
Module to clarify the element info of the smbios structure.
Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@ -12,8 +12,8 @@
**/
#ifndef _SMBIOS_PRINT_INFO_H
#define _SMBIOS_PRINT_INFO_H
#ifndef _SMBIOS_PRINT_INFO_H_
#define _SMBIOS_PRINT_INFO_H_
#include "LibSmbios.h"
@ -34,159 +34,344 @@ extern UINT8 SmbiosMinorVersion;
#define AS_UINT32(pData) (*((UINT32 *) pData))
#define AS_UINT64(pData) (*((UINT64 *) pData))
/**
Print the info of EPS(Entry Point Structure).
@param[in] SmbiosTable Pointer to the SMBIOS table entry point.
@param[in] Option Display option.
**/
VOID
SmbiosPrintEPSInfo (
IN SMBIOS_STRUCTURE_TABLE *pSmbiosTable,
IN SMBIOS_STRUCTURE_TABLE *SmbiosTable,
IN UINT8 Option
);
/**
This function print the content of the structure pointed by Struct.
@param[in] Struct Point to the structure to be printed.
@param[in] Option Print option of information detail.
@retval EFI_SUCCESS Successfully Printing this function.
@retval EFI_INVALID_PARAMETER Invalid Structure.
@retval EFI_UNSUPPORTED Unsupported.
**/
EFI_STATUS
SmbiosPrintStructure (
IN SMBIOS_STRUCTURE_POINTER *pStruct,
IN SMBIOS_STRUCTURE_POINTER *Struct,
IN UINT8 Option
);
//
// BIOS Information (Type 0)
//
/**
Display BIOS Information (Type 0) information.
@param[in] Chara The information bits.
@param[in] Option The optional information.
**/
VOID
DisplayBiosCharacteristics (
UINT64 chara,
UINT8 Option
);
VOID
DisplayBiosCharacteristicsExt1 (
UINT8 byte1,
UINT8 Option
);
VOID
DisplayBiosCharacteristicsExt2 (
UINT8 byte2,
UINT8 Option
IN UINT64 Chara,
IN UINT8 Option
);
//
// Processor Information (Type 4)
//
/**
Display Bios Characteristice extensions1 information.
@param[in] Byte1 The information.
@param[in] Option The optional information.
**/
VOID
DisplayBiosCharacteristicsExt1 (
IN UINT8 Byte1,
IN UINT8 Option
);
/**
Display Bios Characteristice extensions2 information.
@param[in] Byte2 The information.
@param[in] Option The optional information.
**/
VOID
DisplayBiosCharacteristicsExt2 (
IN UINT8 Byte2,
IN UINT8 Option
);
/**
Display Processor Information (Type 4) information.
@param[in] Family The family value.
@param[in] Option The option value.
**/
VOID
DisplayProcessorFamily (
UINT8 Family,
UINT8 Option
);
/**
Display processor family information.
@param[in] Family2 The family value.
@param[in] Option The option value.
**/
VOID
DisplayProcessorFamily2 (
UINT16 Family2,
UINT8 Option
IN UINT16 Family2,
IN UINT8 Option
);
/**
Display processor voltage information.
@param[in] Voltage The 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.
@param[in] Option The option.
**/
VOID
DisplayProcessorVoltage (
UINT8 Voltage,
UINT8 Option
IN UINT8 Voltage,
IN UINT8 Option
);
/**
Display processor information.
@param[in] Status The status.
Bit 7 Reserved, must be 0
Bit 6 CPU Socket Populated
1 - CPU Socket Populated
0 - CPU Socket UnpopulatedBits
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
@param[in] Option The option
**/
VOID
DisplayProcessorStatus (
UINT8 Status,
UINT8 Option
IN UINT8 Status,
IN UINT8 Option
);
//
// Memory Controller Information (Type 5)
//
/**
Display information about Memory Controller Information (Type 5).
@param[in] Size Memory size.
@param[in] SlotNum Which slot is this about.
@param[in] Option Option for the level of detail output required.
**/
VOID
DisplayMaxMemoryModuleSize (
UINT8 Size,
UINT8 SlotNum,
UINT8 Option
IN UINT8 Size,
IN UINT8 SlotNum,
IN UINT8 Option
);
/**
Display information about memory configuration handles.
@param[in] Handles The buffer of handles to output info on.
@param[in] SlotNum The number of handles in the above buffer.
@param[in] Option Option for the level of detail output required.
**/
VOID
DisplayMemoryModuleConfigHandles (
UINT16 *pHandles,
UINT8 SlotNum,
UINT8 Option
IN UINT16 *Handles,
IN UINT8 SlotNum,
IN UINT8 Option
);
//
// Memory Module Information (Type 6)
//
/**
Display Memory Module Information (Type 6).
@param[in] BankConnections
@param[in] Option
**/
VOID
DisplayMmBankConnections (
UINT8 BankConnections,
UINT8 Option
IN UINT8 BankConnections,
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.
@param[in] Size - The size
@param[in] Option - The option
**/
VOID
DisplayMmMemorySize (
UINT8 Size,
UINT8 Option
IN UINT8 Size,
IN UINT8 Option
);
//
// System Slots (Type 9)
//
/**
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).
@param[in] SlotId - The slot ID
@param[in] SlotType - The slot type
@param[in] Option - The Option
**/
VOID
DisplaySystemSlotId (
UINT16 SlotId,
UINT8 SlotType,
UINT8 Option
IN UINT16 SlotId,
IN UINT8 SlotType,
IN UINT8 Option
);
//
// Physical Memory Array (Type 16)
// Memory Device (Type 17)
// Memory Array Mapped Address (Type 19)
// Memory Device Mapped Address (Type 20)
// Portable Battery (Type 22)
//
/**
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).
@param[in] Date The date
@param[in] Option The option
**/
VOID
DisplaySBDSManufactureDate (
UINT16 Date,
UINT8 Option
IN UINT16 Date,
IN UINT8 Option
);
//
// System Reset (Type 23)
//
/**
Display System Reset (Type 23) information.
Routine Description:
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
@param[in] Reset Reset
@param[in] Option The option
**/
VOID
DisplaySystemResetCapabilities (
UINT8 Reset,
UINT8 Option
IN UINT8 Reset,
IN UINT8 Option
);
//
// Hardware Security (Type 24)
//
/**
Display Hardware Security (Type 24) information.
Routine Description:
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
@param[in] Settings The device settings.
@param[in] Option The device options.
**/
VOID
DisplayHardwareSecuritySettings (
UINT8 Settings,
UINT8 Option
IN UINT8 Settings,
IN UINT8 Option
);
//
// Out-of-Band Remote Access (Type 30)
//
/**
Display Out-of-Band Remote Access (Type 30) information.
@param[in] Connections The device characteristics.
@param[in] Option The device options.
**/
VOID
DisplayOBRAConnections (
UINT8 Connections,
UINT8 Option
IN UINT8 Connections,
IN UINT8 Option
);
//
// System Boot Information (Type 32)
//
/**
Display System Boot Information (Type 32) information.
@param[in] Parameter The parameter.
@param[in] Option The options.
**/
VOID
DisplaySystemBootStatus (
UINT8 Parameter,
UINT8 Option
IN UINT8 Parameter,
IN UINT8 Option
);
//
// System Power Supply (Type 39)
//
/**
Display System Power Supply (Type 39) information.
@param[in] Characteristics The device characteristics.
@param[in] Option The device options.
**/
VOID
DisplaySPSCharacteristics (
UINT16 Characteristics,
UINT8 Option
IN UINT16 Characteristics,
IN UINT8 Option
);
#endif

View File

@ -13,8 +13,8 @@
**/
#ifndef _SMBIOS_QUERY_TABLE_H
#define _SMBIOS_QUERY_TABLE_H
#ifndef _SMBIOS_QUERY_TABLE_H_
#define _SMBIOS_QUERY_TABLE_H_
#define QUERY_TABLE_UNFOUND 0xFF
@ -70,386 +70,665 @@ QueryTable (
IN UINTN InfoLen
);
VOID
PrintBitsInfo (
IN TABLE_ITEM *Table,
IN UINTN Number,
IN UINT32 Bits
);
/**
Display the structure type information.
//
// Display the element detail information
//
@param[in] Key The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplayStructureTypeInfo (
UINT8 Key,
UINT8 Option
IN UINT8 Key,
IN UINT8 Option
);
//
// System Information (Type 1)
//
/**
Display System Information (Type 1) Type.
@param[in] Type The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplaySystemWakeupType (
UINT8 Type,
UINT8 Option
IN UINT8 Type,
IN UINT8 Option
);
//
// System Enclosure (Type 3)
//
/**
Display System Enclosure (Type 3) Enclosure Type.
@param[in] Type The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplaySystemEnclosureType (
UINT8 Type,
UINT8 Option
IN UINT8 Type,
IN UINT8 Option
);
/**
Display System Enclosure (Type 3) Enclosure Status.
@param[in] Status The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplaySystemEnclosureStatus (
UINT8 Status,
UINT8 Option
IN UINT8 Status,
IN UINT8 Option
);
/**
Display System Enclosure (Type 3) Security Status.
@param[in] Status The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplaySESecurityStatus (
UINT8 Status,
UINT8 Option
);
IN UINT8 Status,
IN UINT8 Option
)
;
//
// Processor Information (Type 4)
//
/**
Display Processor Information (Type 4) Type.
@param[in] Type The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplayProcessorType (
UINT8 Type,
UINT8 Option
IN UINT8 Type,
IN UINT8 Option
);
/**
Display Processor Information (Type 4) Upgrade.
@param[in] Upgrade The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplayProcessorUpgrade (
UINT8 Upgrade,
UINT8 Option
IN UINT8 Upgrade,
IN UINT8 Option
);
//
// Memory Controller Information (Type 5)
//
/**
Display Memory Controller Information (Type 5) method.
@param[in] Method The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplayMcErrorDetectMethod (
UINT8 Method,
UINT8 Option
IN UINT8 Method,
IN UINT8 Option
);
/**
Display Memory Controller Information (Type 5) Capability.
@param[in] Capability The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplayMcErrorCorrectCapability (
UINT8 Capability,
UINT8 Option
IN UINT8 Capability,
IN UINT8 Option
);
/**
Display Memory Controller Information (Type 5) Support.
@param[in] Support The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplayMcInterleaveSupport (
UINT8 Support,
UINT8 Option
IN UINT8 Support,
IN UINT8 Option
);
/**
Display Memory Controller Information (Type 5) speeds.
@param[in] Speed The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplayMcMemorySpeeds (
UINT16 Speed,
UINT8 Option
IN UINT16 Speed,
IN UINT8 Option
);
/**
Display Memory Controller Information (Type 5) voltage.
@param[in] Voltage The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplayMemoryModuleVoltage (
UINT8 Voltage,
UINT8 Option
IN UINT8 Voltage,
IN UINT8 Option
);
//
// Memory Module Information (Type 6)
//
/**
Display Memory Module Information (Type 6) type.
@param[in] Type The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplayMmMemoryType (
UINT16 Type,
UINT8 Option
IN UINT16 Type,
IN UINT8 Option
);
/**
Display Memory Module Information (Type 6) status.
@param[in] Status The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplayMmErrorStatus (
UINT8 Status,
UINT8 Option
IN UINT8 Status,
IN UINT8 Option
);
//
// Cache Information (Type 7)
//
/**
Display Cache Information (Type 7) SRAM Type.
@param[in] Type The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplayCacheSRAMType (
UINT16 Type,
UINT8 Option
IN UINT16 Type,
IN UINT8 Option
);
/**
Display Cache Information (Type 7) correcting Type.
@param[in] Type The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplayCacheErrCorrectingType (
UINT8 Type,
UINT8 Option
IN UINT8 Type,
IN UINT8 Option
);
/**
Display Cache Information (Type 7) Type.
@param[in] Type The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplayCacheSystemCacheType (
UINT8 Type,
UINT8 Option
IN UINT8 Type,
IN UINT8 Option
);
/**
Display Cache Information (Type 7) Associativity.
@param[in] Associativity The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplayCacheAssociativity (
UINT8 Associativity,
UINT8 Option
IN UINT8 Associativity,
IN UINT8 Option
);
//
// Port Connector Information (Type 8)
//
/**
Display Port Connector Information (Type 8) type.
@param[in] Type The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplayPortConnectorType (
UINT8 Type,
UINT8 Option
IN UINT8 Type,
IN UINT8 Option
);
/**
Display Port Connector Information (Type 8) port type.
@param[in] Type The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplayPortType (
UINT8 Type,
UINT8 Option
IN UINT8 Type,
IN UINT8 Option
);
//
// System Slots (Type 9)
//
/**
Display System Slots (Type 9) slot type.
@param[in] Type The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplaySystemSlotType (
UINT8 Type,
UINT8 Option
IN UINT8 Type,
IN UINT8 Option
);
/**
Display System Slots (Type 9) data bus width.
@param[in] Width The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplaySystemSlotDataBusWidth (
UINT8 Width,
UINT8 Option
IN UINT8 Width,
IN UINT8 Option
);
/**
Display System Slots (Type 9) usage information.
@param[in] Usage The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplaySystemSlotCurrentUsage (
UINT8 Usage,
UINT8 Option
IN UINT8 Usage,
IN UINT8 Option
);
/**
Display System Slots (Type 9) slot length.
@param[in] Length The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplaySystemSlotLength (
UINT8 Length,
UINT8 Option
IN UINT8 Length,
IN UINT8 Option
);
/**
Display System Slots (Type 9) characteristics.
@param[in] Chara1 The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplaySlotCharacteristics1 (
UINT8 Chara1,
UINT8 Option
IN UINT8 Chara1,
IN UINT8 Option
);
/**
Display System Slots (Type 9) characteristics.
@param[in] Chara2 The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplaySlotCharacteristics2 (
UINT8 Chara2,
UINT8 Option
IN UINT8 Chara2,
IN UINT8 Option
);
//
// On Board Devices Information (Type 10)
//
/**
Display On Board Devices Information (Type 10) types.
@param[in] Type The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplayOnboardDeviceTypes (
UINT8 Type,
UINT8 Option
IN UINT8 Type,
IN UINT8 Option
);
//
// System Event Log (Type 15)
//
/**
Display System Event Log (Type 15) types.
@param[in] Type The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplaySELTypes (
UINT8 Type,
UINT8 Option
IN UINT8 Type,
IN UINT8 Option
);
/**
Display System Event Log (Type 15) format type.
@param[in] Type The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplaySELVarDataFormatType (
UINT8 Type,
UINT8 Option
IN UINT8 Type,
IN UINT8 Option
);
/**
Display System Event Log (Type 15) dw1.
@param[in] Key The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplayPostResultsBitmapDw1 (
UINT32 Key,
UINT8 Option
IN UINT32 Key,
IN UINT8 Option
);
/**
Display System Event Log (Type 15) dw2.
@param[in] Key The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplayPostResultsBitmapDw2 (
UINT32 Key,
UINT8 Option
IN UINT32 Key,
IN UINT8 Option
);
/**
Display System Event Log (Type 15) type.
@param[in] SMType The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplaySELSysManagementTypes (
UINT32 SMType,
UINT8 Option
IN UINT32 SMType,
IN UINT8 Option
);
//
// Physical Memory Array (Type 16)
//
/**
Display Physical Memory Array (Type 16) Location.
@param[in] Location The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplayPMALocation (
UINT8 Location,
UINT8 Option
IN UINT8 Location,
IN UINT8 Option
);
/**
Display Physical Memory Array (Type 16) Use.
@param[in] Use The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplayPMAUse (
UINT8 Use,
UINT8 Option
IN UINT8 Use,
IN UINT8 Option
);
/**
Display Physical Memory Array (Type 16) Types.
@param[in] Type The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplayPMAErrorCorrectionTypes (
UINT8 Type,
UINT8 Option
IN UINT8 Type,
IN UINT8 Option
);
//
// Memory Device (Type 17)
//
/**
Display Memory Device (Type 17) form factor.
@param[in] FormFactor The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplayMemoryDeviceFormFactor (
UINT8 FormFactor,
UINT8 Option
IN UINT8 FormFactor,
IN UINT8 Option
);
/**
Display Memory Device (Type 17) type.
@param[in] Type The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplayMemoryDeviceType (
UINT8 Type,
UINT8 Option
IN UINT8 Type,
IN UINT8 Option
);
/**
Display Memory Device (Type 17) details.
@param[in] Para The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplayMemoryDeviceTypeDetail (
UINT16 Parameter,
UINT8 Option
IN UINT16 Para,
IN UINT8 Option
);
//
// 32-bit Memory Error Information (Type 18)
//
/**
Display 32-bit Memory Error Information (Type 18) type.
@param[in] ErrorType The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplayMemoryErrorType (
UINT8 ErrorType,
UINT8 Option
IN UINT8 ErrorType,
IN UINT8 Option
);
/**
Display 32-bit Memory Error Information (Type 18) error granularity.
@param[in] Granularity The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplayMemoryErrorGranularity (
UINT8 Granularity,
UINT8 Option
IN UINT8 Granularity,
IN UINT8 Option
);
/**
Display 32-bit Memory Error Information (Type 18) error information.
@param[in] Operation The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplayMemoryErrorOperation (
UINT8 Operation,
UINT8 Option
IN UINT8 Operation,
IN UINT8 Option
);
//
// Memory Array Mapped Address (Type 19)
// Memory Device Mapped Address (Type 20)
//
// Built-in Pointing Device (Type 21)
//
/**
Display Built-in Pointing Device (Type 21) type information.
@param[in] Type The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplayPointingDeviceType (
UINT8 Type,
UINT8 Option
IN UINT8 Type,
IN UINT8 Option
);
/**
Display Built-in Pointing Device (Type 21) information.
@param[in] Interface The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplayPointingDeviceInterface (
UINT8 Interface,
UINT8 Option
IN UINT8 Interface,
IN UINT8 Option
);
//
// Portable Battery (Type 22)
//
/**
Display Portable Battery (Type 22) information.
@param[in] Key The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplayPBDeviceChemistry (
UINT8 Key,
UINT8 Option
IN UINT8 Key,
IN UINT8 Option
);
//
// Voltage Probe (Type 26)
//
/**
Display Voltage Probe (Type 26) location information.
@param[in] Key The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplayVPLocation (
UINT8 Key,
UINT8 Option
IN UINT8 Key,
IN UINT8 Option
);
/**
Display Voltage Probe (Type 26) status ype information.
@param[in] Key The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplayVPStatus (
UINT8 Key,
UINT8 Option
IN UINT8 Key,
IN UINT8 Option
);
//
// Voltage Probe (Type 27)
//
/**
Display Cooling (Type 27) status information.
@param[in] Key The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplayCoolingDeviceStatus (
UINT8 Key,
UINT8 Option
IN UINT8 Key,
IN UINT8 Option
);
/**
Display Cooling (Type 27) type information.
@param[in] Key The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplayCoolingDeviceType (
UINT8 Key,
UINT8 Option
IN UINT8 Key,
IN UINT8 Option
);
//
// Temperature Probe (Type 28)
//
/**
Display Temperature Probe (Type 28) status information.
@param[in] Key The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplayTemperatureProbeStatus (
UINT8 Key,
UINT8 Option
IN UINT8 Key,
IN UINT8 Option
);
/**
Display Temperature Probe (Type 28) location information.
@param[in] Key The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplayTemperatureProbeLoc (
UINT8 Key,
UINT8 Option
IN UINT8 Key,
IN UINT8 Option
);
//
// Electrical Current Probe (Type 29)
//
/**
Display Electrical Current Probe (Type 29) status information.
@param[in] Key The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplayECPStatus (
UINT8 Key,
UINT8 Option
IN UINT8 Key,
IN UINT8 Option
);
/**
Display Electrical Current Probe (Type 29) location information.
@param[in] Key The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplayECPLoc (
UINT8 Key,
UINT8 Option
IN UINT8 Key,
IN UINT8 Option
);
//
// Management Device (Type 34)
//
/**
Display Management Device (Type 34) information.
@param[in] Key The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplayMDType (
UINT8 Key,
UINT8 Option
);
VOID
DisplayMDAddressType (
UINT8 Key,
UINT8 Option
IN UINT8 Key,
IN UINT8 Option
);
//
// Memory Channel (Type 37)
//
/**
Display Memory Channel (Type 37) information.
@param[in] Key The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplayMemoryChannelType (
UINT8 Key,
UINT8 Option
IN UINT8 Key,
IN UINT8 Option
);
//
// IPMI Device Information (Type 38)
//
/**
Display IPMI Device Information (Type 38) information.
@param[in] Key The key of the structure.
@param[in] Option The optional information.
**/
VOID
DisplayIPMIDIBMCInterfaceType (
UINT8 Key,
UINT8 Option
IN UINT8 Key,
IN UINT8 Option
);
#endif

View File

@ -16,77 +16,20 @@
#include <Guid/Smbios.h>
#include "LibSmbios.h"
EFI_STATUS
LibGetSmbiosSystemGuidAndSerialNumber (
IN EFI_GUID *SystemGuid,
OUT CHAR8 **SystemSerialNumber
)
{
EFI_STATUS Status;
SMBIOS_STRUCTURE_TABLE *SmbiosTable;
SMBIOS_STRUCTURE_POINTER Smbios;
SMBIOS_STRUCTURE_POINTER SmbiosEnd;
UINT16 Index;
/**
Return SMBIOS string given the string number.
Status = GetSystemConfigurationTable (&gEfiSmbiosTableGuid, (VOID **) &SmbiosTable);
if (EFI_ERROR (Status)) {
return EFI_NOT_FOUND;
}
@param[in] Smbios Pointer to SMBIOS structure.
@param[in] StringNumber String number to return. -1 is used to skip all strings and
point to the next SMBIOS structure.
Smbios.Hdr = (SMBIOS_HEADER *) ((UINTN) (SmbiosTable->TableAddress));
SmbiosEnd.Raw = (UINT8 *) ((UINTN) (SmbiosTable->TableAddress + SmbiosTable->TableLength));
for (Index = 0; Index < SmbiosTable->TableLength; Index++) {
if (Smbios.Hdr->Type == 1) {
if (Smbios.Hdr->Length < 0x19) {
//
// Older version did not support Guid and Serial number
//
continue;
}
//
// SMBIOS tables are byte packed so we need to do a byte copy to
// prevend alignment faults on Itanium-based platform.
//
CopyMem (SystemGuid, &Smbios.Type1->Uuid, sizeof (EFI_GUID));
*SystemSerialNumber = LibGetSmbiosString (&Smbios, Smbios.Type1->SerialNumber);
return EFI_SUCCESS;
}
//
// Make Smbios point to the next record
//
LibGetSmbiosString (&Smbios, (UINT16) (-1));
if (Smbios.Raw >= SmbiosEnd.Raw) {
//
// SMBIOS 2.1 incorrectly stated the length of SmbiosTable as 0x1e.
// given this we must double check against the lenght of
// the structure. My home PC has this bug.ruthard
//
return EFI_SUCCESS;
}
}
return EFI_SUCCESS;
}
CHAR8 *
@return Pointer to string, or pointer to next SMBIOS strcuture if StringNumber == -1
**/
CHAR8*
LibGetSmbiosString (
IN SMBIOS_STRUCTURE_POINTER *Smbios,
IN UINT16 StringNumber
)
/*++
Routine Description:
Return SMBIOS string given the string number.
Arguments:
Smbios - Pointer to SMBIOS structure
StringNumber - String number to return. -1 is used to skip all strings and
point to the next SMBIOS structure.
Returns:
Pointer to string, or pointer to next SMBIOS strcuture if StringNumber == -1
**/
{
UINT16 Index;
CHAR8 *String;

View File

@ -14,7 +14,7 @@
#include "../UefiShellDebug1CommandsLib.h"
#include "LibSmbiosView.h"
#include "smbiosview.h"
#include "SmbiosView.h"
#include "PrintInfo.h"
#include "QueryTable.h"
@ -32,6 +32,12 @@ STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
{NULL, TypeMax}
};
/**
Function for 'smbiosview' command.
@param[in] ImageHandle Handle to the Image (NULL if Internal).
@param[in] SystemTable Pointer to the System Table (NULL if Internal).
**/
SHELL_STATUS
EFIAPI
ShellCommandRunSmbiosView (
@ -197,7 +203,7 @@ SMBiosView (
// structure table head.
//
SMBIOS_STRUCTURE_POINTER pStruct;
SMBIOS_STRUCTURE_POINTER SmbiosStruct;
SMBIOS_STRUCTURE_TABLE *SMBiosTable;
SMBiosTable = NULL;
@ -269,14 +275,14 @@ SMBiosView (
break;
}
Offset = (UINT16) (Offset + Length);
pStruct.Raw = Buffer;
SmbiosStruct.Raw = Buffer;
//
// if QueryType==Random, print this structure.
// if QueryType!=Random, but Hdr->Type==QueryType, also print it.
// only if QueryType != Random and Hdr->Type != QueryType, skiped it.
//
if (QueryType != STRUCTURE_TYPE_RANDOM && pStruct.Hdr->Type != QueryType) {
if (QueryType != STRUCTURE_TYPE_RANDOM && SmbiosStruct.Hdr->Type != QueryType) {
continue;
}
@ -284,8 +290,8 @@ SMBiosView (
ShellPrintHiiEx(-1,-1,NULL,
STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_TYPE_HANDLE_DUMP_STRUCT),
gShellDebug1HiiHandle,
pStruct.Hdr->Type,
pStruct.Hdr->Handle
SmbiosStruct.Hdr->Type,
SmbiosStruct.Hdr->Handle
);
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_INDEX_LENGTH), gShellDebug1HiiHandle, Index, Length);
//
@ -312,12 +318,12 @@ SMBiosView (
//
// check structure legality
//
SmbiosCheckStructure (&pStruct);
SmbiosCheckStructure (&SmbiosStruct);
//
// Print structure information
//
SmbiosPrintStructure (&pStruct, gShowType);
SmbiosPrintStructure (&SmbiosStruct, gShowType);
ShellPrintEx(-1,-1,L"\n");
/*
@ -363,9 +369,9 @@ InitSmbiosTableStatistics (
UINT16 Offset;
UINT16 Index;
SMBIOS_STRUCTURE_POINTER pStruct;
SMBIOS_STRUCTURE_POINTER SmbiosStruct;
SMBIOS_STRUCTURE_TABLE *SMBiosTable;
STRUCTURE_STATISTICS *pStatistics;
STRUCTURE_STATISTICS *StatisticsPointer;
SMBiosTable = NULL;
LibSmbiosGetEPS (&SMBiosTable);
@ -394,7 +400,7 @@ InitSmbiosTableStatistics (
}
Offset = 0;
pStatistics = mStatisticsTable;
StatisticsPointer = mStatisticsTable;
//
// search from the first one
@ -415,19 +421,19 @@ InitSmbiosTableStatistics (
break;
}
pStruct.Raw = Buffer;
SmbiosStruct.Raw = Buffer;
Offset = (UINT16) (Offset + Length);
//
// general statistics
//
pStatistics->Index = Index;
pStatistics->Type = pStruct.Hdr->Type;
pStatistics->Handle = pStruct.Hdr->Handle;
pStatistics->Length = Length;
pStatistics->Addr = Offset;
StatisticsPointer->Index = Index;
StatisticsPointer->Type = SmbiosStruct.Hdr->Type;
StatisticsPointer->Handle = SmbiosStruct.Hdr->Handle;
StatisticsPointer->Length = Length;
StatisticsPointer->Addr = Offset;
pStatistics = &mStatisticsTable[Index];
StatisticsPointer = &mStatisticsTable[Index];
}
return EFI_SUCCESS;
@ -448,7 +454,7 @@ DisplayStatisticsTable (
{
UINTN Index;
UINTN Num;
STRUCTURE_STATISTICS *pStatistics;
STRUCTURE_STATISTICS *StatisticsPointer;
SMBIOS_STRUCTURE_TABLE *SMBiosTable;
SMBiosTable = NULL;
@ -477,22 +483,22 @@ DisplayStatisticsTable (
}
ShellPrintEx(-1,-1,L"============================================================\n");
pStatistics = &mStatisticsTable[0];
StatisticsPointer = &mStatisticsTable[0];
Num = SMBiosTable->NumberOfSmbiosStructures;
//
// display statistics table content
//
for (Index = 1; Index <= Num; Index++) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_INDEX), gShellDebug1HiiHandle, pStatistics->Index);
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_TYPE), gShellDebug1HiiHandle, pStatistics->Type);
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_HANDLE), gShellDebug1HiiHandle, pStatistics->Handle);
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_INDEX), gShellDebug1HiiHandle, StatisticsPointer->Index);
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_TYPE), gShellDebug1HiiHandle, StatisticsPointer->Type);
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_HANDLE), gShellDebug1HiiHandle, StatisticsPointer->Handle);
if (Option >= SHOW_DETAIL) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_OFFSET), gShellDebug1HiiHandle, pStatistics->Addr);
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_LENGTH), gShellDebug1HiiHandle, pStatistics->Length);
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_OFFSET), gShellDebug1HiiHandle, StatisticsPointer->Addr);
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_LENGTH), gShellDebug1HiiHandle, StatisticsPointer->Length);
}
ShellPrintEx(-1,-1,L"\n");
pStatistics = &mStatisticsTable[Index];
StatisticsPointer = &mStatisticsTable[Index];
/*
//
// Display 20 lines and wait for a page break

View File

@ -1,7 +1,7 @@
/** @file
Tools of clarify the content of the smbios table.
Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@ -12,8 +12,8 @@
**/
#ifndef _SMBIOS_VIEW_H
#define _SMBIOS_VIEW_H
#ifndef _SMBIOS_VIEW_H_
#define _SMBIOS_VIEW_H_
#define STRUCTURE_TYPE_RANDOM (UINT8) 0xFE
#define STRUCTURE_TYPE_INVALID (UINT8) 0xFF