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␊ |
23 | struct acpi_2_rsdp {␊ |
24 | ␉char␉␉␉Signature[8];␊ |
25 | ␉uint8_t␉␉␉Checksum;␊ |
26 | ␉char␉␉␉OEMID[6];␊ |
27 | ␉uint8_t␉␉␉Revision;␊ |
28 | ␉uint32_t␉␉RsdtAddress;␊ |
29 | ␉uint32_t␉␉Length;␊ |
30 | ␉uint64_t␉␉XsdtAddress;␊ |
31 | ␉uint8_t␉␉␉ExtendedChecksum;␊ |
32 | ␉char␉␉␉Reserved[3];␊ |
33 | } __attribute__((packed));␊ |
34 | ␊ |
35 | // TODO Migrate␊ |
36 | struct acpi_2_rsdt {␊ |
37 | ␉char␉␉␉Signature[4];␊ |
38 | ␉uint32_t␉␉Length;␊ |
39 | ␉uint8_t␉␉␉Revision;␊ |
40 | ␉uint8_t␉␉␉Checksum;␊ |
41 | ␉char␉␉␉OEMID[6];␊ |
42 | ␉char␉␉␉OEMTableId[8];␊ |
43 | ␉uint32_t␉␉OEMRevision;␊ |
44 | ␉uint32_t␉␉CreatorId;␊ |
45 | ␉uint32_t␉␉CreatorRevision;␊ |
46 | } __attribute__((packed));␊ |
47 | ␊ |
48 | // TODO Migrate␊ |
49 | struct acpi_2_xsdt {␊ |
50 | ␉char␉␉␉Signature[4];␊ |
51 | ␉uint32_t␉␉Length;␊ |
52 | ␉uint8_t␉␉␉Revision;␊ |
53 | ␉uint8_t␉␉␉Checksum;␊ |
54 | ␉char␉␉␉OEMID[6];␊ |
55 | ␉char␉␉␉OEMTableId[8];␊ |
56 | ␉uint32_t␉␉OEMRevision;␊ |
57 | ␉uint32_t␉␉CreatorId;␊ |
58 | ␉uint32_t␉␉CreatorRevision;␊ |
59 | } __attribute__((packed));␊ |
60 | ␊ |
61 | // TODO Migrate␊ |
62 | struct acpi_2_gas {␊ |
63 | ␉uint8_t␉␉␉Address_Space_ID;␊ |
64 | ␉uint8_t␉␉␉Register_Bit_Width;␊ |
65 | ␉uint8_t␉␉␉Register_Bit_Offset;␊ |
66 | ␉uint8_t␉␉␉Access_Size;␊ |
67 | ␉uint64_t␉␉Address;␊ |
68 | } __attribute__((packed));␊ |
69 | ␊ |
70 | // TODO Migrate␊ |
71 | struct acpi_2_ssdt {␊ |
72 | ␉char␉␉␉Signature[4];␊ |
73 | ␉uint32_t␉␉Length;␊ |
74 | ␉uint8_t␉␉␉Revision;␊ |
75 | ␉uint8_t␉␉␉Checksum;␊ |
76 | ␉char␉␉␉OEMID[6];␊ |
77 | ␉char␉␉␉OEMTableId[8];␊ |
78 | ␉uint32_t␉␉OEMRevision;␊ |
79 | ␉uint32_t␉␉CreatorId;␊ |
80 | ␉uint32_t␉␉CreatorRevision;␊ |
81 | } __attribute__((packed));␊ |
82 | ␊ |
83 | // TODO Migrate␊ |
84 | struct acpi_2_dsdt {␊ |
85 | ␉char␉␉␉Signature[4];␊ |
86 | ␉uint32_t␉␉Length;␊ |
87 | ␉uint8_t␉␉␉Revision;␊ |
88 | ␉uint8_t␉␉␉Checksum;␊ |
89 | ␉char␉␉␉OEMID[6];␊ |
90 | ␉char␉␉␉OEMTableId[8];␊ |
91 | ␉uint32_t␉␉OEMRevision;␊ |
92 | ␉uint32_t␉␉CreatorId;␊ |
93 | ␉uint32_t␉␉CreatorRevision;␊ |
94 | } __attribute__((packed));␊ |
95 | ␊ |
96 | // TODO Migrate␊ |
97 | struct acpi_2_fadt {␊ |
98 | ␉char␉␉␉Signature[4];␊ |
99 | ␉uint32_t␉␉Length;␊ |
100 | ␉uint8_t␉␉␉Revision;␊ |
101 | ␉uint8_t␉␉␉Checksum;␊ |
102 | ␉char␉␉␉OEMID[6];␊ |
103 | ␉char␉␉␉OEMTableId[8];␊ |
104 | ␉uint32_t␉␉OEMRevision;␊ |
105 | ␉uint32_t␉␉CreatorId;␊ |
106 | ␉uint32_t␉␉CreatorRevision;␊ |
107 | ␉uint32_t␉␉FIRMWARE_CTRL;␊ |
108 | ␉uint32_t␉␉DSDT;␊ |
109 | ␉uint8_t␉␉␉INT_MODEL; // JrCs␊ |
110 | ␉uint8_t␉␉␉Preferred_PM_Profile; // JrCs␊ |
111 | ␉uint16_t␉␉SCI_INT;␊ |
112 | ␉uint32_t␉␉SMI_CMD;␊ |
113 | ␉uint8_t␉␉␉ACPI_ENABLE;␊ |
114 | ␉uint8_t␉␉␉ACPI_DISABLE;␊ |
115 | ␉uint8_t␉␉␉S4BIOS_REQ;␊ |
116 | ␉uint8_t␉␉␉PSTATE_CNT;␊ |
117 | ␉uint32_t␉␉PM1a_EVT_BLK;␊ |
118 | ␉uint32_t␉␉PM1b_EVT_BLK;␊ |
119 | ␉uint32_t␉␉PM1a_CNT_BLK;␊ |
120 | ␉uint32_t␉␉PM1b_CNT_BLK;␊ |
121 | ␉uint32_t␉␉PM2_CNT_BLK;␊ |
122 | ␉uint32_t␉␉PM_TMR_BLK;␊ |
123 | ␉uint32_t␉␉GPE0_BLK;␊ |
124 | ␉uint32_t␉␉GPE1_BLK;␊ |
125 | ␉uint8_t␉␉␉PM1_EVT_LEN;␊ |
126 | ␉uint8_t␉␉␉PM1_CNT_LEN;␊ |
127 | ␉uint8_t␉␉␉PM2_CNT_LEN;␊ |
128 | ␉uint8_t␉␉␉PM_TMR_LEN;␊ |
129 | ␉uint8_t␉␉␉GPE0_BLK_LEN;␊ |
130 | ␉uint8_t␉␉␉GPE1_BLK_LEN;␊ |
131 | ␉uint8_t␉␉␉GPE1_BASE;␊ |
132 | ␉uint8_t␉␉␉CST_CNT;␊ |
133 | ␉uint16_t␉␉P_LVL2_LAT;␊ |
134 | ␉uint16_t␉␉P_LVL3_LAT;␊ |
135 | ␉uint16_t␉␉FLUSH_SIZE;␊ |
136 | ␉uint16_t␉␉FLUSH_STRIDE;␊ |
137 | ␉uint8_t␉␉␉DUTY_OFFSET;␊ |
138 | ␉uint8_t␉␉␉DUTY_WIDTH;␊ |
139 | ␉uint8_t␉␉␉DAY_ALRM;␊ |
140 | ␉uint8_t␉␉␉MON_ALRM;␊ |
141 | ␉uint8_t␉␉␉CENTURY;␊ |
142 | ␉uint16_t␉␉IAPC_BOOT_ARCH;␊ |
143 | ␉uint8_t␉␉␉Reserved1;␊ |
144 | ␉uint32_t␉␉Flags;␊ |
145 | ␉struct acpi_2_gas␉RESET_REG;␊ |
146 | ␉uint8_t␉␉␉RESET_VALUE;␊ |
147 | ␉uint8_t␉␉␉Reserved2[3];␊ |
148 | ␉uint64_t␉␉X_FIRMWARE_CTRL;␊ |
149 | ␉uint64_t␉␉X_DSDT;␊ |
150 | ␉struct acpi_2_gas␉X_PM1a_EVT_BLK;␊ |
151 | ␉struct acpi_2_gas␉X_PM1b_EVT_BLK;␊ |
152 | ␉struct acpi_2_gas␉X_PM1a_CNT_BLK;␊ |
153 | ␉struct acpi_2_gas␉X_PM1b_CNT_BLK;␊ |
154 | ␉struct acpi_2_gas␉X_PM2_CNT_BLK;␊ |
155 | ␉struct acpi_2_gas␉X_PM_TMR_BLK;␊ |
156 | ␉struct acpi_2_gas␉X_GPE0_BLK;␊ |
157 | ␉struct acpi_2_gas␉X_GPE1_BLK;␊ |
158 | } __attribute__((packed));␊ |
159 | ␊ |
160 | #endif /* !__LIBSAIO_ACPI_H */␊ |
161 | |