Chameleon

Chameleon Svn Source Tree

Root/trunk/i386/libsaio/platform.h

1/*
2 * platform.h
3 * AsereBLN: reworked and extended
4 *
5 */
6
7#ifndef __LIBSAIO_PLATFORM_H
8#define __LIBSAIO_PLATFORM_H
9
10#include "libsaio.h"
11
12extern bool platformCPUFeature(uint32_t);
13extern void scan_platform(void);
14
15/* CPUID index into cpuid_raw */
16#define CPUID_00
17#define CPUID_11
18#define CPUID_22
19#define CPUID_33
20#define CPUID_44
21#define CPUID_805
22#define CPUID_816
23#define CPUID_MAX7
24
25/* CPU Features */
26#define CPU_FEATURE_MMX0x00000001// MMX Instruction Set
27#define CPU_FEATURE_SSE0x00000002// SSE Instruction Set
28#define CPU_FEATURE_SSE20x00000004// SSE2 Instruction Set
29#define CPU_FEATURE_SSE30x00000008// SSE3 Instruction Set
30#define CPU_FEATURE_SSE410x00000010// SSE41 Instruction Set
31#define CPU_FEATURE_SSE420x00000020// SSE42 Instruction Set
32#define CPU_FEATURE_EM64T0x00000040// 64Bit Support
33#define CPU_FEATURE_HTT0x00000080// HyperThreading
34#define CPU_FEATURE_MOBILE0x00000100// Mobile CPU
35
36/* SMBIOS Memory Types */
37#define SMB_MEM_TYPE_UNDEFINED0
38#define SMB_MEM_TYPE_OTHER1
39#define SMB_MEM_TYPE_UNKNOWN2
40#define SMB_MEM_TYPE_DRAM3
41#define SMB_MEM_TYPE_EDRAM4
42#define SMB_MEM_TYPE_VRAM5
43#define SMB_MEM_TYPE_SRAM6
44#define SMB_MEM_TYPE_RAM7
45#define SMB_MEM_TYPE_ROM8
46#define SMB_MEM_TYPE_FLASH9
47#define SMB_MEM_TYPE_EEPROM10
48#define SMB_MEM_TYPE_FEPROM11
49#define SMB_MEM_TYPE_EPROM12
50#define SMB_MEM_TYPE_CDRAM13
51#define SMB_MEM_TYPE_3DRAM14
52#define SMB_MEM_TYPE_SDRAM15
53#define SMB_MEM_TYPE_SGRAM16
54#define SMB_MEM_TYPE_RDRAM17
55#define SMB_MEM_TYPE_DDR18
56#define SMB_MEM_TYPE_DDR219
57#define SMB_MEM_TYPE_FBDIMM20
58#define SMB_MEM_TYPE_DDR324// Supported in 10.5.6+ AppleSMBIOS
59
60/* Memory Configuration Types */
61#define SMB_MEM_CHANNEL_UNKNOWN0
62#define SMB_MEM_CHANNEL_SINGLE1
63#define SMB_MEM_CHANNEL_DUAL2
64#define SMB_MEM_CHANNEL_TRIPLE3
65
66/* Maximum number of ram slots */
67#define MAX_RAM_SLOTS12
68#define RAM_SLOT_ENUMERATOR{0, 2, 4, 1, 3, 5, 6, 8, 10, 7, 9, 11}
69
70/* Maximum number of SPD bytes */
71#define MAX_SPD_SIZE256
72
73/* Size of SMBIOS UUID in bytes */
74#define UUID_LEN16
75
76typedef struct _RamSlotInfo_t {
77boolInUse;
78uint8_tType;
79charVendor[64];
80charPartNo[64];
81charSerialNo[16];
82} RamSlotInfo_t;
83
84typedef struct _PlatformInfo_t {
85struct CPU {
86uint32_tFeatures;// CPU Features like MMX, SSE2, VT, MobileCPU
87uint32_tVendor;// Vendor
88uint32_tModel;// Model
89uint32_tExtModel;// Extended Model
90uint32_tFamily;// Family
91uint32_tExtFamily;// Extended Family
92uint32_tNoCores;// No Cores per Package
93uint32_tNoThreads;// Threads per Package
94uint8_tMaxCoef;// Max Multiplier
95uint8_tMaxDiv;
96uint8_tCurrCoef;// Current Multiplier
97uint8_tCurrDiv;
98uint64_tTSCFrequency;// TSC Frequency Hz
99uint64_tFSBFrequency;// FSB Frequency Hz
100uint64_tCPUFrequency;// CPU Frequency Hz
101uint32_tBrandString[16];// 48 Byte Branding String
102uint32_tCPUID[CPUID_MAX][4];// CPUID 0..4, 80..81 Raw Values
103} CPU;
104
105struct RAM {
106RamSlotInfo_tDIMM[MAX_RAM_SLOTS];// Information about each slot
107uint64_tFrequency;// Ram Frequency
108} RAM;
109
110struct DMI {
111intMaxMemorySlots;// number of memory slots polulated by SMBIOS
112intCntMemorySlots;// number of memory slots counted
113intMemoryModules;// number of memory modules installed
114intDIMM[MAX_RAM_SLOTS];// Information and SPD mapping for each slot
115} DMI;
116uint8_tType;// System Type: 1=Desktop, 2=Portable... according ACPI2.0 (FACP: PM_Profile)
117} PlatformInfo_t;
118
119extern PlatformInfo_t Platform;
120
121#endif /* !__LIBSAIO_PLATFORM_H */
122

Archive Download this file

Revision: 84