aboutsummaryrefslogtreecommitdiffstats
path: root/include/acpi
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2005-10-21 00:00:00 -0400
committerLen Brown <len.brown@intel.com>2005-12-10 00:22:54 -0500
commit0897831bb54eb36fd9e2a22da7f0f64be1b20d09 (patch)
tree8d77687ce8ebcfb62d6012d2d3c44f6a904b3c15 /include/acpi
parent50eca3eb89d73d9f0aa070b126c7ee6a616016ab (diff)
[ACPI] ACPICA 20051021
Implemented support for the EM64T and other x86_64 processors. This essentially entails recognizing that these processors support non-aligned memory transfers. Previously, all 64-bit processors were assumed to lack hardware support for non-aligned transfers. Completed conversion of the Resource Manager to nearly full table-driven operation. Specifically, the resource conversion code (convert AML to internal format and the reverse) and the debug code to dump internal resource descriptors are fully table-driven, reducing code and data size and improving maintainability. The OSL interfaces for Acquire and Release Lock now use a 64-bit flag word on 64-bit processors instead of a fixed 32-bit word. (Alexey Starikovskiy) Implemented support within the resource conversion code for the Type-Specific byte within the various ACPI 3.0 *WordSpace macros. Fixed some issues within the resource conversion code for the type-specific flags for both Memory and I/O address resource descriptors. For Memory, implemented support for the MTP and TTP flags. For I/O, split the TRS and TTP flags into two separate fields. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'include/acpi')
-rw-r--r--include/acpi/acconfig.h2
-rw-r--r--include/acpi/acdisasm.h17
-rw-r--r--include/acpi/acmacros.h6
-rw-r--r--include/acpi/acpiosxf.h4
-rw-r--r--include/acpi/acresrc.h401
-rw-r--r--include/acpi/actypes.h183
-rw-r--r--include/acpi/acutils.h7
-rw-r--r--include/acpi/amlresrc.h14
-rw-r--r--include/acpi/platform/acenv.h11
9 files changed, 323 insertions, 322 deletions
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index cb59b018c84c..7676afec09a2 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -63,7 +63,7 @@
63 63
64/* Current ACPICA subsystem version in YYYYMMDD format */ 64/* Current ACPICA subsystem version in YYYYMMDD format */
65 65
66#define ACPI_CA_VERSION 0x20050930 66#define ACPI_CA_VERSION 0x20051021
67 67
68/* 68/*
69 * OS name, used for the _OS object. The _OS object is essentially obsolete, 69 * OS name, used for the _OS object. The _OS object is essentially obsolete,
diff --git a/include/acpi/acdisasm.h b/include/acpi/acdisasm.h
index b2921b869bb4..99250ee1b9d1 100644
--- a/include/acpi/acdisasm.h
+++ b/include/acpi/acdisasm.h
@@ -60,6 +60,7 @@ extern struct acpi_external_list *acpi_gbl_external_list;
60extern const char *acpi_gbl_io_decode[2]; 60extern const char *acpi_gbl_io_decode[2];
61extern const char *acpi_gbl_word_decode[4]; 61extern const char *acpi_gbl_word_decode[4];
62extern const char *acpi_gbl_consume_decode[2]; 62extern const char *acpi_gbl_consume_decode[2];
63extern const char *acpi_gbl_config_decode[4];
63extern const char *acpi_gbl_min_decode[2]; 64extern const char *acpi_gbl_min_decode[2];
64extern const char *acpi_gbl_max_decode[2]; 65extern const char *acpi_gbl_max_decode[2];
65extern const char *acpi_gbl_DECdecode[2]; 66extern const char *acpi_gbl_DECdecode[2];
@@ -171,11 +172,19 @@ u8 acpi_dm_is_string_buffer(union acpi_parse_object *op);
171/* 172/*
172 * dmresrc 173 * dmresrc
173 */ 174 */
175void acpi_dm_dump_integer8(u8 value, char *name);
176
177void acpi_dm_dump_integer16(u16 value, char *name);
178
179void acpi_dm_dump_integer32(u32 value, char *name);
180
181void acpi_dm_dump_integer64(u64 value, char *name);
182
174void 183void
175acpi_dm_resource_descriptor(struct acpi_op_walk_info *info, 184acpi_dm_resource_template(struct acpi_op_walk_info *info,
176 u8 * byte_data, u32 byte_count); 185 u8 * byte_data, u32 byte_count);
177 186
178u8 acpi_dm_is_resource_descriptor(union acpi_parse_object *op); 187u8 acpi_dm_is_resource_template(union acpi_parse_object *op);
179 188
180void acpi_dm_indent(u32 level); 189void acpi_dm_indent(u32 level);
181 190
@@ -223,6 +232,8 @@ void
223acpi_dm_vendor_large_descriptor(union aml_resource *resource, 232acpi_dm_vendor_large_descriptor(union aml_resource *resource,
224 u32 length, u32 level); 233 u32 length, u32 level);
225 234
235void acpi_dm_vendor_common(char *name, u8 * byte_data, u32 length, u32 level);
236
226/* 237/*
227 * dmresrcs 238 * dmresrcs
228 */ 239 */
diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h
index 258cfe5e2aac..e42222c3d34c 100644
--- a/include/acpi/acmacros.h
+++ b/include/acpi/acmacros.h
@@ -202,7 +202,7 @@
202 202
203#define ACPI_BUFFER_INDEX(buf_len,buf_offset,byte_gran) (buf_offset) 203#define ACPI_BUFFER_INDEX(buf_len,buf_offset,byte_gran) (buf_offset)
204 204
205#ifdef ACPI_MISALIGNED_TRANSFERS 205#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
206 206
207/* The hardware supports unaligned transfers, just do the little-endian move */ 207/* The hardware supports unaligned transfers, just do the little-endian move */
208 208
@@ -563,11 +563,11 @@
563 return (_s); }) 563 return (_s); })
564#define return_UINT8(s) ACPI_DO_WHILE0 ({ \ 564#define return_UINT8(s) ACPI_DO_WHILE0 ({ \
565 register u8 _s = (u8) (s); \ 565 register u8 _s = (u8) (s); \
566 acpi_ut_value_exit (ACPI_DEBUG_PARAMETERS, _s); \ 566 acpi_ut_value_exit (ACPI_DEBUG_PARAMETERS, (acpi_integer) _s); \
567 return (_s); }) 567 return (_s); })
568#define return_UINT32(s) ACPI_DO_WHILE0 ({ \ 568#define return_UINT32(s) ACPI_DO_WHILE0 ({ \
569 register u32 _s = (u32) (s); \ 569 register u32 _s = (u32) (s); \
570 acpi_ut_value_exit (ACPI_DEBUG_PARAMETERS, _s); \ 570 acpi_ut_value_exit (ACPI_DEBUG_PARAMETERS, (acpi_integer) _s); \
571 return (_s); }) 571 return (_s); })
572#else /* Use original less-safe macros */ 572#else /* Use original less-safe macros */
573 573
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index 98e0b8cd14ed..58473f60755f 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -108,9 +108,9 @@ acpi_status acpi_os_create_lock(acpi_handle * out_handle);
108 108
109void acpi_os_delete_lock(acpi_handle handle); 109void acpi_os_delete_lock(acpi_handle handle);
110 110
111unsigned long acpi_os_acquire_lock(acpi_handle handle); 111acpi_native_uint acpi_os_acquire_lock(acpi_handle handle);
112 112
113void acpi_os_release_lock(acpi_handle handle, unsigned long flags); 113void acpi_os_release_lock(acpi_handle handle, acpi_native_uint flags);
114 114
115/* 115/*
116 * Memory allocation and mapping 116 * Memory allocation and mapping
diff --git a/include/acpi/acresrc.h b/include/acpi/acresrc.h
index b66994e9e4ee..25cff0d5ba58 100644
--- a/include/acpi/acresrc.h
+++ b/include/acpi/acresrc.h
@@ -49,48 +49,132 @@
49#include "amlresrc.h" 49#include "amlresrc.h"
50 50
51/* 51/*
52 * If possible, pack the following structures to byte alignment, since we
53 * don't care about performance for debug output
54 */
55#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
56#pragma pack(1)
57#endif
58
59/*
60 * Individual entry for the resource conversion tables
61 */
62typedef const struct acpi_rsconvert_info {
63 u8 opcode;
64 u8 resource_offset;
65 u8 aml_offset;
66 u8 value;
67
68} acpi_rsconvert_info;
69
70/* Resource conversion opcodes */
71
72#define ACPI_RSC_INITGET 0
73#define ACPI_RSC_INITSET 1
74#define ACPI_RSC_FLAGINIT 2
75#define ACPI_RSC_1BITFLAG 3
76#define ACPI_RSC_2BITFLAG 4
77#define ACPI_RSC_COUNT 5
78#define ACPI_RSC_COUNT16 6
79#define ACPI_RSC_LENGTH 7
80#define ACPI_RSC_MOVE8 8
81#define ACPI_RSC_MOVE16 9
82#define ACPI_RSC_MOVE32 10
83#define ACPI_RSC_MOVE64 11
84#define ACPI_RSC_SET8 12
85#define ACPI_RSC_DATA8 13
86#define ACPI_RSC_ADDRESS 14
87#define ACPI_RSC_SOURCE 15
88#define ACPI_RSC_SOURCEX 16
89#define ACPI_RSC_BITMASK 17
90#define ACPI_RSC_BITMASK16 18
91#define ACPI_RSC_EXIT_NE 19
92#define ACPI_RSC_EXIT_LE 20
93
94/* Resource Conversion sub-opcodes */
95
96#define ACPI_RSC_COMPARE_AML_LENGTH 0
97#define ACPI_RSC_COMPARE_VALUE 1
98
99#define ACPI_RSC_TABLE_SIZE(d) (sizeof (d) / sizeof (struct acpi_rsconvert_info))
100
101#define ACPI_RS_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_resource,f)
102#define AML_OFFSET(f) (u8) ACPI_OFFSET (union aml_resource,f)
103
104/*
52 * Resource dispatch and info tables 105 * Resource dispatch and info tables
53 */ 106 */
54struct acpi_resource_info { 107typedef const struct acpi_resource_info {
55 u8 length_type; 108 u8 length_type;
56 u8 minimum_aml_resource_length; 109 u8 minimum_aml_resource_length;
57 u8 minimum_internal_struct_length; 110 u8 minimum_internal_struct_length;
58}; 111
112} acpi_resource_info;
59 113
60/* Types for length_type above */ 114/* Types for length_type above */
61 115
62#define ACPI_FIXED_LENGTH 0 116#define ACPI_FIXED_LENGTH 0
63#define ACPI_VARIABLE_LENGTH 1 117#define ACPI_VARIABLE_LENGTH 1
64#define ACPI_SMALL_VARIABLE_LENGTH 2 118#define ACPI_SMALL_VARIABLE_LENGTH 2
119
120typedef const struct acpi_rsdump_info {
121 u8 opcode;
122 u8 offset;
123 char *name;
124 const void *pointer;
65 125
66/* Handlers */ 126} acpi_rsdump_info;
67 127
68typedef acpi_status(*ACPI_SET_RESOURCE_HANDLER) (struct acpi_resource * 128/* Values for the Opcode field above */
69 resource,
70 union aml_resource * aml);
71 129
72typedef acpi_status(*ACPI_GET_RESOURCE_HANDLER) (union aml_resource * aml, 130#define ACPI_RSD_TITLE 0
73 u16 aml_resource_length, 131#define ACPI_RSD_LITERAL 1
74 struct acpi_resource * 132#define ACPI_RSD_STRING 2
75 resource); 133#define ACPI_RSD_UINT8 3
134#define ACPI_RSD_UINT16 4
135#define ACPI_RSD_UINT32 5
136#define ACPI_RSD_UINT64 6
137#define ACPI_RSD_1BITFLAG 7
138#define ACPI_RSD_2BITFLAG 8
139#define ACPI_RSD_SHORTLIST 9
140#define ACPI_RSD_LONGLIST 10
141#define ACPI_RSD_DWORDLIST 11
142#define ACPI_RSD_ADDRESS 12
143#define ACPI_RSD_SOURCE 13
76 144
77typedef void (*ACPI_DUMP_RESOURCE_HANDLER) (union acpi_resource_data * data); 145/* restore default alignment */
78 146
79/* Tables indexed by internal resource type */ 147#pragma pack()
80 148
81extern u8 acpi_gbl_aml_resource_sizes[]; 149/* Resource tables indexed by internal resource type */
82extern ACPI_SET_RESOURCE_HANDLER acpi_gbl_set_resource_dispatch[];
83extern ACPI_DUMP_RESOURCE_HANDLER acpi_gbl_dump_resource_dispatch[];
84 150
85/* Tables indexed by raw AML resource descriptor type */ 151extern const u8 acpi_gbl_aml_resource_sizes[];
152extern struct acpi_rsconvert_info *acpi_gbl_set_resource_dispatch[];
153
154/* Resource tables indexed by raw AML resource descriptor type */
86 155
87extern struct acpi_resource_info acpi_gbl_sm_resource_info[]; 156extern struct acpi_resource_info acpi_gbl_sm_resource_info[];
88extern struct acpi_resource_info acpi_gbl_lg_resource_info[]; 157extern struct acpi_resource_info acpi_gbl_lg_resource_info[];
89extern ACPI_GET_RESOURCE_HANDLER acpi_gbl_sm_get_resource_dispatch[]; 158extern struct acpi_rsconvert_info *acpi_gbl_sm_get_resource_dispatch[];
90extern ACPI_GET_RESOURCE_HANDLER acpi_gbl_lg_get_resource_dispatch[]; 159extern struct acpi_rsconvert_info *acpi_gbl_lg_get_resource_dispatch[];
160
161/*
162 * rscreate
163 */
164acpi_status
165acpi_rs_create_resource_list(union acpi_operand_object *aml_buffer,
166 struct acpi_buffer *output_buffer);
167
168acpi_status
169acpi_rs_create_aml_resources(struct acpi_resource *linked_list_buffer,
170 struct acpi_buffer *output_buffer);
171
172acpi_status
173acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
174 struct acpi_buffer *output_buffer);
91 175
92/* 176/*
93 * Function prototypes called from Acpi* APIs 177 * rsutils
94 */ 178 */
95acpi_status 179acpi_status
96acpi_rs_get_prt_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer); 180acpi_rs_get_prt_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer);
@@ -110,27 +194,6 @@ acpi_rs_get_method_data(acpi_handle handle,
110acpi_status 194acpi_status
111acpi_rs_set_srs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer); 195acpi_rs_set_srs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer);
112 196
113acpi_status
114acpi_rs_create_resource_list(union acpi_operand_object *aml_buffer,
115 struct acpi_buffer *output_buffer);
116
117acpi_status
118acpi_rs_create_aml_resources(struct acpi_resource *linked_list_buffer,
119 struct acpi_buffer *output_buffer);
120
121acpi_status
122acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
123 struct acpi_buffer *output_buffer);
124
125/*
126 * rsdump
127 */
128#ifdef ACPI_FUTURE_USAGE
129void acpi_rs_dump_resource_list(struct acpi_resource *resource);
130
131void acpi_rs_dump_irq_list(u8 * route_table);
132#endif /* ACPI_FUTURE_USAGE */
133
134/* 197/*
135 * rscalc 198 * rscalc
136 */ 199 */
@@ -155,144 +218,28 @@ acpi_rs_convert_resources_to_aml(struct acpi_resource *resource,
155 acpi_size aml_size_needed, u8 * output_buffer); 218 acpi_size aml_size_needed, u8 * output_buffer);
156 219
157/* 220/*
158 * rsio
159 */
160acpi_status
161acpi_rs_get_io(union aml_resource *aml,
162 u16 aml_resource_length, struct acpi_resource *resource);
163
164acpi_status
165acpi_rs_set_io(struct acpi_resource *resource, union aml_resource *aml);
166
167acpi_status
168acpi_rs_get_fixed_io(union aml_resource *aml,
169 u16 aml_resource_length, struct acpi_resource *resource);
170
171acpi_status
172acpi_rs_set_fixed_io(struct acpi_resource *resource, union aml_resource *aml);
173
174acpi_status
175acpi_rs_get_dma(union aml_resource *aml,
176 u16 aml_resource_length, struct acpi_resource *resource);
177
178acpi_status
179acpi_rs_set_dma(struct acpi_resource *resource, union aml_resource *aml);
180
181/*
182 * rsirq
183 */
184acpi_status
185acpi_rs_get_irq(union aml_resource *aml,
186 u16 aml_resource_length, struct acpi_resource *resource);
187
188acpi_status
189acpi_rs_set_irq(struct acpi_resource *resource, union aml_resource *aml);
190
191acpi_status
192acpi_rs_get_ext_irq(union aml_resource *aml,
193 u16 aml_resource_length, struct acpi_resource *resource);
194
195acpi_status
196acpi_rs_set_ext_irq(struct acpi_resource *resource, union aml_resource *aml);
197
198/*
199 * rsaddr 221 * rsaddr
200 */ 222 */
201acpi_status 223void
202acpi_rs_get_address16(union aml_resource *aml, 224acpi_rs_set_address_common(union aml_resource *aml,
203 u16 aml_resource_length, struct acpi_resource *resource);
204
205acpi_status
206acpi_rs_set_address16(struct acpi_resource *resource, union aml_resource *aml);
207
208acpi_status
209acpi_rs_get_address32(union aml_resource *aml,
210 u16 aml_resource_length, struct acpi_resource *resource);
211
212acpi_status
213acpi_rs_set_address32(struct acpi_resource *resource, union aml_resource *aml);
214
215acpi_status
216acpi_rs_get_address64(union aml_resource *aml,
217 u16 aml_resource_length, struct acpi_resource *resource);
218
219acpi_status
220acpi_rs_set_address64(struct acpi_resource *resource, union aml_resource *aml);
221
222acpi_status
223acpi_rs_get_ext_address64(union aml_resource *aml,
224 u16 aml_resource_length,
225 struct acpi_resource *resource);
226
227acpi_status
228acpi_rs_set_ext_address64(struct acpi_resource *resource,
229 union aml_resource *aml);
230
231/*
232 * rsmemory
233 */
234acpi_status
235acpi_rs_get_memory24(union aml_resource *aml,
236 u16 aml_resource_length, struct acpi_resource *resource);
237
238acpi_status
239acpi_rs_set_memory24(struct acpi_resource *resource, union aml_resource *aml);
240
241acpi_status
242acpi_rs_get_memory32(union aml_resource *aml,
243 u16 aml_resource_length, struct acpi_resource *resource);
244
245acpi_status
246acpi_rs_set_memory32(struct acpi_resource *resource, union aml_resource *aml);
247
248acpi_status
249acpi_rs_get_fixed_memory32(union aml_resource *aml,
250 u16 aml_resource_length,
251 struct acpi_resource *resource); 225 struct acpi_resource *resource);
252 226
253acpi_status 227u8
254acpi_rs_set_fixed_memory32(struct acpi_resource *resource, 228acpi_rs_get_address_common(struct acpi_resource *resource,
255 union aml_resource *aml); 229 union aml_resource *aml);
256 230
257/* 231/*
258 * rsmisc 232 * rsmisc
259 */ 233 */
260acpi_status 234acpi_status
261acpi_rs_get_generic_reg(union aml_resource *aml, 235acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
262 u16 aml_resource_length, 236 union aml_resource *aml,
263 struct acpi_resource *resource); 237 struct acpi_rsconvert_info *info);
264
265acpi_status
266acpi_rs_set_generic_reg(struct acpi_resource *resource,
267 union aml_resource *aml);
268
269acpi_status
270acpi_rs_get_vendor(union aml_resource *aml,
271 u16 aml_resource_length, struct acpi_resource *resource);
272
273acpi_status
274acpi_rs_set_vendor(struct acpi_resource *resource, union aml_resource *aml);
275
276acpi_status
277acpi_rs_get_start_dpf(union aml_resource *aml,
278 u16 aml_resource_length, struct acpi_resource *resource);
279
280acpi_status
281acpi_rs_set_start_dpf(struct acpi_resource *resource, union aml_resource *aml);
282
283acpi_status
284acpi_rs_get_end_dpf(union aml_resource *aml,
285 u16 aml_resource_length, struct acpi_resource *resource);
286
287acpi_status
288acpi_rs_set_end_dpf(struct acpi_resource *resource, union aml_resource *aml);
289 238
290acpi_status 239acpi_status
291acpi_rs_get_end_tag(union aml_resource *aml, 240acpi_rs_convert_resource_to_aml(struct acpi_resource *resource,
292 u16 aml_resource_length, struct acpi_resource *resource); 241 union aml_resource *aml,
293 242 struct acpi_rsconvert_info *info);
294acpi_status
295acpi_rs_set_end_tag(struct acpi_resource *resource, union aml_resource *aml);
296 243
297/* 244/*
298 * rsutils 245 * rsutils
@@ -301,74 +248,94 @@ void
301acpi_rs_move_data(void *destination, 248acpi_rs_move_data(void *destination,
302 void *source, u16 item_count, u8 move_type); 249 void *source, u16 item_count, u8 move_type);
303 250
304/* Types used in move_type above */ 251u8 acpi_rs_decode_bitmask(u16 mask, u8 * list);
305 252
306#define ACPI_MOVE_TYPE_16_TO_32 0 253u16 acpi_rs_encode_bitmask(u8 * list, u8 count);
307#define ACPI_MOVE_TYPE_32_TO_16 1
308#define ACPI_MOVE_TYPE_32_TO_32 2
309#define ACPI_MOVE_TYPE_64_TO_64 3
310 254
311u16 255acpi_rs_length
312acpi_rs_get_resource_source(u16 resource_length, 256acpi_rs_get_resource_source(acpi_rs_length resource_length,
313 acpi_size minimum_length, 257 acpi_rs_length minimum_length,
314 struct acpi_resource_source *resource_source, 258 struct acpi_resource_source *resource_source,
315 union aml_resource *aml, char *string_ptr); 259 union aml_resource *aml, char *string_ptr);
316 260
317acpi_size 261acpi_rsdesc_size
318acpi_rs_set_resource_source(union aml_resource *aml, 262acpi_rs_set_resource_source(union aml_resource *aml,
319 acpi_size minimum_length, 263 acpi_rs_length minimum_length,
320 struct acpi_resource_source *resource_source); 264 struct acpi_resource_source *resource_source);
321 265
322u8 acpi_rs_get_resource_type(u8 resource_start_byte);
323
324u32 acpi_rs_get_descriptor_length(union aml_resource *aml);
325
326u16 acpi_rs_get_resource_length(union aml_resource *aml);
327
328void 266void
329acpi_rs_set_resource_header(u8 descriptor_type, 267acpi_rs_set_resource_header(u8 descriptor_type,
330 acpi_size total_length, union aml_resource *aml); 268 acpi_rsdesc_size total_length,
269 union aml_resource *aml);
270
271void
272acpi_rs_set_resource_length(acpi_rsdesc_size total_length,
273 union aml_resource *aml);
331 274
332struct acpi_resource_info *acpi_rs_get_resource_info(u8 resource_type); 275struct acpi_resource_info *acpi_rs_get_resource_info(u8 resource_type);
333 276
334#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
335/* 277/*
336 * rsdump 278 * rsdump
337 */ 279 */
338void acpi_rs_dump_irq(union acpi_resource_data *resource); 280void acpi_rs_dump_resource_list(struct acpi_resource *resource);
339
340void acpi_rs_dump_address16(union acpi_resource_data *resource);
341
342void acpi_rs_dump_address32(union acpi_resource_data *resource);
343
344void acpi_rs_dump_address64(union acpi_resource_data *resource);
345
346void acpi_rs_dump_ext_address64(union acpi_resource_data *resource);
347
348void acpi_rs_dump_dma(union acpi_resource_data *resource);
349
350void acpi_rs_dump_io(union acpi_resource_data *resource);
351
352void acpi_rs_dump_ext_irq(union acpi_resource_data *resource);
353
354void acpi_rs_dump_fixed_io(union acpi_resource_data *resource);
355
356void acpi_rs_dump_fixed_memory32(union acpi_resource_data *resource);
357
358void acpi_rs_dump_memory24(union acpi_resource_data *resource);
359
360void acpi_rs_dump_memory32(union acpi_resource_data *resource);
361
362void acpi_rs_dump_start_dpf(union acpi_resource_data *resource);
363
364void acpi_rs_dump_vendor(union acpi_resource_data *resource);
365 281
366void acpi_rs_dump_generic_reg(union acpi_resource_data *resource); 282void acpi_rs_dump_irq_list(u8 * route_table);
367 283
368void acpi_rs_dump_end_dpf(union acpi_resource_data *resource); 284/*
285 * Resource conversion tables
286 */
287extern struct acpi_rsconvert_info acpi_rs_convert_dma[];
288extern struct acpi_rsconvert_info acpi_rs_convert_end_dpf[];
289extern struct acpi_rsconvert_info acpi_rs_convert_io[];
290extern struct acpi_rsconvert_info acpi_rs_convert_fixed_io[];
291extern struct acpi_rsconvert_info acpi_rs_convert_end_tag[];
292extern struct acpi_rsconvert_info acpi_rs_convert_memory24[];
293extern struct acpi_rsconvert_info acpi_rs_convert_generic_reg[];
294extern struct acpi_rsconvert_info acpi_rs_convert_memory32[];
295extern struct acpi_rsconvert_info acpi_rs_convert_fixed_memory32[];
296extern struct acpi_rsconvert_info acpi_rs_convert_address32[];
297extern struct acpi_rsconvert_info acpi_rs_convert_address16[];
298extern struct acpi_rsconvert_info acpi_rs_convert_ext_irq[];
299extern struct acpi_rsconvert_info acpi_rs_convert_address64[];
300extern struct acpi_rsconvert_info acpi_rs_convert_ext_address64[];
301
302/* These resources require separate get/set tables */
303
304extern struct acpi_rsconvert_info acpi_rs_get_irq[];
305extern struct acpi_rsconvert_info acpi_rs_get_start_dpf[];
306extern struct acpi_rsconvert_info acpi_rs_get_vendor_small[];
307extern struct acpi_rsconvert_info acpi_rs_get_vendor_large[];
308
309extern struct acpi_rsconvert_info acpi_rs_set_irq[];
310extern struct acpi_rsconvert_info acpi_rs_set_start_dpf[];
311extern struct acpi_rsconvert_info acpi_rs_set_vendor[];
369 312
370void acpi_rs_dump_end_tag(union acpi_resource_data *resource); 313#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
314/*
315 * rsinfo
316 */
317extern struct acpi_rsdump_info *acpi_gbl_dump_resource_dispatch[];
371 318
319/*
320 * rsdump
321 */
322extern struct acpi_rsdump_info acpi_rs_dump_irq[];
323extern struct acpi_rsdump_info acpi_rs_dump_dma[];
324extern struct acpi_rsdump_info acpi_rs_dump_start_dpf[];
325extern struct acpi_rsdump_info acpi_rs_dump_end_dpf[];
326extern struct acpi_rsdump_info acpi_rs_dump_io[];
327extern struct acpi_rsdump_info acpi_rs_dump_fixed_io[];
328extern struct acpi_rsdump_info acpi_rs_dump_vendor[];
329extern struct acpi_rsdump_info acpi_rs_dump_end_tag[];
330extern struct acpi_rsdump_info acpi_rs_dump_memory24[];
331extern struct acpi_rsdump_info acpi_rs_dump_memory32[];
332extern struct acpi_rsdump_info acpi_rs_dump_fixed_memory32[];
333extern struct acpi_rsdump_info acpi_rs_dump_address16[];
334extern struct acpi_rsdump_info acpi_rs_dump_address32[];
335extern struct acpi_rsdump_info acpi_rs_dump_address64[];
336extern struct acpi_rsdump_info acpi_rs_dump_ext_address64[];
337extern struct acpi_rsdump_info acpi_rs_dump_ext_irq[];
338extern struct acpi_rsdump_info acpi_rs_dump_generic_reg[];
372#endif 339#endif
373 340
374#endif /* __ACRESRC_H__ */ 341#endif /* __ACRESRC_H__ */
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 43f7c509317a..29b887017b18 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -83,10 +83,11 @@ typedef COMPILER_DEPENDENT_UINT64 u64;
83 * UINT32 32-bit (4 byte) unsigned value 83 * UINT32 32-bit (4 byte) unsigned value
84 * INT64 64-bit (8 byte) signed value 84 * INT64 64-bit (8 byte) signed value
85 * UINT64 64-bit (8 byte) unsigned value 85 * UINT64 64-bit (8 byte) unsigned value
86 * ACPI_NATIVE_INT 32-bit on IA-32, 64-bit on IA-64 signed value 86 * ACPI_NATIVE_UINT 32-bit on IA-32, 64-bit on x86_64/IA-64 unsigned value
87 * ACPI_NATIVE_UINT 32-bit on IA-32, 64-bit on IA-64 unsigned value
88 */ 87 */
89 88
89typedef unsigned long acpi_native_uint;
90
90#ifndef ACPI_MACHINE_WIDTH 91#ifndef ACPI_MACHINE_WIDTH
91#error ACPI_MACHINE_WIDTH not defined 92#error ACPI_MACHINE_WIDTH not defined
92#endif 93#endif
@@ -108,9 +109,6 @@ typedef COMPILER_DEPENDENT_UINT64 UINT64;
108 109
109/*! [End] no source code translation !*/ 110/*! [End] no source code translation !*/
110 111
111typedef s64 acpi_native_int;
112typedef u64 acpi_native_uint;
113
114typedef u64 acpi_table_ptr; 112typedef u64 acpi_table_ptr;
115typedef u64 acpi_io_address; 113typedef u64 acpi_io_address;
116typedef u64 acpi_physical_address; 114typedef u64 acpi_physical_address;
@@ -121,9 +119,22 @@ typedef u64 acpi_size;
121#define ACPI_MAX_PTR ACPI_UINT64_MAX 119#define ACPI_MAX_PTR ACPI_UINT64_MAX
122#define ACPI_SIZE_MAX ACPI_UINT64_MAX 120#define ACPI_SIZE_MAX ACPI_UINT64_MAX
123 121
122/*
123 * In the case of the Itanium Processor Family (IPF), the hardware does not
124 * support misaligned memory transfers. Set the MISALIGNMENT_NOT_SUPPORTED flag
125 * to indicate that special precautions must be taken to avoid alignment faults.
126 * (IA64 or ia64 is currently used by existing compilers to indicate IPF.)
127 *
128 * Note: Em64_t and other X86-64 processors do support misaligned transfers,
129 * so there is no need to define this flag.
130 */
131#if defined (__IA64__) || defined (__ia64__)
132#define ACPI_MISALIGNMENT_NOT_SUPPORTED
133#endif
134
124#elif ACPI_MACHINE_WIDTH == 16 135#elif ACPI_MACHINE_WIDTH == 16
125 136
126/*! [Begin] no source code translation (keep the typedefs) */ 137/*! [Begin] no source code translation (keep the typedefs as-is) */
127 138
128/* 139/*
129 * 16-bit type definitions 140 * 16-bit type definitions
@@ -142,16 +153,12 @@ struct {
142 153
143/*! [End] no source code translation !*/ 154/*! [End] no source code translation !*/
144 155
145typedef u16 acpi_native_uint;
146typedef s16 acpi_native_int;
147
148typedef u32 acpi_table_ptr; 156typedef u32 acpi_table_ptr;
149typedef u32 acpi_io_address; 157typedef u32 acpi_io_address;
150typedef char *acpi_physical_address; 158typedef char *acpi_physical_address;
151typedef u16 acpi_size; 159typedef u16 acpi_size;
152 160
153#define ALIGNED_ADDRESS_BOUNDARY 0x00000002 161#define ALIGNED_ADDRESS_BOUNDARY 0x00000002
154#define ACPI_MISALIGNED_TRANSFERS
155#define ACPI_USE_NATIVE_DIVIDE /* No 64-bit integers, ok to use native divide */ 162#define ACPI_USE_NATIVE_DIVIDE /* No 64-bit integers, ok to use native divide */
156#define ACPI_MAX_PTR ACPI_UINT16_MAX 163#define ACPI_MAX_PTR ACPI_UINT16_MAX
157#define ACPI_SIZE_MAX ACPI_UINT16_MAX 164#define ACPI_SIZE_MAX ACPI_UINT16_MAX
@@ -179,16 +186,12 @@ typedef COMPILER_DEPENDENT_UINT64 UINT64;
179 186
180/*! [End] no source code translation !*/ 187/*! [End] no source code translation !*/
181 188
182typedef s32 acpi_native_int;
183typedef u32 acpi_native_uint;
184
185typedef u64 acpi_table_ptr; 189typedef u64 acpi_table_ptr;
186typedef u32 acpi_io_address; 190typedef u32 acpi_io_address;
187typedef u64 acpi_physical_address; 191typedef u64 acpi_physical_address;
188typedef u32 acpi_size; 192typedef u32 acpi_size;
189 193
190#define ALIGNED_ADDRESS_BOUNDARY 0x00000004 194#define ALIGNED_ADDRESS_BOUNDARY 0x00000004
191#define ACPI_MISALIGNED_TRANSFERS
192#define ACPI_MAX_PTR ACPI_UINT32_MAX 195#define ACPI_MAX_PTR ACPI_UINT32_MAX
193#define ACPI_SIZE_MAX ACPI_UINT32_MAX 196#define ACPI_SIZE_MAX ACPI_UINT32_MAX
194 197
@@ -895,6 +898,8 @@ struct acpi_mem_space_context {
895/* 898/*
896 * Definitions for Resource Attributes 899 * Definitions for Resource Attributes
897 */ 900 */
901typedef u16 acpi_rs_length; /* Resource Length field is fixed at 16 bits */
902typedef u32 acpi_rsdesc_size; /* Max Resource Descriptor size is (length+3) = (64_k-1)+3 */
898 903
899/* 904/*
900 * Memory Attributes 905 * Memory Attributes
@@ -927,8 +932,8 @@ struct acpi_mem_space_context {
927/* 932/*
928 * IRQ Attributes 933 * IRQ Attributes
929 */ 934 */
930#define ACPI_EDGE_SENSITIVE (u8) 0x00 935#define ACPI_LEVEL_SENSITIVE (u8) 0x00
931#define ACPI_LEVEL_SENSITIVE (u8) 0x01 936#define ACPI_EDGE_SENSITIVE (u8) 0x01
932 937
933#define ACPI_ACTIVE_HIGH (u8) 0x00 938#define ACPI_ACTIVE_HIGH (u8) 0x00
934#define ACPI_ACTIVE_LOW (u8) 0x01 939#define ACPI_ACTIVE_LOW (u8) 0x01
@@ -975,27 +980,34 @@ struct acpi_mem_space_context {
975#define ACPI_CONSUMER (u8) 0x01 980#define ACPI_CONSUMER (u8) 0x01
976 981
977/* 982/*
983 * If possible, pack the following structures to byte alignment
984 */
985#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
986#pragma pack(1)
987#endif
988
989/*
978 * Structures used to describe device resources 990 * Structures used to describe device resources
979 */ 991 */
980struct acpi_resource_irq { 992struct acpi_resource_irq {
981 u32 triggering; 993 u8 triggering;
982 u32 polarity; 994 u8 polarity;
983 u32 sharable; 995 u8 sharable;
984 u32 interrupt_count; 996 u8 interrupt_count;
985 u32 interrupts[1]; 997 u8 interrupts[1];
986}; 998};
987 999
988struct acpi_resource_dma { 1000struct acpi_resource_dma {
989 u32 type; 1001 u8 type;
990 u32 bus_master; 1002 u8 bus_master;
991 u32 transfer; 1003 u8 transfer;
992 u32 channel_count; 1004 u8 channel_count;
993 u32 channels[1]; 1005 u8 channels[1];
994}; 1006};
995 1007
996struct acpi_resource_start_dependent { 1008struct acpi_resource_start_dependent {
997 u32 compatibility_priority; 1009 u8 compatibility_priority;
998 u32 performance_robustness; 1010 u8 performance_robustness;
999}; 1011};
1000 1012
1001/* 1013/*
@@ -1004,20 +1016,20 @@ struct acpi_resource_start_dependent {
1004 */ 1016 */
1005 1017
1006struct acpi_resource_io { 1018struct acpi_resource_io {
1007 u32 io_decode; 1019 u8 io_decode;
1008 u32 minimum; 1020 u8 alignment;
1009 u32 maximum; 1021 u8 address_length;
1010 u32 alignment; 1022 u16 minimum;
1011 u32 address_length; 1023 u16 maximum;
1012}; 1024};
1013 1025
1014struct acpi_resource_fixed_io { 1026struct acpi_resource_fixed_io {
1015 u32 address; 1027 u16 address;
1016 u32 address_length; 1028 u8 address_length;
1017}; 1029};
1018 1030
1019struct acpi_resource_vendor { 1031struct acpi_resource_vendor {
1020 u32 byte_length; 1032 u16 byte_length;
1021 u8 byte_data[1]; 1033 u8 byte_data[1];
1022}; 1034};
1023 1035
@@ -1026,15 +1038,15 @@ struct acpi_resource_end_tag {
1026}; 1038};
1027 1039
1028struct acpi_resource_memory24 { 1040struct acpi_resource_memory24 {
1029 u32 read_write_attribute; 1041 u8 write_protect;
1030 u32 minimum; 1042 u16 minimum;
1031 u32 maximum; 1043 u16 maximum;
1032 u32 alignment; 1044 u16 alignment;
1033 u32 address_length; 1045 u16 address_length;
1034}; 1046};
1035 1047
1036struct acpi_resource_memory32 { 1048struct acpi_resource_memory32 {
1037 u32 read_write_attribute; 1049 u8 write_protect;
1038 u32 minimum; 1050 u32 minimum;
1039 u32 maximum; 1051 u32 maximum;
1040 u32 alignment; 1052 u32 alignment;
@@ -1042,57 +1054,59 @@ struct acpi_resource_memory32 {
1042}; 1054};
1043 1055
1044struct acpi_resource_fixed_memory32 { 1056struct acpi_resource_fixed_memory32 {
1045 u32 read_write_attribute; 1057 u8 write_protect;
1046 u32 address; 1058 u32 address;
1047 u32 address_length; 1059 u32 address_length;
1048}; 1060};
1049 1061
1050struct acpi_memory_attribute { 1062struct acpi_memory_attribute {
1051 u16 cache_attribute; 1063 u8 write_protect;
1052 u16 read_write_attribute; 1064 u8 caching;
1065 u8 range_type;
1066 u8 translation;
1053}; 1067};
1054 1068
1055struct acpi_io_attribute { 1069struct acpi_io_attribute {
1056 u16 range_attribute; 1070 u8 range_type;
1057 u16 translation_attribute; 1071 u8 translation;
1058}; 1072 u8 translation_type;
1059 1073 u8 reserved1;
1060struct acpi_bus_attribute {
1061 u16 reserved1;
1062 u16 reserved2;
1063}; 1074};
1064 1075
1065union acpi_resource_attribute { 1076union acpi_resource_attribute {
1066 struct acpi_memory_attribute memory; 1077 struct acpi_memory_attribute mem;
1067 struct acpi_io_attribute io; 1078 struct acpi_io_attribute io;
1068 struct acpi_bus_attribute bus; 1079
1080 /* Used for the *word_space macros */
1081
1082 u8 type_specific;
1069}; 1083};
1070 1084
1071struct acpi_resource_source { 1085struct acpi_resource_source {
1072 u32 index; 1086 u8 index;
1073 u32 string_length; 1087 u16 string_length;
1074 char *string_ptr; 1088 char *string_ptr;
1075}; 1089};
1076 1090
1077/* Fields common to all address descriptors, 16/32/64 bit */ 1091/* Fields common to all address descriptors, 16/32/64 bit */
1078 1092
1079#define ACPI_RESOURCE_ADDRESS_COMMON \ 1093#define ACPI_RESOURCE_ADDRESS_COMMON \
1080 u32 resource_type; \ 1094 u8 resource_type; \
1081 u32 producer_consumer; \ 1095 u8 producer_consumer; \
1082 u32 decode; \ 1096 u8 decode; \
1083 u32 min_address_fixed; \ 1097 u8 min_address_fixed; \
1084 u32 max_address_fixed; \ 1098 u8 max_address_fixed; \
1085 union acpi_resource_attribute attribute; 1099 union acpi_resource_attribute info;
1086 1100
1087struct acpi_resource_address { 1101struct acpi_resource_address {
1088ACPI_RESOURCE_ADDRESS_COMMON}; 1102ACPI_RESOURCE_ADDRESS_COMMON};
1089 1103
1090struct acpi_resource_address16 { 1104struct acpi_resource_address16 {
1091 ACPI_RESOURCE_ADDRESS_COMMON u32 granularity; 1105 ACPI_RESOURCE_ADDRESS_COMMON u16 granularity;
1092 u32 minimum; 1106 u16 minimum;
1093 u32 maximum; 1107 u16 maximum;
1094 u32 translation_offset; 1108 u16 translation_offset;
1095 u32 address_length; 1109 u16 address_length;
1096 struct acpi_resource_source resource_source; 1110 struct acpi_resource_source resource_source;
1097}; 1111};
1098 1112
@@ -1115,30 +1129,30 @@ struct acpi_resource_address64 {
1115}; 1129};
1116 1130
1117struct acpi_resource_extended_address64 { 1131struct acpi_resource_extended_address64 {
1118 ACPI_RESOURCE_ADDRESS_COMMON u64 granularity; 1132 ACPI_RESOURCE_ADDRESS_COMMON u8 revision_iD;
1133 u64 granularity;
1119 u64 minimum; 1134 u64 minimum;
1120 u64 maximum; 1135 u64 maximum;
1121 u64 translation_offset; 1136 u64 translation_offset;
1122 u64 address_length; 1137 u64 address_length;
1123 u64 type_specific_attributes; 1138 u64 type_specific;
1124 u8 revision_iD;
1125}; 1139};
1126 1140
1127struct acpi_resource_extended_irq { 1141struct acpi_resource_extended_irq {
1128 u32 producer_consumer; 1142 u8 producer_consumer;
1129 u32 triggering; 1143 u8 triggering;
1130 u32 polarity; 1144 u8 polarity;
1131 u32 sharable; 1145 u8 sharable;
1132 u32 interrupt_count; 1146 u8 interrupt_count;
1133 struct acpi_resource_source resource_source; 1147 struct acpi_resource_source resource_source;
1134 u32 interrupts[1]; 1148 u32 interrupts[1];
1135}; 1149};
1136 1150
1137struct acpi_resource_generic_register { 1151struct acpi_resource_generic_register {
1138 u32 space_id; 1152 u8 space_id;
1139 u32 bit_width; 1153 u8 bit_width;
1140 u32 bit_offset; 1154 u8 bit_offset;
1141 u32 access_size; 1155 u8 access_size;
1142 u64 address; 1156 u64 address;
1143}; 1157};
1144 1158
@@ -1192,14 +1206,17 @@ struct acpi_resource {
1192 union acpi_resource_data data; 1206 union acpi_resource_data data;
1193}; 1207};
1194 1208
1195#define ACPI_RESOURCE_LENGTH 12 1209/* restore default alignment */
1196#define ACPI_RESOURCE_LENGTH_NO_DATA 8 /* Id + Length fields */ 1210
1211#pragma pack()
1197 1212
1198#define ACPI_SIZEOF_RESOURCE(type) (u32) (ACPI_RESOURCE_LENGTH_NO_DATA + sizeof (type)) 1213#define ACPI_RS_SIZE_MIN 12
1214#define ACPI_RS_SIZE_NO_DATA 8 /* Id + Length fields */
1215#define ACPI_RS_SIZE(type) (u32) (ACPI_RS_SIZE_NO_DATA + sizeof (type))
1199 1216
1200#define ACPI_NEXT_RESOURCE(res) (struct acpi_resource *)((u8 *) res + res->length) 1217#define ACPI_NEXT_RESOURCE(res) (struct acpi_resource *)((u8 *) res + res->length)
1201 1218
1202#ifdef ACPI_MISALIGNED_TRANSFERS 1219#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
1203#define ACPI_ALIGN_RESOURCE_SIZE(length) (length) 1220#define ACPI_ALIGN_RESOURCE_SIZE(length) (length)
1204#else 1221#else
1205#define ACPI_ALIGN_RESOURCE_SIZE(length) ACPI_ROUND_UP_TO_NATIVE_WORD(length) 1222#define ACPI_ALIGN_RESOURCE_SIZE(length) ACPI_ROUND_UP_TO_NATIVE_WORD(length)
diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h
index c1086452696e..7386eb81bd2a 100644
--- a/include/acpi/acutils.h
+++ b/include/acpi/acutils.h
@@ -159,7 +159,6 @@ extern const u8 _acpi_ctype[];
159#define ACPI_IS_LOWER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO)) 159#define ACPI_IS_LOWER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO))
160#define ACPI_IS_PRINT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_SP | _ACPI_PU)) 160#define ACPI_IS_PRINT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_SP | _ACPI_PU))
161#define ACPI_IS_ALPHA(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP)) 161#define ACPI_IS_ALPHA(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP))
162#define ACPI_IS_ASCII(c) ((c) < 0x80)
163 162
164#endif /* ACPI_USE_SYSTEM_CLIBRARY */ 163#endif /* ACPI_USE_SYSTEM_CLIBRARY */
165 164
@@ -419,6 +418,12 @@ acpi_ut_strtoul64(char *string, u32 base, acpi_integer * ret_integer);
419 418
420#define ACPI_ANY_BASE 0 419#define ACPI_ANY_BASE 0
421 420
421u32 acpi_ut_get_descriptor_length(void *aml);
422
423u16 acpi_ut_get_resource_length(void *aml);
424
425u8 acpi_ut_get_resource_type(void *aml);
426
422u8 *acpi_ut_get_resource_end_tag(union acpi_operand_object *obj_desc); 427u8 *acpi_ut_get_resource_end_tag(union acpi_operand_object *obj_desc);
423 428
424u8 acpi_ut_generate_checksum(u8 * buffer, u32 length); 429u8 acpi_ut_generate_checksum(u8 * buffer, u32 length);
diff --git a/include/acpi/amlresrc.h b/include/acpi/amlresrc.h
index 103aff07db18..3112be527731 100644
--- a/include/acpi/amlresrc.h
+++ b/include/acpi/amlresrc.h
@@ -134,7 +134,7 @@ struct aml_resource_end_dependent {
134AML_RESOURCE_SMALL_HEADER_COMMON}; 134AML_RESOURCE_SMALL_HEADER_COMMON};
135 135
136struct aml_resource_io { 136struct aml_resource_io {
137 AML_RESOURCE_SMALL_HEADER_COMMON u8 information; 137 AML_RESOURCE_SMALL_HEADER_COMMON u8 flags;
138 u16 minimum; 138 u16 minimum;
139 u16 maximum; 139 u16 maximum;
140 u8 alignment; 140 u8 alignment;
@@ -164,7 +164,7 @@ struct aml_resource_large_header {
164AML_RESOURCE_LARGE_HEADER_COMMON}; 164AML_RESOURCE_LARGE_HEADER_COMMON};
165 165
166struct aml_resource_memory24 { 166struct aml_resource_memory24 {
167 AML_RESOURCE_LARGE_HEADER_COMMON u8 information; 167 AML_RESOURCE_LARGE_HEADER_COMMON u8 flags;
168 u16 minimum; 168 u16 minimum;
169 u16 maximum; 169 u16 maximum;
170 u16 alignment; 170 u16 alignment;
@@ -175,7 +175,7 @@ struct aml_resource_vendor_large {
175AML_RESOURCE_LARGE_HEADER_COMMON}; 175AML_RESOURCE_LARGE_HEADER_COMMON};
176 176
177struct aml_resource_memory32 { 177struct aml_resource_memory32 {
178 AML_RESOURCE_LARGE_HEADER_COMMON u8 information; 178 AML_RESOURCE_LARGE_HEADER_COMMON u8 flags;
179 u32 minimum; 179 u32 minimum;
180 u32 maximum; 180 u32 maximum;
181 u32 alignment; 181 u32 alignment;
@@ -183,7 +183,7 @@ struct aml_resource_memory32 {
183}; 183};
184 184
185struct aml_resource_fixed_memory32 { 185struct aml_resource_fixed_memory32 {
186 AML_RESOURCE_LARGE_HEADER_COMMON u8 information; 186 AML_RESOURCE_LARGE_HEADER_COMMON u8 flags;
187 u32 address; 187 u32 address;
188 u32 address_length; 188 u32 address_length;
189}; 189};
@@ -205,7 +205,7 @@ struct aml_resource_extended_address64 {
205 u64 maximum; 205 u64 maximum;
206 u64 translation_offset; 206 u64 translation_offset;
207 u64 address_length; 207 u64 address_length;
208 u64 type_specific_attributes; 208 u64 type_specific;
209}; 209};
210 210
211#define AML_RESOURCE_EXTENDED_ADDRESS_REVISION 1 /* ACPI 3.0 */ 211#define AML_RESOURCE_EXTENDED_ADDRESS_REVISION 1 /* ACPI 3.0 */
@@ -239,8 +239,8 @@ struct aml_resource_address16 {
239 239
240struct aml_resource_extended_irq { 240struct aml_resource_extended_irq {
241 AML_RESOURCE_LARGE_HEADER_COMMON u8 flags; 241 AML_RESOURCE_LARGE_HEADER_COMMON u8 flags;
242 u8 table_length; 242 u8 interrupt_count;
243 u32 interrupt_number[1]; 243 u32 interrupts[1];
244 /* res_source_index, res_source optional fields follow */ 244 /* res_source_index, res_source optional fields follow */
245}; 245};
246 246
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h
index 08539125696a..53aa997f05fc 100644
--- a/include/acpi/platform/acenv.h
+++ b/include/acpi/platform/acenv.h
@@ -206,6 +206,8 @@
206 * 206 *
207 *****************************************************************************/ 207 *****************************************************************************/
208 208
209#define ACPI_IS_ASCII(c) ((c) < 0x80)
210
209#ifdef ACPI_USE_SYSTEM_CLIBRARY 211#ifdef ACPI_USE_SYSTEM_CLIBRARY
210/* 212/*
211 * Use the standard C library headers. 213 * Use the standard C library headers.
@@ -235,7 +237,7 @@
235#define ACPI_STRCAT(d,s) (void) strcat((d), (s)) 237#define ACPI_STRCAT(d,s) (void) strcat((d), (s))
236#define ACPI_STRNCAT(d,s,n) strncat((d), (s), (acpi_size)(n)) 238#define ACPI_STRNCAT(d,s,n) strncat((d), (s), (acpi_size)(n))
237#define ACPI_STRTOUL(d,s,n) strtoul((d), (s), (acpi_size)(n)) 239#define ACPI_STRTOUL(d,s,n) strtoul((d), (s), (acpi_size)(n))
238#define ACPI_MEMCMP(s1,s2,n) memcmp((s1), (s2), (acpi_size)(n)) 240#define ACPI_MEMCMP(s1,s2,n) memcmp((const char *)(s1), (const char *)(s2), (acpi_size)(n))
239#define ACPI_MEMCPY(d,s,n) (void) memcpy((d), (s), (acpi_size)(n)) 241#define ACPI_MEMCPY(d,s,n) (void) memcpy((d), (s), (acpi_size)(n))
240#define ACPI_MEMSET(d,s,n) (void) memset((d), (s), (acpi_size)(n)) 242#define ACPI_MEMSET(d,s,n) (void) memset((d), (s), (acpi_size)(n))
241 243
@@ -247,7 +249,6 @@
247#define ACPI_IS_UPPER(i) isupper((int) (i)) 249#define ACPI_IS_UPPER(i) isupper((int) (i))
248#define ACPI_IS_PRINT(i) isprint((int) (i)) 250#define ACPI_IS_PRINT(i) isprint((int) (i))
249#define ACPI_IS_ALPHA(i) isalpha((int) (i)) 251#define ACPI_IS_ALPHA(i) isalpha((int) (i))
250#define ACPI_IS_ASCII(i) isascii((int) (i))
251 252
252#else 253#else
253 254
@@ -274,8 +275,8 @@ typedef char *va_list;
274/* 275/*
275 * Storage alignment properties 276 * Storage alignment properties
276 */ 277 */
277#define _AUPBND (sizeof (acpi_native_int) - 1) 278#define _AUPBND (sizeof (acpi_native_uint) - 1)
278#define _ADNBND (sizeof (acpi_native_int) - 1) 279#define _ADNBND (sizeof (acpi_native_uint) - 1)
279 280
280/* 281/*
281 * Variable argument list macro definitions 282 * Variable argument list macro definitions
@@ -297,7 +298,7 @@ typedef char *va_list;
297#define ACPI_STRCAT(d,s) (void) acpi_ut_strcat ((d), (s)) 298#define ACPI_STRCAT(d,s) (void) acpi_ut_strcat ((d), (s))
298#define ACPI_STRNCAT(d,s,n) acpi_ut_strncat ((d), (s), (acpi_size)(n)) 299#define ACPI_STRNCAT(d,s,n) acpi_ut_strncat ((d), (s), (acpi_size)(n))
299#define ACPI_STRTOUL(d,s,n) acpi_ut_strtoul ((d), (s), (acpi_size)(n)) 300#define ACPI_STRTOUL(d,s,n) acpi_ut_strtoul ((d), (s), (acpi_size)(n))
300#define ACPI_MEMCMP(s1,s2,n) acpi_ut_memcmp((s1), (s2), (acpi_size)(n)) 301#define ACPI_MEMCMP(s1,s2,n) acpi_ut_memcmp((const char *)(s1), (const char *)(s2), (acpi_size)(n))
301#define ACPI_MEMCPY(d,s,n) (void) acpi_ut_memcpy ((d), (s), (acpi_size)(n)) 302#define ACPI_MEMCPY(d,s,n) (void) acpi_ut_memcpy ((d), (s), (acpi_size)(n))
302#define ACPI_MEMSET(d,v,n) (void) acpi_ut_memset ((d), (v), (acpi_size)(n)) 303#define ACPI_MEMSET(d,v,n) (void) acpi_ut_memset ((d), (v), (acpi_size)(n))
303#define ACPI_TOUPPER acpi_ut_to_upper 304#define ACPI_TOUPPER acpi_ut_to_upper