diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-02-02 21:51:52 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-02-02 21:51:52 -0500 |
commit | 33052057e3e2db7f37fc78aa3f25c98f7e989fae (patch) | |
tree | e80a3aa1371f513c833dc94a16674f78faeeeb1d /include/acpi | |
parent | 00b464debf0038b1628996065f0be564ccfbfd86 (diff) | |
parent | 1113a7e92e483074c6235da59460759e33b9b144 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'include/acpi')
36 files changed, 1203 insertions, 804 deletions
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h index 427cff1a3f83..e27dc8f29972 100644 --- a/include/acpi/acconfig.h +++ b/include/acpi/acconfig.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2005, R. Byron Moore | 8 | * Copyright (C) 2000 - 2006, R. Byron Moore |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
@@ -61,9 +61,9 @@ | |||
61 | * | 61 | * |
62 | */ | 62 | */ |
63 | 63 | ||
64 | /* Version string */ | 64 | /* Current ACPICA subsystem version in YYYYMMDD format */ |
65 | 65 | ||
66 | #define ACPI_CA_VERSION 0x20050902 | 66 | #define ACPI_CA_VERSION 0x20060127 |
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, |
@@ -83,7 +83,7 @@ | |||
83 | #define ACPI_MAX_OBJECT_CACHE_DEPTH 96 /* Interpreter operand objects */ | 83 | #define ACPI_MAX_OBJECT_CACHE_DEPTH 96 /* Interpreter operand objects */ |
84 | 84 | ||
85 | /* | 85 | /* |
86 | * Should the subystem abort the loading of an ACPI table if the | 86 | * Should the subsystem abort the loading of an ACPI table if the |
87 | * table checksum is incorrect? | 87 | * table checksum is incorrect? |
88 | */ | 88 | */ |
89 | #define ACPI_CHECKSUM_ABORT FALSE | 89 | #define ACPI_CHECKSUM_ABORT FALSE |
@@ -98,11 +98,6 @@ | |||
98 | 98 | ||
99 | #define ACPI_CA_SUPPORT_LEVEL 3 | 99 | #define ACPI_CA_SUPPORT_LEVEL 3 |
100 | 100 | ||
101 | /* String size constants */ | ||
102 | |||
103 | #define ACPI_MAX_STRING_LENGTH 512 | ||
104 | #define ACPI_PATHNAME_MAX 256 /* A full namespace pathname */ | ||
105 | |||
106 | /* Maximum count for a semaphore object */ | 101 | /* Maximum count for a semaphore object */ |
107 | 102 | ||
108 | #define ACPI_MAX_SEMAPHORE_COUNT 256 | 103 | #define ACPI_MAX_SEMAPHORE_COUNT 256 |
@@ -115,6 +110,10 @@ | |||
115 | 110 | ||
116 | #define ACPI_SYSMEM_REGION_WINDOW_SIZE 4096 | 111 | #define ACPI_SYSMEM_REGION_WINDOW_SIZE 4096 |
117 | 112 | ||
113 | /* owner_id tracking. 8 entries allows for 255 owner_ids */ | ||
114 | |||
115 | #define ACPI_NUM_OWNERID_MASKS 8 | ||
116 | |||
118 | /****************************************************************************** | 117 | /****************************************************************************** |
119 | * | 118 | * |
120 | * ACPI Specification constants (Do not change unless the specification changes) | 119 | * ACPI Specification constants (Do not change unless the specification changes) |
@@ -134,14 +133,11 @@ | |||
134 | #define ACPI_METHOD_NUM_ARGS 7 | 133 | #define ACPI_METHOD_NUM_ARGS 7 |
135 | #define ACPI_METHOD_MAX_ARG 6 | 134 | #define ACPI_METHOD_MAX_ARG 6 |
136 | 135 | ||
137 | /* Maximum length of resulting string when converting from a buffer */ | 136 | /* Length of _HID, _UID, _CID, and UUID values */ |
138 | |||
139 | #define ACPI_MAX_STRING_CONVERSION 200 | ||
140 | |||
141 | /* Length of _HID, _UID, and _CID values */ | ||
142 | 137 | ||
143 | #define ACPI_DEVICE_ID_LENGTH 0x09 | 138 | #define ACPI_DEVICE_ID_LENGTH 0x09 |
144 | #define ACPI_MAX_CID_LENGTH 48 | 139 | #define ACPI_MAX_CID_LENGTH 48 |
140 | #define ACPI_UUID_LENGTH 16 | ||
145 | 141 | ||
146 | /* | 142 | /* |
147 | * Operand Stack (in WALK_STATE), Must be large enough to contain METHOD_MAX_ARG | 143 | * Operand Stack (in WALK_STATE), Must be large enough to contain METHOD_MAX_ARG |
diff --git a/include/acpi/acdebug.h b/include/acpi/acdebug.h index 70ce3b4d006e..d8167095caf3 100644 --- a/include/acpi/acdebug.h +++ b/include/acpi/acdebug.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2005, R. Byron Moore | 8 | * Copyright (C) 2000 - 2006, R. Byron Moore |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
diff --git a/include/acpi/acdisasm.h b/include/acpi/acdisasm.h index 3d96dcb1bb4b..11a8fe39cb04 100644 --- a/include/acpi/acdisasm.h +++ b/include/acpi/acdisasm.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2005, R. Byron Moore | 8 | * Copyright (C) 2000 - 2006, R. Byron Moore |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
@@ -57,26 +57,11 @@ struct acpi_external_list { | |||
57 | }; | 57 | }; |
58 | 58 | ||
59 | extern struct acpi_external_list *acpi_gbl_external_list; | 59 | extern struct acpi_external_list *acpi_gbl_external_list; |
60 | extern const char *acpi_gbl_io_decode[2]; | 60 | |
61 | /* Strings used for decoding flags to ASL keywords */ | ||
62 | |||
61 | extern const char *acpi_gbl_word_decode[4]; | 63 | extern const char *acpi_gbl_word_decode[4]; |
62 | extern const char *acpi_gbl_consume_decode[2]; | ||
63 | extern const char *acpi_gbl_min_decode[2]; | ||
64 | extern const char *acpi_gbl_max_decode[2]; | ||
65 | extern const char *acpi_gbl_DECdecode[2]; | ||
66 | extern const char *acpi_gbl_RNGdecode[4]; | ||
67 | extern const char *acpi_gbl_MEMdecode[4]; | ||
68 | extern const char *acpi_gbl_RWdecode[2]; | ||
69 | extern const char *acpi_gbl_irq_decode[2]; | 64 | extern const char *acpi_gbl_irq_decode[2]; |
70 | extern const char *acpi_gbl_HEdecode[2]; | ||
71 | extern const char *acpi_gbl_LLdecode[2]; | ||
72 | extern const char *acpi_gbl_SHRdecode[2]; | ||
73 | extern const char *acpi_gbl_TYPdecode[4]; | ||
74 | extern const char *acpi_gbl_BMdecode[2]; | ||
75 | extern const char *acpi_gbl_SIZdecode[4]; | ||
76 | extern const char *acpi_gbl_TTPdecode[2]; | ||
77 | extern const char *acpi_gbl_MTPdecode[4]; | ||
78 | extern const char *acpi_gbl_TRSdecode[2]; | ||
79 | |||
80 | extern const char *acpi_gbl_lock_rule[ACPI_NUM_LOCK_RULES]; | 65 | extern const char *acpi_gbl_lock_rule[ACPI_NUM_LOCK_RULES]; |
81 | extern const char *acpi_gbl_access_types[ACPI_NUM_ACCESS_TYPES]; | 66 | extern const char *acpi_gbl_access_types[ACPI_NUM_ACCESS_TYPES]; |
82 | extern const char *acpi_gbl_update_rules[ACPI_NUM_UPDATE_RULES]; | 67 | extern const char *acpi_gbl_update_rules[ACPI_NUM_UPDATE_RULES]; |
@@ -171,11 +156,19 @@ u8 acpi_dm_is_string_buffer(union acpi_parse_object *op); | |||
171 | /* | 156 | /* |
172 | * dmresrc | 157 | * dmresrc |
173 | */ | 158 | */ |
159 | void acpi_dm_dump_integer8(u8 value, char *name); | ||
160 | |||
161 | void acpi_dm_dump_integer16(u16 value, char *name); | ||
162 | |||
163 | void acpi_dm_dump_integer32(u32 value, char *name); | ||
164 | |||
165 | void acpi_dm_dump_integer64(u64 value, char *name); | ||
166 | |||
174 | void | 167 | void |
175 | acpi_dm_resource_descriptor(struct acpi_op_walk_info *info, | 168 | acpi_dm_resource_template(struct acpi_op_walk_info *info, |
176 | u8 * byte_data, u32 byte_count); | 169 | u8 * byte_data, u32 byte_count); |
177 | 170 | ||
178 | u8 acpi_dm_is_resource_descriptor(union acpi_parse_object *op); | 171 | u8 acpi_dm_is_resource_template(union acpi_parse_object *op); |
179 | 172 | ||
180 | void acpi_dm_indent(u32 level); | 173 | void acpi_dm_indent(u32 level); |
181 | 174 | ||
@@ -187,73 +180,69 @@ void acpi_dm_decode_attribute(u8 attribute); | |||
187 | * dmresrcl | 180 | * dmresrcl |
188 | */ | 181 | */ |
189 | void | 182 | void |
190 | acpi_dm_word_descriptor(struct asl_word_address_desc *resource, | 183 | acpi_dm_word_descriptor(union aml_resource *resource, u32 length, u32 level); |
191 | u32 length, u32 level); | ||
192 | 184 | ||
193 | void | 185 | void |
194 | acpi_dm_dword_descriptor(struct asl_dword_address_desc *resource, | 186 | acpi_dm_dword_descriptor(union aml_resource *resource, u32 length, u32 level); |
195 | u32 length, u32 level); | ||
196 | 187 | ||
197 | void | 188 | void |
198 | acpi_dm_extended_descriptor(struct asl_extended_address_desc *resource, | 189 | acpi_dm_extended_descriptor(union aml_resource *resource, |
199 | u32 length, u32 level); | 190 | u32 length, u32 level); |
200 | 191 | ||
201 | void | 192 | void |
202 | acpi_dm_qword_descriptor(struct asl_qword_address_desc *resource, | 193 | acpi_dm_qword_descriptor(union aml_resource *resource, u32 length, u32 level); |
203 | u32 length, u32 level); | ||
204 | 194 | ||
205 | void | 195 | void |
206 | acpi_dm_memory24_descriptor(struct asl_memory_24_desc *resource, | 196 | acpi_dm_memory24_descriptor(union aml_resource *resource, |
207 | u32 length, u32 level); | 197 | u32 length, u32 level); |
208 | 198 | ||
209 | void | 199 | void |
210 | acpi_dm_memory32_descriptor(struct asl_memory_32_desc *resource, | 200 | acpi_dm_memory32_descriptor(union aml_resource *resource, |
211 | u32 length, u32 level); | 201 | u32 length, u32 level); |
212 | 202 | ||
213 | void | 203 | void |
214 | acpi_dm_fixed_mem32_descriptor(struct asl_fixed_memory_32_desc *resource, | 204 | acpi_dm_fixed_memory32_descriptor(union aml_resource *resource, |
215 | u32 length, u32 level); | 205 | u32 length, u32 level); |
216 | 206 | ||
217 | void | 207 | void |
218 | acpi_dm_generic_register_descriptor(struct asl_general_register_desc *resource, | 208 | acpi_dm_generic_register_descriptor(union aml_resource *resource, |
219 | u32 length, u32 level); | 209 | u32 length, u32 level); |
220 | 210 | ||
221 | void | 211 | void |
222 | acpi_dm_interrupt_descriptor(struct asl_extended_xrupt_desc *resource, | 212 | acpi_dm_interrupt_descriptor(union aml_resource *resource, |
223 | u32 length, u32 level); | 213 | u32 length, u32 level); |
224 | 214 | ||
225 | void | 215 | void |
226 | acpi_dm_vendor_large_descriptor(struct asl_large_vendor_desc *resource, | 216 | acpi_dm_vendor_large_descriptor(union aml_resource *resource, |
227 | u32 length, u32 level); | 217 | u32 length, u32 level); |
228 | 218 | ||
219 | void acpi_dm_vendor_common(char *name, u8 * byte_data, u32 length, u32 level); | ||
220 | |||
229 | /* | 221 | /* |
230 | * dmresrcs | 222 | * dmresrcs |
231 | */ | 223 | */ |
232 | void | 224 | void |
233 | acpi_dm_irq_descriptor(struct asl_irq_format_desc *resource, | 225 | acpi_dm_irq_descriptor(union aml_resource *resource, u32 length, u32 level); |
234 | u32 length, u32 level); | ||
235 | 226 | ||
236 | void | 227 | void |
237 | acpi_dm_dma_descriptor(struct asl_dma_format_desc *resource, | 228 | acpi_dm_dma_descriptor(union aml_resource *resource, u32 length, u32 level); |
238 | u32 length, u32 level); | ||
239 | 229 | ||
240 | void | 230 | void acpi_dm_io_descriptor(union aml_resource *resource, u32 length, u32 level); |
241 | acpi_dm_io_descriptor(struct asl_io_port_desc *resource, u32 length, u32 level); | ||
242 | 231 | ||
243 | void | 232 | void |
244 | acpi_dm_fixed_io_descriptor(struct asl_fixed_io_port_desc *resource, | 233 | acpi_dm_fixed_io_descriptor(union aml_resource *resource, |
245 | u32 length, u32 level); | 234 | u32 length, u32 level); |
246 | 235 | ||
247 | void | 236 | void |
248 | acpi_dm_start_dependent_descriptor(struct asl_start_dependent_desc *resource, | 237 | acpi_dm_start_dependent_descriptor(union aml_resource *resource, |
249 | u32 length, u32 level); | 238 | u32 length, u32 level); |
250 | 239 | ||
251 | void | 240 | void |
252 | acpi_dm_end_dependent_descriptor(struct asl_start_dependent_desc *resource, | 241 | acpi_dm_end_dependent_descriptor(union aml_resource *resource, |
253 | u32 length, u32 level); | 242 | u32 length, u32 level); |
254 | 243 | ||
255 | void | 244 | void |
256 | acpi_dm_vendor_small_descriptor(struct asl_small_vendor_desc *resource, | 245 | acpi_dm_vendor_small_descriptor(union aml_resource *resource, |
257 | u32 length, u32 level); | 246 | u32 length, u32 level); |
258 | 247 | ||
259 | /* | 248 | /* |
diff --git a/include/acpi/acdispat.h b/include/acpi/acdispat.h index 065f24a77cfc..c41a926ff317 100644 --- a/include/acpi/acdispat.h +++ b/include/acpi/acdispat.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2005, R. Byron Moore | 8 | * Copyright (C) 2000 - 2006, R. Byron Moore |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
@@ -201,6 +201,9 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node, | |||
201 | union acpi_operand_object *obj_desc, | 201 | union acpi_operand_object *obj_desc, |
202 | struct acpi_namespace_node *calling_method_node); | 202 | struct acpi_namespace_node *calling_method_node); |
203 | 203 | ||
204 | acpi_status | ||
205 | acpi_ds_method_error(acpi_status status, struct acpi_walk_state *walk_state); | ||
206 | |||
204 | /* | 207 | /* |
205 | * dsinit | 208 | * dsinit |
206 | */ | 209 | */ |
diff --git a/include/acpi/acevents.h b/include/acpi/acevents.h index bfa54600ecd9..f2717be4fe0d 100644 --- a/include/acpi/acevents.h +++ b/include/acpi/acevents.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2005, R. Byron Moore | 8 | * Copyright (C) 2000 - 2006, R. Byron Moore |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
@@ -51,6 +51,8 @@ acpi_status acpi_ev_initialize_events(void); | |||
51 | 51 | ||
52 | acpi_status acpi_ev_install_xrupt_handlers(void); | 52 | acpi_status acpi_ev_install_xrupt_handlers(void); |
53 | 53 | ||
54 | acpi_status acpi_ev_install_fadt_gpes(void); | ||
55 | |||
54 | u32 acpi_ev_fixed_event_detect(void); | 56 | u32 acpi_ev_fixed_event_detect(void); |
55 | 57 | ||
56 | /* | 58 | /* |
@@ -105,6 +107,10 @@ acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device, | |||
105 | u32 interrupt_number, | 107 | u32 interrupt_number, |
106 | struct acpi_gpe_block_info **return_gpe_block); | 108 | struct acpi_gpe_block_info **return_gpe_block); |
107 | 109 | ||
110 | acpi_status | ||
111 | acpi_ev_initialize_gpe_block(struct acpi_namespace_node *gpe_device, | ||
112 | struct acpi_gpe_block_info *gpe_block); | ||
113 | |||
108 | acpi_status acpi_ev_delete_gpe_block(struct acpi_gpe_block_info *gpe_block); | 114 | acpi_status acpi_ev_delete_gpe_block(struct acpi_gpe_block_info *gpe_block); |
109 | 115 | ||
110 | u32 | 116 | u32 |
diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h index 4f005eb65928..dc768aa580e4 100644 --- a/include/acpi/acexcep.h +++ b/include/acpi/acexcep.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2005, R. Byron Moore | 8 | * Copyright (C) 2000 - 2006, R. Byron Moore |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
diff --git a/include/acpi/acglobal.h b/include/acpi/acglobal.h index 4ab2ca18b8df..734cc77bf2c7 100644 --- a/include/acpi/acglobal.h +++ b/include/acpi/acglobal.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2005, R. Byron Moore | 8 | * Copyright (C) 2000 - 2006, R. Byron Moore |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
@@ -80,6 +80,15 @@ extern u32 acpi_dbg_layer; | |||
80 | 80 | ||
81 | extern u32 acpi_gbl_nesting_level; | 81 | extern u32 acpi_gbl_nesting_level; |
82 | 82 | ||
83 | /* Support for dynamic control method tracing mechanism */ | ||
84 | |||
85 | ACPI_EXTERN u32 acpi_gbl_original_dbg_level; | ||
86 | ACPI_EXTERN u32 acpi_gbl_original_dbg_layer; | ||
87 | ACPI_EXTERN acpi_name acpi_gbl_trace_method_name; | ||
88 | ACPI_EXTERN u32 acpi_gbl_trace_dbg_level; | ||
89 | ACPI_EXTERN u32 acpi_gbl_trace_dbg_layer; | ||
90 | ACPI_EXTERN u32 acpi_gbl_trace_flags; | ||
91 | |||
83 | /***************************************************************************** | 92 | /***************************************************************************** |
84 | * | 93 | * |
85 | * Runtime configuration (static defaults that can be overriden at runtime) | 94 | * Runtime configuration (static defaults that can be overriden at runtime) |
@@ -89,11 +98,15 @@ extern u32 acpi_gbl_nesting_level; | |||
89 | /* | 98 | /* |
90 | * Enable "slack" in the AML interpreter? Default is FALSE, and the | 99 | * Enable "slack" in the AML interpreter? Default is FALSE, and the |
91 | * interpreter strictly follows the ACPI specification. Setting to TRUE | 100 | * interpreter strictly follows the ACPI specification. Setting to TRUE |
92 | * allows the interpreter to forgive certain bad AML constructs. Currently: | 101 | * allows the interpreter to ignore certain errors and/or bad AML constructs. |
102 | * | ||
103 | * Currently, these features are enabled by this flag: | ||
104 | * | ||
93 | * 1) Allow "implicit return" of last value in a control method | 105 | * 1) Allow "implicit return" of last value in a control method |
94 | * 2) Allow access beyond end of operation region | 106 | * 2) Allow access beyond the end of an operation region |
95 | * 3) Allow access to uninitialized locals/args (auto-init to integer 0) | 107 | * 3) Allow access to uninitialized locals/args (auto-init to integer 0) |
96 | * 4) Allow ANY object type to be a source operand for the Store() operator | 108 | * 4) Allow ANY object type to be a source operand for the Store() operator |
109 | * 5) Allow unresolved references (invalid target name) in package objects | ||
97 | */ | 110 | */ |
98 | ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_enable_interpreter_slack, FALSE); | 111 | ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_enable_interpreter_slack, FALSE); |
99 | 112 | ||
@@ -211,9 +224,11 @@ ACPI_EXTERN u32 acpi_gbl_original_mode; | |||
211 | ACPI_EXTERN u32 acpi_gbl_rsdp_original_location; | 224 | ACPI_EXTERN u32 acpi_gbl_rsdp_original_location; |
212 | ACPI_EXTERN u32 acpi_gbl_ns_lookup_count; | 225 | ACPI_EXTERN u32 acpi_gbl_ns_lookup_count; |
213 | ACPI_EXTERN u32 acpi_gbl_ps_find_count; | 226 | ACPI_EXTERN u32 acpi_gbl_ps_find_count; |
214 | ACPI_EXTERN u64 acpi_gbl_owner_id_mask; | 227 | ACPI_EXTERN u32 acpi_gbl_owner_id_mask[ACPI_NUM_OWNERID_MASKS]; |
215 | ACPI_EXTERN u16 acpi_gbl_pm1_enable_register_save; | 228 | ACPI_EXTERN u16 acpi_gbl_pm1_enable_register_save; |
216 | ACPI_EXTERN u16 acpi_gbl_global_lock_handle; | 229 | ACPI_EXTERN u16 acpi_gbl_global_lock_handle; |
230 | ACPI_EXTERN u8 acpi_gbl_last_owner_id_index; | ||
231 | ACPI_EXTERN u8 acpi_gbl_next_owner_id_offset; | ||
217 | ACPI_EXTERN u8 acpi_gbl_debugger_configuration; | 232 | ACPI_EXTERN u8 acpi_gbl_debugger_configuration; |
218 | ACPI_EXTERN u8 acpi_gbl_global_lock_acquired; | 233 | ACPI_EXTERN u8 acpi_gbl_global_lock_acquired; |
219 | ACPI_EXTERN u8 acpi_gbl_step_to_next_call; | 234 | ACPI_EXTERN u8 acpi_gbl_step_to_next_call; |
diff --git a/include/acpi/achware.h b/include/acpi/achware.h index 3644d7248e7e..29b60a8c0593 100644 --- a/include/acpi/achware.h +++ b/include/acpi/achware.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2005, R. Byron Moore | 8 | * Copyright (C) 2000 - 2006, R. Byron Moore |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
diff --git a/include/acpi/acinterp.h b/include/acpi/acinterp.h index 2c9c1a1d1b7f..9f22cfcb624b 100644 --- a/include/acpi/acinterp.h +++ b/include/acpi/acinterp.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2005, R. Byron Moore | 8 | * Copyright (C) 2000 - 2006, R. Byron Moore |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
@@ -44,7 +44,49 @@ | |||
44 | #ifndef __ACINTERP_H__ | 44 | #ifndef __ACINTERP_H__ |
45 | #define __ACINTERP_H__ | 45 | #define __ACINTERP_H__ |
46 | 46 | ||
47 | #define ACPI_WALK_OPERANDS (&(walk_state->operands [walk_state->num_operands -1])) | 47 | #define ACPI_WALK_OPERANDS (&(walk_state->operands [walk_state->num_operands -1])) |
48 | |||
49 | /* Macros for tables used for debug output */ | ||
50 | |||
51 | #define ACPI_EXD_OFFSET(f) (u8) ACPI_OFFSET (union acpi_operand_object,f) | ||
52 | #define ACPI_EXD_NSOFFSET(f) (u8) ACPI_OFFSET (struct acpi_namespace_node,f) | ||
53 | #define ACPI_EXD_TABLE_SIZE(name) (sizeof(name) / sizeof (struct acpi_exdump_info)) | ||
54 | |||
55 | /* | ||
56 | * If possible, pack the following structure to byte alignment, since we | ||
57 | * don't care about performance for debug output | ||
58 | */ | ||
59 | #ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED | ||
60 | #pragma pack(1) | ||
61 | #endif | ||
62 | |||
63 | typedef const struct acpi_exdump_info { | ||
64 | u8 opcode; | ||
65 | u8 offset; | ||
66 | char *name; | ||
67 | |||
68 | } acpi_exdump_info; | ||
69 | |||
70 | /* Values for the Opcode field above */ | ||
71 | |||
72 | #define ACPI_EXD_INIT 0 | ||
73 | #define ACPI_EXD_TYPE 1 | ||
74 | #define ACPI_EXD_UINT8 2 | ||
75 | #define ACPI_EXD_UINT16 3 | ||
76 | #define ACPI_EXD_UINT32 4 | ||
77 | #define ACPI_EXD_UINT64 5 | ||
78 | #define ACPI_EXD_LITERAL 6 | ||
79 | #define ACPI_EXD_POINTER 7 | ||
80 | #define ACPI_EXD_ADDRESS 8 | ||
81 | #define ACPI_EXD_STRING 9 | ||
82 | #define ACPI_EXD_BUFFER 10 | ||
83 | #define ACPI_EXD_PACKAGE 11 | ||
84 | #define ACPI_EXD_FIELD 12 | ||
85 | #define ACPI_EXD_REFERENCE 13 | ||
86 | |||
87 | /* restore default alignment */ | ||
88 | |||
89 | #pragma pack() | ||
48 | 90 | ||
49 | /* | 91 | /* |
50 | * exconvrt - object conversion | 92 | * exconvrt - object conversion |
@@ -327,7 +369,7 @@ acpi_ex_dump_operands(union acpi_operand_object **operands, | |||
327 | void | 369 | void |
328 | acpi_ex_dump_object_descriptor(union acpi_operand_object *object, u32 flags); | 370 | acpi_ex_dump_object_descriptor(union acpi_operand_object *object, u32 flags); |
329 | 371 | ||
330 | void acpi_ex_dump_node(struct acpi_namespace_node *node, u32 flags); | 372 | void acpi_ex_dump_namespace_node(struct acpi_namespace_node *node, u32 flags); |
331 | #endif /* ACPI_FUTURE_USAGE */ | 373 | #endif /* ACPI_FUTURE_USAGE */ |
332 | 374 | ||
333 | /* | 375 | /* |
diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h index 9fba0fddda90..8361820d2970 100644 --- a/include/acpi/aclocal.h +++ b/include/acpi/aclocal.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2005, R. Byron Moore | 8 | * Copyright (C) 2000 - 2006, R. Byron Moore |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
@@ -276,6 +276,37 @@ struct acpi_create_field_info { | |||
276 | u8 field_type; | 276 | u8 field_type; |
277 | }; | 277 | }; |
278 | 278 | ||
279 | /* | ||
280 | * Bitmapped ACPI types. Used internally only | ||
281 | */ | ||
282 | #define ACPI_BTYPE_ANY 0x00000000 | ||
283 | #define ACPI_BTYPE_INTEGER 0x00000001 | ||
284 | #define ACPI_BTYPE_STRING 0x00000002 | ||
285 | #define ACPI_BTYPE_BUFFER 0x00000004 | ||
286 | #define ACPI_BTYPE_PACKAGE 0x00000008 | ||
287 | #define ACPI_BTYPE_FIELD_UNIT 0x00000010 | ||
288 | #define ACPI_BTYPE_DEVICE 0x00000020 | ||
289 | #define ACPI_BTYPE_EVENT 0x00000040 | ||
290 | #define ACPI_BTYPE_METHOD 0x00000080 | ||
291 | #define ACPI_BTYPE_MUTEX 0x00000100 | ||
292 | #define ACPI_BTYPE_REGION 0x00000200 | ||
293 | #define ACPI_BTYPE_POWER 0x00000400 | ||
294 | #define ACPI_BTYPE_PROCESSOR 0x00000800 | ||
295 | #define ACPI_BTYPE_THERMAL 0x00001000 | ||
296 | #define ACPI_BTYPE_BUFFER_FIELD 0x00002000 | ||
297 | #define ACPI_BTYPE_DDB_HANDLE 0x00004000 | ||
298 | #define ACPI_BTYPE_DEBUG_OBJECT 0x00008000 | ||
299 | #define ACPI_BTYPE_REFERENCE 0x00010000 | ||
300 | #define ACPI_BTYPE_RESOURCE 0x00020000 | ||
301 | |||
302 | #define ACPI_BTYPE_COMPUTE_DATA (ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER) | ||
303 | |||
304 | #define ACPI_BTYPE_DATA (ACPI_BTYPE_COMPUTE_DATA | ACPI_BTYPE_PACKAGE) | ||
305 | #define ACPI_BTYPE_DATA_REFERENCE (ACPI_BTYPE_DATA | ACPI_BTYPE_REFERENCE | ACPI_BTYPE_DDB_HANDLE) | ||
306 | #define ACPI_BTYPE_DEVICE_OBJECTS (ACPI_BTYPE_DEVICE | ACPI_BTYPE_THERMAL | ACPI_BTYPE_PROCESSOR) | ||
307 | #define ACPI_BTYPE_OBJECTS_AND_REFS 0x0001FFFF /* ARG or LOCAL */ | ||
308 | #define ACPI_BTYPE_ALL_OBJECTS 0x0000FFFF | ||
309 | |||
279 | /***************************************************************************** | 310 | /***************************************************************************** |
280 | * | 311 | * |
281 | * Event typedefs and structs | 312 | * Event typedefs and structs |
@@ -385,13 +416,13 @@ struct acpi_field_info { | |||
385 | #define ACPI_CONTROL_PREDICATE_FALSE 0xC3 | 416 | #define ACPI_CONTROL_PREDICATE_FALSE 0xC3 |
386 | #define ACPI_CONTROL_PREDICATE_TRUE 0xC4 | 417 | #define ACPI_CONTROL_PREDICATE_TRUE 0xC4 |
387 | 418 | ||
388 | #define ACPI_STATE_COMMON /* Two 32-bit fields and a pointer */\ | 419 | #define ACPI_STATE_COMMON /* Two 32-bit fields and a pointer */\ |
389 | u8 data_type; /* To differentiate various internal objs */\ | 420 | u8 data_type; /* To differentiate various internal objs */\ |
390 | u8 flags; \ | 421 | u8 flags; \ |
391 | u16 value; \ | 422 | u16 value; \ |
392 | u16 state; \ | 423 | u16 state; \ |
393 | u16 reserved; \ | 424 | u16 reserved; \ |
394 | void *next; \ | 425 | void *next; |
395 | 426 | ||
396 | struct acpi_common_state { | 427 | struct acpi_common_state { |
397 | ACPI_STATE_COMMON}; | 428 | ACPI_STATE_COMMON}; |
@@ -544,8 +575,7 @@ union acpi_parse_value { | |||
544 | char aml_op_name[16]) /* Op name (debug only) */\ | 575 | char aml_op_name[16]) /* Op name (debug only) */\ |
545 | /* NON-DEBUG members below: */\ | 576 | /* NON-DEBUG members below: */\ |
546 | struct acpi_namespace_node *node; /* For use by interpreter */\ | 577 | struct acpi_namespace_node *node; /* For use by interpreter */\ |
547 | union acpi_parse_value value; /* Value or args associated with the opcode */\ | 578 | union acpi_parse_value value; /* Value or args associated with the opcode */ |
548 | |||
549 | 579 | ||
550 | #define ACPI_DASM_BUFFER 0x00 | 580 | #define ACPI_DASM_BUFFER 0x00 |
551 | #define ACPI_DASM_RESOURCE 0x01 | 581 | #define ACPI_DASM_RESOURCE 0x01 |
@@ -573,6 +603,8 @@ struct acpi_parse_obj_named { | |||
573 | 603 | ||
574 | /* The parse node is the fundamental element of the parse tree */ | 604 | /* The parse node is the fundamental element of the parse tree */ |
575 | 605 | ||
606 | #define ACPI_MAX_PARSEOP_NAME 20 | ||
607 | |||
576 | struct acpi_parse_obj_asl { | 608 | struct acpi_parse_obj_asl { |
577 | ACPI_PARSE_COMMON union acpi_parse_object *child; | 609 | ACPI_PARSE_COMMON union acpi_parse_object *child; |
578 | union acpi_parse_object *parent_method; | 610 | union acpi_parse_object *parent_method; |
@@ -597,7 +629,7 @@ struct acpi_parse_obj_asl { | |||
597 | u8 aml_opcode_length; | 629 | u8 aml_opcode_length; |
598 | u8 aml_pkg_len_bytes; | 630 | u8 aml_pkg_len_bytes; |
599 | u8 extra; | 631 | u8 extra; |
600 | char parse_op_name[12]; | 632 | char parse_op_name[ACPI_MAX_PARSEOP_NAME]; |
601 | }; | 633 | }; |
602 | 634 | ||
603 | union acpi_parse_object { | 635 | union acpi_parse_object { |
@@ -735,44 +767,52 @@ struct acpi_bit_register_info { | |||
735 | 767 | ||
736 | /* resource_type values */ | 768 | /* resource_type values */ |
737 | 769 | ||
738 | #define ACPI_RESOURCE_TYPE_MEMORY_RANGE 0 | 770 | #define ACPI_ADDRESS_TYPE_MEMORY_RANGE 0 |
739 | #define ACPI_RESOURCE_TYPE_IO_RANGE 1 | 771 | #define ACPI_ADDRESS_TYPE_IO_RANGE 1 |
740 | #define ACPI_RESOURCE_TYPE_BUS_NUMBER_RANGE 2 | 772 | #define ACPI_ADDRESS_TYPE_BUS_NUMBER_RANGE 2 |
741 | 773 | ||
742 | /* Resource descriptor types and masks */ | 774 | /* Resource descriptor types and masks */ |
743 | 775 | ||
744 | #define ACPI_RDESC_TYPE_LARGE 0x80 | 776 | #define ACPI_RESOURCE_NAME_LARGE 0x80 |
745 | #define ACPI_RDESC_TYPE_SMALL 0x00 | 777 | #define ACPI_RESOURCE_NAME_SMALL 0x00 |
746 | 778 | ||
747 | #define ACPI_RDESC_TYPE_MASK 0x80 | 779 | #define ACPI_RESOURCE_NAME_SMALL_MASK 0x78 /* Bits 6:3 contain the type */ |
748 | #define ACPI_RDESC_SMALL_MASK 0x78 /* Only bits 6:3 contain the type */ | 780 | #define ACPI_RESOURCE_NAME_SMALL_LENGTH_MASK 0x07 /* Bits 2:0 contain the length */ |
781 | #define ACPI_RESOURCE_NAME_LARGE_MASK 0x7F /* Bits 6:0 contain the type */ | ||
749 | 782 | ||
750 | /* | 783 | /* |
751 | * Small resource descriptor types | 784 | * Small resource descriptor "names" as defined by the ACPI specification. |
752 | * Note: The 3 length bits (2:0) must be zero | 785 | * Note: Bits 2:0 are used for the descriptor length |
753 | */ | 786 | */ |
754 | #define ACPI_RDESC_TYPE_IRQ_FORMAT 0x20 | 787 | #define ACPI_RESOURCE_NAME_IRQ 0x20 |
755 | #define ACPI_RDESC_TYPE_DMA_FORMAT 0x28 | 788 | #define ACPI_RESOURCE_NAME_DMA 0x28 |
756 | #define ACPI_RDESC_TYPE_START_DEPENDENT 0x30 | 789 | #define ACPI_RESOURCE_NAME_START_DEPENDENT 0x30 |
757 | #define ACPI_RDESC_TYPE_END_DEPENDENT 0x38 | 790 | #define ACPI_RESOURCE_NAME_END_DEPENDENT 0x38 |
758 | #define ACPI_RDESC_TYPE_IO_PORT 0x40 | 791 | #define ACPI_RESOURCE_NAME_IO 0x40 |
759 | #define ACPI_RDESC_TYPE_FIXED_IO_PORT 0x48 | 792 | #define ACPI_RESOURCE_NAME_FIXED_IO 0x48 |
760 | #define ACPI_RDESC_TYPE_SMALL_VENDOR 0x70 | 793 | #define ACPI_RESOURCE_NAME_RESERVED_S1 0x50 |
761 | #define ACPI_RDESC_TYPE_END_TAG 0x78 | 794 | #define ACPI_RESOURCE_NAME_RESERVED_S2 0x58 |
795 | #define ACPI_RESOURCE_NAME_RESERVED_S3 0x60 | ||
796 | #define ACPI_RESOURCE_NAME_RESERVED_S4 0x68 | ||
797 | #define ACPI_RESOURCE_NAME_VENDOR_SMALL 0x70 | ||
798 | #define ACPI_RESOURCE_NAME_END_TAG 0x78 | ||
762 | 799 | ||
763 | /* | 800 | /* |
764 | * Large resource descriptor types | 801 | * Large resource descriptor "names" as defined by the ACPI specification. |
802 | * Note: includes the Large Descriptor bit in bit[7] | ||
765 | */ | 803 | */ |
766 | #define ACPI_RDESC_TYPE_MEMORY_24 0x81 | 804 | #define ACPI_RESOURCE_NAME_MEMORY24 0x81 |
767 | #define ACPI_RDESC_TYPE_GENERAL_REGISTER 0x82 | 805 | #define ACPI_RESOURCE_NAME_GENERIC_REGISTER 0x82 |
768 | #define ACPI_RDESC_TYPE_LARGE_VENDOR 0x84 | 806 | #define ACPI_RESOURCE_NAME_RESERVED_L1 0x83 |
769 | #define ACPI_RDESC_TYPE_MEMORY_32 0x85 | 807 | #define ACPI_RESOURCE_NAME_VENDOR_LARGE 0x84 |
770 | #define ACPI_RDESC_TYPE_FIXED_MEMORY_32 0x86 | 808 | #define ACPI_RESOURCE_NAME_MEMORY32 0x85 |
771 | #define ACPI_RDESC_TYPE_DWORD_ADDRESS_SPACE 0x87 | 809 | #define ACPI_RESOURCE_NAME_FIXED_MEMORY32 0x86 |
772 | #define ACPI_RDESC_TYPE_WORD_ADDRESS_SPACE 0x88 | 810 | #define ACPI_RESOURCE_NAME_ADDRESS32 0x87 |
773 | #define ACPI_RDESC_TYPE_EXTENDED_XRUPT 0x89 | 811 | #define ACPI_RESOURCE_NAME_ADDRESS16 0x88 |
774 | #define ACPI_RDESC_TYPE_QWORD_ADDRESS_SPACE 0x8A | 812 | #define ACPI_RESOURCE_NAME_EXTENDED_IRQ 0x89 |
775 | #define ACPI_RDESC_TYPE_EXTENDED_ADDRESS_SPACE 0x8B | 813 | #define ACPI_RESOURCE_NAME_ADDRESS64 0x8A |
814 | #define ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 0x8B | ||
815 | #define ACPI_RESOURCE_NAME_LARGE_MAX 0x8B | ||
776 | 816 | ||
777 | /***************************************************************************** | 817 | /***************************************************************************** |
778 | * | 818 | * |
@@ -780,7 +820,7 @@ struct acpi_bit_register_info { | |||
780 | * | 820 | * |
781 | ****************************************************************************/ | 821 | ****************************************************************************/ |
782 | 822 | ||
783 | #define ACPI_ASCII_ZERO 0x30 | 823 | #define ACPI_ASCII_ZERO 0x30 |
784 | 824 | ||
785 | /***************************************************************************** | 825 | /***************************************************************************** |
786 | * | 826 | * |
diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h index 702cc4e57f5f..f2be2a881730 100644 --- a/include/acpi/acmacros.h +++ b/include/acpi/acmacros.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2005, R. Byron Moore | 8 | * Copyright (C) 2000 - 2006, R. Byron Moore |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
@@ -60,7 +60,7 @@ | |||
60 | 60 | ||
61 | /* | 61 | /* |
62 | * For 16-bit addresses, we have to assume that the upper 32 bits | 62 | * For 16-bit addresses, we have to assume that the upper 32 bits |
63 | * are zero. | 63 | * (out of 64) are zero. |
64 | */ | 64 | */ |
65 | #define ACPI_LODWORD(l) ((u32)(l)) | 65 | #define ACPI_LODWORD(l) ((u32)(l)) |
66 | #define ACPI_HIDWORD(l) ((u32)(0)) | 66 | #define ACPI_HIDWORD(l) ((u32)(0)) |
@@ -104,30 +104,38 @@ | |||
104 | #define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i),ACPI_LODWORD(i) | 104 | #define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i),ACPI_LODWORD(i) |
105 | 105 | ||
106 | /* | 106 | /* |
107 | * Extract a byte of data using a pointer. Any more than a byte and we | 107 | * Extract data using a pointer. Any more than a byte and we |
108 | * get into potential aligment issues -- see the STORE macros below | 108 | * get into potential aligment issues -- see the STORE macros below. |
109 | * Use with care. | ||
109 | */ | 110 | */ |
110 | #define ACPI_GET8(addr) (*(u8*)(addr)) | 111 | #define ACPI_GET8(ptr) *ACPI_CAST_PTR (u8, ptr) |
112 | #define ACPI_GET16(ptr) *ACPI_CAST_PTR (u16, ptr) | ||
113 | #define ACPI_GET32(ptr) *ACPI_CAST_PTR (u32, ptr) | ||
114 | #define ACPI_GET64(ptr) *ACPI_CAST_PTR (u64, ptr) | ||
115 | #define ACPI_SET8(ptr) *ACPI_CAST_PTR (u8, ptr) | ||
116 | #define ACPI_SET16(ptr) *ACPI_CAST_PTR (u16, ptr) | ||
117 | #define ACPI_SET32(ptr) *ACPI_CAST_PTR (u32, ptr) | ||
118 | #define ACPI_SET64(ptr) *ACPI_CAST_PTR (u64, ptr) | ||
111 | 119 | ||
112 | /* Pointer arithmetic */ | 120 | /* |
113 | 121 | * Pointer manipulation | |
114 | #define ACPI_PTR_ADD(t,a,b) (t *) (void *)((char *)(a) + (acpi_native_uint)(b)) | 122 | */ |
115 | #define ACPI_PTR_DIFF(a,b) (acpi_native_uint) ((char *)(a) - (char *)(b)) | 123 | #define ACPI_CAST_PTR(t, p) ((t *) (acpi_uintptr_t) (p)) |
124 | #define ACPI_CAST_INDIRECT_PTR(t, p) ((t **) (acpi_uintptr_t) (p)) | ||
125 | #define ACPI_ADD_PTR(t,a,b) ACPI_CAST_PTR (t, (ACPI_CAST_PTR (u8,(a)) + (acpi_native_uint)(b))) | ||
126 | #define ACPI_PTR_DIFF(a,b) (acpi_native_uint) (ACPI_CAST_PTR (u8,(a)) - ACPI_CAST_PTR (u8,(b))) | ||
116 | 127 | ||
117 | /* Pointer/Integer type conversions */ | 128 | /* Pointer/Integer type conversions */ |
118 | 129 | ||
119 | #define ACPI_TO_POINTER(i) ACPI_PTR_ADD (void, (void *) NULL,(acpi_native_uint)i) | 130 | #define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void,(void *) NULL,(acpi_native_uint) i) |
120 | #define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p,(void *) NULL) | 131 | #define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p,(void *) NULL) |
121 | #define ACPI_OFFSET(d,f) (acpi_size) ACPI_PTR_DIFF (&(((d *)0)->f),(void *) NULL) | 132 | #define ACPI_OFFSET(d,f) (acpi_size) ACPI_PTR_DIFF (&(((d *)0)->f),(void *) NULL) |
122 | #define ACPI_FADT_OFFSET(f) ACPI_OFFSET (FADT_DESCRIPTOR, f) | 133 | #define ACPI_FADT_OFFSET(f) ACPI_OFFSET (FADT_DESCRIPTOR, f) |
123 | 134 | ||
124 | #define ACPI_CAST_PTR(t, p) ((t *)(void *)(p)) | ||
125 | #define ACPI_CAST_INDIRECT_PTR(t, p) ((t **)(void *)(p)) | ||
126 | |||
127 | #if ACPI_MACHINE_WIDTH == 16 | 135 | #if ACPI_MACHINE_WIDTH == 16 |
128 | #define ACPI_STORE_POINTER(d,s) ACPI_MOVE_32_TO_32(d,s) | 136 | #define ACPI_STORE_POINTER(d,s) ACPI_MOVE_32_TO_32(d,s) |
129 | #define ACPI_PHYSADDR_TO_PTR(i) (void *)(i) | 137 | #define ACPI_PHYSADDR_TO_PTR(i) (void *)(i) |
130 | #define ACPI_PTR_TO_PHYSADDR(i) (u32) (char *)(i) | 138 | #define ACPI_PTR_TO_PHYSADDR(i) (u32) ACPI_CAST_PTR (u8,(i)) |
131 | #else | 139 | #else |
132 | #define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i) | 140 | #define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i) |
133 | #define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i) | 141 | #define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i) |
@@ -202,7 +210,7 @@ | |||
202 | 210 | ||
203 | #define ACPI_BUFFER_INDEX(buf_len,buf_offset,byte_gran) (buf_offset) | 211 | #define ACPI_BUFFER_INDEX(buf_len,buf_offset,byte_gran) (buf_offset) |
204 | 212 | ||
205 | #ifdef ACPI_MISALIGNED_TRANSFERS | 213 | #ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED |
206 | 214 | ||
207 | /* The hardware supports unaligned transfers, just do the little-endian move */ | 215 | /* The hardware supports unaligned transfers, just do the little-endian move */ |
208 | 216 | ||
@@ -326,11 +334,19 @@ | |||
326 | #define ACPI_MUL_16(a) _ACPI_MUL(a,4) | 334 | #define ACPI_MUL_16(a) _ACPI_MUL(a,4) |
327 | #define ACPI_MOD_16(a) _ACPI_MOD(a,16) | 335 | #define ACPI_MOD_16(a) _ACPI_MOD(a,16) |
328 | 336 | ||
337 | #define ACPI_DIV_32(a) _ACPI_DIV(a,5) | ||
338 | #define ACPI_MUL_32(a) _ACPI_MUL(a,5) | ||
339 | #define ACPI_MOD_32(a) _ACPI_MOD(a,32) | ||
340 | |||
329 | /* | 341 | /* |
330 | * Rounding macros (Power of two boundaries only) | 342 | * Rounding macros (Power of two boundaries only) |
331 | */ | 343 | */ |
332 | #define ACPI_ROUND_DOWN(value,boundary) (((acpi_native_uint)(value)) & (~(((acpi_native_uint) boundary)-1))) | 344 | #define ACPI_ROUND_DOWN(value,boundary) (((acpi_native_uint)(value)) & \ |
333 | #define ACPI_ROUND_UP(value,boundary) ((((acpi_native_uint)(value)) + (((acpi_native_uint) boundary)-1)) & (~(((acpi_native_uint) boundary)-1))) | 345 | (~(((acpi_native_uint) boundary)-1))) |
346 | |||
347 | #define ACPI_ROUND_UP(value,boundary) ((((acpi_native_uint)(value)) + \ | ||
348 | (((acpi_native_uint) boundary)-1)) & \ | ||
349 | (~(((acpi_native_uint) boundary)-1))) | ||
334 | 350 | ||
335 | #define ACPI_ROUND_DOWN_TO_32_BITS(a) ACPI_ROUND_DOWN(a,4) | 351 | #define ACPI_ROUND_DOWN_TO_32_BITS(a) ACPI_ROUND_DOWN(a,4) |
336 | #define ACPI_ROUND_DOWN_TO_64_BITS(a) ACPI_ROUND_DOWN(a,8) | 352 | #define ACPI_ROUND_DOWN_TO_64_BITS(a) ACPI_ROUND_DOWN(a,8) |
@@ -365,6 +381,14 @@ | |||
365 | #define ACPI_REGISTER_PREPARE_BITS(val, pos, mask) ((val << pos) & mask) | 381 | #define ACPI_REGISTER_PREPARE_BITS(val, pos, mask) ((val << pos) & mask) |
366 | #define ACPI_REGISTER_INSERT_VALUE(reg, pos, mask, val) reg = (reg & (~(mask))) | ACPI_REGISTER_PREPARE_BITS(val, pos, mask) | 382 | #define ACPI_REGISTER_INSERT_VALUE(reg, pos, mask, val) reg = (reg & (~(mask))) | ACPI_REGISTER_PREPARE_BITS(val, pos, mask) |
367 | 383 | ||
384 | /* Generate a UUID */ | ||
385 | |||
386 | #define ACPI_INIT_UUID(a,b,c,d0,d1,d2,d3,d4,d5,d6,d7) \ | ||
387 | (a) & 0xFF, ((a) >> 8) & 0xFF, ((a) >> 16) & 0xFF, ((a) >> 24) & 0xFF, \ | ||
388 | (b) & 0xFF, ((b) >> 8) & 0xFF, \ | ||
389 | (c) & 0xFF, ((c) >> 8) & 0xFF, \ | ||
390 | (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) | ||
391 | |||
368 | /* | 392 | /* |
369 | * An struct acpi_namespace_node * can appear in some contexts, | 393 | * An struct acpi_namespace_node * can appear in some contexts, |
370 | * where a pointer to an union acpi_operand_object can also | 394 | * where a pointer to an union acpi_operand_object can also |
@@ -423,57 +447,52 @@ | |||
423 | #define GET_CURRENT_ARG_TYPE(list) (list & ((u32) 0x1F)) | 447 | #define GET_CURRENT_ARG_TYPE(list) (list & ((u32) 0x1F)) |
424 | #define INCREMENT_ARG_LIST(list) (list >>= ((u32) ARG_TYPE_WIDTH)) | 448 | #define INCREMENT_ARG_LIST(list) (list >>= ((u32) ARG_TYPE_WIDTH)) |
425 | 449 | ||
450 | #if defined (ACPI_DEBUG_OUTPUT) || !defined (ACPI_NO_ERROR_MESSAGES) | ||
426 | /* | 451 | /* |
427 | * Reporting macros that are never compiled out | 452 | * Module name is include in both debug and non-debug versions primarily for |
453 | * error messages. The __FILE__ macro is not very useful for this, because it | ||
454 | * often includes the entire pathname to the module | ||
428 | */ | 455 | */ |
429 | #define ACPI_PARAM_LIST(pl) pl | 456 | #define ACPI_MODULE_NAME(name) static char ACPI_UNUSED_VAR *_acpi_module_name = name; |
457 | #else | ||
458 | #define ACPI_MODULE_NAME(name) | ||
459 | #endif | ||
430 | 460 | ||
431 | /* | 461 | /* |
432 | * Error reporting. These versions add callers module and line#. | 462 | * Ascii error messages can be configured out |
433 | * | ||
434 | * Since _acpi_module_name gets compiled out when ACPI_DEBUG_OUTPUT | ||
435 | * isn't defined, only use it in debug mode. | ||
436 | */ | 463 | */ |
437 | #ifdef ACPI_DEBUG_OUTPUT | 464 | #ifndef ACPI_NO_ERROR_MESSAGES |
465 | #define AE_INFO _acpi_module_name, __LINE__ | ||
438 | 466 | ||
439 | #define ACPI_REPORT_INFO(fp) {acpi_ut_report_info(_acpi_module_name,__LINE__,_COMPONENT); \ | 467 | /* |
440 | acpi_os_printf ACPI_PARAM_LIST(fp);} | 468 | * Error reporting. Callers module and line number are inserted by AE_INFO, |
441 | #define ACPI_REPORT_ERROR(fp) {acpi_ut_report_error(_acpi_module_name,__LINE__,_COMPONENT); \ | 469 | * the plist contains a set of parens to allow variable-length lists. |
442 | acpi_os_printf ACPI_PARAM_LIST(fp);} | 470 | * These macros are used for both the debug and non-debug versions of the code. |
443 | #define ACPI_REPORT_WARNING(fp) {acpi_ut_report_warning(_acpi_module_name,__LINE__,_COMPONENT); \ | 471 | */ |
444 | acpi_os_printf ACPI_PARAM_LIST(fp);} | 472 | #define ACPI_INFO(plist) acpi_ut_info plist |
445 | #define ACPI_REPORT_NSERROR(s,e) acpi_ns_report_error(_acpi_module_name,__LINE__,_COMPONENT, s, e); | 473 | #define ACPI_WARNING(plist) acpi_ut_warning plist |
446 | 474 | #define ACPI_EXCEPTION(plist) acpi_ut_exception plist | |
447 | #define ACPI_REPORT_METHOD_ERROR(s,n,p,e) acpi_ns_report_method_error(_acpi_module_name,__LINE__,_COMPONENT, s, n, p, e); | 475 | #define ACPI_ERROR(plist) acpi_ut_error plist |
476 | #define ACPI_ERROR_NAMESPACE(s,e) acpi_ns_report_error (AE_INFO, s, e); | ||
477 | #define ACPI_ERROR_METHOD(s,n,p,e) acpi_ns_report_method_error (AE_INFO, s, n, p, e); | ||
448 | 478 | ||
449 | #else | 479 | #else |
450 | 480 | ||
451 | #define ACPI_REPORT_INFO(fp) {acpi_ut_report_info("ACPI",__LINE__,_COMPONENT); \ | 481 | /* No error messages */ |
452 | acpi_os_printf ACPI_PARAM_LIST(fp);} | ||
453 | #define ACPI_REPORT_ERROR(fp) {acpi_ut_report_error("ACPI",__LINE__,_COMPONENT); \ | ||
454 | acpi_os_printf ACPI_PARAM_LIST(fp);} | ||
455 | #define ACPI_REPORT_WARNING(fp) {acpi_ut_report_warning("ACPI",__LINE__,_COMPONENT); \ | ||
456 | acpi_os_printf ACPI_PARAM_LIST(fp);} | ||
457 | #define ACPI_REPORT_NSERROR(s,e) acpi_ns_report_error("ACPI",__LINE__,_COMPONENT, s, e); | ||
458 | 482 | ||
459 | #define ACPI_REPORT_METHOD_ERROR(s,n,p,e) acpi_ns_report_method_error("ACPI",__LINE__,_COMPONENT, s, n, p, e); | 483 | #define ACPI_INFO(plist) |
484 | #define ACPI_WARNING(plist) | ||
485 | #define ACPI_EXCEPTION(plist) | ||
486 | #define ACPI_ERROR(plist) | ||
487 | #define ACPI_ERROR_NAMESPACE(s,e) | ||
488 | #define ACPI_ERROR_METHOD(s,n,p,e) | ||
460 | 489 | ||
461 | #endif | 490 | #endif |
462 | 491 | ||
463 | /* Error reporting. These versions pass thru the module and line# */ | ||
464 | |||
465 | #define _ACPI_REPORT_INFO(a,b,c,fp) {acpi_ut_report_info(a,b,c); \ | ||
466 | acpi_os_printf ACPI_PARAM_LIST(fp);} | ||
467 | #define _ACPI_REPORT_ERROR(a,b,c,fp) {acpi_ut_report_error(a,b,c); \ | ||
468 | acpi_os_printf ACPI_PARAM_LIST(fp);} | ||
469 | #define _ACPI_REPORT_WARNING(a,b,c,fp) {acpi_ut_report_warning(a,b,c); \ | ||
470 | acpi_os_printf ACPI_PARAM_LIST(fp);} | ||
471 | |||
472 | /* | 492 | /* |
473 | * Debug macros that are conditionally compiled | 493 | * Debug macros that are conditionally compiled |
474 | */ | 494 | */ |
475 | #ifdef ACPI_DEBUG_OUTPUT | 495 | #ifdef ACPI_DEBUG_OUTPUT |
476 | #define ACPI_MODULE_NAME(name) static char ACPI_UNUSED_VAR *_acpi_module_name = name; | ||
477 | 496 | ||
478 | /* | 497 | /* |
479 | * Common parameters used for debug output functions: | 498 | * Common parameters used for debug output functions: |
@@ -509,7 +528,7 @@ | |||
509 | #endif | 528 | #endif |
510 | 529 | ||
511 | #define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a) \ | 530 | #define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a) \ |
512 | acpi_ut_trace(ACPI_DEBUG_PARAMETERS) | 531 | acpi_ut_trace(ACPI_DEBUG_PARAMETERS) |
513 | #define ACPI_FUNCTION_TRACE_PTR(a,b) ACPI_FUNCTION_NAME(a) \ | 532 | #define ACPI_FUNCTION_TRACE_PTR(a,b) ACPI_FUNCTION_NAME(a) \ |
514 | acpi_ut_trace_ptr(ACPI_DEBUG_PARAMETERS,(void *)b) | 533 | acpi_ut_trace_ptr(ACPI_DEBUG_PARAMETERS,(void *)b) |
515 | #define ACPI_FUNCTION_TRACE_U32(a,b) ACPI_FUNCTION_NAME(a) \ | 534 | #define ACPI_FUNCTION_TRACE_U32(a,b) ACPI_FUNCTION_NAME(a) \ |
@@ -525,6 +544,9 @@ | |||
525 | * bad form, but having a separate exit macro is very ugly and difficult to maintain. | 544 | * bad form, but having a separate exit macro is very ugly and difficult to maintain. |
526 | * One of the FUNCTION_TRACE macros above must be used in conjunction with these macros | 545 | * One of the FUNCTION_TRACE macros above must be used in conjunction with these macros |
527 | * so that "_acpi_function_name" is defined. | 546 | * so that "_acpi_function_name" is defined. |
547 | * | ||
548 | * Note: the DO_WHILE0 macro is used to prevent some compilers from complaining | ||
549 | * about these constructs. | ||
528 | */ | 550 | */ |
529 | #ifdef ACPI_USE_DO_WHILE_0 | 551 | #ifdef ACPI_USE_DO_WHILE_0 |
530 | #define ACPI_DO_WHILE0(a) do a while(0) | 552 | #define ACPI_DO_WHILE0(a) do a while(0) |
@@ -532,10 +554,55 @@ | |||
532 | #define ACPI_DO_WHILE0(a) a | 554 | #define ACPI_DO_WHILE0(a) a |
533 | #endif | 555 | #endif |
534 | 556 | ||
535 | #define return_VOID ACPI_DO_WHILE0 ({acpi_ut_exit(ACPI_DEBUG_PARAMETERS);return;}) | 557 | #define return_VOID ACPI_DO_WHILE0 ({ \ |
536 | #define return_ACPI_STATUS(s) ACPI_DO_WHILE0 ({acpi_ut_status_exit(ACPI_DEBUG_PARAMETERS,(s));return((s));}) | 558 | acpi_ut_exit (ACPI_DEBUG_PARAMETERS); \ |
537 | #define return_VALUE(s) ACPI_DO_WHILE0 ({acpi_ut_value_exit(ACPI_DEBUG_PARAMETERS,(acpi_integer)(s));return((s));}) | 559 | return;}) |
538 | #define return_PTR(s) ACPI_DO_WHILE0 ({acpi_ut_ptr_exit(ACPI_DEBUG_PARAMETERS,(u8 *)(s));return((s));}) | 560 | /* |
561 | * There are two versions of most of the return macros. The default version is | ||
562 | * safer, since it avoids side-effects by guaranteeing that the argument will | ||
563 | * not be evaluated twice. | ||
564 | * | ||
565 | * A less-safe version of the macros is provided for optional use if the | ||
566 | * compiler uses excessive CPU stack (for example, this may happen in the | ||
567 | * debug case if code optimzation is disabled.) | ||
568 | */ | ||
569 | #ifndef ACPI_SIMPLE_RETURN_MACROS | ||
570 | |||
571 | #define return_ACPI_STATUS(s) ACPI_DO_WHILE0 ({ \ | ||
572 | register acpi_status _s = (s); \ | ||
573 | acpi_ut_status_exit (ACPI_DEBUG_PARAMETERS, _s); \ | ||
574 | return (_s); }) | ||
575 | #define return_PTR(s) ACPI_DO_WHILE0 ({ \ | ||
576 | register void *_s = (void *) (s); \ | ||
577 | acpi_ut_ptr_exit (ACPI_DEBUG_PARAMETERS, (u8 *) _s); \ | ||
578 | return (_s); }) | ||
579 | #define return_VALUE(s) ACPI_DO_WHILE0 ({ \ | ||
580 | register acpi_integer _s = (s); \ | ||
581 | acpi_ut_value_exit (ACPI_DEBUG_PARAMETERS, _s); \ | ||
582 | return (_s); }) | ||
583 | #define return_UINT8(s) ACPI_DO_WHILE0 ({ \ | ||
584 | register u8 _s = (u8) (s); \ | ||
585 | acpi_ut_value_exit (ACPI_DEBUG_PARAMETERS, (acpi_integer) _s); \ | ||
586 | return (_s); }) | ||
587 | #define return_UINT32(s) ACPI_DO_WHILE0 ({ \ | ||
588 | register u32 _s = (u32) (s); \ | ||
589 | acpi_ut_value_exit (ACPI_DEBUG_PARAMETERS, (acpi_integer) _s); \ | ||
590 | return (_s); }) | ||
591 | #else /* Use original less-safe macros */ | ||
592 | |||
593 | #define return_ACPI_STATUS(s) ACPI_DO_WHILE0 ({ \ | ||
594 | acpi_ut_status_exit (ACPI_DEBUG_PARAMETERS, (s)); \ | ||
595 | return((s)); }) | ||
596 | #define return_PTR(s) ACPI_DO_WHILE0 ({ \ | ||
597 | acpi_ut_ptr_exit (ACPI_DEBUG_PARAMETERS, (u8 *) (s)); \ | ||
598 | return((s)); }) | ||
599 | #define return_VALUE(s) ACPI_DO_WHILE0 ({ \ | ||
600 | acpi_ut_value_exit (ACPI_DEBUG_PARAMETERS, (acpi_integer) (s)); \ | ||
601 | return((s)); }) | ||
602 | #define return_UINT8(s) return_VALUE(s) | ||
603 | #define return_UINT32(s) return_VALUE(s) | ||
604 | |||
605 | #endif /* ACPI_SIMPLE_RETURN_MACROS */ | ||
539 | 606 | ||
540 | /* Conditional execution */ | 607 | /* Conditional execution */ |
541 | 608 | ||
@@ -555,18 +622,6 @@ | |||
555 | #define ACPI_DUMP_PATHNAME(a,b,c,d) acpi_ns_dump_pathname(a,b,c,d) | 622 | #define ACPI_DUMP_PATHNAME(a,b,c,d) acpi_ns_dump_pathname(a,b,c,d) |
556 | #define ACPI_DUMP_RESOURCE_LIST(a) acpi_rs_dump_resource_list(a) | 623 | #define ACPI_DUMP_RESOURCE_LIST(a) acpi_rs_dump_resource_list(a) |
557 | #define ACPI_DUMP_BUFFER(a,b) acpi_ut_dump_buffer((u8 *)a,b,DB_BYTE_DISPLAY,_COMPONENT) | 624 | #define ACPI_DUMP_BUFFER(a,b) acpi_ut_dump_buffer((u8 *)a,b,DB_BYTE_DISPLAY,_COMPONENT) |
558 | #define ACPI_BREAK_MSG(a) acpi_os_signal (ACPI_SIGNAL_BREAKPOINT,(a)) | ||
559 | |||
560 | /* | ||
561 | * Generate INT3 on ACPI_ERROR (Debug only!) | ||
562 | */ | ||
563 | #define ACPI_ERROR_BREAK | ||
564 | #ifdef ACPI_ERROR_BREAK | ||
565 | #define ACPI_BREAK_ON_ERROR(lvl) if ((lvl)&ACPI_ERROR) \ | ||
566 | acpi_os_signal(ACPI_SIGNAL_BREAKPOINT,"Fatal error encountered\n") | ||
567 | #else | ||
568 | #define ACPI_BREAK_ON_ERROR(lvl) | ||
569 | #endif | ||
570 | 625 | ||
571 | /* | 626 | /* |
572 | * Master debug print macros | 627 | * Master debug print macros |
@@ -574,17 +629,14 @@ | |||
574 | * 1) Debug print for the current component is enabled | 629 | * 1) Debug print for the current component is enabled |
575 | * 2) Debug error level or trace level for the print statement is enabled | 630 | * 2) Debug error level or trace level for the print statement is enabled |
576 | */ | 631 | */ |
577 | #define ACPI_DEBUG_PRINT(pl) acpi_ut_debug_print ACPI_PARAM_LIST(pl) | 632 | #define ACPI_DEBUG_PRINT(plist) acpi_ut_debug_print plist |
578 | #define ACPI_DEBUG_PRINT_RAW(pl) acpi_ut_debug_print_raw ACPI_PARAM_LIST(pl) | 633 | #define ACPI_DEBUG_PRINT_RAW(plist) acpi_ut_debug_print_raw plist |
579 | 634 | ||
580 | #else | 635 | #else |
581 | /* | 636 | /* |
582 | * This is the non-debug case -- make everything go away, | 637 | * This is the non-debug case -- make everything go away, |
583 | * leaving no executable debug code! | 638 | * leaving no executable debug code! |
584 | */ | 639 | */ |
585 | #define ACPI_MODULE_NAME(name) | ||
586 | #define _acpi_module_name "" | ||
587 | |||
588 | #define ACPI_DEBUG_EXEC(a) | 640 | #define ACPI_DEBUG_EXEC(a) |
589 | #define ACPI_NORMAL_EXEC(a) a; | 641 | #define ACPI_NORMAL_EXEC(a) a; |
590 | 642 | ||
@@ -607,11 +659,12 @@ | |||
607 | #define ACPI_DUMP_BUFFER(a,b) | 659 | #define ACPI_DUMP_BUFFER(a,b) |
608 | #define ACPI_DEBUG_PRINT(pl) | 660 | #define ACPI_DEBUG_PRINT(pl) |
609 | #define ACPI_DEBUG_PRINT_RAW(pl) | 661 | #define ACPI_DEBUG_PRINT_RAW(pl) |
610 | #define ACPI_BREAK_MSG(a) | ||
611 | 662 | ||
612 | #define return_VOID return | 663 | #define return_VOID return |
613 | #define return_ACPI_STATUS(s) return(s) | 664 | #define return_ACPI_STATUS(s) return(s) |
614 | #define return_VALUE(s) return(s) | 665 | #define return_VALUE(s) return(s) |
666 | #define return_UINT8(s) return(s) | ||
667 | #define return_UINT32(s) return(s) | ||
615 | #define return_PTR(s) return(s) | 668 | #define return_PTR(s) return(s) |
616 | 669 | ||
617 | #endif | 670 | #endif |
diff --git a/include/acpi/acnames.h b/include/acpi/acnames.h index 4f9063f3e951..b67da3636899 100644 --- a/include/acpi/acnames.h +++ b/include/acpi/acnames.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2005, R. Byron Moore | 8 | * Copyright (C) 2000 - 2006, R. Byron Moore |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
diff --git a/include/acpi/acnamesp.h b/include/acpi/acnamesp.h index dd3501f7e5d6..b667a804fc8a 100644 --- a/include/acpi/acnamesp.h +++ b/include/acpi/acnamesp.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2005, R. Byron Moore | 8 | * Copyright (C) 2000 - 2006, R. Byron Moore |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
@@ -263,13 +263,11 @@ u32 acpi_ns_local(acpi_object_type type); | |||
263 | void | 263 | void |
264 | acpi_ns_report_error(char *module_name, | 264 | acpi_ns_report_error(char *module_name, |
265 | u32 line_number, | 265 | u32 line_number, |
266 | u32 component_id, | ||
267 | char *internal_name, acpi_status lookup_status); | 266 | char *internal_name, acpi_status lookup_status); |
268 | 267 | ||
269 | void | 268 | void |
270 | acpi_ns_report_method_error(char *module_name, | 269 | acpi_ns_report_method_error(char *module_name, |
271 | u32 line_number, | 270 | u32 line_number, |
272 | u32 component_id, | ||
273 | char *message, | 271 | char *message, |
274 | struct acpi_namespace_node *node, | 272 | struct acpi_namespace_node *node, |
275 | char *path, acpi_status lookup_status); | 273 | char *path, acpi_status lookup_status); |
diff --git a/include/acpi/acobject.h b/include/acpi/acobject.h index 4a326ba6d482..d130cfed8d55 100644 --- a/include/acpi/acobject.h +++ b/include/acpi/acobject.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 |
@@ -69,7 +69,7 @@ | |||
69 | u8 type; /* acpi_object_type */\ | 69 | u8 type; /* acpi_object_type */\ |
70 | u16 reference_count; /* For object deletion management */\ | 70 | u16 reference_count; /* For object deletion management */\ |
71 | union acpi_operand_object *next_object; /* Objects linked to parent NS node */\ | 71 | union acpi_operand_object *next_object; /* Objects linked to parent NS node */\ |
72 | u8 flags; \ | 72 | u8 flags; |
73 | 73 | ||
74 | /* Values for flag byte above */ | 74 | /* Values for flag byte above */ |
75 | 75 | ||
diff --git a/include/acpi/acopcode.h b/include/acpi/acopcode.h index 64da42992199..e6d78bd9e90a 100644 --- a/include/acpi/acopcode.h +++ b/include/acpi/acopcode.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2005, R. Byron Moore | 8 | * Copyright (C) 2000 - 2006, R. Byron Moore |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h index 68d7edf0f697..7785d481dc3e 100644 --- a/include/acpi/acoutput.h +++ b/include/acpi/acoutput.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2005, R. Byron Moore | 8 | * Copyright (C) 2000 - 2006, R. Byron Moore |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
@@ -137,13 +137,19 @@ | |||
137 | 137 | ||
138 | /* Exception level -- used in the global "debug_level" */ | 138 | /* Exception level -- used in the global "debug_level" */ |
139 | 139 | ||
140 | #define ACPI_DB_ERROR ACPI_DEBUG_LEVEL (ACPI_LV_ERROR) | ||
141 | #define ACPI_DB_WARN ACPI_DEBUG_LEVEL (ACPI_LV_WARN) | ||
142 | #define ACPI_DB_INIT ACPI_DEBUG_LEVEL (ACPI_LV_INIT) | 140 | #define ACPI_DB_INIT ACPI_DEBUG_LEVEL (ACPI_LV_INIT) |
143 | #define ACPI_DB_DEBUG_OBJECT ACPI_DEBUG_LEVEL (ACPI_LV_DEBUG_OBJECT) | 141 | #define ACPI_DB_DEBUG_OBJECT ACPI_DEBUG_LEVEL (ACPI_LV_DEBUG_OBJECT) |
144 | #define ACPI_DB_INFO ACPI_DEBUG_LEVEL (ACPI_LV_INFO) | 142 | #define ACPI_DB_INFO ACPI_DEBUG_LEVEL (ACPI_LV_INFO) |
145 | #define ACPI_DB_ALL_EXCEPTIONS ACPI_DEBUG_LEVEL (ACPI_LV_ALL_EXCEPTIONS) | 143 | #define ACPI_DB_ALL_EXCEPTIONS ACPI_DEBUG_LEVEL (ACPI_LV_ALL_EXCEPTIONS) |
146 | 144 | ||
145 | /* | ||
146 | * These two levels are essentially obsolete, all instances in the | ||
147 | * ACPICA core code have been replaced by REPORT_ERROR and REPORT_WARNING | ||
148 | * (Kept here because some drivers may still use them) | ||
149 | */ | ||
150 | #define ACPI_DB_ERROR ACPI_DEBUG_LEVEL (ACPI_LV_ERROR) | ||
151 | #define ACPI_DB_WARN ACPI_DEBUG_LEVEL (ACPI_LV_WARN) | ||
152 | |||
147 | /* Trace level -- also used in the global "debug_level" */ | 153 | /* Trace level -- also used in the global "debug_level" */ |
148 | 154 | ||
149 | #define ACPI_DB_INIT_NAMES ACPI_DEBUG_LEVEL (ACPI_LV_INIT_NAMES) | 155 | #define ACPI_DB_INIT_NAMES ACPI_DEBUG_LEVEL (ACPI_LV_INIT_NAMES) |
diff --git a/include/acpi/acparser.h b/include/acpi/acparser.h index d352d40de1f3..5a1ff484af33 100644 --- a/include/acpi/acparser.h +++ b/include/acpi/acparser.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2005, R. Byron Moore | 8 | * Copyright (C) 2000 - 2006, R. Byron Moore |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
diff --git a/include/acpi/acpi.h b/include/acpi/acpi.h index ccf34f9dac64..b9a39d1009bd 100644 --- a/include/acpi/acpi.h +++ b/include/acpi/acpi.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2005, R. Byron Moore | 8 | * Copyright (C) 2000 - 2006, R. Byron Moore |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h index c1b4e1f882e4..b425f9bb6d43 100644 --- a/include/acpi/acpi_drivers.h +++ b/include/acpi/acpi_drivers.h | |||
@@ -52,8 +52,8 @@ | |||
52 | /* ACPI PCI Interrupt Link (pci_link.c) */ | 52 | /* ACPI PCI Interrupt Link (pci_link.c) */ |
53 | 53 | ||
54 | int acpi_irq_penalty_init(void); | 54 | int acpi_irq_penalty_init(void); |
55 | int acpi_pci_link_allocate_irq(acpi_handle handle, int index, int *edge_level, | 55 | int acpi_pci_link_allocate_irq(acpi_handle handle, int index, int *triggering, |
56 | int *active_high_low, char **name); | 56 | int *polarity, char **name); |
57 | int acpi_pci_link_free_irq(acpi_handle handle); | 57 | int acpi_pci_link_free_irq(acpi_handle handle); |
58 | 58 | ||
59 | /* ACPI PCI Interrupt Routing (pci_irq.c) */ | 59 | /* ACPI PCI Interrupt Routing (pci_irq.c) */ |
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index 98e0b8cd14ed..970e9a6372c3 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h | |||
@@ -8,7 +8,7 @@ | |||
8 | *****************************************************************************/ | 8 | *****************************************************************************/ |
9 | 9 | ||
10 | /* | 10 | /* |
11 | * Copyright (C) 2000 - 2005, R. Byron Moore | 11 | * Copyright (C) 2000 - 2006, R. Byron Moore |
12 | * All rights reserved. | 12 | * All rights reserved. |
13 | * | 13 | * |
14 | * Redistribution and use in source and binary forms, with or without | 14 | * Redistribution and use in source and binary forms, with or without |
@@ -108,9 +108,9 @@ acpi_status acpi_os_create_lock(acpi_handle * out_handle); | |||
108 | 108 | ||
109 | void acpi_os_delete_lock(acpi_handle handle); | 109 | void acpi_os_delete_lock(acpi_handle handle); |
110 | 110 | ||
111 | unsigned long acpi_os_acquire_lock(acpi_handle handle); | 111 | acpi_cpu_flags acpi_os_acquire_lock(acpi_handle handle); |
112 | 112 | ||
113 | void acpi_os_release_lock(acpi_handle handle, unsigned long flags); | 113 | void acpi_os_release_lock(acpi_handle handle, acpi_cpu_flags flags); |
114 | 114 | ||
115 | /* | 115 | /* |
116 | * Memory allocation and mapping | 116 | * Memory allocation and mapping |
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index 2a9dbc13b0f2..66cf2ecef57a 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.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 |
@@ -149,6 +149,9 @@ acpi_detach_data(acpi_handle obj_handle, acpi_object_handler handler); | |||
149 | acpi_status | 149 | acpi_status |
150 | acpi_get_data(acpi_handle obj_handle, acpi_object_handler handler, void **data); | 150 | acpi_get_data(acpi_handle obj_handle, acpi_object_handler handler, void **data); |
151 | 151 | ||
152 | acpi_status | ||
153 | acpi_debug_trace(char *name, u32 debug_level, u32 debug_layer, u32 flags); | ||
154 | |||
152 | /* | 155 | /* |
153 | * Object manipulation and enumeration | 156 | * Object manipulation and enumeration |
154 | */ | 157 | */ |
@@ -269,6 +272,12 @@ acpi_status(*ACPI_WALK_RESOURCE_CALLBACK) (struct acpi_resource * resource, | |||
269 | void *context); | 272 | void *context); |
270 | 273 | ||
271 | acpi_status | 274 | acpi_status |
275 | acpi_get_vendor_resource(acpi_handle device_handle, | ||
276 | char *name, | ||
277 | struct acpi_vendor_uuid *uuid, | ||
278 | struct acpi_buffer *ret_buffer); | ||
279 | |||
280 | acpi_status | ||
272 | acpi_get_current_resources(acpi_handle device_handle, | 281 | acpi_get_current_resources(acpi_handle device_handle, |
273 | struct acpi_buffer *ret_buffer); | 282 | struct acpi_buffer *ret_buffer); |
274 | 283 | ||
@@ -280,7 +289,7 @@ acpi_get_possible_resources(acpi_handle device_handle, | |||
280 | 289 | ||
281 | acpi_status | 290 | acpi_status |
282 | acpi_walk_resources(acpi_handle device_handle, | 291 | acpi_walk_resources(acpi_handle device_handle, |
283 | char *path, | 292 | char *name, |
284 | ACPI_WALK_RESOURCE_CALLBACK user_function, void *context); | 293 | ACPI_WALK_RESOURCE_CALLBACK user_function, void *context); |
285 | 294 | ||
286 | acpi_status | 295 | acpi_status |
diff --git a/include/acpi/acresrc.h b/include/acpi/acresrc.h index 38e798b05d08..fa02e8083381 100644 --- a/include/acpi/acresrc.h +++ b/include/acpi/acresrc.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2005, R. Byron Moore | 8 | * Copyright (C) 2000 - 2006, R. Byron Moore |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
@@ -44,216 +44,284 @@ | |||
44 | #ifndef __ACRESRC_H__ | 44 | #ifndef __ACRESRC_H__ |
45 | #define __ACRESRC_H__ | 45 | #define __ACRESRC_H__ |
46 | 46 | ||
47 | /* | 47 | /* Need the AML resource descriptor structs */ |
48 | * Function prototypes called from Acpi* APIs | ||
49 | */ | ||
50 | acpi_status | ||
51 | acpi_rs_get_prt_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer); | ||
52 | 48 | ||
53 | acpi_status | 49 | #include "amlresrc.h" |
54 | acpi_rs_get_crs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer); | ||
55 | 50 | ||
56 | #ifdef ACPI_FUTURE_USAGE | 51 | /* |
57 | acpi_status | 52 | * If possible, pack the following structures to byte alignment, since we |
58 | acpi_rs_get_prs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer); | 53 | * don't care about performance for debug output |
59 | #endif /* ACPI_FUTURE_USAGE */ | 54 | */ |
60 | 55 | #ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED | |
61 | acpi_status | 56 | #pragma pack(1) |
62 | acpi_rs_get_method_data(acpi_handle handle, | 57 | #endif |
63 | char *path, struct acpi_buffer *ret_buffer); | ||
64 | 58 | ||
65 | acpi_status | 59 | /* |
66 | acpi_rs_set_srs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer); | 60 | * Individual entry for the resource conversion tables |
61 | */ | ||
62 | typedef 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 | typedef const struct acpi_rsdump_info { | ||
105 | u8 opcode; | ||
106 | u8 offset; | ||
107 | char *name; | ||
108 | const char **pointer; | ||
109 | |||
110 | } acpi_rsdump_info; | ||
111 | |||
112 | /* Values for the Opcode field above */ | ||
113 | |||
114 | #define ACPI_RSD_TITLE 0 | ||
115 | #define ACPI_RSD_LITERAL 1 | ||
116 | #define ACPI_RSD_STRING 2 | ||
117 | #define ACPI_RSD_UINT8 3 | ||
118 | #define ACPI_RSD_UINT16 4 | ||
119 | #define ACPI_RSD_UINT32 5 | ||
120 | #define ACPI_RSD_UINT64 6 | ||
121 | #define ACPI_RSD_1BITFLAG 7 | ||
122 | #define ACPI_RSD_2BITFLAG 8 | ||
123 | #define ACPI_RSD_SHORTLIST 9 | ||
124 | #define ACPI_RSD_LONGLIST 10 | ||
125 | #define ACPI_RSD_DWORDLIST 11 | ||
126 | #define ACPI_RSD_ADDRESS 12 | ||
127 | #define ACPI_RSD_SOURCE 13 | ||
128 | |||
129 | /* restore default alignment */ | ||
130 | |||
131 | #pragma pack() | ||
132 | |||
133 | /* Resource tables indexed by internal resource type */ | ||
134 | |||
135 | extern const u8 acpi_gbl_aml_resource_sizes[]; | ||
136 | extern struct acpi_rsconvert_info *acpi_gbl_set_resource_dispatch[]; | ||
137 | |||
138 | /* Resource tables indexed by raw AML resource descriptor type */ | ||
139 | |||
140 | extern const u8 acpi_gbl_resource_struct_sizes[]; | ||
141 | extern struct acpi_rsconvert_info *acpi_gbl_get_resource_dispatch[]; | ||
142 | |||
143 | struct acpi_vendor_walk_info { | ||
144 | struct acpi_vendor_uuid *uuid; | ||
145 | struct acpi_buffer *buffer; | ||
146 | acpi_status status; | ||
147 | }; | ||
67 | 148 | ||
149 | /* | ||
150 | * rscreate | ||
151 | */ | ||
68 | acpi_status | 152 | acpi_status |
69 | acpi_rs_create_resource_list(union acpi_operand_object *byte_stream_buffer, | 153 | acpi_rs_create_resource_list(union acpi_operand_object *aml_buffer, |
70 | struct acpi_buffer *output_buffer); | 154 | struct acpi_buffer *output_buffer); |
71 | 155 | ||
72 | acpi_status | 156 | acpi_status |
73 | acpi_rs_create_byte_stream(struct acpi_resource *linked_list_buffer, | 157 | acpi_rs_create_aml_resources(struct acpi_resource *linked_list_buffer, |
74 | struct acpi_buffer *output_buffer); | 158 | struct acpi_buffer *output_buffer); |
75 | 159 | ||
76 | acpi_status | 160 | acpi_status |
77 | acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object, | 161 | acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object, |
78 | struct acpi_buffer *output_buffer); | 162 | struct acpi_buffer *output_buffer); |
79 | 163 | ||
80 | /* | 164 | /* |
81 | * rsdump | 165 | * rsutils |
82 | */ | 166 | */ |
83 | #ifdef ACPI_FUTURE_USAGE | ||
84 | void acpi_rs_dump_resource_list(struct acpi_resource *resource); | ||
85 | |||
86 | void acpi_rs_dump_irq_list(u8 * route_table); | ||
87 | #endif /* ACPI_FUTURE_USAGE */ | ||
88 | |||
89 | /* | ||
90 | * rscalc | ||
91 | */ | ||
92 | acpi_status | ||
93 | acpi_rs_get_byte_stream_start(u8 * byte_stream_buffer, | ||
94 | u8 ** byte_stream_start, u32 * size); | ||
95 | |||
96 | acpi_status | ||
97 | acpi_rs_get_list_length(u8 * byte_stream_buffer, | ||
98 | u32 byte_stream_buffer_length, acpi_size * size_needed); | ||
99 | |||
100 | acpi_status | ||
101 | acpi_rs_get_byte_stream_length(struct acpi_resource *linked_list_buffer, | ||
102 | acpi_size * size_needed); | ||
103 | |||
104 | acpi_status | ||
105 | acpi_rs_get_pci_routing_table_length(union acpi_operand_object *package_object, | ||
106 | acpi_size * buffer_size_needed); | ||
107 | |||
108 | acpi_status | ||
109 | acpi_rs_byte_stream_to_list(u8 * byte_stream_buffer, | ||
110 | u32 byte_stream_buffer_length, u8 * output_buffer); | ||
111 | |||
112 | acpi_status | ||
113 | acpi_rs_list_to_byte_stream(struct acpi_resource *linked_list, | ||
114 | acpi_size byte_stream_size_needed, | ||
115 | u8 * output_buffer); | ||
116 | |||
117 | acpi_status | ||
118 | acpi_rs_io_resource(u8 * byte_stream_buffer, | ||
119 | acpi_size * bytes_consumed, | ||
120 | u8 ** output_buffer, acpi_size * structure_size); | ||
121 | |||
122 | acpi_status | ||
123 | acpi_rs_fixed_io_resource(u8 * byte_stream_buffer, | ||
124 | acpi_size * bytes_consumed, | ||
125 | u8 ** output_buffer, acpi_size * structure_size); | ||
126 | |||
127 | acpi_status | 167 | acpi_status |
128 | acpi_rs_io_stream(struct acpi_resource *linked_list, | 168 | acpi_rs_get_prt_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer); |
129 | u8 ** output_buffer, acpi_size * bytes_consumed); | ||
130 | |||
131 | acpi_status | ||
132 | acpi_rs_fixed_io_stream(struct acpi_resource *linked_list, | ||
133 | u8 ** output_buffer, acpi_size * bytes_consumed); | ||
134 | |||
135 | acpi_status | ||
136 | acpi_rs_irq_resource(u8 * byte_stream_buffer, | ||
137 | acpi_size * bytes_consumed, | ||
138 | u8 ** output_buffer, acpi_size * structure_size); | ||
139 | |||
140 | acpi_status | ||
141 | acpi_rs_irq_stream(struct acpi_resource *linked_list, | ||
142 | u8 ** output_buffer, acpi_size * bytes_consumed); | ||
143 | |||
144 | acpi_status | ||
145 | acpi_rs_dma_resource(u8 * byte_stream_buffer, | ||
146 | acpi_size * bytes_consumed, | ||
147 | u8 ** output_buffer, acpi_size * structure_size); | ||
148 | 169 | ||
149 | acpi_status | 170 | acpi_status |
150 | acpi_rs_dma_stream(struct acpi_resource *linked_list, | 171 | acpi_rs_get_crs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer); |
151 | u8 ** output_buffer, acpi_size * bytes_consumed); | ||
152 | 172 | ||
173 | #ifdef ACPI_FUTURE_USAGE | ||
153 | acpi_status | 174 | acpi_status |
154 | acpi_rs_address16_resource(u8 * byte_stream_buffer, | 175 | acpi_rs_get_prs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer); |
155 | acpi_size * bytes_consumed, | 176 | #endif /* ACPI_FUTURE_USAGE */ |
156 | u8 ** output_buffer, acpi_size * structure_size); | ||
157 | 177 | ||
158 | acpi_status | 178 | acpi_status |
159 | acpi_rs_address16_stream(struct acpi_resource *linked_list, | 179 | acpi_rs_get_method_data(acpi_handle handle, |
160 | u8 ** output_buffer, acpi_size * bytes_consumed); | 180 | char *path, struct acpi_buffer *ret_buffer); |
161 | 181 | ||
162 | acpi_status | 182 | acpi_status |
163 | acpi_rs_address32_resource(u8 * byte_stream_buffer, | 183 | acpi_rs_set_srs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer); |
164 | acpi_size * bytes_consumed, | ||
165 | u8 ** output_buffer, acpi_size * structure_size); | ||
166 | 184 | ||
185 | /* | ||
186 | * rscalc | ||
187 | */ | ||
167 | acpi_status | 188 | acpi_status |
168 | acpi_rs_address32_stream(struct acpi_resource *linked_list, | 189 | acpi_rs_get_list_length(u8 * aml_buffer, |
169 | u8 ** output_buffer, acpi_size * bytes_consumed); | 190 | u32 aml_buffer_length, acpi_size * size_needed); |
170 | 191 | ||
171 | acpi_status | 192 | acpi_status |
172 | acpi_rs_address64_resource(u8 * byte_stream_buffer, | 193 | acpi_rs_get_aml_length(struct acpi_resource *linked_list_buffer, |
173 | acpi_size * bytes_consumed, | 194 | acpi_size * size_needed); |
174 | u8 ** output_buffer, acpi_size * structure_size); | ||
175 | 195 | ||
176 | acpi_status | 196 | acpi_status |
177 | acpi_rs_address64_stream(struct acpi_resource *linked_list, | 197 | acpi_rs_get_pci_routing_table_length(union acpi_operand_object *package_object, |
178 | u8 ** output_buffer, acpi_size * bytes_consumed); | 198 | acpi_size * buffer_size_needed); |
179 | 199 | ||
180 | acpi_status | 200 | acpi_status |
181 | acpi_rs_start_depend_fns_resource(u8 * byte_stream_buffer, | 201 | acpi_rs_convert_aml_to_resources(u8 * aml_buffer, |
182 | acpi_size * bytes_consumed, | 202 | u32 aml_buffer_length, u8 * output_buffer); |
183 | u8 ** output_buffer, | ||
184 | acpi_size * structure_size); | ||
185 | 203 | ||
186 | acpi_status | 204 | acpi_status |
187 | acpi_rs_end_depend_fns_resource(u8 * byte_stream_buffer, | 205 | acpi_rs_convert_resources_to_aml(struct acpi_resource *resource, |
188 | acpi_size * bytes_consumed, | 206 | acpi_size aml_size_needed, u8 * output_buffer); |
189 | u8 ** output_buffer, | ||
190 | acpi_size * structure_size); | ||
191 | 207 | ||
192 | acpi_status | 208 | /* |
193 | acpi_rs_start_depend_fns_stream(struct acpi_resource *linked_list, | 209 | * rsaddr |
194 | u8 ** output_buffer, | 210 | */ |
195 | acpi_size * bytes_consumed); | 211 | void |
212 | acpi_rs_set_address_common(union aml_resource *aml, | ||
213 | struct acpi_resource *resource); | ||
196 | 214 | ||
197 | acpi_status | 215 | u8 |
198 | acpi_rs_end_depend_fns_stream(struct acpi_resource *linked_list, | 216 | acpi_rs_get_address_common(struct acpi_resource *resource, |
199 | u8 ** output_buffer, acpi_size * bytes_consumed); | 217 | union aml_resource *aml); |
200 | 218 | ||
219 | /* | ||
220 | * rsmisc | ||
221 | */ | ||
201 | acpi_status | 222 | acpi_status |
202 | acpi_rs_memory24_resource(u8 * byte_stream_buffer, | 223 | acpi_rs_convert_aml_to_resource(struct acpi_resource *resource, |
203 | acpi_size * bytes_consumed, | 224 | union aml_resource *aml, |
204 | u8 ** output_buffer, acpi_size * structure_size); | 225 | struct acpi_rsconvert_info *info); |
205 | 226 | ||
206 | acpi_status | 227 | acpi_status |
207 | acpi_rs_memory24_stream(struct acpi_resource *linked_list, | 228 | acpi_rs_convert_resource_to_aml(struct acpi_resource *resource, |
208 | u8 ** output_buffer, acpi_size * bytes_consumed); | 229 | union aml_resource *aml, |
230 | struct acpi_rsconvert_info *info); | ||
209 | 231 | ||
210 | acpi_status | 232 | /* |
211 | acpi_rs_memory32_range_resource(u8 * byte_stream_buffer, | 233 | * rsutils |
212 | acpi_size * bytes_consumed, | 234 | */ |
213 | u8 ** output_buffer, | 235 | void |
214 | acpi_size * structure_size); | 236 | acpi_rs_move_data(void *destination, |
237 | void *source, u16 item_count, u8 move_type); | ||
215 | 238 | ||
216 | acpi_status | 239 | u8 acpi_rs_decode_bitmask(u16 mask, u8 * list); |
217 | acpi_rs_fixed_memory32_resource(u8 * byte_stream_buffer, | ||
218 | acpi_size * bytes_consumed, | ||
219 | u8 ** output_buffer, | ||
220 | acpi_size * structure_size); | ||
221 | 240 | ||
222 | acpi_status | 241 | u16 acpi_rs_encode_bitmask(u8 * list, u8 count); |
223 | acpi_rs_memory32_range_stream(struct acpi_resource *linked_list, | ||
224 | u8 ** output_buffer, acpi_size * bytes_consumed); | ||
225 | 242 | ||
226 | acpi_status | 243 | acpi_rs_length |
227 | acpi_rs_fixed_memory32_stream(struct acpi_resource *linked_list, | 244 | acpi_rs_get_resource_source(acpi_rs_length resource_length, |
228 | u8 ** output_buffer, acpi_size * bytes_consumed); | 245 | acpi_rs_length minimum_length, |
246 | struct acpi_resource_source *resource_source, | ||
247 | union aml_resource *aml, char *string_ptr); | ||
229 | 248 | ||
230 | acpi_status | 249 | acpi_rsdesc_size |
231 | acpi_rs_extended_irq_resource(u8 * byte_stream_buffer, | 250 | acpi_rs_set_resource_source(union aml_resource *aml, |
232 | acpi_size * bytes_consumed, | 251 | acpi_rs_length minimum_length, |
233 | u8 ** output_buffer, acpi_size * structure_size); | 252 | struct acpi_resource_source *resource_source); |
234 | 253 | ||
235 | acpi_status | 254 | void |
236 | acpi_rs_extended_irq_stream(struct acpi_resource *linked_list, | 255 | acpi_rs_set_resource_header(u8 descriptor_type, |
237 | u8 ** output_buffer, acpi_size * bytes_consumed); | 256 | acpi_rsdesc_size total_length, |
257 | union aml_resource *aml); | ||
238 | 258 | ||
239 | acpi_status | 259 | void |
240 | acpi_rs_end_tag_resource(u8 * byte_stream_buffer, | 260 | acpi_rs_set_resource_length(acpi_rsdesc_size total_length, |
241 | acpi_size * bytes_consumed, | 261 | union aml_resource *aml); |
242 | u8 ** output_buffer, acpi_size * structure_size); | ||
243 | 262 | ||
244 | acpi_status | 263 | /* |
245 | acpi_rs_end_tag_stream(struct acpi_resource *linked_list, | 264 | * rsdump |
246 | u8 ** output_buffer, acpi_size * bytes_consumed); | 265 | */ |
266 | void acpi_rs_dump_resource_list(struct acpi_resource *resource); | ||
247 | 267 | ||
248 | acpi_status | 268 | void acpi_rs_dump_irq_list(u8 * route_table); |
249 | acpi_rs_vendor_resource(u8 * byte_stream_buffer, | ||
250 | acpi_size * bytes_consumed, | ||
251 | u8 ** output_buffer, acpi_size * structure_size); | ||
252 | 269 | ||
253 | acpi_status | 270 | /* |
254 | acpi_rs_vendor_stream(struct acpi_resource *linked_list, | 271 | * Resource conversion tables |
255 | u8 ** output_buffer, acpi_size * bytes_consumed); | 272 | */ |
273 | extern struct acpi_rsconvert_info acpi_rs_convert_dma[]; | ||
274 | extern struct acpi_rsconvert_info acpi_rs_convert_end_dpf[]; | ||
275 | extern struct acpi_rsconvert_info acpi_rs_convert_io[]; | ||
276 | extern struct acpi_rsconvert_info acpi_rs_convert_fixed_io[]; | ||
277 | extern struct acpi_rsconvert_info acpi_rs_convert_end_tag[]; | ||
278 | extern struct acpi_rsconvert_info acpi_rs_convert_memory24[]; | ||
279 | extern struct acpi_rsconvert_info acpi_rs_convert_generic_reg[]; | ||
280 | extern struct acpi_rsconvert_info acpi_rs_convert_memory32[]; | ||
281 | extern struct acpi_rsconvert_info acpi_rs_convert_fixed_memory32[]; | ||
282 | extern struct acpi_rsconvert_info acpi_rs_convert_address32[]; | ||
283 | extern struct acpi_rsconvert_info acpi_rs_convert_address16[]; | ||
284 | extern struct acpi_rsconvert_info acpi_rs_convert_ext_irq[]; | ||
285 | extern struct acpi_rsconvert_info acpi_rs_convert_address64[]; | ||
286 | extern struct acpi_rsconvert_info acpi_rs_convert_ext_address64[]; | ||
287 | |||
288 | /* These resources require separate get/set tables */ | ||
289 | |||
290 | extern struct acpi_rsconvert_info acpi_rs_get_irq[]; | ||
291 | extern struct acpi_rsconvert_info acpi_rs_get_start_dpf[]; | ||
292 | extern struct acpi_rsconvert_info acpi_rs_get_vendor_small[]; | ||
293 | extern struct acpi_rsconvert_info acpi_rs_get_vendor_large[]; | ||
294 | |||
295 | extern struct acpi_rsconvert_info acpi_rs_set_irq[]; | ||
296 | extern struct acpi_rsconvert_info acpi_rs_set_start_dpf[]; | ||
297 | extern struct acpi_rsconvert_info acpi_rs_set_vendor[]; | ||
298 | |||
299 | #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) | ||
300 | /* | ||
301 | * rsinfo | ||
302 | */ | ||
303 | extern struct acpi_rsdump_info *acpi_gbl_dump_resource_dispatch[]; | ||
256 | 304 | ||
257 | u8 acpi_rs_get_resource_type(u8 resource_start_byte); | 305 | /* |
306 | * rsdump | ||
307 | */ | ||
308 | extern struct acpi_rsdump_info acpi_rs_dump_irq[]; | ||
309 | extern struct acpi_rsdump_info acpi_rs_dump_dma[]; | ||
310 | extern struct acpi_rsdump_info acpi_rs_dump_start_dpf[]; | ||
311 | extern struct acpi_rsdump_info acpi_rs_dump_end_dpf[]; | ||
312 | extern struct acpi_rsdump_info acpi_rs_dump_io[]; | ||
313 | extern struct acpi_rsdump_info acpi_rs_dump_fixed_io[]; | ||
314 | extern struct acpi_rsdump_info acpi_rs_dump_vendor[]; | ||
315 | extern struct acpi_rsdump_info acpi_rs_dump_end_tag[]; | ||
316 | extern struct acpi_rsdump_info acpi_rs_dump_memory24[]; | ||
317 | extern struct acpi_rsdump_info acpi_rs_dump_memory32[]; | ||
318 | extern struct acpi_rsdump_info acpi_rs_dump_fixed_memory32[]; | ||
319 | extern struct acpi_rsdump_info acpi_rs_dump_address16[]; | ||
320 | extern struct acpi_rsdump_info acpi_rs_dump_address32[]; | ||
321 | extern struct acpi_rsdump_info acpi_rs_dump_address64[]; | ||
322 | extern struct acpi_rsdump_info acpi_rs_dump_ext_address64[]; | ||
323 | extern struct acpi_rsdump_info acpi_rs_dump_ext_irq[]; | ||
324 | extern struct acpi_rsdump_info acpi_rs_dump_generic_reg[]; | ||
325 | #endif | ||
258 | 326 | ||
259 | #endif /* __ACRESRC_H__ */ | 327 | #endif /* __ACRESRC_H__ */ |
diff --git a/include/acpi/acstruct.h b/include/acpi/acstruct.h index 99d235339801..d8c1c2cdac0c 100644 --- a/include/acpi/acstruct.h +++ b/include/acpi/acstruct.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2005, R. Byron Moore | 8 | * Copyright (C) 2000 - 2006, R. Byron Moore |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
diff --git a/include/acpi/actables.h b/include/acpi/actables.h index f92c1858b808..30a47542e1c8 100644 --- a/include/acpi/actables.h +++ b/include/acpi/actables.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2005, R. Byron Moore | 8 | * Copyright (C) 2000 - 2006, R. Byron Moore |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h index a46f406e1c94..ed53f842dad4 100644 --- a/include/acpi/actbl.h +++ b/include/acpi/actbl.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2005, R. Byron Moore | 8 | * Copyright (C) 2000 - 2006, R. Byron Moore |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
@@ -45,6 +45,12 @@ | |||
45 | #define __ACTBL_H__ | 45 | #define __ACTBL_H__ |
46 | 46 | ||
47 | /* | 47 | /* |
48 | * Note about bitfields: The u8 type is used for bitfields in ACPI tables. | ||
49 | * This is the only type that is even remotely portable. Anything else is not | ||
50 | * portable, so do not use any other bitfield types. | ||
51 | */ | ||
52 | |||
53 | /* | ||
48 | * Values for description table header signatures | 54 | * Values for description table header signatures |
49 | */ | 55 | */ |
50 | #define RSDP_NAME "RSDP" | 56 | #define RSDP_NAME "RSDP" |
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h index 67312c3a915a..cd428d57add0 100644 --- a/include/acpi/actbl1.h +++ b/include/acpi/actbl1.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2005, R. Byron Moore | 8 | * Copyright (C) 2000 - 2006, R. Byron Moore |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h index 50305ce2681a..dfc7ac1094bb 100644 --- a/include/acpi/actbl2.h +++ b/include/acpi/actbl2.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2005, R. Byron Moore | 8 | * Copyright (C) 2000 - 2006, R. Byron Moore |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 6213b27516e8..7ca89cde706e 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2005, R. Byron Moore | 8 | * Copyright (C) 2000 - 2006, R. Byron Moore |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
@@ -44,7 +44,15 @@ | |||
44 | #ifndef __ACTYPES_H__ | 44 | #ifndef __ACTYPES_H__ |
45 | #define __ACTYPES_H__ | 45 | #define __ACTYPES_H__ |
46 | 46 | ||
47 | /*! [Begin] no source code translation (keep the typedefs) */ | 47 | /* |
48 | * ACPI_MACHINE_WIDTH must be specified in an OS- or compiler-dependent header | ||
49 | * and must be either 16, 32, or 64 | ||
50 | */ | ||
51 | #ifndef ACPI_MACHINE_WIDTH | ||
52 | #error ACPI_MACHINE_WIDTH not defined | ||
53 | #endif | ||
54 | |||
55 | /*! [Begin] no source code translation */ | ||
48 | 56 | ||
49 | /* | 57 | /* |
50 | * Data type ranges | 58 | * Data type ranges |
@@ -58,87 +66,150 @@ | |||
58 | #define ACPI_UINT64_MAX (UINT64)(~((UINT64) 0)) /* 0xFFFFFFFFFFFFFFFF */ | 66 | #define ACPI_UINT64_MAX (UINT64)(~((UINT64) 0)) /* 0xFFFFFFFFFFFFFFFF */ |
59 | #define ACPI_ASCII_MAX 0x7F | 67 | #define ACPI_ASCII_MAX 0x7F |
60 | 68 | ||
61 | #ifdef DEFINE_ALTERNATE_TYPES | ||
62 | /* | 69 | /* |
63 | * Types used only in translated source, defined here to enable | 70 | * Architecture-specific ACPICA Subsystem Data Types |
64 | * cross-platform compilation only. | 71 | * |
72 | * The goal of these types is to provide source code portability across | ||
73 | * 16-bit, 32-bit, and 64-bit targets. | ||
74 | * | ||
75 | * 1) The following types are of fixed size for all targets (16/32/64): | ||
76 | * | ||
77 | * BOOLEAN Logical boolean | ||
78 | * | ||
79 | * UINT8 8-bit (1 byte) unsigned value | ||
80 | * UINT16 16-bit (2 byte) unsigned value | ||
81 | * UINT32 32-bit (4 byte) unsigned value | ||
82 | * UINT64 64-bit (8 byte) unsigned value | ||
83 | * | ||
84 | * INT16 16-bit (2 byte) signed value | ||
85 | * INT32 32-bit (4 byte) signed value | ||
86 | * INT64 64-bit (8 byte) signed value | ||
87 | * | ||
88 | * COMPILER_DEPENDENT_UINT64/INT64 - These types are defined in the | ||
89 | * compiler-dependent header(s) and were introduced because there is no common | ||
90 | * 64-bit integer type across the various compilation models, as shown in | ||
91 | * the table below. | ||
92 | * | ||
93 | * Datatype LP64 ILP64 LLP64 ILP32 LP32 16bit | ||
94 | * char 8 8 8 8 8 8 | ||
95 | * short 16 16 16 16 16 16 | ||
96 | * _int32 32 | ||
97 | * int 32 64 32 32 16 16 | ||
98 | * long 64 64 32 32 32 32 | ||
99 | * long long 64 64 | ||
100 | * pointer 64 64 64 32 32 32 | ||
101 | * | ||
102 | * Note: ILP64 and LP32 are currently not supported. | ||
103 | * | ||
104 | * | ||
105 | * 2) These types represent the native word size of the target mode of the | ||
106 | * processor, and may be 16-bit, 32-bit, or 64-bit as required. They are | ||
107 | * usually used for memory allocation, efficient loop counters, and array | ||
108 | * indexes. The types are similar to the size_t type in the C library and are | ||
109 | * required because there is no C type that consistently represents the native | ||
110 | * data width. | ||
111 | * | ||
112 | * ACPI_SIZE 16/32/64-bit unsigned value | ||
113 | * ACPI_NATIVE_UINT 16/32/64-bit unsigned value | ||
114 | * ACPI_NATIVE_INT 16/32/64-bit signed value | ||
115 | * | ||
65 | */ | 116 | */ |
66 | typedef int s32; | ||
67 | typedef unsigned char u8; | ||
68 | typedef unsigned short u16; | ||
69 | typedef unsigned int u32; | ||
70 | typedef COMPILER_DEPENDENT_UINT64 u64; | ||
71 | |||
72 | #endif | ||
73 | 117 | ||
74 | /* | 118 | /******************************************************************************* |
75 | * Data types - Fixed across all compilation models (16/32/64) | ||
76 | * | 119 | * |
77 | * BOOLEAN Logical Boolean. | 120 | * Common types for all compilers, all targets |
78 | * INT8 8-bit (1 byte) signed value | 121 | * |
79 | * UINT8 8-bit (1 byte) unsigned value | 122 | ******************************************************************************/ |
80 | * INT16 16-bit (2 byte) signed value | ||
81 | * UINT16 16-bit (2 byte) unsigned value | ||
82 | * INT32 32-bit (4 byte) signed value | ||
83 | * UINT32 32-bit (4 byte) unsigned value | ||
84 | * INT64 64-bit (8 byte) signed 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 | ||
87 | * ACPI_NATIVE_UINT 32-bit on IA-32, 64-bit on IA-64 unsigned value | ||
88 | */ | ||
89 | 123 | ||
90 | #ifndef ACPI_MACHINE_WIDTH | 124 | typedef unsigned char BOOLEAN; |
91 | #error ACPI_MACHINE_WIDTH not defined | 125 | typedef unsigned char UINT8; |
92 | #endif | 126 | typedef unsigned short UINT16; |
127 | typedef COMPILER_DEPENDENT_UINT64 UINT64; | ||
128 | typedef COMPILER_DEPENDENT_INT64 INT64; | ||
129 | |||
130 | /*! [End] no source code translation !*/ | ||
131 | |||
132 | /******************************************************************************* | ||
133 | * | ||
134 | * Types specific to 64-bit targets | ||
135 | * | ||
136 | ******************************************************************************/ | ||
93 | 137 | ||
94 | #if ACPI_MACHINE_WIDTH == 64 | 138 | #if ACPI_MACHINE_WIDTH == 64 |
95 | 139 | ||
96 | /*! [Begin] no source code translation (keep the typedefs) */ | 140 | /*! [Begin] no source code translation (keep the typedefs as-is) */ |
97 | 141 | ||
98 | /* | ||
99 | * 64-bit type definitions | ||
100 | */ | ||
101 | typedef unsigned char UINT8; | ||
102 | typedef unsigned char BOOLEAN; | ||
103 | typedef unsigned short UINT16; | ||
104 | typedef int INT32; | ||
105 | typedef unsigned int UINT32; | 142 | typedef unsigned int UINT32; |
106 | typedef COMPILER_DEPENDENT_INT64 INT64; | 143 | typedef int INT32; |
107 | typedef COMPILER_DEPENDENT_UINT64 UINT64; | ||
108 | 144 | ||
109 | /*! [End] no source code translation !*/ | 145 | /*! [End] no source code translation !*/ |
110 | 146 | ||
111 | typedef s64 acpi_native_int; | ||
112 | typedef u64 acpi_native_uint; | 147 | typedef u64 acpi_native_uint; |
148 | typedef s64 acpi_native_int; | ||
113 | 149 | ||
114 | typedef u64 acpi_table_ptr; | 150 | typedef u64 acpi_table_ptr; |
115 | typedef u64 acpi_io_address; | 151 | typedef u64 acpi_io_address; |
116 | typedef u64 acpi_physical_address; | 152 | typedef u64 acpi_physical_address; |
117 | typedef u64 acpi_size; | ||
118 | 153 | ||
119 | #define ALIGNED_ADDRESS_BOUNDARY 0x00000008 /* No hardware alignment support in IA64 */ | ||
120 | #define ACPI_USE_NATIVE_DIVIDE /* Native 64-bit integer support */ | ||
121 | #define ACPI_MAX_PTR ACPI_UINT64_MAX | 154 | #define ACPI_MAX_PTR ACPI_UINT64_MAX |
122 | #define ACPI_SIZE_MAX ACPI_UINT64_MAX | 155 | #define ACPI_SIZE_MAX ACPI_UINT64_MAX |
123 | 156 | ||
124 | #elif ACPI_MACHINE_WIDTH == 16 | 157 | #define ALIGNED_ADDRESS_BOUNDARY 0x00000008 |
125 | 158 | #define ACPI_USE_NATIVE_DIVIDE /* Has native 64-bit integer support */ | |
126 | /*! [Begin] no source code translation (keep the typedefs) */ | ||
127 | 159 | ||
128 | /* | 160 | /* |
129 | * 16-bit type definitions | 161 | * In the case of the Itanium Processor Family (IPF), the hardware does not |
162 | * support misaligned memory transfers. Set the MISALIGNMENT_NOT_SUPPORTED flag | ||
163 | * to indicate that special precautions must be taken to avoid alignment faults. | ||
164 | * (IA64 or ia64 is currently used by existing compilers to indicate IPF.) | ||
165 | * | ||
166 | * Note: Em64_t and other X86-64 processors support misaligned transfers, | ||
167 | * so there is no need to define this flag. | ||
130 | */ | 168 | */ |
131 | typedef unsigned char UINT8; | 169 | #if defined (__IA64__) || defined (__ia64__) |
132 | typedef unsigned char BOOLEAN; | 170 | #define ACPI_MISALIGNMENT_NOT_SUPPORTED |
133 | typedef unsigned int UINT16; | 171 | #endif |
134 | typedef long INT32; | ||
135 | typedef int INT16; | ||
136 | typedef unsigned long UINT32; | ||
137 | 172 | ||
138 | struct { | 173 | /******************************************************************************* |
139 | UINT32 Lo; | 174 | * |
140 | UINT32 Hi; | 175 | * Types specific to 32-bit targets |
141 | }; | 176 | * |
177 | ******************************************************************************/ | ||
178 | |||
179 | #elif ACPI_MACHINE_WIDTH == 32 | ||
180 | |||
181 | /*! [Begin] no source code translation (keep the typedefs as-is) */ | ||
182 | |||
183 | typedef unsigned int UINT32; | ||
184 | typedef int INT32; | ||
185 | |||
186 | /*! [End] no source code translation !*/ | ||
187 | |||
188 | typedef u32 acpi_native_uint; | ||
189 | typedef s32 acpi_native_int; | ||
190 | |||
191 | typedef u64 acpi_table_ptr; | ||
192 | typedef u32 acpi_io_address; | ||
193 | typedef u64 acpi_physical_address; | ||
194 | |||
195 | #define ACPI_MAX_PTR ACPI_UINT32_MAX | ||
196 | #define ACPI_SIZE_MAX ACPI_UINT32_MAX | ||
197 | |||
198 | #define ALIGNED_ADDRESS_BOUNDARY 0x00000004 | ||
199 | |||
200 | /******************************************************************************* | ||
201 | * | ||
202 | * Types specific to 16-bit targets | ||
203 | * | ||
204 | ******************************************************************************/ | ||
205 | |||
206 | #elif ACPI_MACHINE_WIDTH == 16 | ||
207 | |||
208 | /*! [Begin] no source code translation (keep the typedefs as-is) */ | ||
209 | |||
210 | typedef unsigned long UINT32; | ||
211 | typedef short INT16; | ||
212 | typedef long INT32; | ||
142 | 213 | ||
143 | /*! [End] no source code translation !*/ | 214 | /*! [End] no source code translation !*/ |
144 | 215 | ||
@@ -148,61 +219,84 @@ typedef s16 acpi_native_int; | |||
148 | typedef u32 acpi_table_ptr; | 219 | typedef u32 acpi_table_ptr; |
149 | typedef u32 acpi_io_address; | 220 | typedef u32 acpi_io_address; |
150 | typedef char *acpi_physical_address; | 221 | typedef char *acpi_physical_address; |
151 | typedef u16 acpi_size; | ||
152 | 222 | ||
153 | #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 */ | ||
156 | #define ACPI_MAX_PTR ACPI_UINT16_MAX | 223 | #define ACPI_MAX_PTR ACPI_UINT16_MAX |
157 | #define ACPI_SIZE_MAX ACPI_UINT16_MAX | 224 | #define ACPI_SIZE_MAX ACPI_UINT16_MAX |
158 | 225 | ||
159 | /* | 226 | #define ALIGNED_ADDRESS_BOUNDARY 0x00000002 |
160 | * (16-bit only) internal integers must be 32-bits, so | 227 | #define ACPI_USE_NATIVE_DIVIDE /* No 64-bit integers, ok to use native divide */ |
161 | * 64-bit integers cannot be supported | 228 | |
162 | */ | 229 | /* 64-bit integers cannot be supported */ |
230 | |||
163 | #define ACPI_NO_INTEGER64_SUPPORT | 231 | #define ACPI_NO_INTEGER64_SUPPORT |
164 | 232 | ||
165 | #elif ACPI_MACHINE_WIDTH == 32 | 233 | #else |
166 | 234 | ||
167 | /*! [Begin] no source code translation (keep the typedefs) */ | 235 | /* ACPI_MACHINE_WIDTH must be either 64, 32, or 16 */ |
168 | 236 | ||
169 | /* | 237 | #error unknown ACPI_MACHINE_WIDTH |
170 | * 32-bit type definitions (default) | 238 | #endif |
171 | */ | ||
172 | typedef unsigned char UINT8; | ||
173 | typedef unsigned char BOOLEAN; | ||
174 | typedef unsigned short UINT16; | ||
175 | typedef int INT32; | ||
176 | typedef unsigned int UINT32; | ||
177 | typedef COMPILER_DEPENDENT_INT64 INT64; | ||
178 | typedef COMPILER_DEPENDENT_UINT64 UINT64; | ||
179 | 239 | ||
180 | /*! [End] no source code translation !*/ | 240 | /* Variable-width type, used instead of clib size_t */ |
181 | 241 | ||
182 | typedef s32 acpi_native_int; | 242 | typedef acpi_native_uint acpi_size; |
183 | typedef u32 acpi_native_uint; | ||
184 | 243 | ||
185 | typedef u64 acpi_table_ptr; | 244 | /******************************************************************************* |
186 | typedef u32 acpi_io_address; | 245 | * |
187 | typedef u64 acpi_physical_address; | 246 | * OS- or compiler-dependent types |
188 | typedef u32 acpi_size; | 247 | * |
248 | * If the defaults below are not appropriate for the host system, they can | ||
249 | * be defined in the compiler-specific or OS-specific header, and this will | ||
250 | * take precedence. | ||
251 | * | ||
252 | ******************************************************************************/ | ||
189 | 253 | ||
190 | #define ALIGNED_ADDRESS_BOUNDARY 0x00000004 | 254 | /* Use C99 uintptr_t for pointer casting if available, "void *" otherwise */ |
191 | #define ACPI_MISALIGNED_TRANSFERS | ||
192 | #define ACPI_MAX_PTR ACPI_UINT32_MAX | ||
193 | #define ACPI_SIZE_MAX ACPI_UINT32_MAX | ||
194 | 255 | ||
195 | #else | 256 | #ifndef acpi_uintptr_t |
196 | #error unknown ACPI_MACHINE_WIDTH | 257 | #define acpi_uintptr_t void * |
197 | #endif | 258 | #endif |
198 | 259 | ||
199 | /* | 260 | /* |
200 | * This type is used for bitfields in ACPI tables. The only type that is | 261 | * If acpi_cache_t was not defined in the OS-dependent header, |
201 | * even remotely portable is u8. Anything else is not portable, so | 262 | * define it now. This is typically the case where the local cache |
202 | * do not add any more bitfield types. | 263 | * manager implementation is to be used (ACPI_USE_LOCAL_CACHE) |
264 | */ | ||
265 | #ifndef acpi_cache_t | ||
266 | #define acpi_cache_t struct acpi_memory_list | ||
267 | #endif | ||
268 | |||
269 | /* | ||
270 | * Allow the CPU flags word to be defined per-OS to simplify the use of the | ||
271 | * lock and unlock OSL interfaces. | ||
272 | */ | ||
273 | #ifndef acpi_cpu_flags | ||
274 | #define acpi_cpu_flags acpi_native_uint | ||
275 | #endif | ||
276 | |||
277 | /* | ||
278 | * ACPI_PRINTF_LIKE is used to tag functions as "printf-like" because | ||
279 | * some compilers can catch printf format string problems | ||
203 | */ | 280 | */ |
204 | typedef u8 UINT8_BIT; | 281 | #ifndef ACPI_PRINTF_LIKE |
205 | typedef acpi_native_uint ACPI_PTRDIFF; | 282 | #define ACPI_PRINTF_LIKE(c) |
283 | #endif | ||
284 | |||
285 | /* | ||
286 | * Some compilers complain about unused variables. Sometimes we don't want to | ||
287 | * use all the variables (for example, _acpi_module_name). This allows us | ||
288 | * to to tell the compiler in a per-variable manner that a variable | ||
289 | * is unused | ||
290 | */ | ||
291 | #ifndef ACPI_UNUSED_VAR | ||
292 | #define ACPI_UNUSED_VAR | ||
293 | #endif | ||
294 | |||
295 | /******************************************************************************* | ||
296 | * | ||
297 | * Independent types | ||
298 | * | ||
299 | ******************************************************************************/ | ||
206 | 300 | ||
207 | /* | 301 | /* |
208 | * Pointer overlays to avoid lots of typecasting for | 302 | * Pointer overlays to avoid lots of typecasting for |
@@ -234,18 +328,8 @@ struct acpi_pointer { | |||
234 | #define ACPI_LOGMODE_PHYSPTR ACPI_LOGICAL_ADDRESSING | ACPI_PHYSICAL_POINTER | 328 | #define ACPI_LOGMODE_PHYSPTR ACPI_LOGICAL_ADDRESSING | ACPI_PHYSICAL_POINTER |
235 | #define ACPI_LOGMODE_LOGPTR ACPI_LOGICAL_ADDRESSING | ACPI_LOGICAL_POINTER | 329 | #define ACPI_LOGMODE_LOGPTR ACPI_LOGICAL_ADDRESSING | ACPI_LOGICAL_POINTER |
236 | 330 | ||
237 | /* | 331 | /* Logical defines and NULL */ |
238 | * If acpi_cache_t was not defined in the OS-dependent header, | ||
239 | * define it now. This is typically the case where the local cache | ||
240 | * manager implementation is to be used (ACPI_USE_LOCAL_CACHE) | ||
241 | */ | ||
242 | #ifndef acpi_cache_t | ||
243 | #define acpi_cache_t struct acpi_memory_list | ||
244 | #endif | ||
245 | 332 | ||
246 | /* | ||
247 | * Useful defines | ||
248 | */ | ||
249 | #ifdef FALSE | 333 | #ifdef FALSE |
250 | #undef FALSE | 334 | #undef FALSE |
251 | #endif | 335 | #endif |
@@ -261,12 +345,12 @@ struct acpi_pointer { | |||
261 | #endif | 345 | #endif |
262 | 346 | ||
263 | /* | 347 | /* |
264 | * Local datatypes | 348 | * Mescellaneous types |
265 | */ | 349 | */ |
266 | typedef u32 acpi_status; /* All ACPI Exceptions */ | 350 | typedef u32 acpi_status; /* All ACPI Exceptions */ |
267 | typedef u32 acpi_name; /* 4-byte ACPI name */ | 351 | typedef u32 acpi_name; /* 4-byte ACPI name */ |
268 | typedef char *acpi_string; /* Null terminated ASCII string */ | 352 | typedef char *acpi_string; /* Null terminated ASCII string */ |
269 | typedef void *acpi_handle; /* Actually a ptr to an Node */ | 353 | typedef void *acpi_handle; /* Actually a ptr to a NS Node */ |
270 | 354 | ||
271 | struct uint64_struct { | 355 | struct uint64_struct { |
272 | u32 lo; | 356 | u32 lo; |
@@ -323,7 +407,7 @@ typedef u64 acpi_integer; | |||
323 | /* | 407 | /* |
324 | * Constants with special meanings | 408 | * Constants with special meanings |
325 | */ | 409 | */ |
326 | #define ACPI_ROOT_OBJECT (acpi_handle) ACPI_PTR_ADD (char, NULL, ACPI_MAX_PTR) | 410 | #define ACPI_ROOT_OBJECT ACPI_ADD_PTR (acpi_handle, NULL, ACPI_MAX_PTR) |
327 | 411 | ||
328 | /* | 412 | /* |
329 | * Initialization sequence | 413 | * Initialization sequence |
@@ -470,37 +554,6 @@ typedef u32 acpi_object_type; | |||
470 | #define ACPI_TYPE_NOT_FOUND 0xFF | 554 | #define ACPI_TYPE_NOT_FOUND 0xFF |
471 | 555 | ||
472 | /* | 556 | /* |
473 | * Bitmapped ACPI types. Used internally only | ||
474 | */ | ||
475 | #define ACPI_BTYPE_ANY 0x00000000 | ||
476 | #define ACPI_BTYPE_INTEGER 0x00000001 | ||
477 | #define ACPI_BTYPE_STRING 0x00000002 | ||
478 | #define ACPI_BTYPE_BUFFER 0x00000004 | ||
479 | #define ACPI_BTYPE_PACKAGE 0x00000008 | ||
480 | #define ACPI_BTYPE_FIELD_UNIT 0x00000010 | ||
481 | #define ACPI_BTYPE_DEVICE 0x00000020 | ||
482 | #define ACPI_BTYPE_EVENT 0x00000040 | ||
483 | #define ACPI_BTYPE_METHOD 0x00000080 | ||
484 | #define ACPI_BTYPE_MUTEX 0x00000100 | ||
485 | #define ACPI_BTYPE_REGION 0x00000200 | ||
486 | #define ACPI_BTYPE_POWER 0x00000400 | ||
487 | #define ACPI_BTYPE_PROCESSOR 0x00000800 | ||
488 | #define ACPI_BTYPE_THERMAL 0x00001000 | ||
489 | #define ACPI_BTYPE_BUFFER_FIELD 0x00002000 | ||
490 | #define ACPI_BTYPE_DDB_HANDLE 0x00004000 | ||
491 | #define ACPI_BTYPE_DEBUG_OBJECT 0x00008000 | ||
492 | #define ACPI_BTYPE_REFERENCE 0x00010000 | ||
493 | #define ACPI_BTYPE_RESOURCE 0x00020000 | ||
494 | |||
495 | #define ACPI_BTYPE_COMPUTE_DATA (ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER) | ||
496 | |||
497 | #define ACPI_BTYPE_DATA (ACPI_BTYPE_COMPUTE_DATA | ACPI_BTYPE_PACKAGE) | ||
498 | #define ACPI_BTYPE_DATA_REFERENCE (ACPI_BTYPE_DATA | ACPI_BTYPE_REFERENCE | ACPI_BTYPE_DDB_HANDLE) | ||
499 | #define ACPI_BTYPE_DEVICE_OBJECTS (ACPI_BTYPE_DEVICE | ACPI_BTYPE_THERMAL | ACPI_BTYPE_PROCESSOR) | ||
500 | #define ACPI_BTYPE_OBJECTS_AND_REFS 0x0001FFFF /* ARG or LOCAL */ | ||
501 | #define ACPI_BTYPE_ALL_OBJECTS 0x0000FFFF | ||
502 | |||
503 | /* | ||
504 | * All I/O | 557 | * All I/O |
505 | */ | 558 | */ |
506 | #define ACPI_READ 0 | 559 | #define ACPI_READ 0 |
@@ -853,6 +906,14 @@ struct acpi_compatible_id_list { | |||
853 | #define ACPI_VALID_CID 0x0010 | 906 | #define ACPI_VALID_CID 0x0010 |
854 | #define ACPI_VALID_SXDS 0x0020 | 907 | #define ACPI_VALID_SXDS 0x0020 |
855 | 908 | ||
909 | /* Flags for _STA method */ | ||
910 | |||
911 | #define ACPI_STA_DEVICE_PRESENT 0x01 | ||
912 | #define ACPI_STA_DEVICE_ENABLED 0x02 | ||
913 | #define ACPI_STA_DEVICE_UI 0x04 | ||
914 | #define ACPI_STA_DEVICE_OK 0x08 | ||
915 | #define ACPI_STA_BATTERY_PRESENT 0x10 | ||
916 | |||
856 | #define ACPI_COMMON_OBJ_INFO \ | 917 | #define ACPI_COMMON_OBJ_INFO \ |
857 | acpi_object_type type; /* ACPI object type */ \ | 918 | acpi_object_type type; /* ACPI object type */ \ |
858 | acpi_name name /* ACPI object Name */ | 919 | acpi_name name /* ACPI object Name */ |
@@ -895,6 +956,8 @@ struct acpi_mem_space_context { | |||
895 | /* | 956 | /* |
896 | * Definitions for Resource Attributes | 957 | * Definitions for Resource Attributes |
897 | */ | 958 | */ |
959 | typedef u16 acpi_rs_length; /* Resource Length field is fixed at 16 bits */ | ||
960 | typedef u32 acpi_rsdesc_size; /* Max Resource Descriptor size is (length+3) = (64_k-1)+3 */ | ||
898 | 961 | ||
899 | /* | 962 | /* |
900 | * Memory Attributes | 963 | * Memory Attributes |
@@ -916,7 +979,9 @@ struct acpi_mem_space_context { | |||
916 | #define ACPI_ISA_ONLY_RANGES (u8) 0x02 | 979 | #define ACPI_ISA_ONLY_RANGES (u8) 0x02 |
917 | #define ACPI_ENTIRE_RANGE (ACPI_NON_ISA_ONLY_RANGES | ACPI_ISA_ONLY_RANGES) | 980 | #define ACPI_ENTIRE_RANGE (ACPI_NON_ISA_ONLY_RANGES | ACPI_ISA_ONLY_RANGES) |
918 | 981 | ||
919 | #define ACPI_SPARSE_TRANSLATION (u8) 0x03 | 982 | /* Type of translation - 1=Sparse, 0=Dense */ |
983 | |||
984 | #define ACPI_SPARSE_TRANSLATION (u8) 0x01 | ||
920 | 985 | ||
921 | /* | 986 | /* |
922 | * IO Port Descriptor Decode | 987 | * IO Port Descriptor Decode |
@@ -927,8 +992,8 @@ struct acpi_mem_space_context { | |||
927 | /* | 992 | /* |
928 | * IRQ Attributes | 993 | * IRQ Attributes |
929 | */ | 994 | */ |
930 | #define ACPI_EDGE_SENSITIVE (u8) 0x00 | 995 | #define ACPI_LEVEL_SENSITIVE (u8) 0x00 |
931 | #define ACPI_LEVEL_SENSITIVE (u8) 0x01 | 996 | #define ACPI_EDGE_SENSITIVE (u8) 0x01 |
932 | 997 | ||
933 | #define ACPI_ACTIVE_HIGH (u8) 0x00 | 998 | #define ACPI_ACTIVE_HIGH (u8) 0x00 |
934 | #define ACPI_ACTIVE_LOW (u8) 0x01 | 999 | #define ACPI_ACTIVE_LOW (u8) 0x01 |
@@ -975,27 +1040,45 @@ struct acpi_mem_space_context { | |||
975 | #define ACPI_CONSUMER (u8) 0x01 | 1040 | #define ACPI_CONSUMER (u8) 0x01 |
976 | 1041 | ||
977 | /* | 1042 | /* |
1043 | * If possible, pack the following structures to byte alignment | ||
1044 | */ | ||
1045 | #ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED | ||
1046 | #pragma pack(1) | ||
1047 | #endif | ||
1048 | |||
1049 | /* UUID data structures for use in vendor-defined resource descriptors */ | ||
1050 | |||
1051 | struct acpi_uuid { | ||
1052 | u8 data[ACPI_UUID_LENGTH]; | ||
1053 | }; | ||
1054 | |||
1055 | struct acpi_vendor_uuid { | ||
1056 | u8 subtype; | ||
1057 | u8 data[ACPI_UUID_LENGTH]; | ||
1058 | }; | ||
1059 | |||
1060 | /* | ||
978 | * Structures used to describe device resources | 1061 | * Structures used to describe device resources |
979 | */ | 1062 | */ |
980 | struct acpi_resource_irq { | 1063 | struct acpi_resource_irq { |
981 | u32 edge_level; | 1064 | u8 triggering; |
982 | u32 active_high_low; | 1065 | u8 polarity; |
983 | u32 shared_exclusive; | 1066 | u8 sharable; |
984 | u32 number_of_interrupts; | 1067 | u8 interrupt_count; |
985 | u32 interrupts[1]; | 1068 | u8 interrupts[1]; |
986 | }; | 1069 | }; |
987 | 1070 | ||
988 | struct acpi_resource_dma { | 1071 | struct acpi_resource_dma { |
989 | u32 type; | 1072 | u8 type; |
990 | u32 bus_master; | 1073 | u8 bus_master; |
991 | u32 transfer; | 1074 | u8 transfer; |
992 | u32 number_of_channels; | 1075 | u8 channel_count; |
993 | u32 channels[1]; | 1076 | u8 channels[1]; |
994 | }; | 1077 | }; |
995 | 1078 | ||
996 | struct acpi_resource_start_dpf { | 1079 | struct acpi_resource_start_dependent { |
997 | u32 compatibility_priority; | 1080 | u8 compatibility_priority; |
998 | u32 performance_robustness; | 1081 | u8 performance_robustness; |
999 | }; | 1082 | }; |
1000 | 1083 | ||
1001 | /* | 1084 | /* |
@@ -1004,179 +1087,217 @@ struct acpi_resource_start_dpf { | |||
1004 | */ | 1087 | */ |
1005 | 1088 | ||
1006 | struct acpi_resource_io { | 1089 | struct acpi_resource_io { |
1007 | u32 io_decode; | 1090 | u8 io_decode; |
1008 | u32 min_base_address; | 1091 | u8 alignment; |
1009 | u32 max_base_address; | 1092 | u8 address_length; |
1010 | u32 alignment; | 1093 | u16 minimum; |
1011 | u32 range_length; | 1094 | u16 maximum; |
1012 | }; | 1095 | }; |
1013 | 1096 | ||
1014 | struct acpi_resource_fixed_io { | 1097 | struct acpi_resource_fixed_io { |
1015 | u32 base_address; | 1098 | u16 address; |
1016 | u32 range_length; | 1099 | u8 address_length; |
1017 | }; | 1100 | }; |
1018 | 1101 | ||
1019 | struct acpi_resource_vendor { | 1102 | struct acpi_resource_vendor { |
1020 | u32 length; | 1103 | u16 byte_length; |
1021 | u8 reserved[1]; | 1104 | u8 byte_data[1]; |
1105 | }; | ||
1106 | |||
1107 | /* Vendor resource with UUID info (introduced in ACPI 3.0) */ | ||
1108 | |||
1109 | struct acpi_resource_vendor_typed { | ||
1110 | u16 byte_length; | ||
1111 | u8 uuid_subtype; | ||
1112 | u8 uuid[ACPI_UUID_LENGTH]; | ||
1113 | u8 byte_data[1]; | ||
1022 | }; | 1114 | }; |
1023 | 1115 | ||
1024 | struct acpi_resource_end_tag { | 1116 | struct acpi_resource_end_tag { |
1025 | u8 checksum; | 1117 | u8 checksum; |
1026 | }; | 1118 | }; |
1027 | 1119 | ||
1028 | struct acpi_resource_mem24 { | 1120 | struct acpi_resource_memory24 { |
1029 | u32 read_write_attribute; | 1121 | u8 write_protect; |
1030 | u32 min_base_address; | 1122 | u16 minimum; |
1031 | u32 max_base_address; | 1123 | u16 maximum; |
1032 | u32 alignment; | 1124 | u16 alignment; |
1033 | u32 range_length; | 1125 | u16 address_length; |
1034 | }; | 1126 | }; |
1035 | 1127 | ||
1036 | struct acpi_resource_mem32 { | 1128 | struct acpi_resource_memory32 { |
1037 | u32 read_write_attribute; | 1129 | u8 write_protect; |
1038 | u32 min_base_address; | 1130 | u32 minimum; |
1039 | u32 max_base_address; | 1131 | u32 maximum; |
1040 | u32 alignment; | 1132 | u32 alignment; |
1041 | u32 range_length; | 1133 | u32 address_length; |
1042 | }; | 1134 | }; |
1043 | 1135 | ||
1044 | struct acpi_resource_fixed_mem32 { | 1136 | struct acpi_resource_fixed_memory32 { |
1045 | u32 read_write_attribute; | 1137 | u8 write_protect; |
1046 | u32 range_base_address; | 1138 | u32 address; |
1047 | u32 range_length; | 1139 | u32 address_length; |
1048 | }; | 1140 | }; |
1049 | 1141 | ||
1050 | struct acpi_memory_attribute { | 1142 | struct acpi_memory_attribute { |
1051 | u16 cache_attribute; | 1143 | u8 write_protect; |
1052 | u16 read_write_attribute; | 1144 | u8 caching; |
1145 | u8 range_type; | ||
1146 | u8 translation; | ||
1053 | }; | 1147 | }; |
1054 | 1148 | ||
1055 | struct acpi_io_attribute { | 1149 | struct acpi_io_attribute { |
1056 | u16 range_attribute; | 1150 | u8 range_type; |
1057 | u16 translation_attribute; | 1151 | u8 translation; |
1058 | }; | 1152 | u8 translation_type; |
1059 | 1153 | u8 reserved1; | |
1060 | struct acpi_bus_attribute { | ||
1061 | u16 reserved1; | ||
1062 | u16 reserved2; | ||
1063 | }; | 1154 | }; |
1064 | 1155 | ||
1065 | union acpi_resource_attribute { | 1156 | union acpi_resource_attribute { |
1066 | struct acpi_memory_attribute memory; | 1157 | struct acpi_memory_attribute mem; |
1067 | struct acpi_io_attribute io; | 1158 | struct acpi_io_attribute io; |
1068 | struct acpi_bus_attribute bus; | 1159 | |
1160 | /* Used for the *word_space macros */ | ||
1161 | |||
1162 | u8 type_specific; | ||
1069 | }; | 1163 | }; |
1070 | 1164 | ||
1071 | struct acpi_resource_source { | 1165 | struct acpi_resource_source { |
1072 | u32 index; | 1166 | u8 index; |
1073 | u32 string_length; | 1167 | u16 string_length; |
1074 | char *string_ptr; | 1168 | char *string_ptr; |
1075 | }; | 1169 | }; |
1076 | 1170 | ||
1077 | /* Fields common to all address descriptors, 16/32/64 bit */ | 1171 | /* Fields common to all address descriptors, 16/32/64 bit */ |
1078 | 1172 | ||
1079 | #define ACPI_RESOURCE_ADDRESS_COMMON \ | 1173 | #define ACPI_RESOURCE_ADDRESS_COMMON \ |
1080 | u32 resource_type; \ | 1174 | u8 resource_type; \ |
1081 | u32 producer_consumer; \ | 1175 | u8 producer_consumer; \ |
1082 | u32 decode; \ | 1176 | u8 decode; \ |
1083 | u32 min_address_fixed; \ | 1177 | u8 min_address_fixed; \ |
1084 | u32 max_address_fixed; \ | 1178 | u8 max_address_fixed; \ |
1085 | union acpi_resource_attribute attribute; | 1179 | union acpi_resource_attribute info; |
1086 | 1180 | ||
1087 | struct acpi_resource_address { | 1181 | struct acpi_resource_address { |
1088 | ACPI_RESOURCE_ADDRESS_COMMON}; | 1182 | ACPI_RESOURCE_ADDRESS_COMMON}; |
1089 | 1183 | ||
1090 | struct acpi_resource_address16 { | 1184 | struct acpi_resource_address16 { |
1091 | ACPI_RESOURCE_ADDRESS_COMMON u32 granularity; | 1185 | ACPI_RESOURCE_ADDRESS_COMMON u16 granularity; |
1092 | u32 min_address_range; | 1186 | u16 minimum; |
1093 | u32 max_address_range; | 1187 | u16 maximum; |
1094 | u32 address_translation_offset; | 1188 | u16 translation_offset; |
1095 | u32 address_length; | 1189 | u16 address_length; |
1096 | struct acpi_resource_source resource_source; | 1190 | struct acpi_resource_source resource_source; |
1097 | }; | 1191 | }; |
1098 | 1192 | ||
1099 | struct acpi_resource_address32 { | 1193 | struct acpi_resource_address32 { |
1100 | ACPI_RESOURCE_ADDRESS_COMMON u32 granularity; | 1194 | ACPI_RESOURCE_ADDRESS_COMMON u32 granularity; |
1101 | u32 min_address_range; | 1195 | u32 minimum; |
1102 | u32 max_address_range; | 1196 | u32 maximum; |
1103 | u32 address_translation_offset; | 1197 | u32 translation_offset; |
1104 | u32 address_length; | 1198 | u32 address_length; |
1105 | struct acpi_resource_source resource_source; | 1199 | struct acpi_resource_source resource_source; |
1106 | }; | 1200 | }; |
1107 | 1201 | ||
1108 | struct acpi_resource_address64 { | 1202 | struct acpi_resource_address64 { |
1109 | ACPI_RESOURCE_ADDRESS_COMMON u64 granularity; | 1203 | ACPI_RESOURCE_ADDRESS_COMMON u64 granularity; |
1110 | u64 min_address_range; | 1204 | u64 minimum; |
1111 | u64 max_address_range; | 1205 | u64 maximum; |
1112 | u64 address_translation_offset; | 1206 | u64 translation_offset; |
1113 | u64 address_length; | 1207 | u64 address_length; |
1114 | u64 type_specific_attributes; | ||
1115 | struct acpi_resource_source resource_source; | 1208 | struct acpi_resource_source resource_source; |
1116 | }; | 1209 | }; |
1117 | 1210 | ||
1118 | struct acpi_resource_ext_irq { | 1211 | struct acpi_resource_extended_address64 { |
1119 | u32 producer_consumer; | 1212 | ACPI_RESOURCE_ADDRESS_COMMON u8 revision_iD; |
1120 | u32 edge_level; | 1213 | u64 granularity; |
1121 | u32 active_high_low; | 1214 | u64 minimum; |
1122 | u32 shared_exclusive; | 1215 | u64 maximum; |
1123 | u32 number_of_interrupts; | 1216 | u64 translation_offset; |
1217 | u64 address_length; | ||
1218 | u64 type_specific; | ||
1219 | }; | ||
1220 | |||
1221 | struct acpi_resource_extended_irq { | ||
1222 | u8 producer_consumer; | ||
1223 | u8 triggering; | ||
1224 | u8 polarity; | ||
1225 | u8 sharable; | ||
1226 | u8 interrupt_count; | ||
1124 | struct acpi_resource_source resource_source; | 1227 | struct acpi_resource_source resource_source; |
1125 | u32 interrupts[1]; | 1228 | u32 interrupts[1]; |
1126 | }; | 1229 | }; |
1127 | 1230 | ||
1231 | struct acpi_resource_generic_register { | ||
1232 | u8 space_id; | ||
1233 | u8 bit_width; | ||
1234 | u8 bit_offset; | ||
1235 | u8 access_size; | ||
1236 | u64 address; | ||
1237 | }; | ||
1238 | |||
1128 | /* ACPI_RESOURCE_TYPEs */ | 1239 | /* ACPI_RESOURCE_TYPEs */ |
1129 | 1240 | ||
1130 | #define ACPI_RSTYPE_IRQ 0 | 1241 | #define ACPI_RESOURCE_TYPE_IRQ 0 |
1131 | #define ACPI_RSTYPE_DMA 1 | 1242 | #define ACPI_RESOURCE_TYPE_DMA 1 |
1132 | #define ACPI_RSTYPE_START_DPF 2 | 1243 | #define ACPI_RESOURCE_TYPE_START_DEPENDENT 2 |
1133 | #define ACPI_RSTYPE_END_DPF 3 | 1244 | #define ACPI_RESOURCE_TYPE_END_DEPENDENT 3 |
1134 | #define ACPI_RSTYPE_IO 4 | 1245 | #define ACPI_RESOURCE_TYPE_IO 4 |
1135 | #define ACPI_RSTYPE_FIXED_IO 5 | 1246 | #define ACPI_RESOURCE_TYPE_FIXED_IO 5 |
1136 | #define ACPI_RSTYPE_VENDOR 6 | 1247 | #define ACPI_RESOURCE_TYPE_VENDOR 6 |
1137 | #define ACPI_RSTYPE_END_TAG 7 | 1248 | #define ACPI_RESOURCE_TYPE_END_TAG 7 |
1138 | #define ACPI_RSTYPE_MEM24 8 | 1249 | #define ACPI_RESOURCE_TYPE_MEMORY24 8 |
1139 | #define ACPI_RSTYPE_MEM32 9 | 1250 | #define ACPI_RESOURCE_TYPE_MEMORY32 9 |
1140 | #define ACPI_RSTYPE_FIXED_MEM32 10 | 1251 | #define ACPI_RESOURCE_TYPE_FIXED_MEMORY32 10 |
1141 | #define ACPI_RSTYPE_ADDRESS16 11 | 1252 | #define ACPI_RESOURCE_TYPE_ADDRESS16 11 |
1142 | #define ACPI_RSTYPE_ADDRESS32 12 | 1253 | #define ACPI_RESOURCE_TYPE_ADDRESS32 12 |
1143 | #define ACPI_RSTYPE_ADDRESS64 13 | 1254 | #define ACPI_RESOURCE_TYPE_ADDRESS64 13 |
1144 | #define ACPI_RSTYPE_EXT_IRQ 14 | 1255 | #define ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 14 /* ACPI 3.0 */ |
1145 | 1256 | #define ACPI_RESOURCE_TYPE_EXTENDED_IRQ 15 | |
1146 | typedef u32 acpi_resource_type; | 1257 | #define ACPI_RESOURCE_TYPE_GENERIC_REGISTER 16 |
1258 | #define ACPI_RESOURCE_TYPE_MAX 16 | ||
1147 | 1259 | ||
1148 | union acpi_resource_data { | 1260 | union acpi_resource_data { |
1149 | struct acpi_resource_irq irq; | 1261 | struct acpi_resource_irq irq; |
1150 | struct acpi_resource_dma dma; | 1262 | struct acpi_resource_dma dma; |
1151 | struct acpi_resource_start_dpf start_dpf; | 1263 | struct acpi_resource_start_dependent start_dpf; |
1152 | struct acpi_resource_io io; | 1264 | struct acpi_resource_io io; |
1153 | struct acpi_resource_fixed_io fixed_io; | 1265 | struct acpi_resource_fixed_io fixed_io; |
1154 | struct acpi_resource_vendor vendor_specific; | 1266 | struct acpi_resource_vendor vendor; |
1267 | struct acpi_resource_vendor_typed vendor_typed; | ||
1155 | struct acpi_resource_end_tag end_tag; | 1268 | struct acpi_resource_end_tag end_tag; |
1156 | struct acpi_resource_mem24 memory24; | 1269 | struct acpi_resource_memory24 memory24; |
1157 | struct acpi_resource_mem32 memory32; | 1270 | struct acpi_resource_memory32 memory32; |
1158 | struct acpi_resource_fixed_mem32 fixed_memory32; | 1271 | struct acpi_resource_fixed_memory32 fixed_memory32; |
1159 | struct acpi_resource_address address; /* Common 16/32/64 address fields */ | ||
1160 | struct acpi_resource_address16 address16; | 1272 | struct acpi_resource_address16 address16; |
1161 | struct acpi_resource_address32 address32; | 1273 | struct acpi_resource_address32 address32; |
1162 | struct acpi_resource_address64 address64; | 1274 | struct acpi_resource_address64 address64; |
1163 | struct acpi_resource_ext_irq extended_irq; | 1275 | struct acpi_resource_extended_address64 ext_address64; |
1276 | struct acpi_resource_extended_irq extended_irq; | ||
1277 | struct acpi_resource_generic_register generic_reg; | ||
1278 | |||
1279 | /* Common fields */ | ||
1280 | |||
1281 | struct acpi_resource_address address; /* Common 16/32/64 address fields */ | ||
1164 | }; | 1282 | }; |
1165 | 1283 | ||
1166 | struct acpi_resource { | 1284 | struct acpi_resource { |
1167 | acpi_resource_type id; | 1285 | u32 type; |
1168 | u32 length; | 1286 | u32 length; |
1169 | union acpi_resource_data data; | 1287 | union acpi_resource_data data; |
1170 | }; | 1288 | }; |
1171 | 1289 | ||
1172 | #define ACPI_RESOURCE_LENGTH 12 | 1290 | /* restore default alignment */ |
1173 | #define ACPI_RESOURCE_LENGTH_NO_DATA 8 /* Id + Length fields */ | 1291 | |
1292 | #pragma pack() | ||
1174 | 1293 | ||
1175 | #define ACPI_SIZEOF_RESOURCE(type) (ACPI_RESOURCE_LENGTH_NO_DATA + sizeof (type)) | 1294 | #define ACPI_RS_SIZE_MIN 12 |
1295 | #define ACPI_RS_SIZE_NO_DATA 8 /* Id + Length fields */ | ||
1296 | #define ACPI_RS_SIZE(type) (u32) (ACPI_RS_SIZE_NO_DATA + sizeof (type)) | ||
1176 | 1297 | ||
1177 | #define ACPI_NEXT_RESOURCE(res) (struct acpi_resource *)((u8 *) res + res->length) | 1298 | #define ACPI_NEXT_RESOURCE(res) (struct acpi_resource *)((u8 *) res + res->length) |
1178 | 1299 | ||
1179 | #ifdef ACPI_MISALIGNED_TRANSFERS | 1300 | #ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED |
1180 | #define ACPI_ALIGN_RESOURCE_SIZE(length) (length) | 1301 | #define ACPI_ALIGN_RESOURCE_SIZE(length) (length) |
1181 | #else | 1302 | #else |
1182 | #define ACPI_ALIGN_RESOURCE_SIZE(length) ACPI_ROUND_UP_TO_NATIVE_WORD(length) | 1303 | #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..0927765df6aa 100644 --- a/include/acpi/acutils.h +++ b/include/acpi/acutils.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2005, R. Byron Moore | 8 | * Copyright (C) 2000 - 2006, R. Byron Moore |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
@@ -44,6 +44,39 @@ | |||
44 | #ifndef _ACUTILS_H | 44 | #ifndef _ACUTILS_H |
45 | #define _ACUTILS_H | 45 | #define _ACUTILS_H |
46 | 46 | ||
47 | extern const u8 acpi_gbl_resource_aml_sizes[]; | ||
48 | |||
49 | /* Strings used by the disassembler and debugger resource dump routines */ | ||
50 | |||
51 | #if defined(ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER) | ||
52 | |||
53 | extern const char *acpi_gbl_BMdecode[2]; | ||
54 | extern const char *acpi_gbl_config_decode[4]; | ||
55 | extern const char *acpi_gbl_consume_decode[2]; | ||
56 | extern const char *acpi_gbl_DECdecode[2]; | ||
57 | extern const char *acpi_gbl_HEdecode[2]; | ||
58 | extern const char *acpi_gbl_io_decode[2]; | ||
59 | extern const char *acpi_gbl_LLdecode[2]; | ||
60 | extern const char *acpi_gbl_max_decode[2]; | ||
61 | extern const char *acpi_gbl_MEMdecode[4]; | ||
62 | extern const char *acpi_gbl_min_decode[2]; | ||
63 | extern const char *acpi_gbl_MTPdecode[4]; | ||
64 | extern const char *acpi_gbl_RNGdecode[4]; | ||
65 | extern const char *acpi_gbl_RWdecode[2]; | ||
66 | extern const char *acpi_gbl_SHRdecode[2]; | ||
67 | extern const char *acpi_gbl_SIZdecode[4]; | ||
68 | extern const char *acpi_gbl_TRSdecode[2]; | ||
69 | extern const char *acpi_gbl_TTPdecode[2]; | ||
70 | extern const char *acpi_gbl_TYPdecode[4]; | ||
71 | #endif | ||
72 | |||
73 | /* Types for Resource descriptor entries */ | ||
74 | |||
75 | #define ACPI_INVALID_RESOURCE 0 | ||
76 | #define ACPI_FIXED_LENGTH 1 | ||
77 | #define ACPI_VARIABLE_LENGTH 2 | ||
78 | #define ACPI_SMALL_VARIABLE_LENGTH 3 | ||
79 | |||
47 | typedef | 80 | typedef |
48 | acpi_status(*acpi_pkg_callback) (u8 object_type, | 81 | acpi_status(*acpi_pkg_callback) (u8 object_type, |
49 | union acpi_operand_object * source_object, | 82 | union acpi_operand_object * source_object, |
@@ -159,7 +192,6 @@ extern const u8 _acpi_ctype[]; | |||
159 | #define ACPI_IS_LOWER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO)) | 192 | #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)) | 193 | #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)) | 194 | #define ACPI_IS_ALPHA(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP)) |
162 | #define ACPI_IS_ASCII(c) ((c) < 0x80) | ||
163 | 195 | ||
164 | #endif /* ACPI_USE_SYSTEM_CLIBRARY */ | 196 | #endif /* ACPI_USE_SYSTEM_CLIBRARY */ |
165 | 197 | ||
@@ -243,21 +275,22 @@ acpi_ut_ptr_exit(u32 line_number, | |||
243 | const char *function_name, | 275 | const char *function_name, |
244 | char *module_name, u32 component_id, u8 * ptr); | 276 | char *module_name, u32 component_id, u8 * ptr); |
245 | 277 | ||
246 | void acpi_ut_report_info(char *module_name, u32 line_number, u32 component_id); | 278 | void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id); |
247 | 279 | ||
248 | void acpi_ut_report_error(char *module_name, u32 line_number, u32 component_id); | 280 | void acpi_ut_report_error(char *module_name, u32 line_number); |
249 | 281 | ||
250 | void | 282 | void acpi_ut_report_info(char *module_name, u32 line_number); |
251 | acpi_ut_report_warning(char *module_name, u32 line_number, u32 component_id); | ||
252 | 283 | ||
253 | void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id); | 284 | void acpi_ut_report_warning(char *module_name, u32 line_number); |
285 | |||
286 | /* Error and message reporting interfaces */ | ||
254 | 287 | ||
255 | void ACPI_INTERNAL_VAR_XFACE | 288 | void ACPI_INTERNAL_VAR_XFACE |
256 | acpi_ut_debug_print(u32 requested_debug_level, | 289 | acpi_ut_debug_print(u32 requested_debug_level, |
257 | u32 line_number, | 290 | u32 line_number, |
258 | const char *function_name, | 291 | const char *function_name, |
259 | char *module_name, | 292 | char *module_name, |
260 | u32 component_id, char *format, ...) ACPI_PRINTF_LIKE_FUNC; | 293 | u32 component_id, char *format, ...) ACPI_PRINTF_LIKE(6); |
261 | 294 | ||
262 | void ACPI_INTERNAL_VAR_XFACE | 295 | void ACPI_INTERNAL_VAR_XFACE |
263 | acpi_ut_debug_print_raw(u32 requested_debug_level, | 296 | acpi_ut_debug_print_raw(u32 requested_debug_level, |
@@ -265,7 +298,24 @@ acpi_ut_debug_print_raw(u32 requested_debug_level, | |||
265 | const char *function_name, | 298 | const char *function_name, |
266 | char *module_name, | 299 | char *module_name, |
267 | u32 component_id, | 300 | u32 component_id, |
268 | char *format, ...) ACPI_PRINTF_LIKE_FUNC; | 301 | char *format, ...) ACPI_PRINTF_LIKE(6); |
302 | |||
303 | void ACPI_INTERNAL_VAR_XFACE | ||
304 | acpi_ut_error(char *module_name, | ||
305 | u32 line_number, char *format, ...) ACPI_PRINTF_LIKE(3); | ||
306 | |||
307 | void ACPI_INTERNAL_VAR_XFACE | ||
308 | acpi_ut_exception(char *module_name, | ||
309 | u32 line_number, | ||
310 | acpi_status status, char *format, ...) ACPI_PRINTF_LIKE(4); | ||
311 | |||
312 | void ACPI_INTERNAL_VAR_XFACE | ||
313 | acpi_ut_warning(char *module_name, | ||
314 | u32 line_number, char *format, ...) ACPI_PRINTF_LIKE(3); | ||
315 | |||
316 | void ACPI_INTERNAL_VAR_XFACE | ||
317 | acpi_ut_info(char *module_name, | ||
318 | u32 line_number, char *format, ...) ACPI_PRINTF_LIKE(3); | ||
269 | 319 | ||
270 | /* | 320 | /* |
271 | * utdelete - Object deletion and reference counts | 321 | * utdelete - Object deletion and reference counts |
@@ -419,7 +469,19 @@ acpi_ut_strtoul64(char *string, u32 base, acpi_integer * ret_integer); | |||
419 | 469 | ||
420 | #define ACPI_ANY_BASE 0 | 470 | #define ACPI_ANY_BASE 0 |
421 | 471 | ||
422 | u8 *acpi_ut_get_resource_end_tag(union acpi_operand_object *obj_desc); | 472 | acpi_status acpi_ut_validate_resource(void *aml, u8 * return_index); |
473 | |||
474 | u32 acpi_ut_get_descriptor_length(void *aml); | ||
475 | |||
476 | u16 acpi_ut_get_resource_length(void *aml); | ||
477 | |||
478 | u8 acpi_ut_get_resource_header_length(void *aml); | ||
479 | |||
480 | u8 acpi_ut_get_resource_type(void *aml); | ||
481 | |||
482 | acpi_status | ||
483 | acpi_ut_get_resource_end_tag(union acpi_operand_object *obj_desc, | ||
484 | u8 ** end_tag); | ||
423 | 485 | ||
424 | u8 acpi_ut_generate_checksum(u8 * buffer, u32 length); | 486 | u8 acpi_ut_generate_checksum(u8 * buffer, u32 length); |
425 | 487 | ||
diff --git a/include/acpi/amlcode.h b/include/acpi/amlcode.h index 7fdf5299f501..37964a59aef8 100644 --- a/include/acpi/amlcode.h +++ b/include/acpi/amlcode.h | |||
@@ -7,7 +7,7 @@ | |||
7 | *****************************************************************************/ | 7 | *****************************************************************************/ |
8 | 8 | ||
9 | /* | 9 | /* |
10 | * Copyright (C) 2000 - 2005, R. Byron Moore | 10 | * Copyright (C) 2000 - 2006, R. Byron Moore |
11 | * All rights reserved. | 11 | * All rights reserved. |
12 | * | 12 | * |
13 | * Redistribution and use in source and binary forms, with or without | 13 | * Redistribution and use in source and binary forms, with or without |
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; |
diff --git a/include/acpi/pdc_intel.h b/include/acpi/pdc_intel.h index 91f4a12a99a1..3fa81d55cd0c 100644 --- a/include/acpi/pdc_intel.h +++ b/include/acpi/pdc_intel.h | |||
@@ -15,9 +15,7 @@ | |||
15 | #define ACPI_PDC_C_C1_FFH (0x0100) | 15 | #define ACPI_PDC_C_C1_FFH (0x0100) |
16 | 16 | ||
17 | #define ACPI_PDC_EST_CAPABILITY_SMP (ACPI_PDC_SMP_C1PT | \ | 17 | #define ACPI_PDC_EST_CAPABILITY_SMP (ACPI_PDC_SMP_C1PT | \ |
18 | ACPI_PDC_C_C1_HALT) | 18 | ACPI_PDC_C_C1_HALT | \ |
19 | |||
20 | #define ACPI_PDC_EST_CAPABILITY_SMP_MSR (ACPI_PDC_EST_CAPABILITY_SMP | \ | ||
21 | ACPI_PDC_P_FFH) | 19 | ACPI_PDC_P_FFH) |
22 | 20 | ||
23 | #define ACPI_PDC_C_CAPABILITY_SMP (ACPI_PDC_SMP_C2C3 | \ | 21 | #define ACPI_PDC_C_CAPABILITY_SMP (ACPI_PDC_SMP_C2C3 | \ |
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h index 16609c1ab2eb..223ec6467108 100644 --- a/include/acpi/platform/acenv.h +++ b/include/acpi/platform/acenv.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2005, R. Byron Moore | 8 | * Copyright (C) 2000 - 2006, R. Byron Moore |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
@@ -68,6 +68,7 @@ | |||
68 | #define ACPI_APPLICATION | 68 | #define ACPI_APPLICATION |
69 | #define ACPI_DEBUGGER | 69 | #define ACPI_DEBUGGER |
70 | #define ACPI_DISASSEMBLER | 70 | #define ACPI_DISASSEMBLER |
71 | #define ACPI_MUTEX_DEBUG | ||
71 | #endif | 72 | #endif |
72 | 73 | ||
73 | #ifdef ACPI_ASL_COMPILER | 74 | #ifdef ACPI_ASL_COMPILER |
@@ -148,6 +149,9 @@ | |||
148 | #elif defined(NETWARE) | 149 | #elif defined(NETWARE) |
149 | #include "acnetware.h" | 150 | #include "acnetware.h" |
150 | 151 | ||
152 | #elif defined(__sun) | ||
153 | #include "acsolaris.h" | ||
154 | |||
151 | #else | 155 | #else |
152 | 156 | ||
153 | /* All other environments */ | 157 | /* All other environments */ |
@@ -157,13 +161,6 @@ | |||
157 | #define COMPILER_DEPENDENT_INT64 long long | 161 | #define COMPILER_DEPENDENT_INT64 long long |
158 | #define COMPILER_DEPENDENT_UINT64 unsigned long long | 162 | #define COMPILER_DEPENDENT_UINT64 unsigned long long |
159 | 163 | ||
160 | /* | ||
161 | * This macro is used to tag functions as "printf-like" because | ||
162 | * some compilers can catch printf format string problems. MSVC | ||
163 | * doesn't, so this is proprocessed away. | ||
164 | */ | ||
165 | #define ACPI_PRINTF_LIKE_FUNC | ||
166 | |||
167 | #endif | 164 | #endif |
168 | 165 | ||
169 | /* | 166 | /* |
@@ -205,6 +202,8 @@ | |||
205 | * | 202 | * |
206 | *****************************************************************************/ | 203 | *****************************************************************************/ |
207 | 204 | ||
205 | #define ACPI_IS_ASCII(c) ((c) < 0x80) | ||
206 | |||
208 | #ifdef ACPI_USE_SYSTEM_CLIBRARY | 207 | #ifdef ACPI_USE_SYSTEM_CLIBRARY |
209 | /* | 208 | /* |
210 | * Use the standard C library headers. | 209 | * Use the standard C library headers. |
@@ -234,7 +233,7 @@ | |||
234 | #define ACPI_STRCAT(d,s) (void) strcat((d), (s)) | 233 | #define ACPI_STRCAT(d,s) (void) strcat((d), (s)) |
235 | #define ACPI_STRNCAT(d,s,n) strncat((d), (s), (acpi_size)(n)) | 234 | #define ACPI_STRNCAT(d,s,n) strncat((d), (s), (acpi_size)(n)) |
236 | #define ACPI_STRTOUL(d,s,n) strtoul((d), (s), (acpi_size)(n)) | 235 | #define ACPI_STRTOUL(d,s,n) strtoul((d), (s), (acpi_size)(n)) |
237 | #define ACPI_MEMCMP(s1,s2,n) memcmp((s1), (s2), (acpi_size)(n)) | 236 | #define ACPI_MEMCMP(s1,s2,n) memcmp((const char *)(s1), (const char *)(s2), (acpi_size)(n)) |
238 | #define ACPI_MEMCPY(d,s,n) (void) memcpy((d), (s), (acpi_size)(n)) | 237 | #define ACPI_MEMCPY(d,s,n) (void) memcpy((d), (s), (acpi_size)(n)) |
239 | #define ACPI_MEMSET(d,s,n) (void) memset((d), (s), (acpi_size)(n)) | 238 | #define ACPI_MEMSET(d,s,n) (void) memset((d), (s), (acpi_size)(n)) |
240 | 239 | ||
@@ -246,7 +245,6 @@ | |||
246 | #define ACPI_IS_UPPER(i) isupper((int) (i)) | 245 | #define ACPI_IS_UPPER(i) isupper((int) (i)) |
247 | #define ACPI_IS_PRINT(i) isprint((int) (i)) | 246 | #define ACPI_IS_PRINT(i) isprint((int) (i)) |
248 | #define ACPI_IS_ALPHA(i) isalpha((int) (i)) | 247 | #define ACPI_IS_ALPHA(i) isalpha((int) (i)) |
249 | #define ACPI_IS_ASCII(i) isascii((int) (i)) | ||
250 | 248 | ||
251 | #else | 249 | #else |
252 | 250 | ||
@@ -273,8 +271,8 @@ typedef char *va_list; | |||
273 | /* | 271 | /* |
274 | * Storage alignment properties | 272 | * Storage alignment properties |
275 | */ | 273 | */ |
276 | #define _AUPBND (sizeof (acpi_native_int) - 1) | 274 | #define _AUPBND (sizeof (acpi_native_uint) - 1) |
277 | #define _ADNBND (sizeof (acpi_native_int) - 1) | 275 | #define _ADNBND (sizeof (acpi_native_uint) - 1) |
278 | 276 | ||
279 | /* | 277 | /* |
280 | * Variable argument list macro definitions | 278 | * Variable argument list macro definitions |
@@ -296,7 +294,7 @@ typedef char *va_list; | |||
296 | #define ACPI_STRCAT(d,s) (void) acpi_ut_strcat ((d), (s)) | 294 | #define ACPI_STRCAT(d,s) (void) acpi_ut_strcat ((d), (s)) |
297 | #define ACPI_STRNCAT(d,s,n) acpi_ut_strncat ((d), (s), (acpi_size)(n)) | 295 | #define ACPI_STRNCAT(d,s,n) acpi_ut_strncat ((d), (s), (acpi_size)(n)) |
298 | #define ACPI_STRTOUL(d,s,n) acpi_ut_strtoul ((d), (s), (acpi_size)(n)) | 296 | #define ACPI_STRTOUL(d,s,n) acpi_ut_strtoul ((d), (s), (acpi_size)(n)) |
299 | #define ACPI_MEMCMP(s1,s2,n) acpi_ut_memcmp((s1), (s2), (acpi_size)(n)) | 297 | #define ACPI_MEMCMP(s1,s2,n) acpi_ut_memcmp((const char *)(s1), (const char *)(s2), (acpi_size)(n)) |
300 | #define ACPI_MEMCPY(d,s,n) (void) acpi_ut_memcpy ((d), (s), (acpi_size)(n)) | 298 | #define ACPI_MEMCPY(d,s,n) (void) acpi_ut_memcpy ((d), (s), (acpi_size)(n)) |
301 | #define ACPI_MEMSET(d,v,n) (void) acpi_ut_memset ((d), (v), (acpi_size)(n)) | 299 | #define ACPI_MEMSET(d,v,n) (void) acpi_ut_memset ((d), (v), (acpi_size)(n)) |
302 | #define ACPI_TOUPPER acpi_ut_to_upper | 300 | #define ACPI_TOUPPER acpi_ut_to_upper |
diff --git a/include/acpi/platform/acgcc.h b/include/acpi/platform/acgcc.h index 4c0e0ba09ba0..da80933963db 100644 --- a/include/acpi/platform/acgcc.h +++ b/include/acpi/platform/acgcc.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2005, R. Byron Moore | 8 | * Copyright (C) 2000 - 2006, R. Byron Moore |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
@@ -48,12 +48,14 @@ | |||
48 | 48 | ||
49 | #define ACPI_GET_FUNCTION_NAME __FUNCTION__ | 49 | #define ACPI_GET_FUNCTION_NAME __FUNCTION__ |
50 | 50 | ||
51 | /* This macro is used to tag functions as "printf-like" because | 51 | /* |
52 | * This macro is used to tag functions as "printf-like" because | ||
52 | * some compilers (like GCC) can catch printf format string problems. | 53 | * some compilers (like GCC) can catch printf format string problems. |
53 | */ | 54 | */ |
54 | #define ACPI_PRINTF_LIKE_FUNC __attribute__ ((__format__ (__printf__, 6, 7))) | 55 | #define ACPI_PRINTF_LIKE(c) __attribute__ ((__format__ (__printf__, c, c+1))) |
55 | 56 | ||
56 | /* Some compilers complain about unused variables. Sometimes we don't want to | 57 | /* |
58 | * Some compilers complain about unused variables. Sometimes we don't want to | ||
57 | * use all the variables (for example, _acpi_module_name). This allows us | 59 | * use all the variables (for example, _acpi_module_name). This allows us |
58 | * to to tell the compiler warning in a per-variable manner that a variable | 60 | * to to tell the compiler warning in a per-variable manner that a variable |
59 | * is unused. | 61 | * is unused. |
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index c93e6562f0e1..2e6d54569ee8 100644 --- a/include/acpi/platform/aclinux.h +++ b/include/acpi/platform/aclinux.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2005, R. Byron Moore | 8 | * Copyright (C) 2000 - 2006, R. Byron Moore |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
@@ -71,6 +71,10 @@ | |||
71 | #define acpi_cache_t kmem_cache_t | 71 | #define acpi_cache_t kmem_cache_t |
72 | #endif | 72 | #endif |
73 | 73 | ||
74 | /* Full namespace pathname length limit - arbitrary */ | ||
75 | |||
76 | #define ACPI_PATHNAME_MAX 256 | ||
77 | |||
74 | #else /* !__KERNEL__ */ | 78 | #else /* !__KERNEL__ */ |
75 | 79 | ||
76 | #include <stdarg.h> | 80 | #include <stdarg.h> |
@@ -98,4 +102,6 @@ | |||
98 | 102 | ||
99 | #include "acgcc.h" | 103 | #include "acgcc.h" |
100 | 104 | ||
105 | #define acpi_cpu_flags unsigned long | ||
106 | |||
101 | #endif /* __ACLINUX_H__ */ | 107 | #endif /* __ACLINUX_H__ */ |
diff --git a/include/acpi/processor.h b/include/acpi/processor.h index 7a00d5089de9..badf0277b1be 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h | |||
@@ -62,9 +62,6 @@ struct acpi_processor_power { | |||
62 | u32 bm_activity; | 62 | u32 bm_activity; |
63 | int count; | 63 | int count; |
64 | struct acpi_processor_cx states[ACPI_PROCESSOR_MAX_POWER]; | 64 | struct acpi_processor_cx states[ACPI_PROCESSOR_MAX_POWER]; |
65 | |||
66 | /* the _PDC objects passed by the driver, if any */ | ||
67 | struct acpi_object_list *pdc; | ||
68 | }; | 65 | }; |
69 | 66 | ||
70 | /* Performance Management */ | 67 | /* Performance Management */ |
@@ -96,8 +93,6 @@ struct acpi_processor_performance { | |||
96 | unsigned int state_count; | 93 | unsigned int state_count; |
97 | struct acpi_processor_px *states; | 94 | struct acpi_processor_px *states; |
98 | 95 | ||
99 | /* the _PDC objects passed by the driver, if any */ | ||
100 | struct acpi_object_list *pdc; | ||
101 | }; | 96 | }; |
102 | 97 | ||
103 | /* Throttling Control */ | 98 | /* Throttling Control */ |
@@ -151,6 +146,9 @@ struct acpi_processor { | |||
151 | struct acpi_processor_performance *performance; | 146 | struct acpi_processor_performance *performance; |
152 | struct acpi_processor_throttling throttling; | 147 | struct acpi_processor_throttling throttling; |
153 | struct acpi_processor_limit limit; | 148 | struct acpi_processor_limit limit; |
149 | |||
150 | /* the _PDC objects for this processor, if any */ | ||
151 | struct acpi_object_list *pdc; | ||
154 | }; | 152 | }; |
155 | 153 | ||
156 | struct acpi_processor_errata { | 154 | struct acpi_processor_errata { |
@@ -178,22 +176,12 @@ int acpi_processor_notify_smm(struct module *calling_module); | |||
178 | extern struct acpi_processor *processors[NR_CPUS]; | 176 | extern struct acpi_processor *processors[NR_CPUS]; |
179 | extern struct acpi_processor_errata errata; | 177 | extern struct acpi_processor_errata errata; |
180 | 178 | ||
181 | int acpi_processor_set_pdc(struct acpi_processor *pr, | 179 | void arch_acpi_processor_init_pdc(struct acpi_processor *pr); |
182 | struct acpi_object_list *pdc_in); | ||
183 | 180 | ||
184 | #ifdef ARCH_HAS_POWER_PDC_INIT | 181 | #ifdef ARCH_HAS_POWER_INIT |
185 | void acpi_processor_power_init_pdc(struct acpi_processor_power *pow, | ||
186 | unsigned int cpu); | ||
187 | void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags, | 182 | void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags, |
188 | unsigned int cpu); | 183 | unsigned int cpu); |
189 | #else | 184 | #else |
190 | static inline void acpi_processor_power_init_pdc(struct acpi_processor_power | ||
191 | *pow, unsigned int cpu) | ||
192 | { | ||
193 | pow->pdc = NULL; | ||
194 | return; | ||
195 | } | ||
196 | |||
197 | static inline void acpi_processor_power_init_bm_check(struct | 185 | static inline void acpi_processor_power_init_bm_check(struct |
198 | acpi_processor_flags | 186 | acpi_processor_flags |
199 | *flags, unsigned int cpu) | 187 | *flags, unsigned int cpu) |
@@ -235,9 +223,6 @@ static inline int acpi_processor_ppc_has_changed(struct acpi_processor *pr) | |||
235 | /* in processor_throttling.c */ | 223 | /* in processor_throttling.c */ |
236 | int acpi_processor_get_throttling_info(struct acpi_processor *pr); | 224 | int acpi_processor_get_throttling_info(struct acpi_processor *pr); |
237 | int acpi_processor_set_throttling(struct acpi_processor *pr, int state); | 225 | int acpi_processor_set_throttling(struct acpi_processor *pr, int state); |
238 | ssize_t acpi_processor_write_throttling(struct file *file, | ||
239 | const char __user * buffer, | ||
240 | size_t count, loff_t * data); | ||
241 | extern struct file_operations acpi_processor_throttling_fops; | 226 | extern struct file_operations acpi_processor_throttling_fops; |
242 | 227 | ||
243 | /* in processor_idle.c */ | 228 | /* in processor_idle.c */ |
@@ -249,9 +234,6 @@ int acpi_processor_power_exit(struct acpi_processor *pr, | |||
249 | 234 | ||
250 | /* in processor_thermal.c */ | 235 | /* in processor_thermal.c */ |
251 | int acpi_processor_get_limit_info(struct acpi_processor *pr); | 236 | int acpi_processor_get_limit_info(struct acpi_processor *pr); |
252 | ssize_t acpi_processor_write_limit(struct file *file, | ||
253 | const char __user * buffer, | ||
254 | size_t count, loff_t * data); | ||
255 | extern struct file_operations acpi_processor_limit_fops; | 237 | extern struct file_operations acpi_processor_limit_fops; |
256 | 238 | ||
257 | #ifdef CONFIG_CPU_FREQ | 239 | #ifdef CONFIG_CPU_FREQ |