#ifndef _APPLESMBIOS_SMBIOS_H
#define _APPLESMBIOS_SMBIOS_H
#include <IOKit/IOLib.h>
typedef UInt8 SMBString;
typedef UInt8 SMBByte;
typedef UInt16 SMBWord;
typedef UInt32 SMBDWord;
typedef UInt64 SMBQWord;
#pragma pack(1) // enable 8-bit struct packing
struct DMIEntryPoint {
SMBByte anchor[5];
SMBByte checksum;
SMBWord tableLength;
SMBDWord tableAddress;
SMBWord structureCount;
SMBByte bcdRevision;
};
struct SMBStructHeader {
SMBByte type;
SMBByte length;
SMBWord handle;
};
#define SMB_STRUCT_HEADER SMBStructHeader header;
enum {
kSMBStructTypeBIOSInformation = 0,
kSMBStructTypeSystemInformation = 1,
kSMBStructTypeSystemEnclosure = 3,
kSMBStructTypeProcessorInformation = 4,
kSMBStructTypeMemoryModule = 6,
kSMBStructTypeCacheInformation = 7,
kSMBStructTypePhysicalMemoryArray = 16,
kSMBStructTypeMemoryDevice = 17
};
struct SMBStructBIOSInformation {
SMB_STRUCT_HEADER SMBString vendor; SMBString version; SMBWord startSegment; SMBString releaseDate; SMBByte romSize; SMBQWord characteristics; };
struct SMBStructSystemInformation {
SMB_STRUCT_HEADER SMBString manufacturer;
SMBString productName;
SMBString version;
SMBString serialNumber;
SMBByte uuid[16]; SMBByte wakeupReason; };
struct SMBStructSystemEnclosure {
SMB_STRUCT_HEADER SMBString manufacturer;
SMBByte type;
SMBString version;
SMBString serialNumber;
SMBString assetTagNumber;
SMBByte bootupState;
SMBByte powerSupplyState;
SMBByte thermalState;
SMBByte securityStatus;
SMBDWord oemDefined;
};
struct SMBStructProcessorInformation {
SMB_STRUCT_HEADER SMBString socketDesignation;
SMBByte processorType; SMBByte processorFamily; SMBString manufacturer;
SMBQWord processorID; SMBString processorVersion;
SMBByte voltage; SMBWord externalClock; SMBWord maximumClock; SMBWord currentClock; SMBByte status;
SMBByte processorUpgrade; SMBWord L1CacheHandle;
SMBWord L2CacheHandle;
SMBWord L3CacheHandle;
SMBString serialNumber;
SMBString assetTag;
SMBString partNumber;
};
struct SMBStructMemoryModule {
SMB_STRUCT_HEADER SMBString socketDesignation;
SMBByte bankConnections;
SMBByte currentSpeed;
SMBWord currentMemoryType;
SMBByte installedSize;
SMBByte enabledSize;
SMBByte errorStatus;
};
#define kSMBMemoryModuleSizeNotDeterminable 0x7D
#define kSMBMemoryModuleSizeNotEnabled 0x7E
#define kSMBMemoryModuleSizeNotInstalled 0x7F
struct SMBStructCacheInformation {
SMB_STRUCT_HEADER SMBString socketDesignation;
SMBWord cacheConfiguration;
SMBWord maximumCacheSize;
SMBWord installedSize;
SMBWord supportedSRAMType;
SMBWord currentSRAMType;
SMBByte cacheSpeed;
SMBByte errorCorrectionType;
SMBByte systemCacheType;
SMBByte associativity;
};
struct SMBStructPhysicalMemoryArray {
SMB_STRUCT_HEADER SMBByte physicalLocation; SMBByte arrayUse; SMBByte errorCorrection; SMBDWord maximumCapacity; SMBWord errorHandle; SMBWord numMemoryDevices; };
struct SMBStructMemoryDevice {
SMB_STRUCT_HEADER SMBWord arrayHandle; SMBWord errorHandle; SMBWord totalWidth; SMBWord dataWidth; SMBWord memorySize; SMBByte formFactor; SMBByte deviceSet; SMBString deviceLocator; SMBString bankLocator; SMBByte memoryType; SMBWord memoryTypeDetail; SMBWord memorySpeed; SMBString manufacturer;
SMBString serialNumber;
SMBString assetTag;
SMBString partNumber;
};
static const char * SMBMemoryDeviceTypes[] =
{
"RAM", "RAM", "RAM", "DRAM",
"EDRAM", "VRAM", "SRAM", "RAM",
"ROM", "FLASH", "EEPROM", "FEPROM",
"EPROM", "CDRAM", "3DRAM", "SDRAM",
"SGRAM", "RDRAM", "DDR"
};
static const int kSMBMemoryDeviceTypeCount = sizeof(SMBMemoryDeviceTypes) /
sizeof(SMBMemoryDeviceTypes[0]);
#if 0
static const char * SMBMemoryDeviceDetailTypes[] =
{
NULL, NULL, NULL, "Fast-paged",
"Static column", "Pseudo-static", "RAMBUS", "Synchronous",
"CMOS", "EDO", "Window", "Cache",
"Non-volatile", NULL, NULL, NULL
};
#endif
#pragma options align=reset // reset to default struct packing
#endif