Chameleon

Chameleon Svn Source Tree

Root/branches/ErmaC/Enoch/i386/libsaio/acpi.h

1#ifndef __LIBSAIO_ACPI_H
2#define __LIBSAIO_ACPI_H
3
4#define ACPI_RANGE_START (0x0E0000)
5#define ACPI_RANGE_END (0x0FFFFF)
6
7#define UINT64_LE_FROM_CHARS(a,b,c,d,e,f,g,h) \
8( ((uint64_t)h << 56) \
9| ((uint64_t)g << 48) \
10| ((uint64_t)f << 40) \
11| ((uint64_t)e << 32) \
12| ((uint64_t)d << 24) \
13| ((uint64_t)c << 16) \
14| ((uint64_t)b << 8) \
15| ((uint64_t)a << 0) \
16)
17
18#define ACPI_SIGNATURE_UINT64_LE UINT64_LE_FROM_CHARS('R','S','D',' ','P','T','R',' ')
19
20/* Per ACPI 3.0a spec */
21
22// TODO Migrate
23struct acpi_2_rsdp
24{
25// 1.0
26charSignature[8];
27uint8_tChecksum;
28charOEMID[6];
29uint8_tRevision;
30uint32_tRsdtAddress;
31// 2.0
32uint32_tLength;
33uint64_tXsdtAddress;
34uint8_tExtendedChecksum;
35charReserved[3];
36} __attribute__((packed));
37
38// TODO Migrate
39struct acpi_2_rsdt
40{
41charSignature[4];
42uint32_tLength;
43uint8_tRevision;
44uint8_tChecksum;
45charOEMID[6];
46charOEMTableId[8];
47uint32_tOEMRevision;
48uint32_tCreatorId;
49uint32_tCreatorRevision;
50} __attribute__((packed));
51
52// TODO Migrate
53struct acpi_2_xsdt
54{
55charSignature[4];
56uint32_tLength;
57uint8_tRevision;
58uint8_tChecksum;
59charOEMID[6];
60charOEMTableId[8];
61uint32_tOEMRevision;
62uint32_tCreatorId;
63uint32_tCreatorRevision;
64} __attribute__((packed));
65
66// TODO Migrate
67struct acpi_2_ssdt
68{
69charSignature[4];
70uint32_tLength;
71uint8_tRevision;
72uint8_tChecksum;
73charOEMID[6];
74charOEMTableId[8];
75uint32_tOEMRevision;
76uint32_tCreatorId;
77uint32_tCreatorRevision;
78} __attribute__((packed));
79
80// TODO Migrate
81struct acpi_2_dsdt
82{
83charSignature[4];
84uint32_tLength;
85uint8_tRevision;
86uint8_tChecksum;
87charOEMID[6];
88charOEMTableId[8];
89uint32_tOEMRevision;
90uint32_tCreatorId;
91uint32_tCreatorRevision;
92} __attribute__((packed));
93
94// TODO Migrate
95struct acpi_2_fadt
96{
97charSignature[4];
98uint32_tLength;
99uint8_tRevision;
100uint8_tChecksum;
101charOEMID[6];
102charOEMTableId[8];
103uint32_tOEMRevision;
104uint32_tCreatorId;
105uint32_tCreatorRevision;
106uint32_tFIRMWARE_CTRL;
107uint32_tDSDT;
108uint8_tModel;// JrCs
109uint8_tPM_Profile;// JrCs
110uint16_tSCI_Interrupt;
111uint32_tSMI_Command_Port;
112uint8_tACPI_Enable;
113uint8_tACPI_Disable;
114uint8_tS4BIOS_Command;
115uint8_tPState_Control;
116uint32_tPM1A_Event_Block_Address;
117uint32_tPM1B_Event_Block_Address;
118uint32_tPM1A_Control_Block_Address;
119uint32_tPM1B_Control_Block_Address;
120uint32_tPM2_Control_Block_Address;
121uint32_tPM_Timer_Block_Address;
122uint32_tGPE0_Block_Address;
123uint32_tGPE1_Block_Address;
124uint8_tPM1_Event_Block_Length;
125uint8_tPM1_Control_Block_Length;
126uint8_tPM2_Control_Block_Length;
127uint8_tPM_Timer_Block_Length;
128uint8_tGPE0_Block_Length;
129uint8_tGPE1_Block_Length;
130uint8_tGPE1_Base_Offset;
131uint8_tCST_Support;
132uint16_tC2_Latency;
133uint16_tC3_Latency;
134uint16_tCPU_Cache_Size;
135uint16_tCache_Flush_Stride;
136uint8_tDuty_Cycle_Offset;
137uint8_tDuty_Cycle_Width;
138uint8_tRTC_Day_Alarm_Index;
139uint8_tRTC_Month_Alarm_Index;
140uint8_tRTC_Century_Index;
141uint16_tBoot_Flags;
142uint8_tReserved0;
143/* Begin Asere */
144//Reset Fix
145uint32_t Flags;
146// Reset Register
147uint8_t Reset_SpaceID;
148uint8_t Reset_BitWidth;
149uint8_t Reset_BitOffset;
150uint8_t Reset_AccessWidth;
151uint64_t Reset_Address;
152uint8_t Reset_Value;
153uint8_t Reserved[3];
154
155uint64_t X_FIRMWARE_CTRL;
156uint64_t X_DSDT;
157/* End Asere */
158/*We absolutely don't care about theese fields*/
159uint8_tnotimp2[96];
160} __attribute__((packed));
161
162#endif /* !__LIBSAIO_ACPI_H */
163

Archive Download this file

Revision: 2542