aboutsummaryrefslogtreecommitdiffstats
path: root/include/acpi/amlresrc.h
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2005-09-30 19:03:00 -0400
committerLen Brown <len.brown@intel.com>2005-12-10 00:20:25 -0500
commit50eca3eb89d73d9f0aa070b126c7ee6a616016ab (patch)
treeb2d06d21b34b9bd17eea4c53cff1f3866fa1b21d /include/acpi/amlresrc.h
parent3d5271f9883cba7b54762bc4fe027d4172f06db7 (diff)
[ACPI] ACPICA 20050930
Completed a major overhaul of the Resource Manager code - specifically, optimizations in the area of the AML/internal resource conversion code. The code has been optimized to simplify and eliminate duplicated code, CPU stack use has been decreased by optimizing function parameters and local variables, and naming conventions across the manager have been standardized for clarity and ease of maintenance (this includes function, parameter, variable, and struct/typedef names.) All Resource Manager dispatch and information tables have been moved to a single location for clarity and ease of maintenance. One new file was created, named "rsinfo.c". The ACPI return macros (return_ACPI_STATUS, etc.) have been modified to guarantee that the argument is not evaluated twice, making them less prone to macro side-effects. However, since there exists the possibility of additional stack use if a particular compiler cannot optimize them (such as in the debug generation case), the original macros are optionally available. Note that some invocations of the return_VALUE macro may now cause size mismatch warnings; the return_UINT8 and return_UINT32 macros are provided to eliminate these. (From Randy Dunlap) Implemented a new mechanism to enable debug tracing for individual control methods. A new external interface, acpi_debug_trace(), is provided to enable this mechanism. The intent is to allow the host OS to easily enable and disable tracing for problematic control methods. This interface can be easily exposed to a user or debugger interface if desired. See the file psxface.c for details. acpi_ut_callocate() will now return a valid pointer if a length of zero is specified - a length of one is used and a warning is issued. This matches the behavior of acpi_ut_allocate(). Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'include/acpi/amlresrc.h')
-rw-r--r--include/acpi/amlresrc.h242
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
103struct 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
109struct aml_resource_small_header {
110AML_RESOURCE_SMALL_HEADER_COMMON};
111
112struct aml_resource_irq {
113 AML_RESOURCE_SMALL_HEADER_COMMON u16 irq_mask;
106 u8 flags; 114 u8 flags;
107}; 115};
108 116
109struct asl_irq_noflags_desc { 117struct 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
114struct asl_dma_format_desc { 121struct 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
120struct asl_start_dependent_desc { 126struct aml_resource_start_dependent {
121 u8 descriptor_type; 127 AML_RESOURCE_SMALL_HEADER_COMMON u8 flags;
122 u8 flags;
123}; 128};
124 129
125struct asl_start_dependent_noprio_desc { 130struct aml_resource_start_dependent_noprio {
126 u8 descriptor_type; 131AML_RESOURCE_SMALL_HEADER_COMMON};
127};
128 132
129struct asl_end_dependent_desc { 133struct aml_resource_end_dependent {
130 u8 descriptor_type; 134AML_RESOURCE_SMALL_HEADER_COMMON};
131};
132 135
133struct asl_io_port_desc { 136struct 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
142struct asl_fixed_io_port_desc { 144struct 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
148struct asl_small_vendor_desc { 149struct aml_resource_vendor_small {
149 u8 descriptor_type; 150AML_RESOURCE_SMALL_HEADER_COMMON};
150 u8 vendor_defined[7];
151};
152 151
153struct asl_end_tag_desc { 152struct 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
164struct asl_large_header { 163struct aml_resource_large_header {
165ASL_LARGE_HEADER_COMMON}; 164AML_RESOURCE_LARGE_HEADER_COMMON};
166 165
167struct asl_memory_24_desc { 166struct 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
175struct asl_large_vendor_desc { 174struct aml_resource_vendor_large {
176 ASL_LARGE_HEADER_COMMON u8 vendor_defined[1]; 175AML_RESOURCE_LARGE_HEADER_COMMON};
177};
178 176
179struct asl_memory_32_desc { 177struct 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
187struct asl_fixed_memory_32_desc { 185struct 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
193struct 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
196struct aml_resource_address {
197AML_RESOURCE_LARGE_HEADER_COMMON AML_RESOURCE_ADDRESS_COMMON};
198
199struct 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
210struct asl_qword_address_desc { 213struct 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
222struct asl_dword_address_desc { 222struct 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
234struct asl_word_address_desc { 231struct 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
246struct asl_extended_xrupt_desc { 240struct 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
253struct asl_generic_register_desc { 247struct 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
267union asl_resource_desc { 261union 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;