#ifndef _APPLE_SMBIOS_H
#define _APPLE_SMBIOS_H
#include <IOKit/IOService.h>
#include <IOKit/IOKitKeys.h>
#include "SMBIOS.h"
class SMBPackedStrings;
struct SystemSlotEntry {
queue_chain_t chain;
UInt16 slotID;
UInt8 slotType;
UInt8 slotUsage;
const char * slotName;
};
class AppleSMBIOS : public IOService
{
OSDeclareDefaultStructors( AppleSMBIOS )
protected:
IOService * fRoot;
int fVerbose;
IOMemoryMap * fDMIMemoryMap;
queue_head_t * fSlotQueueHead;
IOService * fROMNode;
OSData * memSlotsData;
OSData * memTypesData;
OSData * memSizesData;
OSData * memSpeedData;
OSData * memInfoData;
UInt64 memSizeTotal;
void * SMBIOSTable;
UInt16 SMBIOSTableLength;
enum { kMemDataSize = 64 };
enum {
kNoMemoryInfo,
kMemoryModuleInfo,
kMemoryDeviceInfo
} memInfoSource;
const SMBStructHeader * getSMBIOSRecord( SMBWord record );
static bool serializeSMBIOS(
void * target,
void * refcon,
OSSerialize * s );
bool findSMBIOSTableEFI( void );
OSData * getSlotNameWithSlotId( int slotId );
void adjustPCIDeviceEFI(
IOService * pciDevice );
IOReturn callPlatformFunction(
const char * functionName,
bool waitForFunction,
void * param1,
void * param2,
void * param3,
void * param4 );
void decodeSMBIOSTable(
const void * tableData,
UInt16 tableLength,
UInt16 structureCount );
void decodeSMBIOSStructure(
const SMBStructHeader * structureHeader,
const void * tableBoundary );
void processSMBIOSStructure(
const SMBBIOSInformation * bios,
SMBPackedStrings * strings );
void processSMBIOSStructure(
const SMBSystemInformation * sys,
SMBPackedStrings * strings );
void processSMBIOSStructure(
const SMBProcessorInformation * cpu,
SMBPackedStrings * strings );
void processSMBIOSStructure(
const SMBCacheInformation * cache,
SMBPackedStrings * strings );
void processSMBIOSStructure(
const SMBMemoryDevice * memory,
SMBPackedStrings * strings );
void processSMBIOSStructure(
const SMBMemoryModule * memory,
SMBPackedStrings * strings );
void processSMBIOSStructure(
const SMBSystemSlot * slot,
SMBPackedStrings * strings );
void processSMBIOSStructure(
const SMBFirmwareVolume * fv,
SMBPackedStrings * strings );
void processSMBIOSStructure(
const SMBMemorySPD * spd,
SMBPackedStrings * strings );
void processSMBIOSStructure(
const SMBOemProcessorType * cpu,
SMBPackedStrings * strings );
void updateDeviceTree( void );
public:
virtual bool start( IOService * provider );
virtual void free( void );
};
#endif