diff options
Diffstat (limited to 'include/acpi/amlresrc.h')
-rw-r--r-- | include/acpi/amlresrc.h | 242 |
1 files changed, 124 insertions, 118 deletions
diff --git a/include/acpi/amlresrc.h b/include/acpi/amlresrc.h index a3c46ba6358d..103aff07db18 100644 --- a/include/acpi/amlresrc.h +++ b/include/acpi/amlresrc.h | |||
@@ -96,165 +96,159 @@ struct asl_resource_node { | |||
96 | * Resource descriptors defined in the ACPI specification. | 96 | * Resource descriptors defined in the ACPI specification. |
97 | * | 97 | * |
98 | * Packing/alignment must be BYTE because these descriptors | 98 | * Packing/alignment must be BYTE because these descriptors |
99 | * are used to overlay the AML byte stream. | 99 | * are used to overlay the raw AML byte stream. |
100 | */ | 100 | */ |
101 | #pragma pack(1) | 101 | #pragma pack(1) |
102 | 102 | ||
103 | struct asl_irq_format_desc { | 103 | /* |
104 | u8 descriptor_type; | 104 | * SMALL descriptors |
105 | u16 irq_mask; | 105 | */ |
106 | #define AML_RESOURCE_SMALL_HEADER_COMMON \ | ||
107 | u8 descriptor_type; | ||
108 | |||
109 | struct aml_resource_small_header { | ||
110 | AML_RESOURCE_SMALL_HEADER_COMMON}; | ||
111 | |||
112 | struct aml_resource_irq { | ||
113 | AML_RESOURCE_SMALL_HEADER_COMMON u16 irq_mask; | ||
106 | u8 flags; | 114 | u8 flags; |
107 | }; | 115 | }; |
108 | 116 | ||
109 | struct asl_irq_noflags_desc { | 117 | struct aml_resource_irq_noflags { |
110 | u8 descriptor_type; | 118 | AML_RESOURCE_SMALL_HEADER_COMMON u16 irq_mask; |
111 | u16 irq_mask; | ||
112 | }; | 119 | }; |
113 | 120 | ||
114 | struct asl_dma_format_desc { | 121 | struct aml_resource_dma { |
115 | u8 descriptor_type; | 122 | AML_RESOURCE_SMALL_HEADER_COMMON u8 dma_channel_mask; |
116 | u8 dma_channel_mask; | ||
117 | u8 flags; | 123 | u8 flags; |
118 | }; | 124 | }; |
119 | 125 | ||
120 | struct asl_start_dependent_desc { | 126 | struct aml_resource_start_dependent { |
121 | u8 descriptor_type; | 127 | AML_RESOURCE_SMALL_HEADER_COMMON u8 flags; |
122 | u8 flags; | ||
123 | }; | 128 | }; |
124 | 129 | ||
125 | struct asl_start_dependent_noprio_desc { | 130 | struct aml_resource_start_dependent_noprio { |
126 | u8 descriptor_type; | 131 | AML_RESOURCE_SMALL_HEADER_COMMON}; |
127 | }; | ||
128 | 132 | ||
129 | struct asl_end_dependent_desc { | 133 | struct aml_resource_end_dependent { |
130 | u8 descriptor_type; | 134 | AML_RESOURCE_SMALL_HEADER_COMMON}; |
131 | }; | ||
132 | 135 | ||
133 | struct asl_io_port_desc { | 136 | struct aml_resource_io { |
134 | u8 descriptor_type; | 137 | AML_RESOURCE_SMALL_HEADER_COMMON u8 information; |
135 | u8 information; | 138 | u16 minimum; |
136 | u16 address_min; | 139 | u16 maximum; |
137 | u16 address_max; | ||
138 | u8 alignment; | 140 | u8 alignment; |
139 | u8 length; | 141 | u8 address_length; |
140 | }; | 142 | }; |
141 | 143 | ||
142 | struct asl_fixed_io_port_desc { | 144 | struct aml_resource_fixed_io { |
143 | u8 descriptor_type; | 145 | AML_RESOURCE_SMALL_HEADER_COMMON u16 address; |
144 | u16 base_address; | 146 | u8 address_length; |
145 | u8 length; | ||
146 | }; | 147 | }; |
147 | 148 | ||
148 | struct asl_small_vendor_desc { | 149 | struct aml_resource_vendor_small { |
149 | u8 descriptor_type; | 150 | AML_RESOURCE_SMALL_HEADER_COMMON}; |
150 | u8 vendor_defined[7]; | ||
151 | }; | ||
152 | 151 | ||
153 | struct asl_end_tag_desc { | 152 | struct aml_resource_end_tag { |
154 | u8 descriptor_type; | 153 | AML_RESOURCE_SMALL_HEADER_COMMON u8 checksum; |
155 | u8 checksum; | ||
156 | }; | 154 | }; |
157 | 155 | ||
158 | /* LARGE descriptors */ | 156 | /* |
159 | 157 | * LARGE descriptors | |
160 | #define ASL_LARGE_HEADER_COMMON \ | 158 | */ |
159 | #define AML_RESOURCE_LARGE_HEADER_COMMON \ | ||
161 | u8 descriptor_type;\ | 160 | u8 descriptor_type;\ |
162 | u16 length; | 161 | u16 resource_length; |
163 | 162 | ||
164 | struct asl_large_header { | 163 | struct aml_resource_large_header { |
165 | ASL_LARGE_HEADER_COMMON}; | 164 | AML_RESOURCE_LARGE_HEADER_COMMON}; |
166 | 165 | ||
167 | struct asl_memory_24_desc { | 166 | struct aml_resource_memory24 { |
168 | ASL_LARGE_HEADER_COMMON u8 information; | 167 | AML_RESOURCE_LARGE_HEADER_COMMON u8 information; |
169 | u16 address_min; | 168 | u16 minimum; |
170 | u16 address_max; | 169 | u16 maximum; |
171 | u16 alignment; | 170 | u16 alignment; |
172 | u16 range_length; | 171 | u16 address_length; |
173 | }; | 172 | }; |
174 | 173 | ||
175 | struct asl_large_vendor_desc { | 174 | struct aml_resource_vendor_large { |
176 | ASL_LARGE_HEADER_COMMON u8 vendor_defined[1]; | 175 | AML_RESOURCE_LARGE_HEADER_COMMON}; |
177 | }; | ||
178 | 176 | ||
179 | struct asl_memory_32_desc { | 177 | struct aml_resource_memory32 { |
180 | ASL_LARGE_HEADER_COMMON u8 information; | 178 | AML_RESOURCE_LARGE_HEADER_COMMON u8 information; |
181 | u32 address_min; | 179 | u32 minimum; |
182 | u32 address_max; | 180 | u32 maximum; |
183 | u32 alignment; | 181 | u32 alignment; |
184 | u32 range_length; | 182 | u32 address_length; |
185 | }; | 183 | }; |
186 | 184 | ||
187 | struct asl_fixed_memory_32_desc { | 185 | struct aml_resource_fixed_memory32 { |
188 | ASL_LARGE_HEADER_COMMON u8 information; | 186 | AML_RESOURCE_LARGE_HEADER_COMMON u8 information; |
189 | u32 base_address; | 187 | u32 address; |
190 | u32 range_length; | 188 | u32 address_length; |
191 | }; | 189 | }; |
192 | 190 | ||
193 | struct asl_extended_address_desc { | 191 | #define AML_RESOURCE_ADDRESS_COMMON \ |
194 | ASL_LARGE_HEADER_COMMON u8 resource_type; | 192 | u8 resource_type; \ |
195 | u8 flags; | 193 | u8 flags; \ |
196 | u8 specific_flags; | 194 | u8 specific_flags; |
197 | u8 revision_iD; | 195 | |
196 | struct aml_resource_address { | ||
197 | AML_RESOURCE_LARGE_HEADER_COMMON AML_RESOURCE_ADDRESS_COMMON}; | ||
198 | |||
199 | struct aml_resource_extended_address64 { | ||
200 | AML_RESOURCE_LARGE_HEADER_COMMON | ||
201 | AML_RESOURCE_ADDRESS_COMMON u8 revision_iD; | ||
198 | u8 reserved; | 202 | u8 reserved; |
199 | u64 granularity; | 203 | u64 granularity; |
200 | u64 address_min; | 204 | u64 minimum; |
201 | u64 address_max; | 205 | u64 maximum; |
202 | u64 translation_offset; | 206 | u64 translation_offset; |
203 | u64 address_length; | 207 | u64 address_length; |
204 | u64 type_specific_attributes; | 208 | u64 type_specific_attributes; |
205 | u8 optional_fields[2]; /* Used for length calculation only */ | ||
206 | }; | 209 | }; |
207 | 210 | ||
208 | #define ASL_EXTENDED_ADDRESS_DESC_REVISION 1 /* ACPI 3.0 */ | 211 | #define AML_RESOURCE_EXTENDED_ADDRESS_REVISION 1 /* ACPI 3.0 */ |
209 | 212 | ||
210 | struct asl_qword_address_desc { | 213 | struct aml_resource_address64 { |
211 | ASL_LARGE_HEADER_COMMON u8 resource_type; | 214 | AML_RESOURCE_LARGE_HEADER_COMMON |
212 | u8 flags; | 215 | AML_RESOURCE_ADDRESS_COMMON u64 granularity; |
213 | u8 specific_flags; | 216 | u64 minimum; |
214 | u64 granularity; | 217 | u64 maximum; |
215 | u64 address_min; | ||
216 | u64 address_max; | ||
217 | u64 translation_offset; | 218 | u64 translation_offset; |
218 | u64 address_length; | 219 | u64 address_length; |
219 | u8 optional_fields[2]; | ||
220 | }; | 220 | }; |
221 | 221 | ||
222 | struct asl_dword_address_desc { | 222 | struct aml_resource_address32 { |
223 | ASL_LARGE_HEADER_COMMON u8 resource_type; | 223 | AML_RESOURCE_LARGE_HEADER_COMMON |
224 | u8 flags; | 224 | AML_RESOURCE_ADDRESS_COMMON u32 granularity; |
225 | u8 specific_flags; | 225 | u32 minimum; |
226 | u32 granularity; | 226 | u32 maximum; |
227 | u32 address_min; | ||
228 | u32 address_max; | ||
229 | u32 translation_offset; | 227 | u32 translation_offset; |
230 | u32 address_length; | 228 | u32 address_length; |
231 | u8 optional_fields[2]; | ||
232 | }; | 229 | }; |
233 | 230 | ||
234 | struct asl_word_address_desc { | 231 | struct aml_resource_address16 { |
235 | ASL_LARGE_HEADER_COMMON u8 resource_type; | 232 | AML_RESOURCE_LARGE_HEADER_COMMON |
236 | u8 flags; | 233 | AML_RESOURCE_ADDRESS_COMMON u16 granularity; |
237 | u8 specific_flags; | 234 | u16 minimum; |
238 | u16 granularity; | 235 | u16 maximum; |
239 | u16 address_min; | ||
240 | u16 address_max; | ||
241 | u16 translation_offset; | 236 | u16 translation_offset; |
242 | u16 address_length; | 237 | u16 address_length; |
243 | u8 optional_fields[2]; | ||
244 | }; | 238 | }; |
245 | 239 | ||
246 | struct asl_extended_xrupt_desc { | 240 | struct aml_resource_extended_irq { |
247 | ASL_LARGE_HEADER_COMMON u8 flags; | 241 | AML_RESOURCE_LARGE_HEADER_COMMON u8 flags; |
248 | u8 table_length; | 242 | u8 table_length; |
249 | u32 interrupt_number[1]; | 243 | u32 interrupt_number[1]; |
250 | /* res_source_index, res_source optional fields follow */ | 244 | /* res_source_index, res_source optional fields follow */ |
251 | }; | 245 | }; |
252 | 246 | ||
253 | struct asl_generic_register_desc { | 247 | struct aml_resource_generic_register { |
254 | ASL_LARGE_HEADER_COMMON u8 address_space_id; | 248 | AML_RESOURCE_LARGE_HEADER_COMMON u8 address_space_id; |
255 | u8 bit_width; | 249 | u8 bit_width; |
256 | u8 bit_offset; | 250 | u8 bit_offset; |
257 | u8 access_size; /* ACPI 3.0, was Reserved */ | 251 | u8 access_size; /* ACPI 3.0, was previously Reserved */ |
258 | u64 address; | 252 | u64 address; |
259 | }; | 253 | }; |
260 | 254 | ||
@@ -264,27 +258,39 @@ struct asl_generic_register_desc { | |||
264 | 258 | ||
265 | /* Union of all resource descriptors, so we can allocate the worst case */ | 259 | /* Union of all resource descriptors, so we can allocate the worst case */ |
266 | 260 | ||
267 | union asl_resource_desc { | 261 | union aml_resource { |
268 | struct asl_irq_format_desc irq; | 262 | /* Descriptor headers */ |
269 | struct asl_dma_format_desc dma; | 263 | |
270 | struct asl_io_port_desc iop; | 264 | struct aml_resource_small_header small_header; |
271 | struct asl_fixed_io_port_desc fio; | 265 | struct aml_resource_large_header large_header; |
272 | struct asl_start_dependent_desc std; | 266 | |
273 | struct asl_end_dependent_desc end; | 267 | /* Small resource descriptors */ |
274 | struct asl_small_vendor_desc smv; | 268 | |
275 | struct asl_end_tag_desc et; | 269 | struct aml_resource_irq irq; |
276 | 270 | struct aml_resource_dma dma; | |
277 | struct asl_large_header lhd; | 271 | struct aml_resource_start_dependent start_dpf; |
278 | struct asl_memory_24_desc M24; | 272 | struct aml_resource_end_dependent end_dpf; |
279 | struct asl_large_vendor_desc lgv; | 273 | struct aml_resource_io io; |
280 | struct asl_memory_32_desc M32; | 274 | struct aml_resource_fixed_io fixed_io; |
281 | struct asl_fixed_memory_32_desc F32; | 275 | struct aml_resource_vendor_small vendor_small; |
282 | struct asl_qword_address_desc qas; | 276 | struct aml_resource_end_tag end_tag; |
283 | struct asl_dword_address_desc das; | 277 | |
284 | struct asl_word_address_desc was; | 278 | /* Large resource descriptors */ |
285 | struct asl_extended_address_desc eas; | 279 | |
286 | struct asl_extended_xrupt_desc exx; | 280 | struct aml_resource_memory24 memory24; |
287 | struct asl_generic_register_desc grg; | 281 | struct aml_resource_generic_register generic_reg; |
282 | struct aml_resource_vendor_large vendor_large; | ||
283 | struct aml_resource_memory32 memory32; | ||
284 | struct aml_resource_fixed_memory32 fixed_memory32; | ||
285 | struct aml_resource_address16 address16; | ||
286 | struct aml_resource_address32 address32; | ||
287 | struct aml_resource_address64 address64; | ||
288 | struct aml_resource_extended_address64 ext_address64; | ||
289 | struct aml_resource_extended_irq extended_irq; | ||
290 | |||
291 | /* Utility overlays */ | ||
292 | |||
293 | struct aml_resource_address address; | ||
288 | u32 u32_item; | 294 | u32 u32_item; |
289 | u16 u16_item; | 295 | u16 u16_item; |
290 | u8 U8item; | 296 | u8 U8item; |