Chameleon

Chameleon Svn Source Tree

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

Archive Download this file

Revision: 20