From 187cb3dd8d665619ff489ad8a8dc58c6aeab5aec Mon Sep 17 00:00:00 2001 From: lzeng14 Date: Thu, 15 Mar 2012 08:29:49 +0000 Subject: Add SMBIOS 2.7.1 support to SmbiosView command. Signed-off-by: lzeng14 Reviewed-by: jcarsey git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13101 6f19259b-4bc3-4df7-8a09-765794883524 --- .../SmbiosView/LibSmbios.h | 645 -------------------- .../SmbiosView/LibSmbiosView.c | 204 +++---- .../SmbiosView/LibSmbiosView.h | 64 +- .../SmbiosView/PrintInfo.c | 657 +++++++++++++++++---- .../SmbiosView/PrintInfo.h | 68 ++- .../SmbiosView/QueryTable.c | 336 ++++++++++- .../SmbiosView/QueryTable.h | 52 +- .../UefiShellDebug1CommandsLib/SmbiosView/Smbios.c | 69 --- .../SmbiosView/SmbiosView.c | 66 +-- .../SmbiosView/SmbiosView.h | 4 +- .../SmbiosView/SmbiosViewStrings.uni | Bin 93274 -> 96884 bytes .../UefiShellDebug1CommandsLib.inf | 4 +- .../UefiShellDebug1CommandsLib.uni | Bin 151272 -> 152932 bytes 13 files changed, 1072 insertions(+), 1097 deletions(-) delete mode 100644 ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbios.h delete mode 100644 ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/Smbios.c (limited to 'ShellPkg/Library') diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbios.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbios.h deleted file mode 100644 index 4960587254..0000000000 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbios.h +++ /dev/null @@ -1,645 +0,0 @@ -/** @file - Lib include for SMBIOS services. Used to get system serial number and GUID - - Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.
- 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 - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#ifndef _LIB_SMBIOS_H_ -#define _LIB_SMBIOS_H_ - -// -// Define SMBIOS tables. -// -#pragma pack(1) - -typedef UINT8 SMBIOS_STRING; - -typedef struct { - UINT8 AnchorString[4]; - UINT8 EntryPointStructureChecksum; - UINT8 EntryPointLength; - UINT8 MajorVersion; - UINT8 MinorVersion; - UINT16 MaxStructureSize; - UINT8 EntryPointRevision; - UINT8 FormattedArea[5]; - UINT8 IntermediateAnchorString[5]; - UINT8 IntermediateChecksum; - UINT16 TableLength; - UINT32 TableAddress; - UINT16 NumberOfSmbiosStructures; - UINT8 SmbiosBcdRevision; -} SMBIOS_STRUCTURE_TABLE; - -// -// Please note that SMBIOS structures can be odd byte aligned since the -// unformated section of each record is a set of arbitrary size strings. -// -typedef struct { - UINT8 Type; - UINT8 Length; - UINT16 Handle; -} SMBIOS_HEADER; - -typedef struct { - SMBIOS_HEADER Hdr; - SMBIOS_STRING Vendor; - SMBIOS_STRING BiosVersion; - UINT16 BiosSegment; - SMBIOS_STRING BiosReleaseDate; - UINT8 BiosSize; - UINT64 BiosCharacteristics; - UINT8 BIOSCharacteristicsExtensionBytes[2]; - UINT8 SystemBiosMajorRelease; - UINT8 SystemBiosMinorRelease; - UINT8 EmbeddedControllerFirmwareMajorRelease; - UINT8 EmbeddedControllerFirmwareMinorRelease; -} SMBIOS_TYPE0; - -typedef struct { - SMBIOS_HEADER Hdr; - SMBIOS_STRING Manufacturer; - SMBIOS_STRING ProductName; - SMBIOS_STRING Version; - SMBIOS_STRING SerialNumber; - EFI_GUID Uuid; - UINT8 WakeUpType; - SMBIOS_STRING SKUNumber; - SMBIOS_STRING Family; -} SMBIOS_TYPE1; - -typedef struct { - SMBIOS_HEADER Hdr; - SMBIOS_STRING Manufacturer; - SMBIOS_STRING ProductName; - SMBIOS_STRING Version; - SMBIOS_STRING SerialNumber; - SMBIOS_STRING AssetTag; - UINT8 FeatureFlag; - SMBIOS_STRING LocationInChassis; - UINT16 ChassisHandle; - UINT8 BoardType; - UINT8 NumberOfContainedObjectHandles; - UINT16 ContainedObjectHandles[1]; -} SMBIOS_TYPE2; - -typedef struct { - UINT8 ContainedElementType; - UINT8 ContainedElementMinimum; - UINT8 ContainedElementMaximum; -} CONTAINED_ELEMENT; - -typedef struct { - SMBIOS_HEADER Hdr; - SMBIOS_STRING Manufacturer; - UINT8 Type; - SMBIOS_STRING Version; - SMBIOS_STRING SerialNumber; - SMBIOS_STRING AssetTag; - UINT8 BootupState; - UINT8 PowerSupplyState; - UINT8 ThermalState; - UINT8 SecurityStatus; - UINT8 OemDefined[4]; - UINT8 Height; - UINT8 NumberofPowerCords; - UINT8 ContainedElementCount; - UINT8 ContainedElementRecordLength; - CONTAINED_ELEMENT ContainedElements[1]; -} SMBIOS_TYPE3; - -typedef struct { - SMBIOS_HEADER Hdr; - UINT8 Socket; - UINT8 ProcessorType; - UINT8 ProcessorFamily; - SMBIOS_STRING ProcessorManufacture; - UINT8 ProcessorId[8]; - SMBIOS_STRING ProcessorVersion; - UINT8 Voltage; - UINT16 ExternalClock; - UINT16 MaxSpeed; - UINT16 CurrentSpeed; - UINT8 Status; - UINT8 ProcessorUpgrade; - UINT16 L1CacheHandle; - UINT16 L2CacheHandle; - UINT16 L3CacheHandle; - SMBIOS_STRING SerialNumber; - SMBIOS_STRING AssetTag; - SMBIOS_STRING PartNumber; - // - // Add for smbios 2.5 - // - UINT8 CoreCount; - UINT8 EnabledCoreCount; - UINT8 ThreadCount; - UINT16 ProcessorCharacteristics; - // - // Add for smbios 2.6 - // - UINT16 ProcessorFamily2; -} SMBIOS_TYPE4; - -typedef struct { - SMBIOS_HEADER Hdr; - UINT8 ErrDetectMethod; - UINT8 ErrCorrectCapability; - UINT8 SupportInterleave; - UINT8 CurrentInterleave; - UINT8 MaxMemoryModuleSize; - UINT16 SupportSpeed; - UINT16 SupportMemoryType; - UINT8 MemoryModuleVoltage; - UINT8 AssociatedMemorySlotNum; - UINT16 MemoryModuleConfigHandles[1]; -} SMBIOS_TYPE5; - -typedef struct { - SMBIOS_HEADER Hdr; - SMBIOS_STRING SocketDesignation; - UINT8 BankConnections; - UINT8 CurrentSpeed; - UINT16 CurrentMemoryType; - UINT8 InstalledSize; - UINT8 EnabledSize; - UINT8 ErrorStatus; -} SMBIOS_TYPE6; - -typedef struct { - SMBIOS_HEADER Hdr; - SMBIOS_STRING SocketDesignation; - UINT16 CacheConfiguration; - UINT16 MaximumCacheSize; - UINT16 InstalledSize; - UINT16 SupportedSRAMType; - UINT16 CurrentSRAMType; - UINT8 CacheSpeed; - UINT8 ErrorCorrectionType; - UINT8 SystemCacheType; - UINT8 Associativity; -} SMBIOS_TYPE7; - -typedef struct { - SMBIOS_HEADER Hdr; - SMBIOS_STRING InternalReferenceDesignator; - UINT8 InternalConnectorType; - SMBIOS_STRING ExternalReferenceDesignator; - UINT8 ExternalConnectorType; - UINT8 PortType; -} SMBIOS_TYPE8; - -typedef struct { - SMBIOS_HEADER Hdr; - SMBIOS_STRING SlotDesignation; - UINT8 SlotType; - UINT8 SlotDataBusWidth; - UINT8 CurrentUsage; - UINT8 SlotLength; - UINT16 SlotID; - UINT8 SlotCharacteristics1; - UINT8 SlotCharacteristics2; - // - // Add for smbios 2.6 - // - UINT16 SegmentGroupNum; - UINT8 BusNum; - UINT8 DevFuncNum; -} SMBIOS_TYPE9; - -typedef struct _DEVICE_STRUCTURE { - UINT8 DeviceType; - SMBIOS_STRING DescriptionString; -} DEVICE_STRUCTURE; - -typedef struct { - SMBIOS_HEADER Hdr; - DEVICE_STRUCTURE Device[1]; -} SMBIOS_TYPE10; - -typedef struct { - SMBIOS_HEADER Hdr; - UINT8 StringCount; -} SMBIOS_TYPE11; - -typedef struct { - SMBIOS_HEADER Hdr; - UINT8 StringCount; -} SMBIOS_TYPE12; - -typedef struct { - SMBIOS_HEADER Hdr; - UINT8 InstallableLanguages; - UINT8 Flags; - UINT8 Reserved[15]; - SMBIOS_STRING CurrentLanguages; -} SMBIOS_TYPE13; - -typedef struct { - SMBIOS_HEADER Hdr; - SMBIOS_STRING GroupName; - UINT8 ItemType; - UINT16 ItemHandle; -} SMBIOS_TYPE14; - -typedef struct EVENTLOGTYPE { - UINT8 LogType; - UINT8 DataFormatType; -} EVENTLOGTYPE; - -typedef struct { - SMBIOS_HEADER Hdr; - UINT16 LogAreaLength; - UINT16 LogHeaderStartOffset; - UINT16 LogDataStartOffset; - UINT8 AccessMethod; - UINT8 LogStatus; - UINT32 LogChangeToken; - UINT32 AccessMethodAddress; - UINT8 LogHeaderFormat; - UINT8 NumberOfSupportedLogTypeDescriptors; - UINT8 LengthOfLogTypeDescriptor; - EVENTLOGTYPE EventLogTypeDescriptors[1]; -} SMBIOS_TYPE15; - -typedef struct { - SMBIOS_HEADER Hdr; - UINT8 Location; - UINT8 Use; - UINT8 MemoryErrorCorrection; - UINT32 MaximumCapacity; - UINT16 MemoryErrorInformationHandle; - UINT16 NumberOfMemoryDevices; -} SMBIOS_TYPE16; - -typedef struct { - SMBIOS_HEADER Hdr; - UINT16 MemoryArrayHandle; - UINT16 MemoryErrorInformationHandle; - UINT16 TotalWidth; - UINT16 DataWidth; - UINT16 Size; - UINT8 FormFactor; - UINT8 DeviceSet; - SMBIOS_STRING DeviceLocator; - SMBIOS_STRING BankLocator; - UINT8 MemoryType; - UINT16 TypeDetail; - UINT16 Speed; - SMBIOS_STRING Manufacturer; - SMBIOS_STRING SerialNumber; - SMBIOS_STRING AssetTag; - SMBIOS_STRING PartNumber; - // - // Add for smbios 2.6 - // - UINT8 Attributes; -} SMBIOS_TYPE17; - -typedef struct { - SMBIOS_HEADER Hdr; - UINT8 ErrorType; - UINT8 ErrorGranularity; - UINT8 ErrorOperation; - UINT32 VendorSyndrome; - UINT32 MemoryArrayErrorAddress; - UINT32 DeviceErrorAddress; - UINT32 ErrorResolution; -} SMBIOS_TYPE18; - -typedef struct { - SMBIOS_HEADER Hdr; - UINT32 StartingAddress; - UINT32 EndingAddress; - UINT16 MemoryArrayHandle; - UINT8 PartitionWidth; - // - // Add for smbios 2.7 - // - UINT64 ExtendedStartingAddress; - UINT64 ExtendedEndingAddress; -} SMBIOS_TYPE19; - -typedef struct { - SMBIOS_HEADER Hdr; - UINT32 StartingAddress; - UINT32 EndingAddress; - UINT16 MemoryDeviceHandle; - UINT16 MemoryArrayMappedAddressHandle; - UINT8 PartitionRowPosition; - UINT8 InterleavePosition; - UINT8 InterleavedDataDepth; -} SMBIOS_TYPE20; - -typedef struct { - SMBIOS_HEADER Hdr; - UINT8 Type; - UINT8 Interface; - UINT8 NumberOfButtons; -} SMBIOS_TYPE21; - -typedef struct { - SMBIOS_HEADER Hdr; - SMBIOS_STRING Location; - SMBIOS_STRING Manufacturer; - SMBIOS_STRING ManufactureDate; - SMBIOS_STRING SerialNumber; - SMBIOS_STRING DeviceName; - UINT8 DeviceChemistry; - UINT16 DeviceCapacity; - UINT16 DesignVoltage; - SMBIOS_STRING SBDSVersionNumber; - UINT8 MaximumErrorInBatteryData; - UINT16 SBDSSerialNumber; - UINT16 SBDSManufactureDate; - SMBIOS_STRING SBDSDeviceChemistry; - UINT8 DesignCapacityMultiplier; - UINT32 OEMSpecific; -} SMBIOS_TYPE22; - -typedef struct { - SMBIOS_HEADER Hdr; - UINT8 Capabilities; - UINT16 ResetCount; - UINT16 ResetLimit; - UINT16 TimerInterval; - UINT16 Timeout; -} SMBIOS_TYPE23; - -typedef struct { - SMBIOS_HEADER Hdr; - UINT8 HardwareSecuritySettings; -} SMBIOS_TYPE24; - -typedef struct { - SMBIOS_HEADER Hdr; - UINT8 NextScheduledPowerOnMonth; - UINT8 NextScheduledPowerOnDayOfMonth; - UINT8 NextScheduledPowerOnHour; - UINT8 NextScheduledPowerOnMinute; - UINT8 NextScheduledPowerOnSecond; -} SMBIOS_TYPE25; - -typedef struct { - SMBIOS_HEADER Hdr; - SMBIOS_STRING Description; - UINT8 LocationAndStatus; - UINT16 MaximumValue; - UINT16 MinimumValue; - UINT16 Resolution; - UINT16 Tolerance; - UINT16 Accuracy; - UINT32 OEMDefined; - UINT16 NominalValue; -} SMBIOS_TYPE26; - -typedef struct { - SMBIOS_HEADER Hdr; - UINT16 TemperatureProbeHandle; - UINT8 DeviceTypeAndStatus; - UINT8 CoolingUnitGroup; - UINT32 OEMDefined; - UINT16 NominalSpeed; -} SMBIOS_TYPE27; - -typedef struct { - SMBIOS_HEADER Hdr; - SMBIOS_STRING Description; - UINT8 LocationAndStatus; - UINT16 MaximumValue; - UINT16 MinimumValue; - UINT16 Resolution; - UINT16 Tolerance; - UINT16 Accuracy; - UINT32 OEMDefined; - UINT16 NominalValue; -} SMBIOS_TYPE28; - -typedef struct { - SMBIOS_HEADER Hdr; - SMBIOS_STRING Description; - UINT8 LocationAndStatus; - UINT16 MaximumValue; - UINT16 MinimumValue; - UINT16 Resolution; - UINT16 Tolerance; - UINT16 Accuracy; - UINT32 OEMDefined; - UINT16 NominalValue; -} SMBIOS_TYPE29; - -typedef struct { - SMBIOS_HEADER Hdr; - SMBIOS_STRING ManufacturerName; - UINT8 Connections; -} SMBIOS_TYPE30; - -typedef struct { - SMBIOS_HEADER Hdr; - UINT8 Checksum; - UINT8 Reserved1; - UINT16 Reserved2; - UINT32 BisEntry16; - UINT32 BisEntry32; - UINT64 Reserved3; - UINT32 Reserved4; -} SMBIOS_TYPE31; - -typedef struct { - SMBIOS_HEADER Hdr; - UINT8 Reserved[6]; - UINT8 BootStatus[1]; -} SMBIOS_TYPE32; - -typedef struct { - SMBIOS_HEADER Hdr; - UINT8 ErrorType; - UINT8 ErrorGranularity; - UINT8 ErrorOperation; - UINT32 VendorSyndrome; - UINT64 MemoryArrayErrorAddress; - UINT64 DeviceErrorAddress; - UINT32 ErrorResolution; -} SMBIOS_TYPE33; - -typedef struct { - SMBIOS_HEADER Hdr; - SMBIOS_STRING Description; - UINT8 Type; - UINT32 Address; - UINT8 AddressType; -} SMBIOS_TYPE34; - -typedef struct { - SMBIOS_HEADER Hdr; - SMBIOS_STRING Description; - UINT16 ManagementDeviceHandle; - UINT16 ComponentHandle; - UINT16 ThresholdHandle; -} SMBIOS_TYPE35; - -typedef struct { - SMBIOS_HEADER Hdr; - UINT16 LowerThresholdNonCritical; - UINT16 UpperThresholdNonCritical; - UINT16 LowerThresholdCritical; - UINT16 UpperThresholdCritical; - UINT16 LowerThresholdNonRecoverable; - UINT16 UpperThresholdNonRecoverable; -} SMBIOS_TYPE36; - -typedef struct MEMORYDEVICE { - UINT8 DeviceLoad; - UINT16 DeviceHandle; -} MEMORYDEVICE; - -typedef struct { - SMBIOS_HEADER Hdr; - UINT8 ChannelType; - UINT8 MaximumChannelLoad; - UINT8 MemoryDeviceCount; - MEMORYDEVICE MemoryDevice[1]; -} SMBIOS_TYPE37; - -typedef struct { - SMBIOS_HEADER Hdr; - UINT8 InterfaceType; - UINT8 IPMISpecificationRevision; - UINT8 I2CSlaveAddress; - UINT8 NVStorageDeviceAddress; - UINT64 BaseAddress; -} SMBIOS_TYPE38; - -typedef struct { - SMBIOS_HEADER Hdr; - UINT8 PowerUnitGroup; - SMBIOS_STRING Location; - SMBIOS_STRING DeviceName; - SMBIOS_STRING Manufacturer; - SMBIOS_STRING SerialNumber; - SMBIOS_STRING AssetTagNumber; - SMBIOS_STRING ModelPartNumber; - SMBIOS_STRING RevisionLevel; - UINT16 MaxPowerCapacity; - UINT16 PowerSupplyCharacteristics; - UINT16 InputVoltageProbeHandle; - UINT16 CoolingDeviceHandle; - UINT16 InputCurrentProbeHandle; -} SMBIOS_TYPE39; - -// -// Add type 40 and type 41 for smbios 2.6 -// -typedef struct { - UINT8 EntryLength; - UINT16 ReferencedHandle; - UINT8 ReferencedOffset; - SMBIOS_STRING EntryString; - UINT8 Value[1]; -} ADDITIONAL_INFORMATION_ENTRY; - -typedef struct { - SMBIOS_HEADER Hdr; - UINT8 NumberOfAdditionalInformationEntries; - ADDITIONAL_INFORMATION_ENTRY AdditionalInfoEntries[1]; -} SMBIOS_TYPE40; - -typedef struct { - SMBIOS_HEADER Hdr; - SMBIOS_STRING ReferenceDesignation; - UINT8 DeviceType; - UINT8 DeviceTypeInstance; - UINT16 SegmentGroupNum; - UINT8 BusNum; - UINT8 DevFuncNum; -} SMBIOS_TYPE41; - -typedef struct { - SMBIOS_HEADER Hdr; -} SMBIOS_TYPE126; - -typedef struct { - SMBIOS_HEADER Hdr; -} SMBIOS_TYPE127; - -/* - Notes: - Among the following 42 type of structues for SMBIOS Stucture table, - There are only 11 Types(0,1,3,4,7,9,16,17,19,20,32) are required, - The other types is optional. -*/ -typedef union { - SMBIOS_HEADER *Hdr; - SMBIOS_TYPE0 *Type0; - SMBIOS_TYPE1 *Type1; - SMBIOS_TYPE2 *Type2; - SMBIOS_TYPE3 *Type3; - SMBIOS_TYPE4 *Type4; - SMBIOS_TYPE5 *Type5; - SMBIOS_TYPE6 *Type6; - SMBIOS_TYPE7 *Type7; - SMBIOS_TYPE8 *Type8; - SMBIOS_TYPE9 *Type9; - SMBIOS_TYPE10 *Type10; - SMBIOS_TYPE11 *Type11; - SMBIOS_TYPE12 *Type12; - SMBIOS_TYPE13 *Type13; - SMBIOS_TYPE14 *Type14; - SMBIOS_TYPE15 *Type15; - SMBIOS_TYPE16 *Type16; - SMBIOS_TYPE17 *Type17; - SMBIOS_TYPE18 *Type18; - SMBIOS_TYPE19 *Type19; - SMBIOS_TYPE20 *Type20; - SMBIOS_TYPE21 *Type21; - SMBIOS_TYPE22 *Type22; - SMBIOS_TYPE23 *Type23; - SMBIOS_TYPE24 *Type24; - SMBIOS_TYPE25 *Type25; - SMBIOS_TYPE26 *Type26; - SMBIOS_TYPE27 *Type27; - SMBIOS_TYPE28 *Type28; - SMBIOS_TYPE29 *Type29; - SMBIOS_TYPE30 *Type30; - SMBIOS_TYPE31 *Type31; - SMBIOS_TYPE32 *Type32; - SMBIOS_TYPE33 *Type33; - SMBIOS_TYPE34 *Type34; - SMBIOS_TYPE35 *Type35; - SMBIOS_TYPE36 *Type36; - SMBIOS_TYPE37 *Type37; - SMBIOS_TYPE38 *Type38; - SMBIOS_TYPE39 *Type39; - SMBIOS_TYPE40 *Type40; - SMBIOS_TYPE41 *Type41; - SMBIOS_TYPE126 *Type126; - SMBIOS_TYPE127 *Type127; - UINT8 *Raw; -} SMBIOS_STRUCTURE_POINTER; - -#pragma pack() - -/** - 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 - ); - -#endif diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.c index ed73a584bd..23a46d3fe1 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.c @@ -1,7 +1,7 @@ /** @file API for SMBIOS table. - Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.
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 @@ -15,12 +15,11 @@ #include "../UefiShellDebug1CommandsLib.h" #include -#include "LibSmbios.h" #include "LibSmbiosView.h" #include "SmbiosView.h" STATIC UINT8 mInit = 0; -STATIC SMBIOS_STRUCTURE_TABLE *mSmbiosTable = NULL; +STATIC SMBIOS_TABLE_ENTRY_POINT *mSmbiosTable = NULL; STATIC SMBIOS_STRUCTURE_POINTER m_SmbiosStruct; STATIC SMBIOS_STRUCTURE_POINTER *mSmbiosStruct = &m_SmbiosStruct; @@ -90,7 +89,7 @@ LibSmbiosCleanup ( **/ VOID LibSmbiosGetEPS ( - OUT SMBIOS_STRUCTURE_TABLE **EntryPointStructure + OUT SMBIOS_TABLE_ENTRY_POINT **EntryPointStructure ) { // @@ -100,27 +99,77 @@ LibSmbiosGetEPS ( } /** - Get SMBIOS structure given the Handle,copy data to the Buffer, + Return SMBIOS string for the given 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 + ) +{ + UINT16 Index; + CHAR8 *String; + + ASSERT (Smbios != NULL); + + // + // Skip over formatted section + // + String = (CHAR8 *) (Smbios->Raw + Smbios->Hdr->Length); + + // + // Look through unformated section + // + for (Index = 1; Index <= StringNumber; Index++) { + if (StringNumber == Index) { + return String; + } + // + // Skip string + // + for (; *String != 0; String++); + String++; + + if (*String == 0) { + // + // If double NULL then we are done. + // Return pointer to next structure in Smbios. + // if you pass in a -1 you will always get here + // + Smbios->Raw = (UINT8 *)++String; + return NULL; + } + } + + return NULL; +} + +/** + Get SMBIOS structure for the given Handle, Handle is changed to the next handle or 0xFFFF when the end is reached or the handle is not found. @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. + @param[out] Buffer The pointer to the pointer to the structure. + @param[out] Length Length of the structure. - @retval DMI_SUCCESS Buffer contains the required structure data - Handle is updated with next structure handle or + @retval DMI_SUCCESS 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 + @retval DMI_INVALID_HANDLE Handle is updated with first structure handle or 0xFFFF(end-of-list). **/ EFI_STATUS LibGetSmbiosStructure ( IN OUT UINT16 *Handle, - IN OUT UINT8 *Buffer, + OUT UINT8 **Buffer, OUT UINT16 *Length ) { @@ -128,13 +177,13 @@ LibGetSmbiosStructure ( SMBIOS_STRUCTURE_POINTER SmbiosEnd; UINT8 *Raw; - if (*Handle == INVALIDE_HANDLE) { + if (*Handle == INVALID_HANDLE) { *Handle = mSmbiosStruct->Hdr->Handle; return DMI_INVALID_HANDLE; } - if (Buffer == NULL) { - ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_LIBSMBIOSVIEW_NO_BUFF_SPEC), gShellDebug1HiiHandle); + if ((Buffer == NULL) || (Length == NULL)) { + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_LIBSMBIOSVIEW_NO_BUFF_LEN_SPEC), gShellDebug1HiiHandle); return DMI_INVALID_HANDLE; } @@ -152,14 +201,14 @@ LibGetSmbiosStructure ( // Length = Next structure head - this structure head // *Length = (UINT16) (Smbios.Raw - Raw); - CopyMem (Buffer, Raw, *Length); + *Buffer = Raw; // // update with the next structure handle. // if (Smbios.Raw < SmbiosEnd.Raw) { *Handle = Smbios.Hdr->Handle; } else { - *Handle = INVALIDE_HANDLE; + *Handle = INVALID_HANDLE; } return DMI_SUCCESS; } @@ -169,126 +218,7 @@ LibGetSmbiosStructure ( LibGetSmbiosString (&Smbios, (UINT16) (-1)); } - *Handle = INVALIDE_HANDLE; + *Handle = INVALID_HANDLE; 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 - ) -{ - // - // If key != value, then error. - // -#define CHECK_VALUE(key, value) (((key) == (value)) ? EFI_SUCCESS : DMI_BAD_PARAMETER) - - EFI_STATUS Status; - // - // Assume staus is EFI_SUCCESS, - // but if check is error, then EFI_ERROR. - // - Status = EFI_SUCCESS; - - switch (Smbios->Hdr->Type) { - case 0: - break; - - case 1: - if (Smbios->Type1->Hdr.Length == 0x08 || Smbios->Type0->Hdr.Length == 0x19) { - Status = EFI_SUCCESS; - } else { - Status = DMI_BAD_PARAMETER; - } - break; - - case 2: - Status = CHECK_VALUE (Smbios->Type2->Hdr.Length, 0x08); - break; - - case 6: - Status = CHECK_VALUE (Smbios->Type6->Hdr.Length, 0x0C); - break; - - case 11: - Status = CHECK_VALUE (Smbios->Type11->Hdr.Length, 0x05); - break; - - case 12: - Status = CHECK_VALUE (Smbios->Type12->Hdr.Length, 0x05); - break; - - case 13: - Status = CHECK_VALUE (Smbios->Type13->Hdr.Length, 0x16); - break; - - case 16: - Status = CHECK_VALUE (Smbios->Type16->Hdr.Length, 0x0F); - break; - - case 19: - Status = CHECK_VALUE (Smbios->Type19->Hdr.Length, 0x0F); - break; - - case 20: - Status = CHECK_VALUE (Smbios->Type20->Hdr.Length, 0x13); - break; - - case 32: - // - // Because EFI_SUCCESS == 0, - // So errors added up is also error. - // - Status = CHECK_VALUE (Smbios->Type32->Reserved[0], 0x00) + - CHECK_VALUE (Smbios->Type32->Reserved[1], 0x00) + - CHECK_VALUE (Smbios->Type32->Reserved[2], 0x00) + - CHECK_VALUE (Smbios->Type32->Reserved[3], 0x00) + - CHECK_VALUE (Smbios->Type32->Reserved[4], 0x00) + - CHECK_VALUE (Smbios->Type32->Reserved[5], 0x00); - break; - - default: - Status = DMI_BAD_PARAMETER; - } - - 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, - IN UINT16 StringNumber, - OUT CHAR8 *Buffer - ) -{ - CHAR8 *String; - if (Buffer == NULL) { - ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_LIBSMBIOSVIEW_NO_BUF_SPEC_WHEN_STRUCT), gShellDebug1HiiHandle); - return ; - } - // - // Get string and copy to buffer. - // Caller should provide the buffer. - // - String = LibGetSmbiosString (Smbios, StringNumber); - if (String != NULL) { - CopyMem (Buffer, String, AsciiStrLen(String)); - } else { - Buffer = NULL; - } -} diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.h index 5a9b2ad626..f953296bd9 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.h +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.h @@ -1,7 +1,7 @@ /** @file API for SMBIOS Plug and Play functions, access to SMBIOS table and structures. - Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.
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 @@ -15,7 +15,7 @@ #ifndef _LIB_SMBIOS_VIEW_H_ #define _LIB_SMBIOS_VIEW_H_ -#include "LibSmbios.h" +#include #define DMI_SUCCESS 0x00 #define DMI_UNKNOWN_FUNCTION 0x81 @@ -30,7 +30,7 @@ #define DMI_CURRENTLY_LOCKED 0x91 #define DMI_INVALID_LOCK 0x92 -#define INVALIDE_HANDLE (UINT16) (-1) +#define INVALID_HANDLE (UINT16) (-1) #define EFI_SMBIOSERR(val) EFIERR (0x30000 | val) @@ -64,59 +64,45 @@ LibSmbiosCleanup ( **/ VOID LibSmbiosGetEPS ( - OUT SMBIOS_STRUCTURE_TABLE **EntryPointStructure + OUT SMBIOS_TABLE_ENTRY_POINT **EntryPointStructure ); /** - Get SMBIOS structure given the Handle,copy data to the Buffer, + Return SMBIOS string for the given 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 + ); + +/** + Get SMBIOS structure for the given Handle, Handle is changed to the next handle or 0xFFFF when the end is reached or the handle is not found. @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. + @param[out] Buffer The pointer to the pointer to the structure. + @param[out] Length Length of the structure. - @retval DMI_SUCCESS Buffer contains the required structure data - Handle is updated with next structure handle or + @retval DMI_SUCCESS 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 + @retval DMI_INVALID_HANDLE Handle is updated with first structure handle or 0xFFFF(end-of-list). **/ EFI_STATUS LibGetSmbiosStructure ( IN OUT UINT16 *Handle, - IN OUT UINT8 *Buffer, + OUT UINT8 **Buffer, OUT UINT16 *Length ); -/** - 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, - IN UINT16 StringNumber, - 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 - ); - #endif diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c index feaf91065f..3aea96b6e0 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c @@ -1,7 +1,7 @@ /** @file Module for clarifying the content of the smbios structure element information. - Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.
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 @@ -24,26 +24,30 @@ // #define BIT(value, bit) ((value) & ((UINT64) 1) << (bit)) +// +// Check if above or equal to version +// +#define AE_SMBIOS_VERSION(MajorVersion, MinorVersion) \ + (SmbiosMajorVersion > (MajorVersion) || (SmbiosMajorVersion == (MajorVersion) && SmbiosMinorVersion >= (MinorVersion))) + // ////////////////////////////////////////////////////////// // Macros of print structure element, simplify coding. // #define PRINT_PENDING_STRING(pStruct, type, element) \ do { \ - CHAR8 StringBuf[64]; \ - SetMem (StringBuf, sizeof (StringBuf), 0x00); \ - SmbiosGetPendingString ((pStruct), (pStruct->type->element), StringBuf); \ + CHAR8 *StringBuf; \ + StringBuf = LibGetSmbiosString ((pStruct), (pStruct->type->element)); \ ShellPrintEx(-1,-1,L"%a",#element); \ - ShellPrintEx(-1,-1,L": %a\n", StringBuf); \ + ShellPrintEx(-1,-1,L": %a\n", (StringBuf != NULL) ? StringBuf: ""); \ } while (0); #define PRINT_SMBIOS_STRING(pStruct, stringnumber, element) \ do { \ - CHAR8 StringBuf[64]; \ - SetMem (StringBuf, sizeof (StringBuf), 0x00); \ - SmbiosGetPendingString ((pStruct), (stringnumber), StringBuf); \ + CHAR8 *StringBuf; \ + StringBuf = LibGetSmbiosString ((pStruct), (stringnumber)); \ ShellPrintEx(-1,-1,L"%a",#element); \ - ShellPrintEx(-1,-1,L": %a\n", StringBuf); \ + ShellPrintEx(-1,-1,L": %a\n", (StringBuf != NULL) ? StringBuf: ""); \ } while (0); #define PRINT_STRUCT_VALUE(pStruct, type, element) \ @@ -129,8 +133,8 @@ MemToString ( **/ VOID SmbiosPrintEPSInfo ( - IN SMBIOS_STRUCTURE_TABLE *SmbiosTable, - IN UINT8 Option + IN SMBIOS_TABLE_ENTRY_POINT *SmbiosTable, + IN UINT8 Option ) { UINT8 Anchor[5]; @@ -213,8 +217,6 @@ SmbiosPrintStructure ( UINT8 Index; UINT8 *Buffer; - Buffer = (UINT8 *) (UINTN) (Struct->Raw); - if (Struct == NULL) { return EFI_INVALID_PARAMETER; } @@ -222,6 +224,9 @@ SmbiosPrintStructure ( if (Option == SHOW_NONE) { return EFI_SUCCESS; } + + Buffer = (UINT8 *) (UINTN) (Struct->Raw); + // // Display structure header // @@ -235,7 +240,7 @@ SmbiosPrintStructure ( switch (Struct->Hdr->Type) { // - // + // BIOS Information (Type 0) // case 0: PRINT_PENDING_STRING (Struct, Type0, Vendor); @@ -244,35 +249,22 @@ SmbiosPrintStructure ( PRINT_PENDING_STRING (Struct, Type0, BiosReleaseDate); ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIOS_SIZE), gShellDebug1HiiHandle, 64 * (Struct->Type0->BiosSize + 1)); - if (Option < SHOW_DETAIL) { - PRINT_STRUCT_VALUE_H (Struct, Type0, BiosCharacteristics); - } else { - DisplayBiosCharacteristics (Struct->Type0->BiosCharacteristics, Option); - - // - // The length of above format part is 0x12 bytes, - // Ext bytes are following, size = 'len-0x12'. - // If len-0x12 > 0, then - // there are extension bytes (Byte1, byte2, byte3...) - // And byte3 not stated in spec, so dump all extension bytes(1, 2, 3..) - // - if ((Buffer[1] - (CHAR8) 0x12) > 0) { - DisplayBiosCharacteristicsExt1 (Buffer[0x12], Option); - } + DisplayBiosCharacteristics (*(UINT64 *) &(Struct->Type0->BiosCharacteristics), Option); - if ((Buffer[1] - (CHAR8) 0x12) > 1) { - DisplayBiosCharacteristicsExt2 (Buffer[0x13], Option); - } + if (Struct->Hdr->Length > 0x12) { + DisplayBiosCharacteristicsExt1 (Struct->Type0->BIOSCharacteristicsExtensionBytes[0], Option); + } + if (Struct->Hdr->Length > 0x13) { + DisplayBiosCharacteristicsExt2 (Struct->Type0->BIOSCharacteristicsExtensionBytes[1], Option); + } - if ((Buffer[1] - (CHAR8) 0x12) > 2) { - PRINT_BIT_FIELD ( - Struct, - Type0, - BiosCharacteristics, - Buffer[1] - (CHAR8) 0x12 - ); - } + if (AE_SMBIOS_VERSION (0x2, 0x4) && (Struct->Hdr->Length > 0x14)) { + PRINT_STRUCT_VALUE (Struct, Type0, SystemBiosMajorRelease); + PRINT_STRUCT_VALUE (Struct, Type0, SystemBiosMinorRelease); + PRINT_STRUCT_VALUE (Struct, Type0, EmbeddedControllerFirmwareMajorRelease); + PRINT_STRUCT_VALUE (Struct, Type0, EmbeddedControllerFirmwareMinorRelease); } + break; // @@ -285,13 +277,28 @@ SmbiosPrintStructure ( PRINT_PENDING_STRING (Struct, Type1, SerialNumber); PRINT_BIT_FIELD (Struct, Type1, Uuid, 16); DisplaySystemWakeupType (Struct->Type1->WakeUpType, Option); + if (AE_SMBIOS_VERSION (0x2, 0x4) && (Struct->Hdr->Length > 0x19)) { + PRINT_PENDING_STRING (Struct, Type1, SKUNumber); + PRINT_PENDING_STRING (Struct, Type1, Family); + } + break; + // + // Baseboard Information (Type 2) + // case 2: PRINT_PENDING_STRING (Struct, Type2, Manufacturer); PRINT_PENDING_STRING (Struct, Type2, ProductName); PRINT_PENDING_STRING (Struct, Type2, Version); PRINT_PENDING_STRING (Struct, Type2, SerialNumber); + if (Struct->Hdr->Length > 0x8) { + PRINT_PENDING_STRING (Struct, Type2, AssetTag); + DisplayBaseBoardFeatureFlags (*(UINT8 *) &Struct->Type2->FeatureFlag, Option); + PRINT_PENDING_STRING (Struct, Type2, LocationInChassis); + PRINT_STRUCT_VALUE_H (Struct, Type2, ChassisHandle); + DisplayBaseBoardBoardType (Struct->Type2->BoardType, Option); + } break; // @@ -312,7 +319,9 @@ SmbiosPrintStructure ( DisplaySystemEnclosureStatus (Struct->Type3->ThermalState, Option); ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SECURITY_STATUS), gShellDebug1HiiHandle); DisplaySESecurityStatus (Struct->Type3->SecurityStatus, Option); - PRINT_BIT_FIELD (Struct, Type3, OemDefined, 4); + if (AE_SMBIOS_VERSION (0x2, 0x3) && (Struct->Hdr->Length > 0xD)) { + PRINT_BIT_FIELD (Struct, Type3, OemDefined, 4); + } break; // @@ -321,7 +330,7 @@ SmbiosPrintStructure ( case 4: PRINT_PENDING_STRING (Struct, Type4, Socket); DisplayProcessorType (Struct->Type4->ProcessorType, Option); - if ((SmbiosMajorVersion > 0x2 || (SmbiosMajorVersion == 0x2 && SmbiosMinorVersion >= 0x6)) && + if (AE_SMBIOS_VERSION (0x2, 0x6) && (Struct->Hdr->Length > 0x28) && (Struct->Type4->ProcessorFamily == 0xFE)) { // // Get family from ProcessorFamily2 field @@ -333,7 +342,7 @@ SmbiosPrintStructure ( PRINT_PENDING_STRING (Struct, Type4, ProcessorManufacture); PRINT_BIT_FIELD (Struct, Type4, ProcessorId, 8); PRINT_PENDING_STRING (Struct, Type4, ProcessorVersion); - DisplayProcessorVoltage (Struct->Type4->Voltage, Option); + DisplayProcessorVoltage (*(UINT8 *) &(Struct->Type4->Voltage), Option); PRINT_STRUCT_VALUE (Struct, Type4, ExternalClock); PRINT_STRUCT_VALUE (Struct, Type4, MaxSpeed); PRINT_STRUCT_VALUE (Struct, Type4, CurrentSpeed); @@ -342,14 +351,16 @@ SmbiosPrintStructure ( PRINT_STRUCT_VALUE_H (Struct, Type4, L1CacheHandle); PRINT_STRUCT_VALUE_H (Struct, Type4, L2CacheHandle); PRINT_STRUCT_VALUE_H (Struct, Type4, L3CacheHandle); - PRINT_PENDING_STRING (Struct, Type4, SerialNumber); - PRINT_PENDING_STRING (Struct, Type4, AssetTag); - PRINT_PENDING_STRING (Struct, Type4, PartNumber); - if (SmbiosMajorVersion > 0x2 || (SmbiosMajorVersion == 0x2 && SmbiosMinorVersion >= 0x5)) { + if (AE_SMBIOS_VERSION (0x2, 0x3) && (Struct->Hdr->Length > 0x20)) { + PRINT_PENDING_STRING (Struct, Type4, SerialNumber); + PRINT_PENDING_STRING (Struct, Type4, AssetTag); + PRINT_PENDING_STRING (Struct, Type4, PartNumber); + } + if (AE_SMBIOS_VERSION (0x2, 0x5) && (Struct->Hdr->Length > 0x23)) { PRINT_STRUCT_VALUE (Struct, Type4, CoreCount); PRINT_STRUCT_VALUE (Struct, Type4, EnabledCoreCount); PRINT_STRUCT_VALUE (Struct, Type4, ThreadCount); - PRINT_STRUCT_VALUE_H (Struct, Type4, ProcessorCharacteristics); + DisplayProcessorCharacteristics (Struct->Type4->ProcessorCharacteristics, Option); } break; @@ -362,13 +373,13 @@ SmbiosPrintStructure ( SlotNum = Struct->Type5->AssociatedMemorySlotNum; DisplayMcErrorDetectMethod (Struct->Type5->ErrDetectMethod, Option); - DisplayMcErrorCorrectCapability (Struct->Type5->ErrCorrectCapability, Option); + DisplayMcErrorCorrectCapability (*(UINT8 *) &(Struct->Type5->ErrCorrectCapability), Option); ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SUPOPRT), gShellDebug1HiiHandle); DisplayMcInterleaveSupport (Struct->Type5->SupportInterleave, Option); ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CURRENT), gShellDebug1HiiHandle); DisplayMcInterleaveSupport (Struct->Type5->CurrentInterleave, Option); DisplayMaxMemoryModuleSize (Struct->Type5->MaxMemoryModuleSize, SlotNum, Option); - DisplayMcMemorySpeeds (Struct->Type5->SupportSpeed, Option); + DisplayMcMemorySpeeds (*(UINT16 *) &(Struct->Type5->SupportSpeed), Option); DisplayMmMemoryType (Struct->Type5->SupportMemoryType, Option); DisplayMemoryModuleVoltage (Struct->Type5->MemoryModuleVoltage, Option); PRINT_STRUCT_VALUE (Struct, Type5, AssociatedMemorySlotNum); @@ -387,11 +398,11 @@ SmbiosPrintStructure ( PRINT_PENDING_STRING (Struct, Type6, SocketDesignation); DisplayMmBankConnections (Struct->Type6->BankConnections, Option); PRINT_STRUCT_VALUE (Struct, Type6, CurrentSpeed); - DisplayMmMemoryType (Struct->Type6->CurrentMemoryType, Option); + DisplayMmMemoryType (*(UINT16 *) &(Struct->Type6->CurrentMemoryType), Option); ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INSTALLED), gShellDebug1HiiHandle); - DisplayMmMemorySize (Struct->Type6->InstalledSize, Option); + DisplayMmMemorySize (*(UINT8 *) &(Struct->Type6->InstalledSize), Option); ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ENABLED), gShellDebug1HiiHandle); - DisplayMmMemorySize (Struct->Type6->EnabledSize, Option); + DisplayMmMemorySize (*(UINT8 *) &(Struct->Type6->EnabledSize), Option); DisplayMmErrorStatus (Struct->Type6->ErrorStatus, Option); break; @@ -400,12 +411,12 @@ SmbiosPrintStructure ( // case 7: PRINT_PENDING_STRING (Struct, Type7, SocketDesignation); - PRINT_STRUCT_VALUE_H (Struct, Type7, CacheConfiguration); + DisplayCacheConfiguration (Struct->Type7->CacheConfiguration, Option); PRINT_STRUCT_VALUE_H (Struct, Type7, MaximumCacheSize); PRINT_STRUCT_VALUE_H (Struct, Type7, InstalledSize); PRINT_STRUCT_VALUE_H (Struct, Type7, SupportedSRAMType); PRINT_STRUCT_VALUE_H (Struct, Type7, CurrentSRAMType); - DisplayCacheSRAMType (Struct->Type7->CurrentSRAMType, Option); + DisplayCacheSRAMType (*(UINT16 *) &(Struct->Type7->CurrentSRAMType), Option); PRINT_STRUCT_VALUE_H (Struct, Type7, CacheSpeed); DisplayCacheErrCorrectingType (Struct->Type7->ErrorCorrectionType, Option); DisplayCacheSystemCacheType (Struct->Type7->SystemCacheType, Option); @@ -439,9 +450,9 @@ SmbiosPrintStructure ( Struct->Type9->SlotType, Option ); - DisplaySlotCharacteristics1 (Struct->Type9->SlotCharacteristics1, Option); - DisplaySlotCharacteristics2 (Struct->Type9->SlotCharacteristics2, Option); - if (SmbiosMajorVersion > 0x2 || (SmbiosMajorVersion == 0x2 && SmbiosMinorVersion >= 0x6)) { + DisplaySlotCharacteristics1 (*(UINT8 *) &(Struct->Type9->SlotCharacteristics1), Option); + DisplaySlotCharacteristics2 (*(UINT8 *) &(Struct->Type9->SlotCharacteristics2), Option); + if (AE_SMBIOS_VERSION (0x2, 0x6) && (Struct->Hdr->Length > 0xD)) { PRINT_STRUCT_VALUE_H (Struct, Type9, SegmentGroupNum); PRINT_STRUCT_VALUE_H (Struct, Type9, BusNum); PRINT_STRUCT_VALUE_H (Struct, Type9, DevFuncNum); @@ -454,15 +465,18 @@ SmbiosPrintStructure ( case 10: { UINTN NumOfDevice; - NumOfDevice = (Struct->Type10->Hdr.Length - sizeof (SMBIOS_HEADER)) / (2 * sizeof (UINT8)); + NumOfDevice = (Struct->Type10->Hdr.Length - sizeof (SMBIOS_STRUCTURE)) / (2 * sizeof (UINT8)); for (Index = 0; Index < NumOfDevice; Index++) { DisplayOnboardDeviceTypes (Struct->Type10->Device[Index].DeviceType, Option); ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DESC_STRING), gShellDebug1HiiHandle); - ShellPrintEx(-1,-1,L"%a",LibGetSmbiosString (Struct, Struct->Type10->Device[Index].DescriptionString)); + ShellPrintEx(-1,-1,L"%a\n",LibGetSmbiosString (Struct, Struct->Type10->Device[Index].DescriptionString)); } } break; + // + // Oem Strings (Type 11) + // case 11: PRINT_STRUCT_VALUE (Struct, Type11, StringCount); for (Index = 1; Index <= Struct->Type11->StringCount; Index++) { @@ -470,6 +484,9 @@ SmbiosPrintStructure ( } break; + // + // System Configuration Options (Type 12) + // case 12: PRINT_STRUCT_VALUE (Struct, Type12, StringCount); for (Index = 1; Index <= Struct->Type12->StringCount; Index++) { @@ -477,6 +494,9 @@ SmbiosPrintStructure ( } break; + // + // BIOS Language Information (Type 13) + // case 13: PRINT_STRUCT_VALUE (Struct, Type13, InstallableLanguages); PRINT_STRUCT_VALUE (Struct, Type13, Flags); @@ -484,10 +504,19 @@ SmbiosPrintStructure ( PRINT_PENDING_STRING (Struct, Type13, CurrentLanguages); break; + // + // Group Associations (Type 14) + // case 14: - PRINT_PENDING_STRING (Struct, Type14, GroupName); - PRINT_STRUCT_VALUE (Struct, Type14, ItemType); - PRINT_STRUCT_VALUE (Struct, Type14, ItemHandle); + { + UINT8 NumOfItem; + NumOfItem = (Struct->Type14->Hdr.Length - 5) / 3; + PRINT_PENDING_STRING (Struct, Type14, GroupName); + for (Index = 0; Index < NumOfItem; Index++) { + ShellPrintEx(-1,-1,L"ItemType %d: %d\n", Index + 1, Struct->Type14->Group[Index].ItemType); + ShellPrintEx(-1,-1,L"ItemHandle %d: %d\n", Index + 1, Struct->Type14->Group[Index].ItemHandle); + } + } break; // @@ -495,9 +524,9 @@ SmbiosPrintStructure ( // case 15: { - EVENTLOGTYPE *Ptr; - UINT8 Count; - UINT8 *AccessMethodAddress; + EVENT_LOG_TYPE *Ptr; + UINT8 Count; + UINT8 *AccessMethodAddress; PRINT_STRUCT_VALUE_H (Struct, Type15, LogAreaLength); PRINT_STRUCT_VALUE_H (Struct, Type15, LogHeaderStartOffset); @@ -562,9 +591,9 @@ SmbiosPrintStructure ( AccessMethodAddress + Struct->Type15->LogDataStartOffset, (UINT16) ( - Struct->Type15->LogAreaLength - - (Struct->Type15->LogDataStartOffset - Struct->Type15->LogDataStartOffset) - ) + Struct->Type15->LogAreaLength - + (Struct->Type15->LogDataStartOffset - Struct->Type15->LogHeaderStartOffset) + ) ); } @@ -585,6 +614,9 @@ SmbiosPrintStructure ( PRINT_STRUCT_VALUE_H (Struct, Type16, MaximumCapacity); PRINT_STRUCT_VALUE_H (Struct, Type16, MemoryErrorInformationHandle); PRINT_STRUCT_VALUE_H (Struct, Type16, NumberOfMemoryDevices); + if (AE_SMBIOS_VERSION (0x2, 0x7) && Struct->Hdr->Length > 0xF) { + PRINT_STRUCT_VALUE_LH (Struct, Type16, ExtendedMaximumCapacity); + } break; // @@ -601,15 +633,19 @@ SmbiosPrintStructure ( PRINT_PENDING_STRING (Struct, Type17, DeviceLocator); PRINT_PENDING_STRING (Struct, Type17, BankLocator); DisplayMemoryDeviceType (Struct->Type17->MemoryType, Option); - DisplayMemoryDeviceTypeDetail (Struct->Type17->TypeDetail, Option); + DisplayMemoryDeviceTypeDetail (*(UINT16 *) &(Struct->Type17->TypeDetail), Option); PRINT_STRUCT_VALUE_H (Struct, Type17, Speed); PRINT_PENDING_STRING (Struct, Type17, Manufacturer); PRINT_PENDING_STRING (Struct, Type17, SerialNumber); PRINT_PENDING_STRING (Struct, Type17, AssetTag); PRINT_PENDING_STRING (Struct, Type17, PartNumber); - if (SmbiosMajorVersion > 0x2 || (SmbiosMajorVersion == 0x2 && SmbiosMinorVersion >= 0x6)) { + if (AE_SMBIOS_VERSION (0x2, 0x6) && (Struct->Hdr->Length > 0x1B)) { PRINT_STRUCT_VALUE_H (Struct, Type17, Attributes); } + if (AE_SMBIOS_VERSION (0x2, 0x7) && (Struct->Hdr->Length > 0x1C)) { + PRINT_STRUCT_VALUE (Struct, Type17, ExtendedSize); + PRINT_STRUCT_VALUE (Struct, Type17, ConfiguredMemoryClockSpeed); + } break; // @@ -636,15 +672,14 @@ SmbiosPrintStructure ( PRINT_STRUCT_VALUE_H (Struct, Type19, EndingAddress); PRINT_STRUCT_VALUE_H (Struct, Type19, MemoryArrayHandle); PRINT_STRUCT_VALUE_H (Struct, Type19, PartitionWidth); - if (Struct->Hdr->Length >= 0x19) { - // SMBIOS 2.7+ + if (AE_SMBIOS_VERSION (0x2, 0x7) && (Struct->Hdr->Length > 0xF)) { PRINT_STRUCT_VALUE_LH (Struct, Type19, ExtendedStartingAddress); PRINT_STRUCT_VALUE_LH (Struct, Type19, ExtendedEndingAddress); } break; // - // Memory Device Mapped Address (Type 20) + // Memory Device Mapped Address (Type 20) // case 20: PRINT_STRUCT_VALUE_H (Struct, Type20, StartingAddress); @@ -654,10 +689,14 @@ SmbiosPrintStructure ( PRINT_STRUCT_VALUE_H (Struct, Type20, PartitionRowPosition); PRINT_STRUCT_VALUE_H (Struct, Type20, InterleavePosition); PRINT_STRUCT_VALUE_H (Struct, Type20, InterleavedDataDepth); + if (AE_SMBIOS_VERSION (0x2, 0x7) && (Struct->Hdr->Length > 0x13)) { + PRINT_STRUCT_VALUE_LH (Struct, Type19, ExtendedStartingAddress); + PRINT_STRUCT_VALUE_LH (Struct, Type19, ExtendedEndingAddress); + } break; // - // Built-in Pointing Device (Type 21) + // Built-in Pointing Device (Type 21) // case 21: DisplayPointingDeviceType (Struct->Type21->Type, Option); @@ -666,7 +705,7 @@ SmbiosPrintStructure ( break; // - // Portable Battery (Type 22) + // Portable Battery (Type 22) // case 22: PRINT_PENDING_STRING (Struct, Type22, Location); @@ -692,6 +731,9 @@ SmbiosPrintStructure ( PRINT_STRUCT_VALUE_H (Struct, Type22, OEMSpecific); break; + // + // System Reset (Type 23) + // case 23: DisplaySystemResetCapabilities ( Struct->Type23->Capabilities, @@ -703,6 +745,9 @@ SmbiosPrintStructure ( PRINT_STRUCT_VALUE_H (Struct, Type23, Timeout); break; + // + // Hardware Security (Type 24) + // case 24: DisplayHardwareSecuritySettings ( Struct->Type24->HardwareSecuritySettings, @@ -710,6 +755,9 @@ SmbiosPrintStructure ( ); break; + // + // System Power Controls (Type 25) + // case 25: PRINT_STRUCT_VALUE_H (Struct, Type25, NextScheduledPowerOnMonth); PRINT_STRUCT_VALUE_H (Struct, Type25, NextScheduledPowerOnDayOfMonth); @@ -718,10 +766,13 @@ SmbiosPrintStructure ( PRINT_STRUCT_VALUE_H (Struct, Type25, NextScheduledPowerOnSecond); break; + // + // Voltage Probe (Type 26) + // case 26: PRINT_PENDING_STRING (Struct, Type26, Description); - DisplayVPLocation (Struct->Type26->LocationAndStatus, Option); - DisplayVPStatus (Struct->Type26->LocationAndStatus, Option); + DisplayVPLocation (*(UINT8 *) &(Struct->Type26->LocationAndStatus), Option); + DisplayVPStatus (*(UINT8 *) &(Struct->Type26->LocationAndStatus), Option); PRINT_STRUCT_VALUE_H (Struct, Type26, MaximumValue); PRINT_STRUCT_VALUE_H (Struct, Type26, MinimumValue); PRINT_STRUCT_VALUE_H (Struct, Type26, Resolution); @@ -731,19 +782,28 @@ SmbiosPrintStructure ( PRINT_STRUCT_VALUE_H (Struct, Type26, NominalValue); break; + // + // Cooling Device (Type 27) + // case 27: PRINT_STRUCT_VALUE_H (Struct, Type27, TemperatureProbeHandle); - DisplayCoolingDeviceStatus (Struct->Type27->DeviceTypeAndStatus, Option); - DisplayCoolingDeviceType (Struct->Type27->DeviceTypeAndStatus, Option); + DisplayCoolingDeviceStatus (*(UINT8 *) &(Struct->Type27->DeviceTypeAndStatus), Option); + DisplayCoolingDeviceType (*(UINT8 *) &(Struct->Type27->DeviceTypeAndStatus), Option); PRINT_STRUCT_VALUE_H (Struct, Type27, CoolingUnitGroup); PRINT_STRUCT_VALUE_H (Struct, Type27, OEMDefined); PRINT_STRUCT_VALUE_H (Struct, Type27, NominalSpeed); + if (AE_SMBIOS_VERSION (0x2, 0x7) && (Struct->Hdr->Length > 0xE)) { + PRINT_PENDING_STRING (Struct, Type27, Description); + } break; + // + // Temperature Probe (Type 28) + // case 28: PRINT_PENDING_STRING (Struct, Type28, Description); - DisplayTemperatureProbeStatus (Struct->Type28->LocationAndStatus, Option); - DisplayTemperatureProbeLoc (Struct->Type28->LocationAndStatus, Option); + DisplayTemperatureProbeStatus (*(UINT8 *) &(Struct->Type28->LocationAndStatus), Option); + DisplayTemperatureProbeLoc (*(UINT8 *) &(Struct->Type28->LocationAndStatus), Option); PRINT_STRUCT_VALUE_H (Struct, Type28, MaximumValue); PRINT_STRUCT_VALUE_H (Struct, Type28, MinimumValue); PRINT_STRUCT_VALUE_H (Struct, Type28, Resolution); @@ -753,10 +813,13 @@ SmbiosPrintStructure ( PRINT_STRUCT_VALUE_H (Struct, Type28, NominalValue); break; + // + // Electrical Current Probe (Type 29) + // case 29: PRINT_PENDING_STRING (Struct, Type29, Description); - DisplayECPStatus (Struct->Type29->LocationAndStatus, Option); - DisplayECPLoc (Struct->Type29->LocationAndStatus, Option); + DisplayECPStatus (*(UINT8 *) &(Struct->Type29->LocationAndStatus), Option); + DisplayECPLoc (*(UINT8 *) &(Struct->Type29->LocationAndStatus), Option); PRINT_STRUCT_VALUE_H (Struct, Type29, MaximumValue); PRINT_STRUCT_VALUE_H (Struct, Type29, MinimumValue); PRINT_STRUCT_VALUE_H (Struct, Type29, Resolution); @@ -766,20 +829,32 @@ SmbiosPrintStructure ( PRINT_STRUCT_VALUE_H (Struct, Type29, NominalValue); break; + // + // Out-of-Band Remote Access (Type 30) + // case 30: PRINT_PENDING_STRING (Struct, Type30, ManufacturerName); DisplayOBRAConnections (Struct->Type30->Connections, Option); break; + // + // Boot Integrity Services (BIS) Entry Point (Type 31) + // case 31: ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_STRUCT_TYPE31), gShellDebug1HiiHandle); break; + // + // System Boot Information (Type 32) + // case 32: PRINT_BIT_FIELD (Struct, Type32, Reserved, 6); - DisplaySystemBootStatus (Struct->Type32->BootStatus[0], Option); + DisplaySystemBootStatus (Struct->Type32->BootStatus, Option); break; + // + // 64-Bit Memory Error Information (Type 33) + // case 33: DisplayMemoryErrorType (Struct->Type33->ErrorType, Option); DisplayMemoryErrorGranularity ( @@ -788,21 +863,24 @@ SmbiosPrintStructure ( ); DisplayMemoryErrorOperation (Struct->Type33->ErrorOperation, Option); PRINT_STRUCT_VALUE_H (Struct, Type33, VendorSyndrome); - PRINT_STRUCT_VALUE_H (Struct, Type33, MemoryArrayErrorAddress); - PRINT_STRUCT_VALUE_H (Struct, Type33, DeviceErrorAddress); + PRINT_STRUCT_VALUE_LH (Struct, Type33, MemoryArrayErrorAddress); + PRINT_STRUCT_VALUE_LH (Struct, Type33, DeviceErrorAddress); PRINT_STRUCT_VALUE_H (Struct, Type33, ErrorResolution); break; // - // Management Device (Type 34) + // Management Device (Type 34) // case 34: PRINT_PENDING_STRING (Struct, Type34, Description); DisplayMDType (Struct->Type34->Type, Option); PRINT_STRUCT_VALUE_H (Struct, Type34, Address); - PRINT_STRUCT_VALUE_H (Struct, Type34, AddressType); + DisplayMDAddressType (Struct->Type34->AddressType, Option); break; + // + // Management Device Component (Type 35) + // case 35: PRINT_PENDING_STRING (Struct, Type35, Description); PRINT_STRUCT_VALUE_H (Struct, Type35, ManagementDeviceHandle); @@ -810,6 +888,9 @@ SmbiosPrintStructure ( PRINT_STRUCT_VALUE_H (Struct, Type35, ThresholdHandle); break; + // + // Management Device Threshold Data (Type 36) + // case 36: PRINT_STRUCT_VALUE_H (Struct, Type36, LowerThresholdNonCritical); PRINT_STRUCT_VALUE_H (Struct, Type36, UpperThresholdNonCritical); @@ -820,12 +901,12 @@ SmbiosPrintStructure ( break; // - // Memory Channel (Type 37) + // Memory Channel (Type 37) // case 37: { - UINT8 Count; - MEMORYDEVICE *Ptr; + UINT8 Count; + MEMORY_DEVICE *Ptr; DisplayMemoryChannelType (Struct->Type37->ChannelType, Option); PRINT_STRUCT_VALUE_H (Struct, Type37, MaximumChannelLoad); PRINT_STRUCT_VALUE_H (Struct, Type37, MemoryDeviceCount); @@ -834,21 +915,21 @@ SmbiosPrintStructure ( Ptr = Struct->Type37->MemoryDevice; for (Index = 0; Index < Count; Index++) { ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MEM_DEVICE), gShellDebug1HiiHandle, Index + 1); - ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DEV_LOAD), gShellDebug1HiiHandle, Ptr->DeviceLoad); - ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DEV_HANDLE), gShellDebug1HiiHandle, Ptr->DeviceHandle); + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DEV_LOAD), gShellDebug1HiiHandle, Ptr[Index].DeviceLoad); + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DEV_HANDLE), gShellDebug1HiiHandle, Ptr[Index].DeviceHandle); } } break; // - // IPMI Device Information (Type 38) + // IPMI Device Information (Type 38) // case 38: DisplayIPMIDIBMCInterfaceType (Struct->Type38->InterfaceType, Option); PRINT_STRUCT_VALUE_H (Struct, Type38, IPMISpecificationRevision); PRINT_STRUCT_VALUE_H (Struct, Type38, I2CSlaveAddress); PRINT_STRUCT_VALUE_H (Struct, Type38, NVStorageDeviceAddress); - PRINT_STRUCT_VALUE_H (Struct, Type38, BaseAddress); + PRINT_STRUCT_VALUE_LH (Struct, Type38, BaseAddress); break; // @@ -865,7 +946,7 @@ SmbiosPrintStructure ( PRINT_PENDING_STRING (Struct, Type39, RevisionLevel); PRINT_STRUCT_VALUE_H (Struct, Type39, MaxPowerCapacity); DisplaySPSCharacteristics ( - Struct->Type39->PowerSupplyCharacteristics, + *(UINT16 *) &(Struct->Type39->PowerSupplyCharacteristics), Option ); PRINT_STRUCT_VALUE_H (Struct, Type39, InputVoltageProbeHandle); @@ -905,17 +986,31 @@ SmbiosPrintStructure ( // case 41: PRINT_PENDING_STRING (Struct, Type41, ReferenceDesignation); - PRINT_STRUCT_VALUE_H (Struct, Type41, DeviceType); + ShellPrintEx(-1,-1,(((Struct->Type41->DeviceType) & 0x80) != 0) ? L"Device Enabled\n": L"Device Disabled\n"); + DisplayOnboardDeviceTypes ((Struct->Type41->DeviceType) & 0x7F, Option); PRINT_STRUCT_VALUE_H (Struct, Type41, DeviceTypeInstance); PRINT_STRUCT_VALUE_H (Struct, Type41, SegmentGroupNum); PRINT_STRUCT_VALUE_H (Struct, Type41, BusNum); PRINT_STRUCT_VALUE_H (Struct, Type41, DevFuncNum); break; + // + // Management Controller Host Interface (Type 42) + // + case 42: + PRINT_STRUCT_VALUE_H (Struct, Type42, InterfaceType); + break; + + // + // Inactive (Type 126) + // case 126: ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INACTIVE_STRUCT), gShellDebug1HiiHandle); break; + // + // End-of-Table (Type 127) + // case 127: ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_THIS_STRUCT_END_TABLE), gShellDebug1HiiHandle); break; @@ -1168,7 +1263,24 @@ DisplayBiosCharacteristicsExt2 ( ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_FUNCTION_KEY_INIT), gShellDebug1HiiHandle); } - ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BITS_RSVD_FOR_FUTURE), gShellDebug1HiiHandle); + if (AE_SMBIOS_VERSION (0x2, 0x4)) { + if (BIT (byte2, 2) != 0) { + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ENABLE_TAR_CONT_DIST), gShellDebug1HiiHandle); + } + if (AE_SMBIOS_VERSION (0x2, 0x7)) { + if (BIT (byte2, 3) != 0) { + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UEFI_SPEC_SUPPORT), gShellDebug1HiiHandle); + } + if (BIT (byte2, 4) != 0) { + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_VIRTUAL_MACHINE), gShellDebug1HiiHandle); + } + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BITS_RSVD_FOR_FUTURE), gShellDebug1HiiHandle, 5); + } else { + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BITS_RSVD_FOR_FUTURE), gShellDebug1HiiHandle, 3); + } + } else { + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BITS_RSVD_FOR_FUTURE), gShellDebug1HiiHandle, 2); + } } /** @@ -1268,6 +1380,18 @@ DisplayProcessorFamily ( ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_M1_FAMILY), gShellDebug1HiiHandle); break; + case 0x13: + Print (L"M2 Family\n"); + break; + + case 0x14: + Print (L"Intel Celeron M\n"); + break; + + case 0x15: + Print (L"Intel Pentium 4 HT\n"); + break; + case 0x18: Print (L"AMD Duron\n"); break; @@ -1276,6 +1400,30 @@ DisplayProcessorFamily ( ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_K5_FAMILY), gShellDebug1HiiHandle); break; + case 0x1A: + Print (L"K6 Family\n"); + break; + + case 0x1B: + Print (L"K6-2\n"); + break; + + case 0x1C: + Print (L"K6-3\n"); + break; + + case 0x1D: + Print (L"AMD Althon Processor Family\n"); + break; + + case 0x1E: + Print (L"AMD 29000 Family\n"); + break; + + case 0x1F: + Print (L"K6-2+\n"); + break; + case 0x20: ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_POWER_PC_FAMILY), gShellDebug1HiiHandle); break; @@ -1356,6 +1504,34 @@ DisplayProcessorFamily ( Print (L"Alpha 21364\n"); break; + case 0x38: + Print (L"AMD Turion II Ultra Dual-Core Mobile M Processor Family\n"); + break; + + case 0x39: + Print (L"AMD Turion II Dual-Core Mobile M Processor Family\n"); + break; + + case 0x3A: + Print (L"AMD Althon II Dual-Core M Processor Family\n"); + break; + + case 0x3B: + Print (L"AMD Opteron 6100 Series Processor\n"); + break; + + case 0x3C: + Print (L"AMD Opteron 4100 Series Processor\n"); + break; + + case 0x3D: + Print (L"AMD Opteron 6200 Series Processor\n"); + break; + + case 0x3E: + Print (L"AMD Opteron 4200 Series Processor\n"); + break; + case 0x40: ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MIPS_FAMILY), gShellDebug1HiiHandle); break; @@ -1380,6 +1556,22 @@ DisplayProcessorFamily ( Print (L"MIPS R10000\n"); break; + case 0x46: + Print (L"AMD C-Series Processor\n"); + break; + + case 0x47: + Print (L"AMD E-Series Processor\n"); + break; + + case 0x48: + Print (L"AMD S-Series Processor\n"); + break; + + case 0x49: + Print (L"AMD G-Series Processor\n"); + break; + case 0x50: ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SPARC_FAMILY), gShellDebug1HiiHandle); break; @@ -1520,6 +1712,30 @@ DisplayProcessorFamily ( ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PA_RISC_FAMILY), gShellDebug1HiiHandle); break; + case 0x91: + Print (L"PA-RISC 8500\n"); + break; + + case 0x92: + Print (L"PA-RISC 8000\n"); + break; + + case 0x93: + Print (L"PA-RISC 7300LC\n"); + break; + + case 0x94: + Print (L"PA-RISC 7200\n"); + break; + + case 0x95: + Print (L"PA-RISC 7100LC\n"); + break; + + case 0x96: + Print (L"PA-RISC 7100\n"); + break; + case 0xA0: ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_V30_FAMILY), gShellDebug1HiiHandle); break; @@ -1588,6 +1804,62 @@ DisplayProcessorFamily ( ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PENTIUM_III_XEON), gShellDebug1HiiHandle); break; + case 0xB1: + Print (L"Pentium III Processorwith Intel SpeedStep Technology\n"); + break; + + case 0xB2: + Print (L"Pentium 4 processor\n"); + break; + + case 0xB3: + Print (L"Intel Xeon Processor\n"); + break; + + case 0xB4: + Print (L"AS400 Family\n"); + break; + + case 0xB5: + Print (L"Intel Xeon processor MP\n"); + break; + + case 0xB6: + Print (L"AMD Althon XP Processor Family\n"); + break; + + case 0xB7: + Print (L"AMD Althon MP Promcessor Family\n"); + break; + + case 0xB8: + Print (L"Intel Itanium 2 processor\n"); + break; + + case 0xB9: + Print (L"Intel Penium M processor\n"); + break; + + case 0xBA: + Print (L"Intel Celeron D processor\n"); + break; + + case 0xBB: + Print (L"Intel Pentium D processor\n"); + break; + + case 0xBC: + Print (L"Intel Pentium Processor Extreme Edition\n"); + break; + + case 0xBD: + Print (L"Intel Core Solo Processor\n"); + break; + + case 0xBF: + Print (L"Intel Core 2 Duo Processor\n"); + break; + case 0xC0: ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_CORE2_SOLO), gShellDebug1HiiHandle); break; @@ -1640,6 +1912,14 @@ DisplayProcessorFamily ( Print (L"zArchitectur\n"); break; + case 0xCD: + Print (L"Intel Core i5 processor\n"); + break; + + case 0xCE: + Print (L"Intel Core i3 processor\n"); + break; + case 0xD2: Print (L"ViaC7M\n"); break; @@ -1688,6 +1968,10 @@ DisplayProcessorFamily ( ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_7_SERIES_MULTI_CORE), gShellDebug1HiiHandle); break; + case 0xE0: + Print (L"Multi-Core Intel Xeon processor 3400 Series\n"); + break; + case 0xE6: ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_EMBEDDED_OPTERON_QUAD_CORE), gShellDebug1HiiHandle); break; @@ -1712,6 +1996,22 @@ DisplayProcessorFamily ( ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_SEMPRON_SI), gShellDebug1HiiHandle); break; + case 0xEC: + Print (L"AMD Phenom II Processor Family\n"); + break; + + case 0xED: + Print (L"AMD Althon II Processor Family\n"); + break; + + case 0xEE: + Print (L"Six-Core AMD Opteron Processor Family\n"); + break; + + case 0xEF: + Print (L"AMD Sempron M Processor Family\n"); + break; + case 0xFA: Print (L"i860\n"); break; @@ -1721,21 +2021,7 @@ DisplayProcessorFamily ( break; default: - // - // In order to reduce code quality notice of - // case & break not pair, so - // move multiple case into the else part and - // use if/else to check value. - // - if (Family >= 0x13 && Family <= 0x17) { - ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_RSVD_FOR_SPEC_M1), gShellDebug1HiiHandle); - } else if (Family >= 0x1A && Family <= 0x1F) { - ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_RSVD_FOR_SPEC_K5), gShellDebug1HiiHandle); - } else if (Family >= 0xB1 && Family <= 0xBF) { - ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_RSVD_FOR_SPEC_PENTIUM), gShellDebug1HiiHandle); - } else { - ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNDEFINED_PROC_FAMILY), gShellDebug1HiiHandle); - } + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNDEFINED_PROC_FAMILY), gShellDebug1HiiHandle); } // // end switch @@ -1888,11 +2174,11 @@ DisplayProcessorVoltage ( @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 +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 @@ -1913,13 +2199,13 @@ DisplayProcessorStatus ( PRINT_INFO_OPTION (Status, Option); if (BIT (Status, 7) != 0) { - ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ERROR_BIT7), gShellDebug1HiiHandle); + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT7_NOT_ZERO), gShellDebug1HiiHandle); } else if (BIT (Status, 5) != 0) { - ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ERROR_BIT5), gShellDebug1HiiHandle); + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT5_NOT_ZERO), gShellDebug1HiiHandle); } else if (BIT (Status, 4) != 0) { - ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ERROR_BIT4), gShellDebug1HiiHandle); + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT4_NOT_ZERO), gShellDebug1HiiHandle); } else if (BIT (Status, 3) != 0) { - ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ERROR_BIT3), gShellDebug1HiiHandle); + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT3_NOT_ZERO), gShellDebug1HiiHandle); } // // Check BIT 6 @@ -2111,6 +2397,123 @@ DisplayMmMemorySize ( } } +/** + Display Cache Configuration. + + @param[in] CacheConfiguration Cache 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.) + + @param[in] Option The option +**/ +VOID +DisplayCacheConfiguration ( + IN UINT16 CacheConfiguration, + IN UINT8 Option + ) +{ + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CACHE_CONFIGURATION), gShellDebug1HiiHandle); + PRINT_INFO_OPTION (CacheConfiguration, Option); + + if (BIT (CacheConfiguration, 15) != 0) { + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT15_NOT_ZERO), gShellDebug1HiiHandle); + } else if (BIT (CacheConfiguration, 14) != 0) { + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT14_NOT_ZERO), gShellDebug1HiiHandle); + } else if (BIT (CacheConfiguration, 13) != 0) { + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT13_NOT_ZERO), gShellDebug1HiiHandle); + } else if (BIT (CacheConfiguration, 12) != 0) { + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT12_NOT_ZERO), gShellDebug1HiiHandle); + } else if (BIT (CacheConfiguration, 11) != 0) { + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT11_NOT_ZERO), gShellDebug1HiiHandle); + } else if (BIT (CacheConfiguration, 10) != 0) { + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT10_NOT_ZERO), gShellDebug1HiiHandle); + } else if (BIT (CacheConfiguration, 4) != 0) { + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT4_NOT_ZERO), gShellDebug1HiiHandle); + } + + // + // Check BITs 9:8 + // + switch ((CacheConfiguration & 0x300) >> 8) { + case 0: + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CACHE_WRITE_THROUGH), gShellDebug1HiiHandle); + break; + + case 1: + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CACHE_WRITE_BACK), gShellDebug1HiiHandle); + break; + + case 2: + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CACHE_VARIES_WITH_MEM_ADDR), gShellDebug1HiiHandle); + break; + + case 3: + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNKNOWN), gShellDebug1HiiHandle); + break; + } + + // + // Check BIT 7 + // + if (BIT (CacheConfiguration, 7) != 0) { + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ENABLED), gShellDebug1HiiHandle); + } else { + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DISABLED), gShellDebug1HiiHandle); + } + + // + // Check BITs 6:5 + // + switch ((CacheConfiguration & 0x60) >> 5) { + case 0: + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CACHE_INTERNAL), gShellDebug1HiiHandle); + break; + + case 1: + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CACHE_EXTERNAL), gShellDebug1HiiHandle); + break; + + case 2: + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_RESERVED), gShellDebug1HiiHandle); + break; + + case 3: + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNKNOWN), gShellDebug1HiiHandle); + break; + } + + // + // Check BIT 3 + // + if (BIT (CacheConfiguration, 3) != 0) { + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CACHE_SOCKETED), gShellDebug1HiiHandle); + } else { + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CACHE_NOT_SOCKETED), gShellDebug1HiiHandle); + } + + + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CACHE_LEVEL), gShellDebug1HiiHandle, (CacheConfiguration & 0x07) + 1); +} + /** 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 @@ -2185,7 +2588,7 @@ DisplaySystemSlotId ( break; default: - if (SlotType >= 0x0E && SlotType <= 0x12) { + if ((SlotType >= 0x0E && SlotType <= 0x12) || (SlotType >= 0xA6 && SlotType <= 0xB6)){ ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_VALUE_PRESENT), gShellDebug1HiiHandle, SlotId); } else { ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNDEFINED_SLOT_ID), gShellDebug1HiiHandle); @@ -2272,14 +2675,14 @@ DisplaySBDSManufactureDate ( // Print date // Day = Date & 0x001F; - Month = (Date & 0x00E0) >> 5; - Year = ((Date & 0xFF00) >> 8) + 1980; + Month = (Date & 0x01E0) >> 5; + Year = ((Date & 0xFE00) >> 9) + 1980; ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MONTH_DAY_YEAR), gShellDebug1HiiHandle, Day, Month, Year); } /** - Display System Reset (Type 23) information. + Display System Reset (Type 23) information. Identifies the system-reset capabilities for the system. diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.h index d9bf3b687d..d24aeb96cc 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.h +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.h @@ -1,7 +1,7 @@ /** @file Module to clarify the element info of the smbios structure. - Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.
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 @@ -15,7 +15,7 @@ #ifndef _SMBIOS_PRINT_INFO_H_ #define _SMBIOS_PRINT_INFO_H_ -#include "LibSmbios.h" +#include extern UINT8 SmbiosMajorVersion; extern UINT8 SmbiosMinorVersion; @@ -42,8 +42,8 @@ extern UINT8 SmbiosMinorVersion; **/ VOID SmbiosPrintEPSInfo ( - IN SMBIOS_STRUCTURE_TABLE *SmbiosTable, - IN UINT8 Option + IN SMBIOS_TABLE_ENTRY_POINT *SmbiosTable, + IN UINT8 Option ); /** @@ -154,19 +154,19 @@ DisplayProcessorVoltage ( 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 +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 @param[in] Option The option **/ @@ -236,6 +236,40 @@ DisplayMmMemorySize ( IN UINT8 Option ); +/** + Display Cache Configuration. + + @param[in] CacheConfiguration Cache 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.) + + @param[in] Option The option +**/ +VOID +DisplayCacheConfiguration ( + IN UINT16 CacheConfiguration, + 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 diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c index 64997284b0..b6f3847992 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c @@ -2,7 +2,7 @@ Build a table, each item is (Key, Info) pair. And give a interface of query a string out of a table. - Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.
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 @@ -52,10 +52,88 @@ TABLE_ITEM SystemWakeupTypeTable[] = { } }; +TABLE_ITEM BaseBoardFeatureFlagsTable[] = { + { + 0, + L" Hosting board" + }, + { + 1, + L" Requires at least one daughter board or auxiliary card" + }, + { + 2, + L" Removable" + }, + { + 3, + L" Replaceable" + }, + { + 4, + L" Hot swappable" + } +}; + +TABLE_ITEM BaseBoardBoardTypeTable[] = { + { + 0x01, + L" Unknown" + }, + { + 0x02, + L" Other" + }, + { + 0x03, + L" Server Blade" + }, + { + 0x04, + L" Connectivity Switch" + }, + { + 0x05, + L" System Management Module" + }, + { + 0x06, + L" Processor Module" + }, + { + 0x07, + L" I/O Module" + }, + { + 0x08, + L" Memory Module" + }, + { + 0x09, + L" Daughter board" + }, + { + 0x0A, + L" Motherboard" + }, + { + 0x0B, + L" Processor/Memory Module" + }, + { + 0x0C, + L" Processor/IO Module" + }, + { + 0x0D, + L" Interconnect Board" + } +}; + TABLE_ITEM SystemEnclosureTypeTable[] = { { 0x01, - L" None" + L" Other" }, { 0x02, @@ -348,9 +426,109 @@ TABLE_ITEM ProcessorUpgradeTable[] = { { 0x19, L"Socket LGA1366" - }\ + }, + { + 0x1A, + L"Socket G34" + }, + { + 0x1B, + L"Socket AM3" + }, + { + 0x1C, + L"Socket C32" + }, + { + 0x1D, + L"Socket LGA1156" + }, + { + 0x1E, + L"Socket LGA1567" + }, + { + 0x1F, + L"Socket PGA988A" + }, + { + 0x20, + L"Socket BGA1288" + }, + { + 0x21, + L"Socket rPGA988B" + }, + { + 0x22, + L"Socket BGA1023" + }, + { + 0x23, + L"Socket BGA1224" + }, + { + 0x24, + L"Socket BGA1155" + }, + { + 0x25, + L"Socket LGA1356" + }, + { + 0x26, + L"Socket LGA2011" + }, + { + 0x27, + L"Socket FS1" + }, + { + 0x28, + L"Socket FS2" + }, + { + 0x29, + L"Socket FM1" + }, + { + 0x2A, + L"Socket FM2" + } }; +TABLE_ITEM ProcessorCharacteristicsTable[] = { + { + 1, + L" Unknown" + }, + { + 2, + L" 64-bit Capable" + }, + { + 3, + L" Multi-Core" + }, + { + 4, + L" Hardware Thread" + }, + { + 5, + L" Execute Protection" + }, + { + 6, + L" Enhanced Virtualization" + }, + { + 7, + L" Power/Performance Control" + } +}; + + TABLE_ITEM McErrorDetectMethodTable[] = { { 0x01, @@ -599,10 +777,6 @@ TABLE_ITEM CacheErrCorrectingTypeTable[] = { { 0x06, L"Multi-bit ECC" - }, - { - 0x07, - L"Sixteen Way Interleave" } }; @@ -681,6 +855,10 @@ TABLE_ITEM CacheAssociativityTable[] = { { 0x0D, L"64-way Set-Associative" + }, + { + 0x0E, + L"20-way Set-Associative" } }; @@ -1121,7 +1299,7 @@ TABLE_ITEM SystemSlotTypeTable[] = { }, { 0xAB, - L"PCI Express Gen 26" + L"PCI Express Gen 2" }, { 0xAC, @@ -1142,6 +1320,30 @@ TABLE_ITEM SystemSlotTypeTable[] = { { 0xB0, L"PCI Express Gen 2 X16" + }, + { + 0xB1, + L"PCI Express Gen 3" + }, + { + 0xB2, + L"PCI Express Gen 3 X1" + }, + { + 0xB3, + L"PCI Express Gen 3 X2" + }, + { + 0xB4, + L"PCI Express Gen 3 X4" + }, + { + 0xB5, + L"PCI Express Gen 3 X8" + }, + { + 0xB6, + L"PCI Express Gen 3 X16" } }; @@ -1174,6 +1376,34 @@ TABLE_ITEM SystemSlotDataBusWidthTable[] = { 0x07, L" 128 bit" }, + { + 0x08, + L" 1x or x1" + }, + { + 0x09, + L" 2x or x2" + }, + { + 0x0A, + L" 4x or x4" + }, + { + 0x0B, + L" 8x or x8" + }, + { + 0x0C, + L" 12x or x12" + }, + { + 0x0D, + L" 16x or x16" + }, + { + 0x0E, + L" 32x or x32" + } }; TABLE_ITEM SystemSlotCurrentUsageTable[] = { @@ -2117,6 +2347,14 @@ TABLE_ITEM MemoryDeviceTypeDetailTable[] = { 12, L" Non-volatile" }, + { + 13, + L" Registered(Buffered)" + }, + { + 14, + L" Unbuffered(Unregistered)" + } }; TABLE_ITEM MemoryErrorTypeTable[] = { @@ -2910,6 +3148,18 @@ TABLE_ITEM StructureTypeInfoTable[] = { 39, L" System Power Supply" }, + { + 40, + L" Additional Information" + }, + { + 41, + L" Onboard Devices Extended Information" + }, + { + 42, + L" Management Controller Host Interface" + }, { 0x7E, L" Inactive" @@ -3086,6 +3336,40 @@ DisplaySystemWakeupType ( PRINT_TABLE_ITEM (SystemWakeupTypeTable, Type); } +/** + Display Base Board (Type 2) Feature Flags. + + @param[in] FeatureFlags The key of the structure. + @param[in] Option The optional information. +**/ +VOID +DisplayBaseBoardFeatureFlags ( + IN UINT8 FeatureFlags, + IN UINT8 Option + ) +{ + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_BASE_BOARD_FEATURE_FLAGS), gShellDebug1HiiHandle); + PRINT_INFO_OPTION (FeatureFlags, Option); + PRINT_BITS_INFO (BaseBoardFeatureFlagsTable, FeatureFlags); +} + +/** + Display Base Board (Type 2) Board Type. + + @param[in] Type The key of the structure. + @param[in] Option The optional information. +**/ +VOID +DisplayBaseBoardBoardType( + IN UINT8 Type, + IN UINT8 Option + ) +{ + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_BASE_BOARD_BOARD_TYPE), gShellDebug1HiiHandle); + PRINT_INFO_OPTION (Type, Option); + PRINT_TABLE_ITEM (BaseBoardBoardTypeTable, Type); +} + /** Display System Enclosure (Type 3) Enclosure Type. @@ -3178,6 +3462,23 @@ DisplayProcessorUpgrade ( PRINT_TABLE_ITEM (ProcessorUpgradeTable, Upgrade); } +/** + Display Processor Information (Type 4) Characteristics. + + @param[in] Type The key of the structure. + @param[in] Option The optional information. +**/ +VOID +DisplayProcessorCharacteristics ( + IN UINT16 Type, + IN UINT8 Option + ) +{ + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_PROC_CHARACTERISTICS), gShellDebug1HiiHandle); + PRINT_INFO_OPTION (Type, Option); + PRINT_BITS_INFO (ProcessorCharacteristicsTable, Type); +} + /** Display Memory Controller Information (Type 5) method. @@ -3988,7 +4289,7 @@ DisplayECPLoc ( } /** - Display Management Device (Type 34) information. + Display Management Device (Type 34) Type. @param[in] Key The key of the structure. @param[in] Option The optional information. @@ -4004,6 +4305,23 @@ DisplayMDType ( PRINT_TABLE_ITEM (MDTypeTable, Key); } +/** + Display Management Device (Type 34) Address Type. + + @param[in] Key The key of the structure. + @param[in] Option The optional information. +**/ +VOID +DisplayMDAddressType ( + IN UINT8 Key, + IN UINT8 Option + ) +{ + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MANAGEMENT_DEV_ADDR_TYPE), gShellDebug1HiiHandle); + PRINT_INFO_OPTION (Key, Option); + PRINT_TABLE_ITEM (MDAddressTypeTable, Key); +} + /** Display Memory Channel (Type 37) information. diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.h index 5a0c5e05c0..9cae7094fb 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.h +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.h @@ -2,7 +2,7 @@ Build a table, each item is (key, info) pair. and give a interface of query a string out of a table. - Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.
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 @@ -94,6 +94,30 @@ DisplaySystemWakeupType ( IN UINT8 Option ); +/** + Display Base Board (Type 2) Feature Flags. + + @param[in] FeatureFlags The key of the structure. + @param[in] Option The optional information. +**/ +VOID +DisplayBaseBoardFeatureFlags ( + IN UINT8 FeatureFlags, + IN UINT8 Option + ); + +/** + Display Base Board (Type 2) Board Type. + + @param[in] Type The key of the structure. + @param[in] Option The optional information. +**/ +VOID +DisplayBaseBoardBoardType( + IN UINT8 Type, + IN UINT8 Option + ); + /** Display System Enclosure (Type 3) Enclosure Type. @@ -155,6 +179,18 @@ DisplayProcessorUpgrade ( IN UINT8 Option ); +/** + Display Processor Information (Type 4) Characteristics. + + @param[in] Type The key of the structure. + @param[in] Option The optional information. +**/ +VOID +DisplayProcessorCharacteristics ( + IN UINT16 Type, + IN UINT8 Option + ); + /** Display Memory Controller Information (Type 5) method. @@ -696,7 +732,7 @@ DisplayECPLoc ( ); /** - Display Management Device (Type 34) information. + Display Management Device (Type 34) Type. @param[in] Key The key of the structure. @param[in] Option The optional information. @@ -707,6 +743,18 @@ DisplayMDType ( IN UINT8 Option ); +/** + Display Management Device (Type 34) Address Type. + + @param[in] Key The key of the structure. + @param[in] Option The optional information. +**/ +VOID +DisplayMDAddressType ( + IN UINT8 Key, + IN UINT8 Option + ); + /** Display Memory Channel (Type 37) information. diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/Smbios.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/Smbios.c deleted file mode 100644 index 7e627b98bd..0000000000 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/Smbios.c +++ /dev/null @@ -1,69 +0,0 @@ -/** @file - Lib fucntions for SMBIOS. Used to get system serial number and GUID - - Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.
- 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 - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#include "../UefiShellDebug1CommandsLib.h" -#include -#include "LibSmbios.h" - -/** - 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 - ) -{ - UINT16 Index; - CHAR8 *String; - - ASSERT (Smbios != NULL); - - // - // Skip over formatted section - // - String = (CHAR8 *) (Smbios->Raw + Smbios->Hdr->Length); - - // - // Look through unformated section - // - for (Index = 1; Index <= StringNumber; Index++) { - if (StringNumber == Index) { - return String; - } - // - // Skip string - // - for (; *String != 0; String++); - String++; - - if (*String == 0) { - // - // If double NULL then we are done. - // Retrun pointer to next structure in Smbios. - // if you pass in a -1 you will always get here - // - Smbios->Raw = (UINT8 *)++String; - return NULL; - } - } - - return NULL; -} diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.c index b280306695..95627a545c 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.c @@ -1,7 +1,7 @@ /** @file Tools of clarify the content of the smbios table. - Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.
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 @@ -111,7 +111,7 @@ ShellCommandRunSmbiosView ( // // Initialize the StructHandle to be the first handle // - StructHandle = STRUCTURE_HANDLE_INVALID; + StructHandle = INVALID_HANDLE; LibGetSmbiosStructure (&StructHandle, NULL, NULL); Temp = ShellCommandLineGetValue(Package, L"-t"); @@ -188,23 +188,12 @@ SMBiosView ( ) { UINT16 Handle; - UINT8 Buffer[1024]; - // - // bigger than SMBIOS_STRUCTURE_TABLE.MaxStructureSize - // + UINT8 *Buffer; UINT16 Length; UINTN Index; - UINT16 Offset; - // - // address offset from structure table head. - // - UINT32 TableHead; - // - // structure table head. - // SMBIOS_STRUCTURE_POINTER SmbiosStruct; - SMBIOS_STRUCTURE_TABLE *SMBiosTable; + SMBIOS_TABLE_ENTRY_POINT *SMBiosTable; SMBiosTable = NULL; LibSmbiosGetEPS (&SMBiosTable); @@ -215,7 +204,7 @@ SMBiosView ( if (CompareMem (SMBiosTable->AnchorString, "_SM_", 4) == 0) { // - // Have get SMBIOS table + // Have got SMBIOS table // SmbiosPrintEPSInfo (SMBiosTable, Option); @@ -259,22 +248,20 @@ SMBiosView ( // Searching and display structure info // Handle = QueryHandle; - TableHead = SMBiosTable->TableAddress; - Offset = 0; for (Index = 0; Index < SMBiosTable->NumberOfSmbiosStructures; Index++) { // // if reach the end of table, break.. // - if (Handle == STRUCTURE_HANDLE_INVALID) { + if (Handle == INVALID_HANDLE) { break; } // // handle then point to the next! // - if (LibGetSmbiosStructure (&Handle, Buffer, &Length) != DMI_SUCCESS) { + if (LibGetSmbiosStructure (&Handle, &Buffer, &Length) != DMI_SUCCESS) { break; } - Offset = (UINT16) (Offset + Length); + SmbiosStruct.Raw = Buffer; // @@ -297,7 +284,7 @@ SMBiosView ( // // Addr of structure in structure in table // - ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_ADDR), gShellDebug1HiiHandle, TableHead + Offset); + ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_ADDR), gShellDebug1HiiHandle, (UINTN) Buffer); DumpHex (0, 0, Length, Buffer); /* @@ -315,11 +302,6 @@ SMBiosView ( */ if (gShowType != SHOW_NONE) { - // - // check structure legality - // - SmbiosCheckStructure (&SmbiosStruct); - // // Print structure information // @@ -364,13 +346,13 @@ InitSmbiosTableStatistics ( ) { UINT16 Handle; - UINT8 Buffer[1024]; + UINT8 *Buffer; UINT16 Length; UINT16 Offset; UINT16 Index; SMBIOS_STRUCTURE_POINTER SmbiosStruct; - SMBIOS_STRUCTURE_TABLE *SMBiosTable; + SMBIOS_TABLE_ENTRY_POINT *SMBiosTable; STRUCTURE_STATISTICS *StatisticsPointer; SMBiosTable = NULL; @@ -405,24 +387,23 @@ InitSmbiosTableStatistics ( // // search from the first one // - Handle = STRUCTURE_HANDLE_INVALID; + Handle = INVALID_HANDLE; LibGetSmbiosStructure (&Handle, NULL, NULL); for (Index = 1; Index <= SMBiosTable->NumberOfSmbiosStructures; Index++) { // // If reach the end of table, break.. // - if (Handle == STRUCTURE_HANDLE_INVALID) { + if (Handle == INVALID_HANDLE) { break; } // // After LibGetSmbiosStructure(), handle then point to the next! // - if (LibGetSmbiosStructure (&Handle, Buffer, &Length) != DMI_SUCCESS) { + if (LibGetSmbiosStructure (&Handle, &Buffer, &Length) != DMI_SUCCESS) { break; } SmbiosStruct.Raw = Buffer; - Offset = (UINT16) (Offset + Length); // // general statistics @@ -433,6 +414,8 @@ InitSmbiosTableStatistics ( StatisticsPointer->Length = Length; StatisticsPointer->Addr = Offset; + Offset = (UINT16) (Offset + Length); + StatisticsPointer = &mStatisticsTable[Index]; } @@ -452,10 +435,10 @@ DisplayStatisticsTable ( IN UINT8 Option ) { - UINTN Index; - UINTN Num; - STRUCTURE_STATISTICS *StatisticsPointer; - SMBIOS_STRUCTURE_TABLE *SMBiosTable; + UINTN Index; + UINTN Num; + STRUCTURE_STATISTICS *StatisticsPointer; + SMBIOS_TABLE_ENTRY_POINT *SMBiosTable; SMBiosTable = NULL; if (Option < SHOW_OUTLINE) { @@ -558,12 +541,3 @@ GetShowTypeString ( } } -/* -EFI_STATUS -InitializeSmbiosViewApplicationGetLineHelp ( - OUT CHAR16 **Str - ) -{ - return LibCmdGetStringByToken (STRING_ARRAY_NAME, &EfiSmbiosViewGuid, STRING_TOKEN (STR_SMBIOSVIEW_LINE_HELP), Str); -} -*/ diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.h index 22d7b241f4..638917ae8b 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.h +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.h @@ -1,7 +1,7 @@ /** @file Tools of clarify the content of the smbios table. - Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.
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 @@ -18,8 +18,6 @@ #define STRUCTURE_TYPE_RANDOM (UINT8) 0xFE #define STRUCTURE_TYPE_INVALID (UINT8) 0xFF -#define STRUCTURE_HANDLE_INVALID (UINT16) 0xFFFF - typedef struct { UINT16 Index; UINT8 Type; diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStrings.uni b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStrings.uni index c63001a90e..e50995c58f 100644 Binary files a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStrings.uni and b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStrings.uni differ diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf index 6452543676..37f6f60aee 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf @@ -1,7 +1,7 @@ ## @file # Provides shell Debug1 profile functions # -# Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.
+# Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -46,12 +46,10 @@ SmbiosView/PrintInfo.c SmbiosView/QueryTable.c SmbiosView/SmbiosView.c - SmbiosView/Smbios.c SmbiosView/SmbiosViewStrings.uni SmbiosView/LibSmbiosView.c SmbiosView/PrintInfo.h SmbiosView/LibSmbiosView.h - SmbiosView/LibSmbios.h SmbiosView/QueryTable.h SmbiosView/SmbiosView.h UefiShellDebug1CommandsLib.c diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni index 54f72d42ea..8d8234f5ad 100644 Binary files a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni and b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni differ -- cgit v1.2.3