Chameleon

Chameleon Svn Source Tree

Root/branches/andyvand/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;
73uint8_tType;
74charVendor[64];
75charPartNo[64];
76charSerialNo[16];
77uint8_tspd[MAX_SPD_SIZE];
78} RamSlotInfo_t;
79
80typedef struct _PlatformInfo_t {
81struct CPU {
82uint32_tFeatures;// CPU Features like MMX, SSE2, VT, MobileCPU
83uint32_tVendor;// Vendor
84uint32_tModel;// Model
85uint32_tExtModel;// Extended Model
86uint32_tFamily;// Family
87uint32_tExtFamily;// Extended Family
88uint32_tNoCores;// No Cores per Package
89uint32_tNoThreads;// Threads per Package
90uint8_tMaxCoef;// Max Multiplier
91uint8_tMaxDiv;
92uint8_tCurrCoef;// Current Multiplier
93uint8_tCurrDiv;
94uint64_tTSCFrequency;// TSC Frequency Hz
95uint64_tFSBFrequency;// FSB Frequency Hz
96uint64_tCPUFrequency;// CPU Frequency Hz
97uint32_tBrandString[16];// 48 Byte Branding String
98uint32_tCPUID[CPUID_MAX][4];// CPUID 0..4, 80..81 Raw Values
99} CPU;
100struct RAM {
101RamSlotInfo_tDIMM[MAX_RAM_SLOTS];// Information about each slot
102uint64_tFrequency;// Ram Frequency
103} RAM;
104
105uint8_t Type; // JrCs: System Type: 1=Desktop, 2=Portable... according ACPI2.0 (FADT: PM_Profile)
106
107} PlatformInfo_t;
108
109extern PlatformInfo_t Platform;
110
111#endif /* !__LIBSAIO_PLATFORM_H */
112

Archive Download this file

Revision: 69