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 | ␊ |
21 | /* Per ACPI 3.0a spec */␊ |
22 | ␊ |
23 | // TODO Migrate␊ |
24 | struct acpi_2_rsdp {␊ |
25 | char Signature[8];␊ |
26 | uint8_t Checksum;␊ |
27 | char OEMID[6];␊ |
28 | uint8_t Revision;␊ |
29 | uint32_t RsdtAddress;␊ |
30 | uint32_t Length;␊ |
31 | uint64_t XsdtAddress;␊ |
32 | uint8_t ExtendedChecksum;␊ |
33 | char Reserved[3];␊ |
34 | } __attribute__((packed));␊ |
35 | ␊ |
36 | // TODO Migrate␊ |
37 | struct acpi_2_rsdt {␊ |
38 | ␉char Signature[4];␊ |
39 | ␉uint32_t Length;␊ |
40 | ␉uint8_t Revision;␊ |
41 | ␉uint8_t Checksum;␊ |
42 | ␉char OEMID[6];␊ |
43 | ␉char OEMTableId[8];␊ |
44 | ␉uint32_t OEMRevision;␊ |
45 | ␉uint32_t CreatorId;␊ |
46 | ␉uint32_t CreatorRevision;␊ |
47 | } __attribute__((packed));␊ |
48 | ␊ |
49 | // TODO Migrate␊ |
50 | struct acpi_2_xsdt {␊ |
51 | ␉char Signature[4];␊ |
52 | ␉uint32_t Length;␊ |
53 | ␉uint8_t Revision;␊ |
54 | ␉uint8_t Checksum;␊ |
55 | ␉char OEMID[6];␊ |
56 | ␉char OEMTableId[8];␊ |
57 | ␉uint32_t OEMRevision;␊ |
58 | ␉uint32_t CreatorId;␊ |
59 | ␉uint32_t CreatorRevision;␊ |
60 | } __attribute__((packed));␊ |
61 | ␊ |
62 | // TODO Migrate␊ |
63 | struct acpi_2_ssdt {␊ |
64 | ␉char Signature[4];␊ |
65 | ␉uint32_t Length;␊ |
66 | ␉uint8_t Revision;␊ |
67 | ␉uint8_t Checksum;␊ |
68 | ␉char OEMID[6];␊ |
69 | ␉char OEMTableId[8];␊ |
70 | ␉uint32_t OEMRevision;␊ |
71 | ␉uint32_t CreatorId;␊ |
72 | ␉uint32_t CreatorRevision;␊ |
73 | } __attribute__((packed));␊ |
74 | ␊ |
75 | // TODO Migrate␊ |
76 | struct acpi_2_dsdt {␊ |
77 | ␉char Signature[4];␊ |
78 | ␉uint32_t Length;␊ |
79 | ␉uint8_t Revision;␊ |
80 | ␉uint8_t Checksum;␊ |
81 | ␉char OEMID[6];␊ |
82 | ␉char OEMTableId[8];␊ |
83 | ␉uint32_t OEMRevision;␊ |
84 | ␉uint32_t CreatorId;␊ |
85 | ␉uint32_t CreatorRevision;␊ |
86 | } __attribute__((packed));␊ |
87 | ␊ |
88 | // TODO Migrate␊ |
89 | struct acpi_2_fadt {␊ |
90 | ␉char Signature[4];␊ |
91 | ␉uint32_t Length;␊ |
92 | ␉uint8_t Revision;␊ |
93 | ␉uint8_t Checksum;␊ |
94 | ␉char OEMID[6];␊ |
95 | ␉char OEMTableId[8];␊ |
96 | ␉uint32_t OEMRevision;␊ |
97 | ␉uint32_t CreatorId;␊ |
98 | ␉uint32_t CreatorRevision;␊ |
99 | ␉uint32_t FIRMWARE_CTRL;␊ |
100 | ␉uint32_t DSDT;␊ |
101 | ␉uint8_t Model;␉␉␉// JrCs␊ |
102 | ␉uint8_t PM_Profile;␉␉// JrCs␊ |
103 | ␉uint16_t␉␉SCI_Interrupt;␊ |
104 | ␉uint32_t␉␉SMI_Command_Port;␊ |
105 | ␉uint8_t␉␉␉ACPI_Enable;␊ |
106 | ␉uint8_t␉␉␉ACPI_Disable;␊ |
107 | ␉uint8_t␉␉␉S4BIOS_Command;␊ |
108 | ␉uint8_t␉␉␉PState_Control;␊ |
109 | ␉uint32_t␉␉PM1A_Event_Block_Address;␊ |
110 | ␉uint32_t␉␉PM1B_Event_Block_Address;␊ |
111 | ␉uint32_t␉␉PM1A_Control_Block_Address;␊ |
112 | ␉uint32_t␉␉PM1B_Control_Block_Address;␊ |
113 | ␉uint32_t␉␉PM2_Control_Block_Address;␊ |
114 | ␉uint32_t␉␉PM_Timer_Block_Address;␊ |
115 | ␉uint32_t␉␉GPE0_Block_Address;␊ |
116 | ␉uint32_t␉␉GPE1_Block_Address;␊ |
117 | ␉uint8_t␉␉␉PM1_Event_Block_Length;␊ |
118 | ␉uint8_t␉␉␉PM1_Control_Block_Length;␊ |
119 | ␉uint8_t␉␉␉PM2_Control_Block_Length;␊ |
120 | ␉uint8_t␉␉␉PM_Timer_Block_Length;␊ |
121 | ␉uint8_t␉␉␉GPE0_Block_Length;␊ |
122 | ␉uint8_t␉␉␉GPE1_Block_Length;␊ |
123 | ␉uint8_t␉␉␉GPE1_Base_Offset;␊ |
124 | ␉uint8_t␉␉␉CST_Support;␊ |
125 | ␉uint16_t␉␉C2_Latency;␊ |
126 | ␉uint16_t␉␉C3_Latency;␊ |
127 | ␉uint16_t␉␉CPU_Cache_Size;␊ |
128 | ␉uint16_t␉␉Cache_Flush_Stride;␊ |
129 | ␉uint8_t␉␉␉Duty_Cycle_Offset;␊ |
130 | ␉uint8_t␉␉␉Duty_Cycle_Width;␊ |
131 | ␉uint8_t␉␉␉RTC_Day_Alarm_Index;␊ |
132 | ␉uint8_t␉␉␉RTC_Month_Alarm_Index;␊ |
133 | ␉uint8_t␉␉␉RTC_Century_Index;␊ |
134 | ␉uint16_t␉␉Boot_Flags;␊ |
135 | ␉uint8_t␉␉␉Reserved0;␊ |
136 | /* Begin Asere */␊ |
137 | ␉//Reset Fix␊ |
138 | ␉uint32_t Flags;␊ |
139 | ␉uint8_t Reset_SpaceID;␊ |
140 | ␉uint8_t Reset_BitWidth;␊ |
141 | ␉uint8_t Reset_BitOffset;␊ |
142 | ␉uint8_t Reset_AccessWidth;␊ |
143 | ␉uint64_t Reset_Address;␊ |
144 | ␉uint8_t Reset_Value;␊ |
145 | ␉uint8_t Reserved[3];␊ |
146 | ␊ |
147 | ␉uint64_t␉ X_FIRMWARE_CTRL;␊ |
148 | ␉uint64_t␉ X_DSDT;␊ |
149 | /* End Asere */␊ |
150 | ␉/*We absolutely don't care about theese fields*/␊ |
151 | ␉uint8_t␉␉notimp2[96];␊ |
152 | } __attribute__((packed));␊ |
153 | ␊ |
154 | #endif /* !__LIBSAIO_ACPI_H */␊ |
155 | |