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