Chameleon

Chameleon Svn Source Tree

Root/trunk/i386/libsaio/platform.h

1/*
2 * platform.h
3 *
4 */
5
6#ifndef __LIBSAIO_PLATFORM_H
7#define __LIBSAIO_PLATFORM_H
8
9#include "libsaio.h"
10
11#define bit(n)(1ULL << (n))
12#define bitmask(h,l)((bit(h)|(bit(h)-1)) & ~(bit(l)-1))
13#define bitfield(x,h,l)(((x) & bitmask(h,l)) >> l)
14
15extern void scan_platform();
16
17/* SMBIOS Memory Types */
18#define SMB_MEM_TYPE_UNDEFINED0
19#define SMB_MEM_TYPE_OTHER1
20#define SMB_MEM_TYPE_UNKNOWN2
21#define SMB_MEM_TYPE_DRAM3
22#define SMB_MEM_TYPE_EDRAM4
23#define SMB_MEM_TYPE_VRAM5
24#define SMB_MEM_TYPE_SRAM6
25#define SMB_MEM_TYPE_RAM7
26#define SMB_MEM_TYPE_ROM8
27#define SMB_MEM_TYPE_FLASH9
28#define SMB_MEM_TYPE_EEPROM10
29#define SMB_MEM_TYPE_FEPROM11
30#define SMB_MEM_TYPE_EPROM12
31#define SMB_MEM_TYPE_CDRAM13
32#define SMB_MEM_TYPE_3DRAM14
33#define SMB_MEM_TYPE_SDRAM15
34#define SMB_MEM_TYPE_SGRAM16
35#define SMB_MEM_TYPE_RDRAM17
36#define SMB_MEM_TYPE_DDR18
37#define SMB_MEM_TYPE_DDR219
38#define SMB_MEM_TYPE_FBDIMM20
39#define SMB_MEM_TYPE_DDR324// Supported in 10.5.6+ AppleSMBIOS
40
41/* Memory Configuration Types */
42#define SMB_MEM_CHANNEL_UNKNOWN0
43#define SMB_MEM_CHANNEL_SINGLE1
44#define SMB_MEM_CHANNEL_DUAL2
45#define SMB_MEM_CHANNEL_TRIPLE3
46
47/* Maximum number of ram slots */
48#defineMAX_RAM_SLOTS16
49
50typedef struct _RamSlotInfo_t {
51boolInUse;// Module Present
52uint32_tModuleSize;// Size of Module in MB
53char*spd;// SPD Dump
54} RamSlotInfo_t;
55
56typedef struct _PlatformInfo_t {
57boolMobile;// Mobile Platform
58boolx86_64;// 64 Bit Capable
59struct PCI {
60uint8_tNoDevices;// No of PCI devices
61} PCI;
62struct CPU {
63uint32_tVendor;// Vendor
64uint32_tModel;// Model
65uint32_tExtModel;// Extended Model
66uint32_tFamily;// Family
67uint32_tExtFamily;// Extended Family
68uint8_tNoCores;// No Cores per Package
69uint8_tNoThreads;// Threads per Package
70uint8_tMaxCoef;// Max Multiplier
71uint8_tMaxDiv;
72uint8_tCurrCoef;// Current Multiplier
73uint8_tCurrDiv;
74floatMaxRatio;
75floatCurrRatio;
76uint64_tTSCFrequency;// TSC Frequency Hz
77uint64_tFSBFrequency;// FSB Frequency Hz
78uint64_tCPUFrequency;// CPU Frequency Hz
79boolMobile;// Mobile CPU
80uint32_tBrandString[16];// 48 Byte Branding String
81} CPU;
82struct RAM {
83uint64_tFrequency;// Ram Frequency
84uint32_tDivider;// Memory divider
85floatCAS;// CAS 1/2/2.5/3/4/5/6/7
86uint8_tTRC;
87uint8_tTRP;
88uint8_tRAS;
89uint8_tChannels;// Channel Configuration Single,Dual or Triple
90uint8_tNoSlots;// Maximum no of slots available
91uint8_tType;// Standard SMBIOS v2.5 Memory Type
92char*BrandString;// Branding String Memory Controller
93RamSlotInfo_tDIMM[MAX_RAM_SLOTS];// Information about each slot
94} RAM;
95} PlatformInfo_t;
96
97extern PlatformInfo_t Platform;
98
99#endif /* !__LIBSAIO_PLATFORM_H */
100
101

Archive Download this file

Revision: 1