diff options
Diffstat (limited to 'include/acpi')
39 files changed, 3353 insertions, 5532 deletions
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h index d62af7293923..f3810cc5d48e 100644 --- a/include/acpi/acconfig.h +++ b/include/acpi/acconfig.h | |||
@@ -44,7 +44,6 @@ | |||
44 | #ifndef _ACCONFIG_H | 44 | #ifndef _ACCONFIG_H |
45 | #define _ACCONFIG_H | 45 | #define _ACCONFIG_H |
46 | 46 | ||
47 | |||
48 | /****************************************************************************** | 47 | /****************************************************************************** |
49 | * | 48 | * |
50 | * Configuration options | 49 | * Configuration options |
@@ -78,10 +77,10 @@ | |||
78 | 77 | ||
79 | /* Maximum objects in the various object caches */ | 78 | /* Maximum objects in the various object caches */ |
80 | 79 | ||
81 | #define ACPI_MAX_STATE_CACHE_DEPTH 96 /* State objects */ | 80 | #define ACPI_MAX_STATE_CACHE_DEPTH 96 /* State objects */ |
82 | #define ACPI_MAX_PARSE_CACHE_DEPTH 96 /* Parse tree objects */ | 81 | #define ACPI_MAX_PARSE_CACHE_DEPTH 96 /* Parse tree objects */ |
83 | #define ACPI_MAX_EXTPARSE_CACHE_DEPTH 96 /* Parse tree objects */ | 82 | #define ACPI_MAX_EXTPARSE_CACHE_DEPTH 96 /* Parse tree objects */ |
84 | #define ACPI_MAX_OBJECT_CACHE_DEPTH 96 /* Interpreter operand objects */ | 83 | #define ACPI_MAX_OBJECT_CACHE_DEPTH 96 /* Interpreter operand objects */ |
85 | 84 | ||
86 | /* | 85 | /* |
87 | * Should the subystem abort the loading of an ACPI table if the | 86 | * Should the subystem abort the loading of an ACPI table if the |
@@ -89,7 +88,6 @@ | |||
89 | */ | 88 | */ |
90 | #define ACPI_CHECKSUM_ABORT FALSE | 89 | #define ACPI_CHECKSUM_ABORT FALSE |
91 | 90 | ||
92 | |||
93 | /****************************************************************************** | 91 | /****************************************************************************** |
94 | * | 92 | * |
95 | * Subsystem Constants | 93 | * Subsystem Constants |
@@ -103,7 +101,7 @@ | |||
103 | /* String size constants */ | 101 | /* String size constants */ |
104 | 102 | ||
105 | #define ACPI_MAX_STRING_LENGTH 512 | 103 | #define ACPI_MAX_STRING_LENGTH 512 |
106 | #define ACPI_PATHNAME_MAX 256 /* A full namespace pathname */ | 104 | #define ACPI_PATHNAME_MAX 256 /* A full namespace pathname */ |
107 | 105 | ||
108 | /* Maximum count for a semaphore object */ | 106 | /* Maximum count for a semaphore object */ |
109 | 107 | ||
@@ -117,7 +115,6 @@ | |||
117 | 115 | ||
118 | #define ACPI_SYSMEM_REGION_WINDOW_SIZE 4096 | 116 | #define ACPI_SYSMEM_REGION_WINDOW_SIZE 4096 |
119 | 117 | ||
120 | |||
121 | /****************************************************************************** | 118 | /****************************************************************************** |
122 | * | 119 | * |
123 | * ACPI Specification constants (Do not change unless the specification changes) | 120 | * ACPI Specification constants (Do not change unless the specification changes) |
@@ -155,15 +152,15 @@ | |||
155 | /* Names within the namespace are 4 bytes long */ | 152 | /* Names within the namespace are 4 bytes long */ |
156 | 153 | ||
157 | #define ACPI_NAME_SIZE 4 | 154 | #define ACPI_NAME_SIZE 4 |
158 | #define ACPI_PATH_SEGMENT_LENGTH 5 /* 4 chars for name + 1 char for separator */ | 155 | #define ACPI_PATH_SEGMENT_LENGTH 5 /* 4 chars for name + 1 char for separator */ |
159 | #define ACPI_PATH_SEPARATOR '.' | 156 | #define ACPI_PATH_SEPARATOR '.' |
160 | 157 | ||
161 | /* Constants used in searching for the RSDP in low memory */ | 158 | /* Constants used in searching for the RSDP in low memory */ |
162 | 159 | ||
163 | #define ACPI_EBDA_PTR_LOCATION 0x0000040E /* Physical Address */ | 160 | #define ACPI_EBDA_PTR_LOCATION 0x0000040E /* Physical Address */ |
164 | #define ACPI_EBDA_PTR_LENGTH 2 | 161 | #define ACPI_EBDA_PTR_LENGTH 2 |
165 | #define ACPI_EBDA_WINDOW_SIZE 1024 | 162 | #define ACPI_EBDA_WINDOW_SIZE 1024 |
166 | #define ACPI_HI_RSDP_WINDOW_BASE 0x000E0000 /* Physical Address */ | 163 | #define ACPI_HI_RSDP_WINDOW_BASE 0x000E0000 /* Physical Address */ |
167 | #define ACPI_HI_RSDP_WINDOW_SIZE 0x00020000 | 164 | #define ACPI_HI_RSDP_WINDOW_SIZE 0x00020000 |
168 | #define ACPI_RSDP_SCAN_STEP 16 | 165 | #define ACPI_RSDP_SCAN_STEP 16 |
169 | 166 | ||
@@ -198,18 +195,15 @@ | |||
198 | 195 | ||
199 | #define ACPI_NUM_OSI_STRINGS 10 | 196 | #define ACPI_NUM_OSI_STRINGS 10 |
200 | 197 | ||
201 | |||
202 | /****************************************************************************** | 198 | /****************************************************************************** |
203 | * | 199 | * |
204 | * ACPI AML Debugger | 200 | * ACPI AML Debugger |
205 | * | 201 | * |
206 | *****************************************************************************/ | 202 | *****************************************************************************/ |
207 | 203 | ||
208 | #define ACPI_DEBUGGER_MAX_ARGS 8 /* Must be max method args + 1 */ | 204 | #define ACPI_DEBUGGER_MAX_ARGS 8 /* Must be max method args + 1 */ |
209 | 205 | ||
210 | #define ACPI_DEBUGGER_COMMAND_PROMPT '-' | 206 | #define ACPI_DEBUGGER_COMMAND_PROMPT '-' |
211 | #define ACPI_DEBUGGER_EXECUTE_PROMPT '%' | 207 | #define ACPI_DEBUGGER_EXECUTE_PROMPT '%' |
212 | 208 | ||
213 | 209 | #endif /* _ACCONFIG_H */ | |
214 | #endif /* _ACCONFIG_H */ | ||
215 | |||
diff --git a/include/acpi/acdebug.h b/include/acpi/acdebug.h index f8fa2227583d..70ce3b4d006e 100644 --- a/include/acpi/acdebug.h +++ b/include/acpi/acdebug.h | |||
@@ -44,22 +44,17 @@ | |||
44 | #ifndef __ACDEBUG_H__ | 44 | #ifndef __ACDEBUG_H__ |
45 | #define __ACDEBUG_H__ | 45 | #define __ACDEBUG_H__ |
46 | 46 | ||
47 | |||
48 | #define ACPI_DEBUG_BUFFER_SIZE 4196 | 47 | #define ACPI_DEBUG_BUFFER_SIZE 4196 |
49 | 48 | ||
50 | struct command_info | 49 | struct command_info { |
51 | { | 50 | char *name; /* Command Name */ |
52 | char *name; /* Command Name */ | 51 | u8 min_args; /* Minimum arguments required */ |
53 | u8 min_args; /* Minimum arguments required */ | ||
54 | }; | 52 | }; |
55 | 53 | ||
56 | 54 | struct argument_info { | |
57 | struct argument_info | 55 | char *name; /* Argument Name */ |
58 | { | ||
59 | char *name; /* Argument Name */ | ||
60 | }; | 56 | }; |
61 | 57 | ||
62 | |||
63 | #define PARAM_LIST(pl) pl | 58 | #define PARAM_LIST(pl) pl |
64 | #define DBTEST_OUTPUT_LEVEL(lvl) if (acpi_gbl_db_opt_verbose) | 59 | #define DBTEST_OUTPUT_LEVEL(lvl) if (acpi_gbl_db_opt_verbose) |
65 | #define VERBOSE_PRINT(fp) DBTEST_OUTPUT_LEVEL(lvl) {\ | 60 | #define VERBOSE_PRINT(fp) DBTEST_OUTPUT_LEVEL(lvl) {\ |
@@ -68,279 +63,155 @@ struct argument_info | |||
68 | #define EX_NO_SINGLE_STEP 1 | 63 | #define EX_NO_SINGLE_STEP 1 |
69 | #define EX_SINGLE_STEP 2 | 64 | #define EX_SINGLE_STEP 2 |
70 | 65 | ||
71 | |||
72 | /* | 66 | /* |
73 | * dbxface - external debugger interfaces | 67 | * dbxface - external debugger interfaces |
74 | */ | 68 | */ |
75 | acpi_status | 69 | acpi_status acpi_db_initialize(void); |
76 | acpi_db_initialize ( | ||
77 | void); | ||
78 | 70 | ||
79 | void | 71 | void acpi_db_terminate(void); |
80 | acpi_db_terminate ( | ||
81 | void); | ||
82 | 72 | ||
83 | acpi_status | 73 | acpi_status |
84 | acpi_db_single_step ( | 74 | acpi_db_single_step(struct acpi_walk_state *walk_state, |
85 | struct acpi_walk_state *walk_state, | 75 | union acpi_parse_object *op, u32 op_type); |
86 | union acpi_parse_object *op, | ||
87 | u32 op_type); | ||
88 | |||
89 | 76 | ||
90 | /* | 77 | /* |
91 | * dbcmds - debug commands and output routines | 78 | * dbcmds - debug commands and output routines |
92 | */ | 79 | */ |
93 | acpi_status | 80 | acpi_status acpi_db_disassemble_method(char *name); |
94 | acpi_db_disassemble_method ( | ||
95 | char *name); | ||
96 | |||
97 | void | ||
98 | acpi_db_display_table_info ( | ||
99 | char *table_arg); | ||
100 | 81 | ||
101 | void | 82 | void acpi_db_display_table_info(char *table_arg); |
102 | acpi_db_unload_acpi_table ( | ||
103 | char *table_arg, | ||
104 | char *instance_arg); | ||
105 | 83 | ||
106 | void | 84 | void acpi_db_unload_acpi_table(char *table_arg, char *instance_arg); |
107 | acpi_db_set_method_breakpoint ( | ||
108 | char *location, | ||
109 | struct acpi_walk_state *walk_state, | ||
110 | union acpi_parse_object *op); | ||
111 | 85 | ||
112 | void | 86 | void |
113 | acpi_db_set_method_call_breakpoint ( | 87 | acpi_db_set_method_breakpoint(char *location, |
114 | union acpi_parse_object *op); | 88 | struct acpi_walk_state *walk_state, |
89 | union acpi_parse_object *op); | ||
115 | 90 | ||
116 | void | 91 | void acpi_db_set_method_call_breakpoint(union acpi_parse_object *op); |
117 | acpi_db_get_bus_info ( | ||
118 | void); | ||
119 | 92 | ||
120 | void | 93 | void acpi_db_get_bus_info(void); |
121 | acpi_db_disassemble_aml ( | ||
122 | char *statements, | ||
123 | union acpi_parse_object *op); | ||
124 | 94 | ||
125 | void | 95 | void acpi_db_disassemble_aml(char *statements, union acpi_parse_object *op); |
126 | acpi_db_dump_namespace ( | ||
127 | char *start_arg, | ||
128 | char *depth_arg); | ||
129 | 96 | ||
130 | void | 97 | void acpi_db_dump_namespace(char *start_arg, char *depth_arg); |
131 | acpi_db_dump_namespace_by_owner ( | ||
132 | char *owner_arg, | ||
133 | char *depth_arg); | ||
134 | 98 | ||
135 | void | 99 | void acpi_db_dump_namespace_by_owner(char *owner_arg, char *depth_arg); |
136 | acpi_db_send_notify ( | ||
137 | char *name, | ||
138 | u32 value); | ||
139 | 100 | ||
140 | void | 101 | void acpi_db_send_notify(char *name, u32 value); |
141 | acpi_db_set_method_data ( | ||
142 | char *type_arg, | ||
143 | char *index_arg, | ||
144 | char *value_arg); | ||
145 | 102 | ||
146 | acpi_status | 103 | void acpi_db_set_method_data(char *type_arg, char *index_arg, char *value_arg); |
147 | acpi_db_display_objects ( | ||
148 | char *obj_type_arg, | ||
149 | char *display_count_arg); | ||
150 | 104 | ||
151 | acpi_status | 105 | acpi_status |
152 | acpi_db_find_name_in_namespace ( | 106 | acpi_db_display_objects(char *obj_type_arg, char *display_count_arg); |
153 | char *name_arg); | ||
154 | 107 | ||
155 | void | 108 | acpi_status acpi_db_find_name_in_namespace(char *name_arg); |
156 | acpi_db_set_scope ( | ||
157 | char *name); | ||
158 | 109 | ||
159 | acpi_status | 110 | void acpi_db_set_scope(char *name); |
160 | acpi_db_sleep ( | ||
161 | char *object_arg); | ||
162 | 111 | ||
163 | void | 112 | acpi_status acpi_db_sleep(char *object_arg); |
164 | acpi_db_find_references ( | ||
165 | char *object_arg); | ||
166 | 113 | ||
167 | void | 114 | void acpi_db_find_references(char *object_arg); |
168 | acpi_db_display_locks ( | ||
169 | void); | ||
170 | 115 | ||
171 | void | 116 | void acpi_db_display_locks(void); |
172 | acpi_db_display_resources ( | ||
173 | char *object_arg); | ||
174 | 117 | ||
175 | void | 118 | void acpi_db_display_resources(char *object_arg); |
176 | acpi_db_display_gpes ( | ||
177 | void); | ||
178 | 119 | ||
179 | void | 120 | void acpi_db_display_gpes(void); |
180 | acpi_db_check_integrity ( | ||
181 | void); | ||
182 | 121 | ||
183 | void | 122 | void acpi_db_check_integrity(void); |
184 | acpi_db_generate_gpe ( | ||
185 | char *gpe_arg, | ||
186 | char *block_arg); | ||
187 | 123 | ||
124 | void acpi_db_generate_gpe(char *gpe_arg, char *block_arg); | ||
188 | 125 | ||
189 | /* | 126 | /* |
190 | * dbdisply - debug display commands | 127 | * dbdisply - debug display commands |
191 | */ | 128 | */ |
192 | void | 129 | void acpi_db_display_method_info(union acpi_parse_object *op); |
193 | acpi_db_display_method_info ( | ||
194 | union acpi_parse_object *op); | ||
195 | 130 | ||
196 | void | 131 | void acpi_db_decode_and_display_object(char *target, char *output_type); |
197 | acpi_db_decode_and_display_object ( | ||
198 | char *target, | ||
199 | char *output_type); | ||
200 | 132 | ||
201 | void | 133 | void |
202 | acpi_db_display_result_object ( | 134 | acpi_db_display_result_object(union acpi_operand_object *obj_desc, |
203 | union acpi_operand_object *obj_desc, | 135 | struct acpi_walk_state *walk_state); |
204 | struct acpi_walk_state *walk_state); | ||
205 | 136 | ||
206 | acpi_status | 137 | acpi_status acpi_db_display_all_methods(char *display_count_arg); |
207 | acpi_db_display_all_methods ( | ||
208 | char *display_count_arg); | ||
209 | 138 | ||
210 | void | 139 | void acpi_db_display_arguments(void); |
211 | acpi_db_display_arguments ( | ||
212 | void); | ||
213 | 140 | ||
214 | void | 141 | void acpi_db_display_locals(void); |
215 | acpi_db_display_locals ( | ||
216 | void); | ||
217 | 142 | ||
218 | void | 143 | void acpi_db_display_results(void); |
219 | acpi_db_display_results ( | ||
220 | void); | ||
221 | 144 | ||
222 | void | 145 | void acpi_db_display_calling_tree(void); |
223 | acpi_db_display_calling_tree ( | ||
224 | void); | ||
225 | 146 | ||
226 | void | 147 | void acpi_db_display_object_type(char *object_arg); |
227 | acpi_db_display_object_type ( | ||
228 | char *object_arg); | ||
229 | 148 | ||
230 | void | 149 | void |
231 | acpi_db_display_argument_object ( | 150 | acpi_db_display_argument_object(union acpi_operand_object *obj_desc, |
232 | union acpi_operand_object *obj_desc, | 151 | struct acpi_walk_state *walk_state); |
233 | struct acpi_walk_state *walk_state); | ||
234 | |||
235 | 152 | ||
236 | /* | 153 | /* |
237 | * dbexec - debugger control method execution | 154 | * dbexec - debugger control method execution |
238 | */ | 155 | */ |
239 | void | 156 | void acpi_db_execute(char *name, char **args, u32 flags); |
240 | acpi_db_execute ( | ||
241 | char *name, | ||
242 | char **args, | ||
243 | u32 flags); | ||
244 | 157 | ||
245 | void | 158 | void |
246 | acpi_db_create_execution_threads ( | 159 | acpi_db_create_execution_threads(char *num_threads_arg, |
247 | char *num_threads_arg, | 160 | char *num_loops_arg, char *method_name_arg); |
248 | char *num_loops_arg, | ||
249 | char *method_name_arg); | ||
250 | |||
251 | 161 | ||
252 | /* | 162 | /* |
253 | * dbfileio - Debugger file I/O commands | 163 | * dbfileio - Debugger file I/O commands |
254 | */ | 164 | */ |
255 | acpi_object_type | 165 | acpi_object_type |
256 | acpi_db_match_argument ( | 166 | acpi_db_match_argument(char *user_argument, struct argument_info *arguments); |
257 | char *user_argument, | ||
258 | struct argument_info *arguments); | ||
259 | 167 | ||
260 | void | 168 | void acpi_db_close_debug_file(void); |
261 | acpi_db_close_debug_file ( | ||
262 | void); | ||
263 | 169 | ||
264 | void | 170 | void acpi_db_open_debug_file(char *name); |
265 | acpi_db_open_debug_file ( | ||
266 | char *name); | ||
267 | 171 | ||
268 | acpi_status | 172 | acpi_status acpi_db_load_acpi_table(char *filename); |
269 | acpi_db_load_acpi_table ( | ||
270 | char *filename); | ||
271 | 173 | ||
272 | acpi_status | 174 | acpi_status |
273 | acpi_db_get_table_from_file ( | 175 | acpi_db_get_table_from_file(char *filename, struct acpi_table_header **table); |
274 | char *filename, | ||
275 | struct acpi_table_header **table); | ||
276 | 176 | ||
277 | acpi_status | 177 | acpi_status |
278 | acpi_db_read_table_from_file ( | 178 | acpi_db_read_table_from_file(char *filename, struct acpi_table_header **table); |
279 | char *filename, | ||
280 | struct acpi_table_header **table); | ||
281 | |||
282 | 179 | ||
283 | /* | 180 | /* |
284 | * dbhistry - debugger HISTORY command | 181 | * dbhistry - debugger HISTORY command |
285 | */ | 182 | */ |
286 | void | 183 | void acpi_db_add_to_history(char *command_line); |
287 | acpi_db_add_to_history ( | ||
288 | char *command_line); | ||
289 | 184 | ||
290 | void | 185 | void acpi_db_display_history(void); |
291 | acpi_db_display_history ( | ||
292 | void); | ||
293 | |||
294 | char * | ||
295 | acpi_db_get_from_history ( | ||
296 | char *command_num_arg); | ||
297 | 186 | ||
187 | char *acpi_db_get_from_history(char *command_num_arg); | ||
298 | 188 | ||
299 | /* | 189 | /* |
300 | * dbinput - user front-end to the AML debugger | 190 | * dbinput - user front-end to the AML debugger |
301 | */ | 191 | */ |
302 | acpi_status | 192 | acpi_status |
303 | acpi_db_command_dispatch ( | 193 | acpi_db_command_dispatch(char *input_buffer, |
304 | char *input_buffer, | 194 | struct acpi_walk_state *walk_state, |
305 | struct acpi_walk_state *walk_state, | 195 | union acpi_parse_object *op); |
306 | union acpi_parse_object *op); | ||
307 | |||
308 | void ACPI_SYSTEM_XFACE | ||
309 | acpi_db_execute_thread ( | ||
310 | void *context); | ||
311 | 196 | ||
197 | void ACPI_SYSTEM_XFACE acpi_db_execute_thread(void *context); | ||
312 | 198 | ||
313 | /* | 199 | /* |
314 | * dbstats - Generation and display of ACPI table statistics | 200 | * dbstats - Generation and display of ACPI table statistics |
315 | */ | 201 | */ |
316 | void | 202 | void acpi_db_generate_statistics(union acpi_parse_object *root, u8 is_method); |
317 | acpi_db_generate_statistics ( | ||
318 | union acpi_parse_object *root, | ||
319 | u8 is_method); | ||
320 | |||
321 | acpi_status | ||
322 | acpi_db_display_statistics ( | ||
323 | char *type_arg); | ||
324 | 203 | ||
204 | acpi_status acpi_db_display_statistics(char *type_arg); | ||
325 | 205 | ||
326 | /* | 206 | /* |
327 | * dbutils - AML debugger utilities | 207 | * dbutils - AML debugger utilities |
328 | */ | 208 | */ |
329 | void | 209 | void acpi_db_set_output_destination(u32 where); |
330 | acpi_db_set_output_destination ( | ||
331 | u32 where); | ||
332 | 210 | ||
333 | void | 211 | void acpi_db_dump_external_object(union acpi_object *obj_desc, u32 level); |
334 | acpi_db_dump_external_object ( | ||
335 | union acpi_object *obj_desc, | ||
336 | u32 level); | ||
337 | 212 | ||
338 | void | 213 | void acpi_db_prep_namestring(char *name); |
339 | acpi_db_prep_namestring ( | ||
340 | char *name); | ||
341 | 214 | ||
342 | struct acpi_namespace_node * | 215 | struct acpi_namespace_node *acpi_db_local_ns_lookup(char *name); |
343 | acpi_db_local_ns_lookup ( | ||
344 | char *name); | ||
345 | 216 | ||
346 | #endif /* __ACDEBUG_H__ */ | 217 | #endif /* __ACDEBUG_H__ */ |
diff --git a/include/acpi/acdisasm.h b/include/acpi/acdisasm.h index 26325430db80..3d96dcb1bb4b 100644 --- a/include/acpi/acdisasm.h +++ b/include/acpi/acdisasm.h | |||
@@ -46,328 +46,219 @@ | |||
46 | 46 | ||
47 | #include "amlresrc.h" | 47 | #include "amlresrc.h" |
48 | 48 | ||
49 | |||
50 | #define BLOCK_NONE 0 | 49 | #define BLOCK_NONE 0 |
51 | #define BLOCK_PAREN 1 | 50 | #define BLOCK_PAREN 1 |
52 | #define BLOCK_BRACE 2 | 51 | #define BLOCK_BRACE 2 |
53 | #define BLOCK_COMMA_LIST 4 | 52 | #define BLOCK_COMMA_LIST 4 |
54 | 53 | ||
55 | struct acpi_external_list | 54 | struct acpi_external_list { |
56 | { | 55 | char *path; |
57 | char *path; | 56 | struct acpi_external_list *next; |
58 | struct acpi_external_list *next; | ||
59 | }; | 57 | }; |
60 | 58 | ||
61 | extern struct acpi_external_list *acpi_gbl_external_list; | 59 | extern struct acpi_external_list *acpi_gbl_external_list; |
62 | extern const char *acpi_gbl_io_decode[2]; | 60 | extern const char *acpi_gbl_io_decode[2]; |
63 | extern const char *acpi_gbl_word_decode[4]; | 61 | extern const char *acpi_gbl_word_decode[4]; |
64 | extern const char *acpi_gbl_consume_decode[2]; | 62 | extern const char *acpi_gbl_consume_decode[2]; |
65 | extern const char *acpi_gbl_min_decode[2]; | 63 | extern const char *acpi_gbl_min_decode[2]; |
66 | extern const char *acpi_gbl_max_decode[2]; | 64 | extern const char *acpi_gbl_max_decode[2]; |
67 | extern const char *acpi_gbl_DECdecode[2]; | 65 | extern const char *acpi_gbl_DECdecode[2]; |
68 | extern const char *acpi_gbl_RNGdecode[4]; | 66 | extern const char *acpi_gbl_RNGdecode[4]; |
69 | extern const char *acpi_gbl_MEMdecode[4]; | 67 | extern const char *acpi_gbl_MEMdecode[4]; |
70 | extern const char *acpi_gbl_RWdecode[2]; | 68 | extern const char *acpi_gbl_RWdecode[2]; |
71 | extern const char *acpi_gbl_irq_decode[2]; | 69 | extern const char *acpi_gbl_irq_decode[2]; |
72 | extern const char *acpi_gbl_HEdecode[2]; | 70 | extern const char *acpi_gbl_HEdecode[2]; |
73 | extern const char *acpi_gbl_LLdecode[2]; | 71 | extern const char *acpi_gbl_LLdecode[2]; |
74 | extern const char *acpi_gbl_SHRdecode[2]; | 72 | extern const char *acpi_gbl_SHRdecode[2]; |
75 | extern const char *acpi_gbl_TYPdecode[4]; | 73 | extern const char *acpi_gbl_TYPdecode[4]; |
76 | extern const char *acpi_gbl_BMdecode[2]; | 74 | extern const char *acpi_gbl_BMdecode[2]; |
77 | extern const char *acpi_gbl_SIZdecode[4]; | 75 | extern const char *acpi_gbl_SIZdecode[4]; |
78 | extern const char *acpi_gbl_TTPdecode[2]; | 76 | extern const char *acpi_gbl_TTPdecode[2]; |
79 | extern const char *acpi_gbl_MTPdecode[4]; | 77 | extern const char *acpi_gbl_MTPdecode[4]; |
80 | extern const char *acpi_gbl_TRSdecode[2]; | 78 | extern const char *acpi_gbl_TRSdecode[2]; |
81 | 79 | ||
82 | 80 | extern const char *acpi_gbl_lock_rule[ACPI_NUM_LOCK_RULES]; | |
83 | extern const char *acpi_gbl_lock_rule[ACPI_NUM_LOCK_RULES]; | 81 | extern const char *acpi_gbl_access_types[ACPI_NUM_ACCESS_TYPES]; |
84 | extern const char *acpi_gbl_access_types[ACPI_NUM_ACCESS_TYPES]; | 82 | extern const char *acpi_gbl_update_rules[ACPI_NUM_UPDATE_RULES]; |
85 | extern const char *acpi_gbl_update_rules[ACPI_NUM_UPDATE_RULES]; | 83 | extern const char *acpi_gbl_match_ops[ACPI_NUM_MATCH_OPS]; |
86 | extern const char *acpi_gbl_match_ops[ACPI_NUM_MATCH_OPS]; | 84 | |
87 | 85 | struct acpi_op_walk_info { | |
88 | 86 | u32 level; | |
89 | struct acpi_op_walk_info | 87 | u32 bit_offset; |
90 | { | 88 | struct acpi_walk_state *walk_state; |
91 | u32 level; | ||
92 | u32 bit_offset; | ||
93 | struct acpi_walk_state *walk_state; | ||
94 | }; | 89 | }; |
95 | 90 | ||
96 | typedef | 91 | typedef |
97 | acpi_status (*asl_walk_callback) ( | 92 | acpi_status(*asl_walk_callback) (union acpi_parse_object * op, |
98 | union acpi_parse_object *op, | 93 | u32 level, void *context); |
99 | u32 level, | ||
100 | void *context); | ||
101 | |||
102 | 94 | ||
103 | /* | 95 | /* |
104 | * dmwalk | 96 | * dmwalk |
105 | */ | 97 | */ |
106 | void | 98 | void |
107 | acpi_dm_disassemble ( | 99 | acpi_dm_disassemble(struct acpi_walk_state *walk_state, |
108 | struct acpi_walk_state *walk_state, | 100 | union acpi_parse_object *origin, u32 num_opcodes); |
109 | union acpi_parse_object *origin, | ||
110 | u32 num_opcodes); | ||
111 | |||
112 | 101 | ||
113 | /* | 102 | /* |
114 | * dmopcode | 103 | * dmopcode |
115 | */ | 104 | */ |
116 | void | 105 | void |
117 | acpi_dm_disassemble_one_op ( | 106 | acpi_dm_disassemble_one_op(struct acpi_walk_state *walk_state, |
118 | struct acpi_walk_state *walk_state, | 107 | struct acpi_op_walk_info *info, |
119 | struct acpi_op_walk_info *info, | 108 | union acpi_parse_object *op); |
120 | union acpi_parse_object *op); | ||
121 | 109 | ||
122 | void | 110 | void acpi_dm_decode_internal_object(union acpi_operand_object *obj_desc); |
123 | acpi_dm_decode_internal_object ( | ||
124 | union acpi_operand_object *obj_desc); | ||
125 | 111 | ||
126 | u32 | 112 | u32 acpi_dm_list_type(union acpi_parse_object *op); |
127 | acpi_dm_list_type ( | ||
128 | union acpi_parse_object *op); | ||
129 | 113 | ||
130 | void | 114 | void acpi_dm_method_flags(union acpi_parse_object *op); |
131 | acpi_dm_method_flags ( | ||
132 | union acpi_parse_object *op); | ||
133 | |||
134 | void | ||
135 | acpi_dm_field_flags ( | ||
136 | union acpi_parse_object *op); | ||
137 | 115 | ||
138 | void | 116 | void acpi_dm_field_flags(union acpi_parse_object *op); |
139 | acpi_dm_address_space ( | ||
140 | u8 space_id); | ||
141 | 117 | ||
142 | void | 118 | void acpi_dm_address_space(u8 space_id); |
143 | acpi_dm_region_flags ( | ||
144 | union acpi_parse_object *op); | ||
145 | 119 | ||
146 | void | 120 | void acpi_dm_region_flags(union acpi_parse_object *op); |
147 | acpi_dm_match_op ( | ||
148 | union acpi_parse_object *op); | ||
149 | 121 | ||
150 | u8 | 122 | void acpi_dm_match_op(union acpi_parse_object *op); |
151 | acpi_dm_comma_if_list_member ( | ||
152 | union acpi_parse_object *op); | ||
153 | 123 | ||
154 | void | 124 | u8 acpi_dm_comma_if_list_member(union acpi_parse_object *op); |
155 | acpi_dm_comma_if_field_member ( | ||
156 | union acpi_parse_object *op); | ||
157 | 125 | ||
126 | void acpi_dm_comma_if_field_member(union acpi_parse_object *op); | ||
158 | 127 | ||
159 | /* | 128 | /* |
160 | * dmnames | 129 | * dmnames |
161 | */ | 130 | */ |
162 | u32 | 131 | u32 acpi_dm_dump_name(char *name); |
163 | acpi_dm_dump_name ( | ||
164 | char *name); | ||
165 | 132 | ||
166 | acpi_status | 133 | acpi_status |
167 | acpi_ps_display_object_pathname ( | 134 | acpi_ps_display_object_pathname(struct acpi_walk_state *walk_state, |
168 | struct acpi_walk_state *walk_state, | 135 | union acpi_parse_object *op); |
169 | union acpi_parse_object *op); | ||
170 | |||
171 | void | ||
172 | acpi_dm_namestring ( | ||
173 | char *name); | ||
174 | 136 | ||
137 | void acpi_dm_namestring(char *name); | ||
175 | 138 | ||
176 | /* | 139 | /* |
177 | * dmobject | 140 | * dmobject |
178 | */ | 141 | */ |
179 | void | 142 | void |
180 | acpi_dm_display_internal_object ( | 143 | acpi_dm_display_internal_object(union acpi_operand_object *obj_desc, |
181 | union acpi_operand_object *obj_desc, | 144 | struct acpi_walk_state *walk_state); |
182 | struct acpi_walk_state *walk_state); | ||
183 | 145 | ||
184 | void | 146 | void acpi_dm_display_arguments(struct acpi_walk_state *walk_state); |
185 | acpi_dm_display_arguments ( | ||
186 | struct acpi_walk_state *walk_state); | ||
187 | 147 | ||
188 | void | 148 | void acpi_dm_display_locals(struct acpi_walk_state *walk_state); |
189 | acpi_dm_display_locals ( | ||
190 | struct acpi_walk_state *walk_state); | ||
191 | 149 | ||
192 | void | 150 | void |
193 | acpi_dm_dump_method_info ( | 151 | acpi_dm_dump_method_info(acpi_status status, |
194 | acpi_status status, | 152 | struct acpi_walk_state *walk_state, |
195 | struct acpi_walk_state *walk_state, | 153 | union acpi_parse_object *op); |
196 | union acpi_parse_object *op); | ||
197 | |||
198 | 154 | ||
199 | /* | 155 | /* |
200 | * dmbuffer | 156 | * dmbuffer |
201 | */ | 157 | */ |
202 | void | 158 | void acpi_dm_disasm_byte_list(u32 level, u8 * byte_data, u32 byte_count); |
203 | acpi_dm_disasm_byte_list ( | ||
204 | u32 level, | ||
205 | u8 *byte_data, | ||
206 | u32 byte_count); | ||
207 | 159 | ||
208 | void | 160 | void |
209 | acpi_dm_byte_list ( | 161 | acpi_dm_byte_list(struct acpi_op_walk_info *info, union acpi_parse_object *op); |
210 | struct acpi_op_walk_info *info, | ||
211 | union acpi_parse_object *op); | ||
212 | 162 | ||
213 | void | 163 | void acpi_dm_is_eisa_id(union acpi_parse_object *op); |
214 | acpi_dm_is_eisa_id ( | ||
215 | union acpi_parse_object *op); | ||
216 | 164 | ||
217 | void | 165 | void acpi_dm_eisa_id(u32 encoded_id); |
218 | acpi_dm_eisa_id ( | ||
219 | u32 encoded_id); | ||
220 | |||
221 | u8 | ||
222 | acpi_dm_is_unicode_buffer ( | ||
223 | union acpi_parse_object *op); | ||
224 | 166 | ||
225 | u8 | 167 | u8 acpi_dm_is_unicode_buffer(union acpi_parse_object *op); |
226 | acpi_dm_is_string_buffer ( | ||
227 | union acpi_parse_object *op); | ||
228 | 168 | ||
169 | u8 acpi_dm_is_string_buffer(union acpi_parse_object *op); | ||
229 | 170 | ||
230 | /* | 171 | /* |
231 | * dmresrc | 172 | * dmresrc |
232 | */ | 173 | */ |
233 | void | 174 | void |
234 | acpi_dm_resource_descriptor ( | 175 | acpi_dm_resource_descriptor(struct acpi_op_walk_info *info, |
235 | struct acpi_op_walk_info *info, | 176 | u8 * byte_data, u32 byte_count); |
236 | u8 *byte_data, | ||
237 | u32 byte_count); | ||
238 | 177 | ||
239 | u8 | 178 | u8 acpi_dm_is_resource_descriptor(union acpi_parse_object *op); |
240 | acpi_dm_is_resource_descriptor ( | ||
241 | union acpi_parse_object *op); | ||
242 | 179 | ||
243 | void | 180 | void acpi_dm_indent(u32 level); |
244 | acpi_dm_indent ( | ||
245 | u32 level); | ||
246 | 181 | ||
247 | void | 182 | void acpi_dm_bit_list(u16 mask); |
248 | acpi_dm_bit_list ( | ||
249 | u16 mask); | ||
250 | |||
251 | void | ||
252 | acpi_dm_decode_attribute ( | ||
253 | u8 attribute); | ||
254 | 183 | ||
184 | void acpi_dm_decode_attribute(u8 attribute); | ||
255 | 185 | ||
256 | /* | 186 | /* |
257 | * dmresrcl | 187 | * dmresrcl |
258 | */ | 188 | */ |
259 | void | 189 | void |
260 | acpi_dm_word_descriptor ( | 190 | acpi_dm_word_descriptor(struct asl_word_address_desc *resource, |
261 | struct asl_word_address_desc *resource, | 191 | u32 length, u32 level); |
262 | u32 length, | ||
263 | u32 level); | ||
264 | 192 | ||
265 | void | 193 | void |
266 | acpi_dm_dword_descriptor ( | 194 | acpi_dm_dword_descriptor(struct asl_dword_address_desc *resource, |
267 | struct asl_dword_address_desc *resource, | 195 | u32 length, u32 level); |
268 | u32 length, | ||
269 | u32 level); | ||
270 | 196 | ||
271 | void | 197 | void |
272 | acpi_dm_extended_descriptor ( | 198 | acpi_dm_extended_descriptor(struct asl_extended_address_desc *resource, |
273 | struct asl_extended_address_desc *resource, | 199 | u32 length, u32 level); |
274 | u32 length, | ||
275 | u32 level); | ||
276 | 200 | ||
277 | void | 201 | void |
278 | acpi_dm_qword_descriptor ( | 202 | acpi_dm_qword_descriptor(struct asl_qword_address_desc *resource, |
279 | struct asl_qword_address_desc *resource, | 203 | u32 length, u32 level); |
280 | u32 length, | ||
281 | u32 level); | ||
282 | 204 | ||
283 | void | 205 | void |
284 | acpi_dm_memory24_descriptor ( | 206 | acpi_dm_memory24_descriptor(struct asl_memory_24_desc *resource, |
285 | struct asl_memory_24_desc *resource, | 207 | u32 length, u32 level); |
286 | u32 length, | ||
287 | u32 level); | ||
288 | 208 | ||
289 | void | 209 | void |
290 | acpi_dm_memory32_descriptor ( | 210 | acpi_dm_memory32_descriptor(struct asl_memory_32_desc *resource, |
291 | struct asl_memory_32_desc *resource, | 211 | u32 length, u32 level); |
292 | u32 length, | ||
293 | u32 level); | ||
294 | 212 | ||
295 | void | 213 | void |
296 | acpi_dm_fixed_mem32_descriptor ( | 214 | acpi_dm_fixed_mem32_descriptor(struct asl_fixed_memory_32_desc *resource, |
297 | struct asl_fixed_memory_32_desc *resource, | 215 | u32 length, u32 level); |
298 | u32 length, | ||
299 | u32 level); | ||
300 | 216 | ||
301 | void | 217 | void |
302 | acpi_dm_generic_register_descriptor ( | 218 | acpi_dm_generic_register_descriptor(struct asl_general_register_desc *resource, |
303 | struct asl_general_register_desc *resource, | 219 | u32 length, u32 level); |
304 | u32 length, | ||
305 | u32 level); | ||
306 | 220 | ||
307 | void | 221 | void |
308 | acpi_dm_interrupt_descriptor ( | 222 | acpi_dm_interrupt_descriptor(struct asl_extended_xrupt_desc *resource, |
309 | struct asl_extended_xrupt_desc *resource, | 223 | u32 length, u32 level); |
310 | u32 length, | ||
311 | u32 level); | ||
312 | 224 | ||
313 | void | 225 | void |
314 | acpi_dm_vendor_large_descriptor ( | 226 | acpi_dm_vendor_large_descriptor(struct asl_large_vendor_desc *resource, |
315 | struct asl_large_vendor_desc *resource, | 227 | u32 length, u32 level); |
316 | u32 length, | ||
317 | u32 level); | ||
318 | |||
319 | 228 | ||
320 | /* | 229 | /* |
321 | * dmresrcs | 230 | * dmresrcs |
322 | */ | 231 | */ |
323 | void | 232 | void |
324 | acpi_dm_irq_descriptor ( | 233 | acpi_dm_irq_descriptor(struct asl_irq_format_desc *resource, |
325 | struct asl_irq_format_desc *resource, | 234 | u32 length, u32 level); |
326 | u32 length, | ||
327 | u32 level); | ||
328 | 235 | ||
329 | void | 236 | void |
330 | acpi_dm_dma_descriptor ( | 237 | acpi_dm_dma_descriptor(struct asl_dma_format_desc *resource, |
331 | struct asl_dma_format_desc *resource, | 238 | u32 length, u32 level); |
332 | u32 length, | ||
333 | u32 level); | ||
334 | 239 | ||
335 | void | 240 | void |
336 | acpi_dm_io_descriptor ( | 241 | acpi_dm_io_descriptor(struct asl_io_port_desc *resource, u32 length, u32 level); |
337 | struct asl_io_port_desc *resource, | ||
338 | u32 length, | ||
339 | u32 level); | ||
340 | 242 | ||
341 | void | 243 | void |
342 | acpi_dm_fixed_io_descriptor ( | 244 | acpi_dm_fixed_io_descriptor(struct asl_fixed_io_port_desc *resource, |
343 | struct asl_fixed_io_port_desc *resource, | 245 | u32 length, u32 level); |
344 | u32 length, | ||
345 | u32 level); | ||
346 | 246 | ||
347 | void | 247 | void |
348 | acpi_dm_start_dependent_descriptor ( | 248 | acpi_dm_start_dependent_descriptor(struct asl_start_dependent_desc *resource, |
349 | struct asl_start_dependent_desc *resource, | 249 | u32 length, u32 level); |
350 | u32 length, | ||
351 | u32 level); | ||
352 | 250 | ||
353 | void | 251 | void |
354 | acpi_dm_end_dependent_descriptor ( | 252 | acpi_dm_end_dependent_descriptor(struct asl_start_dependent_desc *resource, |
355 | struct asl_start_dependent_desc *resource, | 253 | u32 length, u32 level); |
356 | u32 length, | ||
357 | u32 level); | ||
358 | 254 | ||
359 | void | 255 | void |
360 | acpi_dm_vendor_small_descriptor ( | 256 | acpi_dm_vendor_small_descriptor(struct asl_small_vendor_desc *resource, |
361 | struct asl_small_vendor_desc *resource, | 257 | u32 length, u32 level); |
362 | u32 length, | ||
363 | u32 level); | ||
364 | |||
365 | 258 | ||
366 | /* | 259 | /* |
367 | * dmutils | 260 | * dmutils |
368 | */ | 261 | */ |
369 | void | 262 | void acpi_dm_add_to_external_list(char *path); |
370 | acpi_dm_add_to_external_list ( | ||
371 | char *path); | ||
372 | 263 | ||
373 | #endif /* __ACDISASM_H__ */ | 264 | #endif /* __ACDISASM_H__ */ |
diff --git a/include/acpi/acdispat.h b/include/acpi/acdispat.h index 90b7d30bd255..59306186f5e2 100644 --- a/include/acpi/acdispat.h +++ b/include/acpi/acdispat.h | |||
@@ -41,413 +41,305 @@ | |||
41 | * POSSIBILITY OF SUCH DAMAGES. | 41 | * POSSIBILITY OF SUCH DAMAGES. |
42 | */ | 42 | */ |
43 | 43 | ||
44 | |||
45 | #ifndef _ACDISPAT_H_ | 44 | #ifndef _ACDISPAT_H_ |
46 | #define _ACDISPAT_H_ | 45 | #define _ACDISPAT_H_ |
47 | 46 | ||
48 | |||
49 | #define NAMEOF_LOCAL_NTE "__L0" | 47 | #define NAMEOF_LOCAL_NTE "__L0" |
50 | #define NAMEOF_ARG_NTE "__A0" | 48 | #define NAMEOF_ARG_NTE "__A0" |
51 | 49 | ||
52 | |||
53 | /* | 50 | /* |
54 | * dsopcode - support for late evaluation | 51 | * dsopcode - support for late evaluation |
55 | */ | 52 | */ |
56 | acpi_status | 53 | acpi_status |
57 | acpi_ds_get_buffer_field_arguments ( | 54 | acpi_ds_get_buffer_field_arguments(union acpi_operand_object *obj_desc); |
58 | union acpi_operand_object *obj_desc); | ||
59 | 55 | ||
60 | acpi_status | 56 | acpi_status acpi_ds_get_region_arguments(union acpi_operand_object *rgn_desc); |
61 | acpi_ds_get_region_arguments ( | ||
62 | union acpi_operand_object *rgn_desc); | ||
63 | 57 | ||
64 | acpi_status | 58 | acpi_status acpi_ds_get_buffer_arguments(union acpi_operand_object *obj_desc); |
65 | acpi_ds_get_buffer_arguments ( | ||
66 | union acpi_operand_object *obj_desc); | ||
67 | 59 | ||
68 | acpi_status | 60 | acpi_status acpi_ds_get_package_arguments(union acpi_operand_object *obj_desc); |
69 | acpi_ds_get_package_arguments ( | ||
70 | union acpi_operand_object *obj_desc); | ||
71 | |||
72 | acpi_status | ||
73 | acpi_ds_eval_buffer_field_operands ( | ||
74 | struct acpi_walk_state *walk_state, | ||
75 | union acpi_parse_object *op); | ||
76 | 61 | ||
77 | acpi_status | 62 | acpi_status |
78 | acpi_ds_eval_region_operands ( | 63 | acpi_ds_eval_buffer_field_operands(struct acpi_walk_state *walk_state, |
79 | struct acpi_walk_state *walk_state, | 64 | union acpi_parse_object *op); |
80 | union acpi_parse_object *op); | ||
81 | 65 | ||
82 | acpi_status | 66 | acpi_status |
83 | acpi_ds_eval_data_object_operands ( | 67 | acpi_ds_eval_region_operands(struct acpi_walk_state *walk_state, |
84 | struct acpi_walk_state *walk_state, | 68 | union acpi_parse_object *op); |
85 | union acpi_parse_object *op, | ||
86 | union acpi_operand_object *obj_desc); | ||
87 | 69 | ||
88 | acpi_status | 70 | acpi_status |
89 | acpi_ds_initialize_region ( | 71 | acpi_ds_eval_data_object_operands(struct acpi_walk_state *walk_state, |
90 | acpi_handle obj_handle); | 72 | union acpi_parse_object *op, |
73 | union acpi_operand_object *obj_desc); | ||
91 | 74 | ||
75 | acpi_status acpi_ds_initialize_region(acpi_handle obj_handle); | ||
92 | 76 | ||
93 | /* | 77 | /* |
94 | * dsctrl - Parser/Interpreter interface, control stack routines | 78 | * dsctrl - Parser/Interpreter interface, control stack routines |
95 | */ | 79 | */ |
96 | acpi_status | 80 | acpi_status |
97 | acpi_ds_exec_begin_control_op ( | 81 | acpi_ds_exec_begin_control_op(struct acpi_walk_state *walk_state, |
98 | struct acpi_walk_state *walk_state, | 82 | union acpi_parse_object *op); |
99 | union acpi_parse_object *op); | ||
100 | 83 | ||
101 | acpi_status | 84 | acpi_status |
102 | acpi_ds_exec_end_control_op ( | 85 | acpi_ds_exec_end_control_op(struct acpi_walk_state *walk_state, |
103 | struct acpi_walk_state *walk_state, | 86 | union acpi_parse_object *op); |
104 | union acpi_parse_object *op); | ||
105 | |||
106 | 87 | ||
107 | /* | 88 | /* |
108 | * dsexec - Parser/Interpreter interface, method execution callbacks | 89 | * dsexec - Parser/Interpreter interface, method execution callbacks |
109 | */ | 90 | */ |
110 | acpi_status | 91 | acpi_status |
111 | acpi_ds_get_predicate_value ( | 92 | acpi_ds_get_predicate_value(struct acpi_walk_state *walk_state, |
112 | struct acpi_walk_state *walk_state, | 93 | union acpi_operand_object *result_obj); |
113 | union acpi_operand_object *result_obj); | ||
114 | 94 | ||
115 | acpi_status | 95 | acpi_status |
116 | acpi_ds_exec_begin_op ( | 96 | acpi_ds_exec_begin_op(struct acpi_walk_state *walk_state, |
117 | struct acpi_walk_state *walk_state, | 97 | union acpi_parse_object **out_op); |
118 | union acpi_parse_object **out_op); | ||
119 | |||
120 | acpi_status | ||
121 | acpi_ds_exec_end_op ( | ||
122 | struct acpi_walk_state *state); | ||
123 | 98 | ||
99 | acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *state); | ||
124 | 100 | ||
125 | /* | 101 | /* |
126 | * dsfield - Parser/Interpreter interface for AML fields | 102 | * dsfield - Parser/Interpreter interface for AML fields |
127 | */ | 103 | */ |
128 | acpi_status | 104 | acpi_status |
129 | acpi_ds_create_field ( | 105 | acpi_ds_create_field(union acpi_parse_object *op, |
130 | union acpi_parse_object *op, | 106 | struct acpi_namespace_node *region_node, |
131 | struct acpi_namespace_node *region_node, | 107 | struct acpi_walk_state *walk_state); |
132 | struct acpi_walk_state *walk_state); | ||
133 | 108 | ||
134 | acpi_status | 109 | acpi_status |
135 | acpi_ds_create_bank_field ( | 110 | acpi_ds_create_bank_field(union acpi_parse_object *op, |
136 | union acpi_parse_object *op, | 111 | struct acpi_namespace_node *region_node, |
137 | struct acpi_namespace_node *region_node, | 112 | struct acpi_walk_state *walk_state); |
138 | struct acpi_walk_state *walk_state); | ||
139 | 113 | ||
140 | acpi_status | 114 | acpi_status |
141 | acpi_ds_create_index_field ( | 115 | acpi_ds_create_index_field(union acpi_parse_object *op, |
142 | union acpi_parse_object *op, | 116 | struct acpi_namespace_node *region_node, |
143 | struct acpi_namespace_node *region_node, | 117 | struct acpi_walk_state *walk_state); |
144 | struct acpi_walk_state *walk_state); | ||
145 | 118 | ||
146 | acpi_status | 119 | acpi_status |
147 | acpi_ds_create_buffer_field ( | 120 | acpi_ds_create_buffer_field(union acpi_parse_object *op, |
148 | union acpi_parse_object *op, | 121 | struct acpi_walk_state *walk_state); |
149 | struct acpi_walk_state *walk_state); | ||
150 | 122 | ||
151 | acpi_status | 123 | acpi_status |
152 | acpi_ds_init_field_objects ( | 124 | acpi_ds_init_field_objects(union acpi_parse_object *op, |
153 | union acpi_parse_object *op, | 125 | struct acpi_walk_state *walk_state); |
154 | struct acpi_walk_state *walk_state); | ||
155 | |||
156 | 126 | ||
157 | /* | 127 | /* |
158 | * dsload - Parser/Interpreter interface, namespace load callbacks | 128 | * dsload - Parser/Interpreter interface, namespace load callbacks |
159 | */ | 129 | */ |
160 | acpi_status | 130 | acpi_status |
161 | acpi_ds_load1_begin_op ( | 131 | acpi_ds_load1_begin_op(struct acpi_walk_state *walk_state, |
162 | struct acpi_walk_state *walk_state, | 132 | union acpi_parse_object **out_op); |
163 | union acpi_parse_object **out_op); | ||
164 | 133 | ||
165 | acpi_status | 134 | acpi_status acpi_ds_load1_end_op(struct acpi_walk_state *walk_state); |
166 | acpi_ds_load1_end_op ( | ||
167 | struct acpi_walk_state *walk_state); | ||
168 | 135 | ||
169 | acpi_status | 136 | acpi_status |
170 | acpi_ds_load2_begin_op ( | 137 | acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state, |
171 | struct acpi_walk_state *walk_state, | 138 | union acpi_parse_object **out_op); |
172 | union acpi_parse_object **out_op); | ||
173 | 139 | ||
174 | acpi_status | 140 | acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state); |
175 | acpi_ds_load2_end_op ( | ||
176 | struct acpi_walk_state *walk_state); | ||
177 | 141 | ||
178 | acpi_status | 142 | acpi_status |
179 | acpi_ds_init_callbacks ( | 143 | acpi_ds_init_callbacks(struct acpi_walk_state *walk_state, u32 pass_number); |
180 | struct acpi_walk_state *walk_state, | ||
181 | u32 pass_number); | ||
182 | |||
183 | 144 | ||
184 | /* | 145 | /* |
185 | * dsmthdat - method data (locals/args) | 146 | * dsmthdat - method data (locals/args) |
186 | */ | 147 | */ |
187 | acpi_status | 148 | acpi_status |
188 | acpi_ds_store_object_to_local ( | 149 | acpi_ds_store_object_to_local(u16 opcode, |
189 | u16 opcode, | 150 | u32 index, |
190 | u32 index, | 151 | union acpi_operand_object *src_desc, |
191 | union acpi_operand_object *src_desc, | 152 | struct acpi_walk_state *walk_state); |
192 | struct acpi_walk_state *walk_state); | ||
193 | 153 | ||
194 | acpi_status | 154 | acpi_status |
195 | acpi_ds_method_data_get_entry ( | 155 | acpi_ds_method_data_get_entry(u16 opcode, |
196 | u16 opcode, | 156 | u32 index, |
197 | u32 index, | 157 | struct acpi_walk_state *walk_state, |
198 | struct acpi_walk_state *walk_state, | 158 | union acpi_operand_object ***node); |
199 | union acpi_operand_object ***node); | ||
200 | 159 | ||
201 | void | 160 | void acpi_ds_method_data_delete_all(struct acpi_walk_state *walk_state); |
202 | acpi_ds_method_data_delete_all ( | ||
203 | struct acpi_walk_state *walk_state); | ||
204 | 161 | ||
205 | u8 | 162 | u8 acpi_ds_is_method_value(union acpi_operand_object *obj_desc); |
206 | acpi_ds_is_method_value ( | ||
207 | union acpi_operand_object *obj_desc); | ||
208 | 163 | ||
209 | acpi_status | 164 | acpi_status |
210 | acpi_ds_method_data_get_value ( | 165 | acpi_ds_method_data_get_value(u16 opcode, |
211 | u16 opcode, | 166 | u32 index, |
212 | u32 index, | 167 | struct acpi_walk_state *walk_state, |
213 | struct acpi_walk_state *walk_state, | 168 | union acpi_operand_object **dest_desc); |
214 | union acpi_operand_object **dest_desc); | ||
215 | 169 | ||
216 | acpi_status | 170 | acpi_status |
217 | acpi_ds_method_data_init_args ( | 171 | acpi_ds_method_data_init_args(union acpi_operand_object **params, |
218 | union acpi_operand_object **params, | 172 | u32 max_param_count, |
219 | u32 max_param_count, | 173 | struct acpi_walk_state *walk_state); |
220 | struct acpi_walk_state *walk_state); | ||
221 | 174 | ||
222 | acpi_status | 175 | acpi_status |
223 | acpi_ds_method_data_get_node ( | 176 | acpi_ds_method_data_get_node(u16 opcode, |
224 | u16 opcode, | 177 | u32 index, |
225 | u32 index, | 178 | struct acpi_walk_state *walk_state, |
226 | struct acpi_walk_state *walk_state, | 179 | struct acpi_namespace_node **node); |
227 | struct acpi_namespace_node **node); | ||
228 | |||
229 | void | ||
230 | acpi_ds_method_data_init ( | ||
231 | struct acpi_walk_state *walk_state); | ||
232 | 180 | ||
181 | void acpi_ds_method_data_init(struct acpi_walk_state *walk_state); | ||
233 | 182 | ||
234 | /* | 183 | /* |
235 | * dsmethod - Parser/Interpreter interface - control method parsing | 184 | * dsmethod - Parser/Interpreter interface - control method parsing |
236 | */ | 185 | */ |
237 | acpi_status | 186 | acpi_status acpi_ds_parse_method(struct acpi_namespace_node *node); |
238 | acpi_ds_parse_method ( | ||
239 | struct acpi_namespace_node *node); | ||
240 | 187 | ||
241 | acpi_status | 188 | acpi_status |
242 | acpi_ds_call_control_method ( | 189 | acpi_ds_call_control_method(struct acpi_thread_state *thread, |
243 | struct acpi_thread_state *thread, | 190 | struct acpi_walk_state *walk_state, |
244 | struct acpi_walk_state *walk_state, | 191 | union acpi_parse_object *op); |
245 | union acpi_parse_object *op); | ||
246 | 192 | ||
247 | acpi_status | 193 | acpi_status |
248 | acpi_ds_restart_control_method ( | 194 | acpi_ds_restart_control_method(struct acpi_walk_state *walk_state, |
249 | struct acpi_walk_state *walk_state, | 195 | union acpi_operand_object *return_desc); |
250 | union acpi_operand_object *return_desc); | ||
251 | 196 | ||
252 | acpi_status | 197 | acpi_status |
253 | acpi_ds_terminate_control_method ( | 198 | acpi_ds_terminate_control_method(struct acpi_walk_state *walk_state); |
254 | struct acpi_walk_state *walk_state); | ||
255 | 199 | ||
256 | acpi_status | 200 | acpi_status |
257 | acpi_ds_begin_method_execution ( | 201 | acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node, |
258 | struct acpi_namespace_node *method_node, | 202 | union acpi_operand_object *obj_desc, |
259 | union acpi_operand_object *obj_desc, | 203 | struct acpi_namespace_node *calling_method_node); |
260 | struct acpi_namespace_node *calling_method_node); | ||
261 | |||
262 | 204 | ||
263 | /* | 205 | /* |
264 | * dsinit | 206 | * dsinit |
265 | */ | 207 | */ |
266 | acpi_status | 208 | acpi_status |
267 | acpi_ds_initialize_objects ( | 209 | acpi_ds_initialize_objects(struct acpi_table_desc *table_desc, |
268 | struct acpi_table_desc *table_desc, | 210 | struct acpi_namespace_node *start_node); |
269 | struct acpi_namespace_node *start_node); | ||
270 | |||
271 | 211 | ||
272 | /* | 212 | /* |
273 | * dsobject - Parser/Interpreter interface - object initialization and conversion | 213 | * dsobject - Parser/Interpreter interface - object initialization and conversion |
274 | */ | 214 | */ |
275 | acpi_status | 215 | acpi_status |
276 | acpi_ds_build_internal_buffer_obj ( | 216 | acpi_ds_build_internal_buffer_obj(struct acpi_walk_state *walk_state, |
277 | struct acpi_walk_state *walk_state, | 217 | union acpi_parse_object *op, |
278 | union acpi_parse_object *op, | 218 | u32 buffer_length, |
279 | u32 buffer_length, | 219 | union acpi_operand_object **obj_desc_ptr); |
280 | union acpi_operand_object **obj_desc_ptr); | ||
281 | 220 | ||
282 | acpi_status | 221 | acpi_status |
283 | acpi_ds_build_internal_package_obj ( | 222 | acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state, |
284 | struct acpi_walk_state *walk_state, | 223 | union acpi_parse_object *op, |
285 | union acpi_parse_object *op, | 224 | u32 package_length, |
286 | u32 package_length, | 225 | union acpi_operand_object **obj_desc); |
287 | union acpi_operand_object **obj_desc); | ||
288 | 226 | ||
289 | acpi_status | 227 | acpi_status |
290 | acpi_ds_init_object_from_op ( | 228 | acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state, |
291 | struct acpi_walk_state *walk_state, | 229 | union acpi_parse_object *op, |
292 | union acpi_parse_object *op, | 230 | u16 opcode, union acpi_operand_object **obj_desc); |
293 | u16 opcode, | ||
294 | union acpi_operand_object **obj_desc); | ||
295 | 231 | ||
296 | acpi_status | 232 | acpi_status |
297 | acpi_ds_create_node ( | 233 | acpi_ds_create_node(struct acpi_walk_state *walk_state, |
298 | struct acpi_walk_state *walk_state, | 234 | struct acpi_namespace_node *node, |
299 | struct acpi_namespace_node *node, | 235 | union acpi_parse_object *op); |
300 | union acpi_parse_object *op); | ||
301 | |||
302 | 236 | ||
303 | /* | 237 | /* |
304 | * dsutils - Parser/Interpreter interface utility routines | 238 | * dsutils - Parser/Interpreter interface utility routines |
305 | */ | 239 | */ |
306 | void | 240 | void acpi_ds_clear_implicit_return(struct acpi_walk_state *walk_state); |
307 | acpi_ds_clear_implicit_return ( | ||
308 | struct acpi_walk_state *walk_state); | ||
309 | 241 | ||
310 | u8 | 242 | u8 |
311 | acpi_ds_do_implicit_return ( | 243 | acpi_ds_do_implicit_return(union acpi_operand_object *return_desc, |
312 | union acpi_operand_object *return_desc, | 244 | struct acpi_walk_state *walk_state, |
313 | struct acpi_walk_state *walk_state, | 245 | u8 add_reference); |
314 | u8 add_reference); | ||
315 | 246 | ||
316 | u8 | 247 | u8 |
317 | acpi_ds_is_result_used ( | 248 | acpi_ds_is_result_used(union acpi_parse_object *op, |
318 | union acpi_parse_object *op, | 249 | struct acpi_walk_state *walk_state); |
319 | struct acpi_walk_state *walk_state); | ||
320 | 250 | ||
321 | void | 251 | void |
322 | acpi_ds_delete_result_if_not_used ( | 252 | acpi_ds_delete_result_if_not_used(union acpi_parse_object *op, |
323 | union acpi_parse_object *op, | 253 | union acpi_operand_object *result_obj, |
324 | union acpi_operand_object *result_obj, | 254 | struct acpi_walk_state *walk_state); |
325 | struct acpi_walk_state *walk_state); | ||
326 | |||
327 | acpi_status | ||
328 | acpi_ds_create_operand ( | ||
329 | struct acpi_walk_state *walk_state, | ||
330 | union acpi_parse_object *arg, | ||
331 | u32 args_remaining); | ||
332 | 255 | ||
333 | acpi_status | 256 | acpi_status |
334 | acpi_ds_create_operands ( | 257 | acpi_ds_create_operand(struct acpi_walk_state *walk_state, |
335 | struct acpi_walk_state *walk_state, | 258 | union acpi_parse_object *arg, u32 args_remaining); |
336 | union acpi_parse_object *first_arg); | ||
337 | 259 | ||
338 | acpi_status | 260 | acpi_status |
339 | acpi_ds_resolve_operands ( | 261 | acpi_ds_create_operands(struct acpi_walk_state *walk_state, |
340 | struct acpi_walk_state *walk_state); | 262 | union acpi_parse_object *first_arg); |
341 | 263 | ||
342 | void | 264 | acpi_status acpi_ds_resolve_operands(struct acpi_walk_state *walk_state); |
343 | acpi_ds_clear_operands ( | ||
344 | struct acpi_walk_state *walk_state); | ||
345 | 265 | ||
266 | void acpi_ds_clear_operands(struct acpi_walk_state *walk_state); | ||
346 | 267 | ||
347 | /* | 268 | /* |
348 | * dswscope - Scope Stack manipulation | 269 | * dswscope - Scope Stack manipulation |
349 | */ | 270 | */ |
350 | acpi_status | 271 | acpi_status |
351 | acpi_ds_scope_stack_push ( | 272 | acpi_ds_scope_stack_push(struct acpi_namespace_node *node, |
352 | struct acpi_namespace_node *node, | 273 | acpi_object_type type, |
353 | acpi_object_type type, | 274 | struct acpi_walk_state *walk_state); |
354 | struct acpi_walk_state *walk_state); | ||
355 | 275 | ||
276 | acpi_status acpi_ds_scope_stack_pop(struct acpi_walk_state *walk_state); | ||
356 | 277 | ||
357 | acpi_status | 278 | void acpi_ds_scope_stack_clear(struct acpi_walk_state *walk_state); |
358 | acpi_ds_scope_stack_pop ( | ||
359 | struct acpi_walk_state *walk_state); | ||
360 | |||
361 | void | ||
362 | acpi_ds_scope_stack_clear ( | ||
363 | struct acpi_walk_state *walk_state); | ||
364 | |||
365 | 279 | ||
366 | /* | 280 | /* |
367 | * dswstate - parser WALK_STATE management routines | 281 | * dswstate - parser WALK_STATE management routines |
368 | */ | 282 | */ |
369 | acpi_status | 283 | acpi_status |
370 | acpi_ds_obj_stack_push ( | 284 | acpi_ds_obj_stack_push(void *object, struct acpi_walk_state *walk_state); |
371 | void *object, | ||
372 | struct acpi_walk_state *walk_state); | ||
373 | 285 | ||
374 | acpi_status | 286 | acpi_status |
375 | acpi_ds_obj_stack_pop ( | 287 | acpi_ds_obj_stack_pop(u32 pop_count, struct acpi_walk_state *walk_state); |
376 | u32 pop_count, | ||
377 | struct acpi_walk_state *walk_state); | ||
378 | 288 | ||
379 | struct acpi_walk_state * | 289 | struct acpi_walk_state *acpi_ds_create_walk_state(acpi_owner_id owner_id, |
380 | acpi_ds_create_walk_state ( | 290 | union acpi_parse_object |
381 | acpi_owner_id owner_id, | 291 | *origin, |
382 | union acpi_parse_object *origin, | 292 | union acpi_operand_object |
383 | union acpi_operand_object *mth_desc, | 293 | *mth_desc, |
384 | struct acpi_thread_state *thread); | 294 | struct acpi_thread_state |
295 | *thread); | ||
385 | 296 | ||
386 | acpi_status | 297 | acpi_status |
387 | acpi_ds_init_aml_walk ( | 298 | acpi_ds_init_aml_walk(struct acpi_walk_state *walk_state, |
388 | struct acpi_walk_state *walk_state, | 299 | union acpi_parse_object *op, |
389 | union acpi_parse_object *op, | 300 | struct acpi_namespace_node *method_node, |
390 | struct acpi_namespace_node *method_node, | 301 | u8 * aml_start, |
391 | u8 *aml_start, | 302 | u32 aml_length, |
392 | u32 aml_length, | 303 | struct acpi_parameter_info *info, u8 pass_number); |
393 | struct acpi_parameter_info *info, | ||
394 | u8 pass_number); | ||
395 | 304 | ||
396 | acpi_status | 305 | acpi_status |
397 | acpi_ds_obj_stack_pop_and_delete ( | 306 | acpi_ds_obj_stack_pop_and_delete(u32 pop_count, |
398 | u32 pop_count, | 307 | struct acpi_walk_state *walk_state); |
399 | struct acpi_walk_state *walk_state); | ||
400 | 308 | ||
401 | void | 309 | void acpi_ds_delete_walk_state(struct acpi_walk_state *walk_state); |
402 | acpi_ds_delete_walk_state ( | ||
403 | struct acpi_walk_state *walk_state); | ||
404 | 310 | ||
405 | struct acpi_walk_state * | 311 | struct acpi_walk_state *acpi_ds_pop_walk_state(struct acpi_thread_state |
406 | acpi_ds_pop_walk_state ( | 312 | *thread); |
407 | struct acpi_thread_state *thread); | ||
408 | 313 | ||
409 | void | 314 | void |
410 | acpi_ds_push_walk_state ( | 315 | acpi_ds_push_walk_state(struct acpi_walk_state *walk_state, |
411 | struct acpi_walk_state *walk_state, | 316 | struct acpi_thread_state *thread); |
412 | struct acpi_thread_state *thread); | ||
413 | 317 | ||
414 | acpi_status | 318 | acpi_status acpi_ds_result_stack_pop(struct acpi_walk_state *walk_state); |
415 | acpi_ds_result_stack_pop ( | ||
416 | struct acpi_walk_state *walk_state); | ||
417 | 319 | ||
418 | acpi_status | 320 | acpi_status acpi_ds_result_stack_push(struct acpi_walk_state *walk_state); |
419 | acpi_ds_result_stack_push ( | ||
420 | struct acpi_walk_state *walk_state); | ||
421 | 321 | ||
422 | acpi_status | 322 | acpi_status acpi_ds_result_stack_clear(struct acpi_walk_state *walk_state); |
423 | acpi_ds_result_stack_clear ( | ||
424 | struct acpi_walk_state *walk_state); | ||
425 | 323 | ||
426 | struct acpi_walk_state * | 324 | struct acpi_walk_state *acpi_ds_get_current_walk_state(struct acpi_thread_state |
427 | acpi_ds_get_current_walk_state ( | 325 | *thread); |
428 | struct acpi_thread_state *thread); | ||
429 | 326 | ||
430 | #ifdef ACPI_FUTURE_USAGE | 327 | #ifdef ACPI_FUTURE_USAGE |
431 | acpi_status | 328 | acpi_status |
432 | acpi_ds_result_remove ( | 329 | acpi_ds_result_remove(union acpi_operand_object **object, |
433 | union acpi_operand_object **object, | 330 | u32 index, struct acpi_walk_state *walk_state); |
434 | u32 index, | ||
435 | struct acpi_walk_state *walk_state); | ||
436 | #endif | 331 | #endif |
437 | 332 | ||
438 | acpi_status | 333 | acpi_status |
439 | acpi_ds_result_pop ( | 334 | acpi_ds_result_pop(union acpi_operand_object **object, |
440 | union acpi_operand_object **object, | 335 | struct acpi_walk_state *walk_state); |
441 | struct acpi_walk_state *walk_state); | ||
442 | 336 | ||
443 | acpi_status | 337 | acpi_status |
444 | acpi_ds_result_push ( | 338 | acpi_ds_result_push(union acpi_operand_object *object, |
445 | union acpi_operand_object *object, | 339 | struct acpi_walk_state *walk_state); |
446 | struct acpi_walk_state *walk_state); | ||
447 | 340 | ||
448 | acpi_status | 341 | acpi_status |
449 | acpi_ds_result_pop_from_bottom ( | 342 | acpi_ds_result_pop_from_bottom(union acpi_operand_object **object, |
450 | union acpi_operand_object **object, | 343 | struct acpi_walk_state *walk_state); |
451 | struct acpi_walk_state *walk_state); | ||
452 | 344 | ||
453 | #endif /* _ACDISPAT_H_ */ | 345 | #endif /* _ACDISPAT_H_ */ |
diff --git a/include/acpi/acevents.h b/include/acpi/acevents.h index 33ae2ca997b7..bfa54600ecd9 100644 --- a/include/acpi/acevents.h +++ b/include/acpi/acevents.h | |||
@@ -44,249 +44,167 @@ | |||
44 | #ifndef __ACEVENTS_H__ | 44 | #ifndef __ACEVENTS_H__ |
45 | #define __ACEVENTS_H__ | 45 | #define __ACEVENTS_H__ |
46 | 46 | ||
47 | |||
48 | /* | 47 | /* |
49 | * evevent | 48 | * evevent |
50 | */ | 49 | */ |
51 | acpi_status | 50 | acpi_status acpi_ev_initialize_events(void); |
52 | acpi_ev_initialize_events ( | ||
53 | void); | ||
54 | 51 | ||
55 | acpi_status | 52 | acpi_status acpi_ev_install_xrupt_handlers(void); |
56 | acpi_ev_install_xrupt_handlers ( | ||
57 | void); | ||
58 | |||
59 | u32 | ||
60 | acpi_ev_fixed_event_detect ( | ||
61 | void); | ||
62 | 53 | ||
54 | u32 acpi_ev_fixed_event_detect(void); | ||
63 | 55 | ||
64 | /* | 56 | /* |
65 | * evmisc | 57 | * evmisc |
66 | */ | 58 | */ |
67 | u8 | 59 | u8 acpi_ev_is_notify_object(struct acpi_namespace_node *node); |
68 | acpi_ev_is_notify_object ( | ||
69 | struct acpi_namespace_node *node); | ||
70 | 60 | ||
71 | acpi_status | 61 | acpi_status acpi_ev_acquire_global_lock(u16 timeout); |
72 | acpi_ev_acquire_global_lock( | ||
73 | u16 timeout); | ||
74 | 62 | ||
75 | acpi_status | 63 | acpi_status acpi_ev_release_global_lock(void); |
76 | acpi_ev_release_global_lock( | ||
77 | void); | ||
78 | 64 | ||
79 | acpi_status | 65 | acpi_status acpi_ev_init_global_lock_handler(void); |
80 | acpi_ev_init_global_lock_handler ( | ||
81 | void); | ||
82 | 66 | ||
83 | u32 | 67 | u32 acpi_ev_get_gpe_number_index(u32 gpe_number); |
84 | acpi_ev_get_gpe_number_index ( | ||
85 | u32 gpe_number); | ||
86 | 68 | ||
87 | acpi_status | 69 | acpi_status |
88 | acpi_ev_queue_notify_request ( | 70 | acpi_ev_queue_notify_request(struct acpi_namespace_node *node, |
89 | struct acpi_namespace_node *node, | 71 | u32 notify_value); |
90 | u32 notify_value); | ||
91 | |||
92 | 72 | ||
93 | /* | 73 | /* |
94 | * evgpe - GPE handling and dispatch | 74 | * evgpe - GPE handling and dispatch |
95 | */ | 75 | */ |
96 | acpi_status | 76 | acpi_status |
97 | acpi_ev_update_gpe_enable_masks ( | 77 | acpi_ev_update_gpe_enable_masks(struct acpi_gpe_event_info *gpe_event_info, |
98 | struct acpi_gpe_event_info *gpe_event_info, | 78 | u8 type); |
99 | u8 type); | ||
100 | 79 | ||
101 | acpi_status | 80 | acpi_status |
102 | acpi_ev_enable_gpe ( | 81 | acpi_ev_enable_gpe(struct acpi_gpe_event_info *gpe_event_info, |
103 | struct acpi_gpe_event_info *gpe_event_info, | 82 | u8 write_to_hardware); |
104 | u8 write_to_hardware); | ||
105 | 83 | ||
106 | acpi_status | 84 | acpi_status acpi_ev_disable_gpe(struct acpi_gpe_event_info *gpe_event_info); |
107 | acpi_ev_disable_gpe ( | ||
108 | struct acpi_gpe_event_info *gpe_event_info); | ||
109 | |||
110 | struct acpi_gpe_event_info * | ||
111 | acpi_ev_get_gpe_event_info ( | ||
112 | acpi_handle gpe_device, | ||
113 | u32 gpe_number); | ||
114 | 85 | ||
86 | struct acpi_gpe_event_info *acpi_ev_get_gpe_event_info(acpi_handle gpe_device, | ||
87 | u32 gpe_number); | ||
115 | 88 | ||
116 | /* | 89 | /* |
117 | * evgpeblk | 90 | * evgpeblk |
118 | */ | 91 | */ |
119 | u8 | 92 | u8 acpi_ev_valid_gpe_event(struct acpi_gpe_event_info *gpe_event_info); |
120 | acpi_ev_valid_gpe_event ( | ||
121 | struct acpi_gpe_event_info *gpe_event_info); | ||
122 | |||
123 | acpi_status | ||
124 | acpi_ev_walk_gpe_list ( | ||
125 | ACPI_GPE_CALLBACK gpe_walk_callback); | ||
126 | 93 | ||
127 | acpi_status | 94 | acpi_status acpi_ev_walk_gpe_list(ACPI_GPE_CALLBACK gpe_walk_callback); |
128 | acpi_ev_delete_gpe_handlers ( | ||
129 | struct acpi_gpe_xrupt_info *gpe_xrupt_info, | ||
130 | struct acpi_gpe_block_info *gpe_block); | ||
131 | 95 | ||
132 | acpi_status | 96 | acpi_status |
133 | acpi_ev_create_gpe_block ( | 97 | acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info, |
134 | struct acpi_namespace_node *gpe_device, | 98 | struct acpi_gpe_block_info *gpe_block); |
135 | struct acpi_generic_address *gpe_block_address, | ||
136 | u32 register_count, | ||
137 | u8 gpe_block_base_number, | ||
138 | u32 interrupt_number, | ||
139 | struct acpi_gpe_block_info **return_gpe_block); | ||
140 | 99 | ||
141 | acpi_status | 100 | acpi_status |
142 | acpi_ev_delete_gpe_block ( | 101 | acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device, |
143 | struct acpi_gpe_block_info *gpe_block); | 102 | struct acpi_generic_address *gpe_block_address, |
103 | u32 register_count, | ||
104 | u8 gpe_block_base_number, | ||
105 | u32 interrupt_number, | ||
106 | struct acpi_gpe_block_info **return_gpe_block); | ||
144 | 107 | ||
145 | u32 | 108 | acpi_status acpi_ev_delete_gpe_block(struct acpi_gpe_block_info *gpe_block); |
146 | acpi_ev_gpe_dispatch ( | ||
147 | struct acpi_gpe_event_info *gpe_event_info, | ||
148 | u32 gpe_number); | ||
149 | 109 | ||
150 | u32 | 110 | u32 |
151 | acpi_ev_gpe_detect ( | 111 | acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, |
152 | struct acpi_gpe_xrupt_info *gpe_xrupt_list); | 112 | u32 gpe_number); |
153 | 113 | ||
154 | acpi_status | 114 | u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info *gpe_xrupt_list); |
155 | acpi_ev_set_gpe_type ( | ||
156 | struct acpi_gpe_event_info *gpe_event_info, | ||
157 | u8 type); | ||
158 | 115 | ||
159 | acpi_status | 116 | acpi_status |
160 | acpi_ev_check_for_wake_only_gpe ( | 117 | acpi_ev_set_gpe_type(struct acpi_gpe_event_info *gpe_event_info, u8 type); |
161 | struct acpi_gpe_event_info *gpe_event_info); | ||
162 | 118 | ||
163 | acpi_status | 119 | acpi_status |
164 | acpi_ev_gpe_initialize ( | 120 | acpi_ev_check_for_wake_only_gpe(struct acpi_gpe_event_info *gpe_event_info); |
165 | void); | ||
166 | 121 | ||
122 | acpi_status acpi_ev_gpe_initialize(void); | ||
167 | 123 | ||
168 | /* | 124 | /* |
169 | * evregion - Address Space handling | 125 | * evregion - Address Space handling |
170 | */ | 126 | */ |
171 | acpi_status | 127 | acpi_status acpi_ev_install_region_handlers(void); |
172 | acpi_ev_install_region_handlers ( | ||
173 | void); | ||
174 | 128 | ||
175 | acpi_status | 129 | acpi_status acpi_ev_initialize_op_regions(void); |
176 | acpi_ev_initialize_op_regions ( | ||
177 | void); | ||
178 | 130 | ||
179 | acpi_status | 131 | acpi_status |
180 | acpi_ev_address_space_dispatch ( | 132 | acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, |
181 | union acpi_operand_object *region_obj, | 133 | u32 function, |
182 | u32 function, | 134 | acpi_physical_address address, |
183 | acpi_physical_address address, | 135 | u32 bit_width, void *value); |
184 | u32 bit_width, | ||
185 | void *value); | ||
186 | 136 | ||
187 | acpi_status | 137 | acpi_status |
188 | acpi_ev_attach_region ( | 138 | acpi_ev_attach_region(union acpi_operand_object *handler_obj, |
189 | union acpi_operand_object *handler_obj, | 139 | union acpi_operand_object *region_obj, |
190 | union acpi_operand_object *region_obj, | 140 | u8 acpi_ns_is_locked); |
191 | u8 acpi_ns_is_locked); | ||
192 | 141 | ||
193 | void | 142 | void |
194 | acpi_ev_detach_region ( | 143 | acpi_ev_detach_region(union acpi_operand_object *region_obj, |
195 | union acpi_operand_object *region_obj, | 144 | u8 acpi_ns_is_locked); |
196 | u8 acpi_ns_is_locked); | ||
197 | 145 | ||
198 | acpi_status | 146 | acpi_status |
199 | acpi_ev_install_space_handler ( | 147 | acpi_ev_install_space_handler(struct acpi_namespace_node *node, |
200 | struct acpi_namespace_node *node, | 148 | acpi_adr_space_type space_id, |
201 | acpi_adr_space_type space_id, | 149 | acpi_adr_space_handler handler, |
202 | acpi_adr_space_handler handler, | 150 | acpi_adr_space_setup setup, void *context); |
203 | acpi_adr_space_setup setup, | ||
204 | void *context); | ||
205 | 151 | ||
206 | acpi_status | 152 | acpi_status |
207 | acpi_ev_execute_reg_methods ( | 153 | acpi_ev_execute_reg_methods(struct acpi_namespace_node *node, |
208 | struct acpi_namespace_node *node, | 154 | acpi_adr_space_type space_id); |
209 | acpi_adr_space_type space_id); | ||
210 | 155 | ||
211 | acpi_status | 156 | acpi_status |
212 | acpi_ev_execute_reg_method ( | 157 | acpi_ev_execute_reg_method(union acpi_operand_object *region_obj, u32 function); |
213 | union acpi_operand_object *region_obj, | ||
214 | u32 function); | ||
215 | |||
216 | 158 | ||
217 | /* | 159 | /* |
218 | * evregini - Region initialization and setup | 160 | * evregini - Region initialization and setup |
219 | */ | 161 | */ |
220 | acpi_status | 162 | acpi_status |
221 | acpi_ev_system_memory_region_setup ( | 163 | acpi_ev_system_memory_region_setup(acpi_handle handle, |
222 | acpi_handle handle, | 164 | u32 function, |
223 | u32 function, | 165 | void *handler_context, |
224 | void *handler_context, | 166 | void **region_context); |
225 | void **region_context); | ||
226 | 167 | ||
227 | acpi_status | 168 | acpi_status |
228 | acpi_ev_io_space_region_setup ( | 169 | acpi_ev_io_space_region_setup(acpi_handle handle, |
229 | acpi_handle handle, | 170 | u32 function, |
230 | u32 function, | 171 | void *handler_context, void **region_context); |
231 | void *handler_context, | ||
232 | void **region_context); | ||
233 | 172 | ||
234 | acpi_status | 173 | acpi_status |
235 | acpi_ev_pci_config_region_setup ( | 174 | acpi_ev_pci_config_region_setup(acpi_handle handle, |
236 | acpi_handle handle, | 175 | u32 function, |
237 | u32 function, | 176 | void *handler_context, void **region_context); |
238 | void *handler_context, | ||
239 | void **region_context); | ||
240 | 177 | ||
241 | acpi_status | 178 | acpi_status |
242 | acpi_ev_cmos_region_setup ( | 179 | acpi_ev_cmos_region_setup(acpi_handle handle, |
243 | acpi_handle handle, | 180 | u32 function, |
244 | u32 function, | 181 | void *handler_context, void **region_context); |
245 | void *handler_context, | ||
246 | void **region_context); | ||
247 | 182 | ||
248 | acpi_status | 183 | acpi_status |
249 | acpi_ev_pci_bar_region_setup ( | 184 | acpi_ev_pci_bar_region_setup(acpi_handle handle, |
250 | acpi_handle handle, | 185 | u32 function, |
251 | u32 function, | 186 | void *handler_context, void **region_context); |
252 | void *handler_context, | ||
253 | void **region_context); | ||
254 | 187 | ||
255 | acpi_status | 188 | acpi_status |
256 | acpi_ev_default_region_setup ( | 189 | acpi_ev_default_region_setup(acpi_handle handle, |
257 | acpi_handle handle, | 190 | u32 function, |
258 | u32 function, | 191 | void *handler_context, void **region_context); |
259 | void *handler_context, | ||
260 | void **region_context); | ||
261 | 192 | ||
262 | acpi_status | 193 | acpi_status |
263 | acpi_ev_initialize_region ( | 194 | acpi_ev_initialize_region(union acpi_operand_object *region_obj, |
264 | union acpi_operand_object *region_obj, | 195 | u8 acpi_ns_locked); |
265 | u8 acpi_ns_locked); | ||
266 | |||
267 | 196 | ||
268 | /* | 197 | /* |
269 | * evsci - SCI (System Control Interrupt) handling/dispatch | 198 | * evsci - SCI (System Control Interrupt) handling/dispatch |
270 | */ | 199 | */ |
271 | u32 ACPI_SYSTEM_XFACE | 200 | u32 ACPI_SYSTEM_XFACE acpi_ev_gpe_xrupt_handler(void *context); |
272 | acpi_ev_gpe_xrupt_handler ( | ||
273 | void *context); | ||
274 | |||
275 | u32 | ||
276 | acpi_ev_install_sci_handler ( | ||
277 | void); | ||
278 | 201 | ||
279 | acpi_status | 202 | u32 acpi_ev_install_sci_handler(void); |
280 | acpi_ev_remove_sci_handler ( | ||
281 | void); | ||
282 | 203 | ||
283 | u32 | 204 | acpi_status acpi_ev_remove_sci_handler(void); |
284 | acpi_ev_initialize_sCI ( | ||
285 | u32 program_sCI); | ||
286 | 205 | ||
287 | void | 206 | u32 acpi_ev_initialize_sCI(u32 program_sCI); |
288 | acpi_ev_terminate ( | ||
289 | void); | ||
290 | 207 | ||
208 | void acpi_ev_terminate(void); | ||
291 | 209 | ||
292 | #endif /* __ACEVENTS_H__ */ | 210 | #endif /* __ACEVENTS_H__ */ |
diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h index 0a6f492f3c8e..4f005eb65928 100644 --- a/include/acpi/acexcep.h +++ b/include/acpi/acexcep.h | |||
@@ -44,7 +44,6 @@ | |||
44 | #ifndef __ACEXCEP_H__ | 44 | #ifndef __ACEXCEP_H__ |
45 | #define __ACEXCEP_H__ | 45 | #define __ACEXCEP_H__ |
46 | 46 | ||
47 | |||
48 | /* | 47 | /* |
49 | * Exceptions returned by external ACPI interfaces | 48 | * Exceptions returned by external ACPI interfaces |
50 | */ | 49 | */ |
@@ -55,11 +54,9 @@ | |||
55 | #define AE_CODE_CONTROL 0x4000 | 54 | #define AE_CODE_CONTROL 0x4000 |
56 | #define AE_CODE_MASK 0xF000 | 55 | #define AE_CODE_MASK 0xF000 |
57 | 56 | ||
58 | |||
59 | #define ACPI_SUCCESS(a) (!(a)) | 57 | #define ACPI_SUCCESS(a) (!(a)) |
60 | #define ACPI_FAILURE(a) (a) | 58 | #define ACPI_FAILURE(a) (a) |
61 | 59 | ||
62 | |||
63 | #define AE_OK (acpi_status) 0x0000 | 60 | #define AE_OK (acpi_status) 0x0000 |
64 | 61 | ||
65 | /* | 62 | /* |
@@ -99,7 +96,6 @@ | |||
99 | 96 | ||
100 | #define AE_CODE_ENV_MAX 0x001F | 97 | #define AE_CODE_ENV_MAX 0x001F |
101 | 98 | ||
102 | |||
103 | /* | 99 | /* |
104 | * Programmer exceptions | 100 | * Programmer exceptions |
105 | */ | 101 | */ |
@@ -115,7 +111,6 @@ | |||
115 | 111 | ||
116 | #define AE_CODE_PGM_MAX 0x0009 | 112 | #define AE_CODE_PGM_MAX 0x0009 |
117 | 113 | ||
118 | |||
119 | /* | 114 | /* |
120 | * Acpi table exceptions | 115 | * Acpi table exceptions |
121 | */ | 116 | */ |
@@ -128,7 +123,6 @@ | |||
128 | 123 | ||
129 | #define AE_CODE_TBL_MAX 0x0006 | 124 | #define AE_CODE_TBL_MAX 0x0006 |
130 | 125 | ||
131 | |||
132 | /* | 126 | /* |
133 | * AML exceptions. These are caused by problems with | 127 | * AML exceptions. These are caused by problems with |
134 | * the actual AML byte stream | 128 | * the actual AML byte stream |
@@ -169,7 +163,6 @@ | |||
169 | 163 | ||
170 | #define AE_CODE_AML_MAX 0x0021 | 164 | #define AE_CODE_AML_MAX 0x0021 |
171 | 165 | ||
172 | |||
173 | /* | 166 | /* |
174 | * Internal exceptions used for control | 167 | * Internal exceptions used for control |
175 | */ | 168 | */ |
@@ -187,16 +180,13 @@ | |||
187 | 180 | ||
188 | #define AE_CODE_CTRL_MAX 0x000B | 181 | #define AE_CODE_CTRL_MAX 0x000B |
189 | 182 | ||
190 | |||
191 | #ifdef DEFINE_ACPI_GLOBALS | 183 | #ifdef DEFINE_ACPI_GLOBALS |
192 | 184 | ||
193 | |||
194 | /* | 185 | /* |
195 | * String versions of the exception codes above | 186 | * String versions of the exception codes above |
196 | * These strings must match the corresponding defines exactly | 187 | * These strings must match the corresponding defines exactly |
197 | */ | 188 | */ |
198 | char const *acpi_gbl_exception_names_env[] = | 189 | char const *acpi_gbl_exception_names_env[] = { |
199 | { | ||
200 | "AE_OK", | 190 | "AE_OK", |
201 | "AE_ERROR", | 191 | "AE_ERROR", |
202 | "AE_NO_ACPI_TABLES", | 192 | "AE_NO_ACPI_TABLES", |
@@ -231,8 +221,7 @@ char const *acpi_gbl_exception_names_env[] = | |||
231 | "AE_OWNER_ID_LIMIT" | 221 | "AE_OWNER_ID_LIMIT" |
232 | }; | 222 | }; |
233 | 223 | ||
234 | char const *acpi_gbl_exception_names_pgm[] = | 224 | char const *acpi_gbl_exception_names_pgm[] = { |
235 | { | ||
236 | "AE_BAD_PARAMETER", | 225 | "AE_BAD_PARAMETER", |
237 | "AE_BAD_CHARACTER", | 226 | "AE_BAD_CHARACTER", |
238 | "AE_BAD_PATHNAME", | 227 | "AE_BAD_PATHNAME", |
@@ -244,8 +233,7 @@ char const *acpi_gbl_exception_names_pgm[] = | |||
244 | "AE_BAD_DECIMAL_CONSTANT" | 233 | "AE_BAD_DECIMAL_CONSTANT" |
245 | }; | 234 | }; |
246 | 235 | ||
247 | char const *acpi_gbl_exception_names_tbl[] = | 236 | char const *acpi_gbl_exception_names_tbl[] = { |
248 | { | ||
249 | "AE_BAD_SIGNATURE", | 237 | "AE_BAD_SIGNATURE", |
250 | "AE_BAD_HEADER", | 238 | "AE_BAD_HEADER", |
251 | "AE_BAD_CHECKSUM", | 239 | "AE_BAD_CHECKSUM", |
@@ -254,8 +242,7 @@ char const *acpi_gbl_exception_names_tbl[] = | |||
254 | "AE_INVALID_TABLE_LENGTH" | 242 | "AE_INVALID_TABLE_LENGTH" |
255 | }; | 243 | }; |
256 | 244 | ||
257 | char const *acpi_gbl_exception_names_aml[] = | 245 | char const *acpi_gbl_exception_names_aml[] = { |
258 | { | ||
259 | "AE_AML_ERROR", | 246 | "AE_AML_ERROR", |
260 | "AE_AML_PARSE", | 247 | "AE_AML_PARSE", |
261 | "AE_AML_BAD_OPCODE", | 248 | "AE_AML_BAD_OPCODE", |
@@ -291,8 +278,7 @@ char const *acpi_gbl_exception_names_aml[] = | |||
291 | "AE_AML_BAD_RESOURCE_LENGTH" | 278 | "AE_AML_BAD_RESOURCE_LENGTH" |
292 | }; | 279 | }; |
293 | 280 | ||
294 | char const *acpi_gbl_exception_names_ctrl[] = | 281 | char const *acpi_gbl_exception_names_ctrl[] = { |
295 | { | ||
296 | "AE_CTRL_RETURN_VALUE", | 282 | "AE_CTRL_RETURN_VALUE", |
297 | "AE_CTRL_PENDING", | 283 | "AE_CTRL_PENDING", |
298 | "AE_CTRL_TERMINATE", | 284 | "AE_CTRL_TERMINATE", |
@@ -306,6 +292,6 @@ char const *acpi_gbl_exception_names_ctrl[] = | |||
306 | "AE_CTRL_SKIP" | 292 | "AE_CTRL_SKIP" |
307 | }; | 293 | }; |
308 | 294 | ||
309 | #endif /* ACPI GLOBALS */ | 295 | #endif /* ACPI GLOBALS */ |
310 | 296 | ||
311 | #endif /* __ACEXCEP_H__ */ | 297 | #endif /* __ACEXCEP_H__ */ |
diff --git a/include/acpi/acglobal.h b/include/acpi/acglobal.h index e3cf16eadbed..e9c2790139ec 100644 --- a/include/acpi/acglobal.h +++ b/include/acpi/acglobal.h | |||
@@ -44,7 +44,6 @@ | |||
44 | #ifndef __ACGLOBAL_H__ | 44 | #ifndef __ACGLOBAL_H__ |
45 | #define __ACGLOBAL_H__ | 45 | #define __ACGLOBAL_H__ |
46 | 46 | ||
47 | |||
48 | /* | 47 | /* |
49 | * Ensure that the globals are actually defined and initialized only once. | 48 | * Ensure that the globals are actually defined and initialized only once. |
50 | * | 49 | * |
@@ -63,9 +62,8 @@ | |||
63 | * Keep local copies of these FADT-based registers. NOTE: These globals | 62 | * Keep local copies of these FADT-based registers. NOTE: These globals |
64 | * are first in this file for alignment reasons on 64-bit systems. | 63 | * are first in this file for alignment reasons on 64-bit systems. |
65 | */ | 64 | */ |
66 | ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1a_enable; | 65 | ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1a_enable; |
67 | ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1b_enable; | 66 | ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1b_enable; |
68 | |||
69 | 67 | ||
70 | /***************************************************************************** | 68 | /***************************************************************************** |
71 | * | 69 | * |
@@ -75,13 +73,12 @@ ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1b_enable; | |||
75 | 73 | ||
76 | /* Runtime configuration of debug print levels */ | 74 | /* Runtime configuration of debug print levels */ |
77 | 75 | ||
78 | extern u32 acpi_dbg_level; | 76 | extern u32 acpi_dbg_level; |
79 | extern u32 acpi_dbg_layer; | 77 | extern u32 acpi_dbg_layer; |
80 | 78 | ||
81 | /* Procedure nesting level for debug output */ | 79 | /* Procedure nesting level for debug output */ |
82 | 80 | ||
83 | extern u32 acpi_gbl_nesting_level; | 81 | extern u32 acpi_gbl_nesting_level; |
84 | |||
85 | 82 | ||
86 | /***************************************************************************** | 83 | /***************************************************************************** |
87 | * | 84 | * |
@@ -98,7 +95,7 @@ extern u32 acpi_gbl_nesting_level; | |||
98 | * 3) Allow access to uninitialized locals/args (auto-init to integer 0) | 95 | * 3) Allow access to uninitialized locals/args (auto-init to integer 0) |
99 | * 4) Allow ANY object type to be a source operand for the Store() operator | 96 | * 4) Allow ANY object type to be a source operand for the Store() operator |
100 | */ | 97 | */ |
101 | ACPI_EXTERN u8 ACPI_INIT_GLOBAL (acpi_gbl_enable_interpreter_slack, FALSE); | 98 | ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_enable_interpreter_slack, FALSE); |
102 | 99 | ||
103 | /* | 100 | /* |
104 | * Automatically serialize ALL control methods? Default is FALSE, meaning | 101 | * Automatically serialize ALL control methods? Default is FALSE, meaning |
@@ -106,22 +103,21 @@ ACPI_EXTERN u8 ACPI_INIT_GLOBAL (acpi_gbl_enable_interpreter_slack, FALSE) | |||
106 | * Only change this if the ASL code is poorly written and cannot handle | 103 | * Only change this if the ASL code is poorly written and cannot handle |
107 | * reentrancy even though methods are marked "not_serialized". | 104 | * reentrancy even though methods are marked "not_serialized". |
108 | */ | 105 | */ |
109 | ACPI_EXTERN u8 ACPI_INIT_GLOBAL (acpi_gbl_all_methods_serialized, FALSE); | 106 | ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_all_methods_serialized, FALSE); |
110 | 107 | ||
111 | /* | 108 | /* |
112 | * Create the predefined _OSI method in the namespace? Default is TRUE | 109 | * Create the predefined _OSI method in the namespace? Default is TRUE |
113 | * because ACPI CA is fully compatible with other ACPI implementations. | 110 | * because ACPI CA is fully compatible with other ACPI implementations. |
114 | * Changing this will revert ACPI CA (and machine ASL) to pre-OSI behavior. | 111 | * Changing this will revert ACPI CA (and machine ASL) to pre-OSI behavior. |
115 | */ | 112 | */ |
116 | ACPI_EXTERN u8 ACPI_INIT_GLOBAL (acpi_gbl_create_osi_method, TRUE); | 113 | ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_create_osi_method, TRUE); |
117 | 114 | ||
118 | /* | 115 | /* |
119 | * Disable wakeup GPEs during runtime? Default is TRUE because WAKE and | 116 | * Disable wakeup GPEs during runtime? Default is TRUE because WAKE and |
120 | * RUNTIME GPEs should never be shared, and WAKE GPEs should typically only | 117 | * RUNTIME GPEs should never be shared, and WAKE GPEs should typically only |
121 | * be enabled just before going to sleep. | 118 | * be enabled just before going to sleep. |
122 | */ | 119 | */ |
123 | ACPI_EXTERN u8 ACPI_INIT_GLOBAL (acpi_gbl_leave_wake_gpes_disabled, TRUE); | 120 | ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_leave_wake_gpes_disabled, TRUE); |
124 | |||
125 | 121 | ||
126 | /***************************************************************************** | 122 | /***************************************************************************** |
127 | * | 123 | * |
@@ -137,49 +133,46 @@ ACPI_EXTERN u8 ACPI_INIT_GLOBAL (acpi_gbl_leave_wake_gpes_disabled, TRUE); | |||
137 | * These tables are single-table only; meaning that there can be at most one | 133 | * These tables are single-table only; meaning that there can be at most one |
138 | * of each in the system. Each global points to the actual table. | 134 | * of each in the system. Each global points to the actual table. |
139 | */ | 135 | */ |
140 | ACPI_EXTERN u32 acpi_gbl_table_flags; | 136 | ACPI_EXTERN u32 acpi_gbl_table_flags; |
141 | ACPI_EXTERN u32 acpi_gbl_rsdt_table_count; | 137 | ACPI_EXTERN u32 acpi_gbl_rsdt_table_count; |
142 | ACPI_EXTERN struct rsdp_descriptor *acpi_gbl_RSDP; | 138 | ACPI_EXTERN struct rsdp_descriptor *acpi_gbl_RSDP; |
143 | ACPI_EXTERN XSDT_DESCRIPTOR *acpi_gbl_XSDT; | 139 | ACPI_EXTERN XSDT_DESCRIPTOR *acpi_gbl_XSDT; |
144 | ACPI_EXTERN FADT_DESCRIPTOR *acpi_gbl_FADT; | 140 | ACPI_EXTERN FADT_DESCRIPTOR *acpi_gbl_FADT; |
145 | ACPI_EXTERN struct acpi_table_header *acpi_gbl_DSDT; | 141 | ACPI_EXTERN struct acpi_table_header *acpi_gbl_DSDT; |
146 | ACPI_EXTERN FACS_DESCRIPTOR *acpi_gbl_FACS; | 142 | ACPI_EXTERN FACS_DESCRIPTOR *acpi_gbl_FACS; |
147 | ACPI_EXTERN struct acpi_common_facs acpi_gbl_common_fACS; | 143 | ACPI_EXTERN struct acpi_common_facs acpi_gbl_common_fACS; |
148 | /* | 144 | /* |
149 | * Since there may be multiple SSDTs and PSDTs, a single pointer is not | 145 | * Since there may be multiple SSDTs and PSDTs, a single pointer is not |
150 | * sufficient; Therefore, there isn't one! | 146 | * sufficient; Therefore, there isn't one! |
151 | */ | 147 | */ |
152 | 148 | ||
153 | |||
154 | /* The root table can be either an RSDT or an XSDT */ | 149 | /* The root table can be either an RSDT or an XSDT */ |
155 | 150 | ||
156 | ACPI_EXTERN u8 acpi_gbl_root_table_type; | 151 | ACPI_EXTERN u8 acpi_gbl_root_table_type; |
157 | #define ACPI_TABLE_TYPE_RSDT 'R' | 152 | #define ACPI_TABLE_TYPE_RSDT 'R' |
158 | #define ACPI_TABLE_TYPE_XSDT 'X' | 153 | #define ACPI_TABLE_TYPE_XSDT 'X' |
159 | 154 | ||
160 | |||
161 | /* | 155 | /* |
162 | * Handle both ACPI 1.0 and ACPI 2.0 Integer widths: | 156 | * Handle both ACPI 1.0 and ACPI 2.0 Integer widths: |
163 | * If we are executing a method that exists in a 32-bit ACPI table, | 157 | * If we are executing a method that exists in a 32-bit ACPI table, |
164 | * use only the lower 32 bits of the (internal) 64-bit Integer. | 158 | * use only the lower 32 bits of the (internal) 64-bit Integer. |
165 | */ | 159 | */ |
166 | ACPI_EXTERN u8 acpi_gbl_integer_bit_width; | 160 | ACPI_EXTERN u8 acpi_gbl_integer_bit_width; |
167 | ACPI_EXTERN u8 acpi_gbl_integer_byte_width; | 161 | ACPI_EXTERN u8 acpi_gbl_integer_byte_width; |
168 | ACPI_EXTERN u8 acpi_gbl_integer_nybble_width; | 162 | ACPI_EXTERN u8 acpi_gbl_integer_nybble_width; |
169 | 163 | ||
170 | /* | 164 | /* |
171 | * ACPI Table info arrays | 165 | * ACPI Table info arrays |
172 | */ | 166 | */ |
173 | extern struct acpi_table_list acpi_gbl_table_lists[NUM_ACPI_TABLE_TYPES]; | 167 | extern struct acpi_table_list acpi_gbl_table_lists[NUM_ACPI_TABLE_TYPES]; |
174 | extern struct acpi_table_support acpi_gbl_table_data[NUM_ACPI_TABLE_TYPES]; | 168 | extern struct acpi_table_support acpi_gbl_table_data[NUM_ACPI_TABLE_TYPES]; |
175 | 169 | ||
176 | /* | 170 | /* |
177 | * Predefined mutex objects. This array contains the | 171 | * Predefined mutex objects. This array contains the |
178 | * actual OS mutex handles, indexed by the local ACPI_MUTEX_HANDLEs. | 172 | * actual OS mutex handles, indexed by the local ACPI_MUTEX_HANDLEs. |
179 | * (The table maps local handles to the real OS handles) | 173 | * (The table maps local handles to the real OS handles) |
180 | */ | 174 | */ |
181 | ACPI_EXTERN struct acpi_mutex_info acpi_gbl_mutex_info[NUM_MUTEX]; | 175 | ACPI_EXTERN struct acpi_mutex_info acpi_gbl_mutex_info[NUM_MUTEX]; |
182 | |||
183 | 176 | ||
184 | /***************************************************************************** | 177 | /***************************************************************************** |
185 | * | 178 | * |
@@ -191,53 +184,52 @@ ACPI_EXTERN struct acpi_mutex_info acpi_gbl_mutex_info[NUM_MUTEX]; | |||
191 | 184 | ||
192 | /* Lists for tracking memory allocations */ | 185 | /* Lists for tracking memory allocations */ |
193 | 186 | ||
194 | ACPI_EXTERN struct acpi_memory_list *acpi_gbl_global_list; | 187 | ACPI_EXTERN struct acpi_memory_list *acpi_gbl_global_list; |
195 | ACPI_EXTERN struct acpi_memory_list *acpi_gbl_ns_node_list; | 188 | ACPI_EXTERN struct acpi_memory_list *acpi_gbl_ns_node_list; |
196 | #endif | 189 | #endif |
197 | 190 | ||
198 | /* Object caches */ | 191 | /* Object caches */ |
199 | 192 | ||
200 | ACPI_EXTERN acpi_cache_t *acpi_gbl_state_cache; | 193 | ACPI_EXTERN acpi_cache_t *acpi_gbl_state_cache; |
201 | ACPI_EXTERN acpi_cache_t *acpi_gbl_ps_node_cache; | 194 | ACPI_EXTERN acpi_cache_t *acpi_gbl_ps_node_cache; |
202 | ACPI_EXTERN acpi_cache_t *acpi_gbl_ps_node_ext_cache; | 195 | ACPI_EXTERN acpi_cache_t *acpi_gbl_ps_node_ext_cache; |
203 | ACPI_EXTERN acpi_cache_t *acpi_gbl_operand_cache; | 196 | ACPI_EXTERN acpi_cache_t *acpi_gbl_operand_cache; |
204 | 197 | ||
205 | /* Global handlers */ | 198 | /* Global handlers */ |
206 | 199 | ||
207 | ACPI_EXTERN struct acpi_object_notify_handler acpi_gbl_device_notify; | 200 | ACPI_EXTERN struct acpi_object_notify_handler acpi_gbl_device_notify; |
208 | ACPI_EXTERN struct acpi_object_notify_handler acpi_gbl_system_notify; | 201 | ACPI_EXTERN struct acpi_object_notify_handler acpi_gbl_system_notify; |
209 | ACPI_EXTERN acpi_exception_handler acpi_gbl_exception_handler; | 202 | ACPI_EXTERN acpi_exception_handler acpi_gbl_exception_handler; |
210 | ACPI_EXTERN acpi_init_handler acpi_gbl_init_handler; | 203 | ACPI_EXTERN acpi_init_handler acpi_gbl_init_handler; |
211 | ACPI_EXTERN struct acpi_walk_state *acpi_gbl_breakpoint_walk; | 204 | ACPI_EXTERN struct acpi_walk_state *acpi_gbl_breakpoint_walk; |
212 | ACPI_EXTERN acpi_handle acpi_gbl_global_lock_semaphore; | 205 | ACPI_EXTERN acpi_handle acpi_gbl_global_lock_semaphore; |
213 | 206 | ||
214 | /* Misc */ | 207 | /* Misc */ |
215 | 208 | ||
216 | ACPI_EXTERN u32 acpi_gbl_global_lock_thread_count; | 209 | ACPI_EXTERN u32 acpi_gbl_global_lock_thread_count; |
217 | ACPI_EXTERN u32 acpi_gbl_original_mode; | 210 | ACPI_EXTERN u32 acpi_gbl_original_mode; |
218 | ACPI_EXTERN u32 acpi_gbl_rsdp_original_location; | 211 | ACPI_EXTERN u32 acpi_gbl_rsdp_original_location; |
219 | ACPI_EXTERN u32 acpi_gbl_ns_lookup_count; | 212 | ACPI_EXTERN u32 acpi_gbl_ns_lookup_count; |
220 | ACPI_EXTERN u32 acpi_gbl_ps_find_count; | 213 | ACPI_EXTERN u32 acpi_gbl_ps_find_count; |
221 | ACPI_EXTERN u32 acpi_gbl_owner_id_mask; | 214 | ACPI_EXTERN u32 acpi_gbl_owner_id_mask; |
222 | ACPI_EXTERN u16 acpi_gbl_pm1_enable_register_save; | 215 | ACPI_EXTERN u16 acpi_gbl_pm1_enable_register_save; |
223 | ACPI_EXTERN u16 acpi_gbl_global_lock_handle; | 216 | ACPI_EXTERN u16 acpi_gbl_global_lock_handle; |
224 | ACPI_EXTERN u8 acpi_gbl_debugger_configuration; | 217 | ACPI_EXTERN u8 acpi_gbl_debugger_configuration; |
225 | ACPI_EXTERN u8 acpi_gbl_global_lock_acquired; | 218 | ACPI_EXTERN u8 acpi_gbl_global_lock_acquired; |
226 | ACPI_EXTERN u8 acpi_gbl_step_to_next_call; | 219 | ACPI_EXTERN u8 acpi_gbl_step_to_next_call; |
227 | ACPI_EXTERN u8 acpi_gbl_acpi_hardware_present; | 220 | ACPI_EXTERN u8 acpi_gbl_acpi_hardware_present; |
228 | ACPI_EXTERN u8 acpi_gbl_global_lock_present; | 221 | ACPI_EXTERN u8 acpi_gbl_global_lock_present; |
229 | ACPI_EXTERN u8 acpi_gbl_events_initialized; | 222 | ACPI_EXTERN u8 acpi_gbl_events_initialized; |
230 | ACPI_EXTERN u8 acpi_gbl_system_awake_and_running; | 223 | ACPI_EXTERN u8 acpi_gbl_system_awake_and_running; |
231 | 224 | ||
232 | extern u8 acpi_gbl_shutdown; | 225 | extern u8 acpi_gbl_shutdown; |
233 | extern u32 acpi_gbl_startup_flags; | 226 | extern u32 acpi_gbl_startup_flags; |
234 | extern const u8 acpi_gbl_decode_to8bit[8]; | 227 | extern const u8 acpi_gbl_decode_to8bit[8]; |
235 | extern const char *acpi_gbl_sleep_state_names[ACPI_S_STATE_COUNT]; | 228 | extern const char *acpi_gbl_sleep_state_names[ACPI_S_STATE_COUNT]; |
236 | extern const char *acpi_gbl_highest_dstate_names[4]; | 229 | extern const char *acpi_gbl_highest_dstate_names[4]; |
237 | extern const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES]; | 230 | extern const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES]; |
238 | extern const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS]; | 231 | extern const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS]; |
239 | extern const char *acpi_gbl_valid_osi_strings[ACPI_NUM_OSI_STRINGS]; | 232 | extern const char *acpi_gbl_valid_osi_strings[ACPI_NUM_OSI_STRINGS]; |
240 | |||
241 | 233 | ||
242 | /***************************************************************************** | 234 | /***************************************************************************** |
243 | * | 235 | * |
@@ -253,36 +245,34 @@ extern const char *acpi_gbl_valid_osi_strings[ACPI_ | |||
253 | #define NUM_PREDEFINED_NAMES 9 | 245 | #define NUM_PREDEFINED_NAMES 9 |
254 | #endif | 246 | #endif |
255 | 247 | ||
256 | ACPI_EXTERN struct acpi_namespace_node acpi_gbl_root_node_struct; | 248 | ACPI_EXTERN struct acpi_namespace_node acpi_gbl_root_node_struct; |
257 | ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_root_node; | 249 | ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_root_node; |
258 | ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_fadt_gpe_device; | 250 | ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_fadt_gpe_device; |
259 | 251 | ||
260 | extern const u8 acpi_gbl_ns_properties[NUM_NS_TYPES]; | 252 | extern const u8 acpi_gbl_ns_properties[NUM_NS_TYPES]; |
261 | extern const struct acpi_predefined_names acpi_gbl_pre_defined_names [NUM_PREDEFINED_NAMES]; | 253 | extern const struct acpi_predefined_names |
254 | acpi_gbl_pre_defined_names[NUM_PREDEFINED_NAMES]; | ||
262 | 255 | ||
263 | #ifdef ACPI_DEBUG_OUTPUT | 256 | #ifdef ACPI_DEBUG_OUTPUT |
264 | ACPI_EXTERN u32 acpi_gbl_current_node_count; | 257 | ACPI_EXTERN u32 acpi_gbl_current_node_count; |
265 | ACPI_EXTERN u32 acpi_gbl_current_node_size; | 258 | ACPI_EXTERN u32 acpi_gbl_current_node_size; |
266 | ACPI_EXTERN u32 acpi_gbl_max_concurrent_node_count; | 259 | ACPI_EXTERN u32 acpi_gbl_max_concurrent_node_count; |
267 | ACPI_EXTERN acpi_size acpi_gbl_entry_stack_pointer; | 260 | ACPI_EXTERN acpi_size acpi_gbl_entry_stack_pointer; |
268 | ACPI_EXTERN acpi_size acpi_gbl_lowest_stack_pointer; | 261 | ACPI_EXTERN acpi_size acpi_gbl_lowest_stack_pointer; |
269 | ACPI_EXTERN u32 acpi_gbl_deepest_nesting; | 262 | ACPI_EXTERN u32 acpi_gbl_deepest_nesting; |
270 | #endif | 263 | #endif |
271 | 264 | ||
272 | |||
273 | /***************************************************************************** | 265 | /***************************************************************************** |
274 | * | 266 | * |
275 | * Interpreter globals | 267 | * Interpreter globals |
276 | * | 268 | * |
277 | ****************************************************************************/ | 269 | ****************************************************************************/ |
278 | 270 | ||
279 | 271 | ACPI_EXTERN struct acpi_thread_state *acpi_gbl_current_walk_list; | |
280 | ACPI_EXTERN struct acpi_thread_state *acpi_gbl_current_walk_list; | ||
281 | 272 | ||
282 | /* Control method single step flag */ | 273 | /* Control method single step flag */ |
283 | 274 | ||
284 | ACPI_EXTERN u8 acpi_gbl_cm_single_step; | 275 | ACPI_EXTERN u8 acpi_gbl_cm_single_step; |
285 | |||
286 | 276 | ||
287 | /***************************************************************************** | 277 | /***************************************************************************** |
288 | * | 278 | * |
@@ -290,8 +280,7 @@ ACPI_EXTERN u8 acpi_gbl_cm_single_step; | |||
290 | * | 280 | * |
291 | ****************************************************************************/ | 281 | ****************************************************************************/ |
292 | 282 | ||
293 | ACPI_EXTERN union acpi_parse_object *acpi_gbl_parsed_namespace_root; | 283 | ACPI_EXTERN union acpi_parse_object *acpi_gbl_parsed_namespace_root; |
294 | |||
295 | 284 | ||
296 | /***************************************************************************** | 285 | /***************************************************************************** |
297 | * | 286 | * |
@@ -299,10 +288,10 @@ ACPI_EXTERN union acpi_parse_object *acpi_gbl_parsed_namespace_root; | |||
299 | * | 288 | * |
300 | ****************************************************************************/ | 289 | ****************************************************************************/ |
301 | 290 | ||
302 | extern struct acpi_bit_register_info acpi_gbl_bit_register_info[ACPI_NUM_BITREG]; | 291 | extern struct acpi_bit_register_info |
303 | ACPI_EXTERN u8 acpi_gbl_sleep_type_a; | 292 | acpi_gbl_bit_register_info[ACPI_NUM_BITREG]; |
304 | ACPI_EXTERN u8 acpi_gbl_sleep_type_b; | 293 | ACPI_EXTERN u8 acpi_gbl_sleep_type_a; |
305 | 294 | ACPI_EXTERN u8 acpi_gbl_sleep_type_b; | |
306 | 295 | ||
307 | /***************************************************************************** | 296 | /***************************************************************************** |
308 | * | 297 | * |
@@ -310,12 +299,14 @@ ACPI_EXTERN u8 acpi_gbl_sleep_type_b; | |||
310 | * | 299 | * |
311 | ****************************************************************************/ | 300 | ****************************************************************************/ |
312 | 301 | ||
313 | extern struct acpi_fixed_event_info acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVENTS]; | 302 | extern struct acpi_fixed_event_info |
314 | ACPI_EXTERN struct acpi_fixed_event_handler acpi_gbl_fixed_event_handlers[ACPI_NUM_FIXED_EVENTS]; | 303 | acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVENTS]; |
315 | ACPI_EXTERN struct acpi_gpe_xrupt_info *acpi_gbl_gpe_xrupt_list_head; | 304 | ACPI_EXTERN struct acpi_fixed_event_handler |
316 | ACPI_EXTERN struct acpi_gpe_block_info *acpi_gbl_gpe_fadt_blocks[ACPI_MAX_GPE_BLOCKS]; | 305 | acpi_gbl_fixed_event_handlers[ACPI_NUM_FIXED_EVENTS]; |
317 | ACPI_EXTERN acpi_handle acpi_gbl_gpe_lock; | 306 | ACPI_EXTERN struct acpi_gpe_xrupt_info *acpi_gbl_gpe_xrupt_list_head; |
318 | 307 | ACPI_EXTERN struct acpi_gpe_block_info | |
308 | *acpi_gbl_gpe_fadt_blocks[ACPI_MAX_GPE_BLOCKS]; | ||
309 | ACPI_EXTERN acpi_handle acpi_gbl_gpe_lock; | ||
319 | 310 | ||
320 | /***************************************************************************** | 311 | /***************************************************************************** |
321 | * | 312 | * |
@@ -323,58 +314,55 @@ ACPI_EXTERN acpi_handle acpi_gbl_gpe_lock; | |||
323 | * | 314 | * |
324 | ****************************************************************************/ | 315 | ****************************************************************************/ |
325 | 316 | ||
326 | ACPI_EXTERN u8 acpi_gbl_db_output_flags; | 317 | ACPI_EXTERN u8 acpi_gbl_db_output_flags; |
327 | 318 | ||
328 | #ifdef ACPI_DISASSEMBLER | 319 | #ifdef ACPI_DISASSEMBLER |
329 | 320 | ||
330 | ACPI_EXTERN u8 acpi_gbl_db_opt_disasm; | 321 | ACPI_EXTERN u8 acpi_gbl_db_opt_disasm; |
331 | ACPI_EXTERN u8 acpi_gbl_db_opt_verbose; | 322 | ACPI_EXTERN u8 acpi_gbl_db_opt_verbose; |
332 | #endif | 323 | #endif |
333 | 324 | ||
334 | |||
335 | #ifdef ACPI_DEBUGGER | 325 | #ifdef ACPI_DEBUGGER |
336 | 326 | ||
337 | extern u8 acpi_gbl_method_executing; | 327 | extern u8 acpi_gbl_method_executing; |
338 | extern u8 acpi_gbl_abort_method; | 328 | extern u8 acpi_gbl_abort_method; |
339 | extern u8 acpi_gbl_db_terminate_threads; | 329 | extern u8 acpi_gbl_db_terminate_threads; |
340 | 330 | ||
341 | ACPI_EXTERN int optind; | 331 | ACPI_EXTERN int optind; |
342 | ACPI_EXTERN char *optarg; | 332 | ACPI_EXTERN char *optarg; |
343 | 333 | ||
344 | ACPI_EXTERN u8 acpi_gbl_db_opt_tables; | 334 | ACPI_EXTERN u8 acpi_gbl_db_opt_tables; |
345 | ACPI_EXTERN u8 acpi_gbl_db_opt_stats; | 335 | ACPI_EXTERN u8 acpi_gbl_db_opt_stats; |
346 | ACPI_EXTERN u8 acpi_gbl_db_opt_ini_methods; | 336 | ACPI_EXTERN u8 acpi_gbl_db_opt_ini_methods; |
347 | 337 | ||
348 | 338 | ACPI_EXTERN char *acpi_gbl_db_args[ACPI_DEBUGGER_MAX_ARGS]; | |
349 | ACPI_EXTERN char *acpi_gbl_db_args[ACPI_DEBUGGER_MAX_ARGS]; | 339 | ACPI_EXTERN char acpi_gbl_db_line_buf[80]; |
350 | ACPI_EXTERN char acpi_gbl_db_line_buf[80]; | 340 | ACPI_EXTERN char acpi_gbl_db_parsed_buf[80]; |
351 | ACPI_EXTERN char acpi_gbl_db_parsed_buf[80]; | 341 | ACPI_EXTERN char acpi_gbl_db_scope_buf[40]; |
352 | ACPI_EXTERN char acpi_gbl_db_scope_buf[40]; | 342 | ACPI_EXTERN char acpi_gbl_db_debug_filename[40]; |
353 | ACPI_EXTERN char acpi_gbl_db_debug_filename[40]; | 343 | ACPI_EXTERN u8 acpi_gbl_db_output_to_file; |
354 | ACPI_EXTERN u8 acpi_gbl_db_output_to_file; | 344 | ACPI_EXTERN char *acpi_gbl_db_buffer; |
355 | ACPI_EXTERN char *acpi_gbl_db_buffer; | 345 | ACPI_EXTERN char *acpi_gbl_db_filename; |
356 | ACPI_EXTERN char *acpi_gbl_db_filename; | 346 | ACPI_EXTERN u32 acpi_gbl_db_debug_level; |
357 | ACPI_EXTERN u32 acpi_gbl_db_debug_level; | 347 | ACPI_EXTERN u32 acpi_gbl_db_console_debug_level; |
358 | ACPI_EXTERN u32 acpi_gbl_db_console_debug_level; | 348 | ACPI_EXTERN struct acpi_table_header *acpi_gbl_db_table_ptr; |
359 | ACPI_EXTERN struct acpi_table_header *acpi_gbl_db_table_ptr; | 349 | ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_db_scope_node; |
360 | ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_db_scope_node; | ||
361 | 350 | ||
362 | /* | 351 | /* |
363 | * Statistic globals | 352 | * Statistic globals |
364 | */ | 353 | */ |
365 | ACPI_EXTERN u16 acpi_gbl_obj_type_count[ACPI_TYPE_NS_NODE_MAX+1]; | 354 | ACPI_EXTERN u16 acpi_gbl_obj_type_count[ACPI_TYPE_NS_NODE_MAX + 1]; |
366 | ACPI_EXTERN u16 acpi_gbl_node_type_count[ACPI_TYPE_NS_NODE_MAX+1]; | 355 | ACPI_EXTERN u16 acpi_gbl_node_type_count[ACPI_TYPE_NS_NODE_MAX + 1]; |
367 | ACPI_EXTERN u16 acpi_gbl_obj_type_count_misc; | 356 | ACPI_EXTERN u16 acpi_gbl_obj_type_count_misc; |
368 | ACPI_EXTERN u16 acpi_gbl_node_type_count_misc; | 357 | ACPI_EXTERN u16 acpi_gbl_node_type_count_misc; |
369 | ACPI_EXTERN u32 acpi_gbl_num_nodes; | 358 | ACPI_EXTERN u32 acpi_gbl_num_nodes; |
370 | ACPI_EXTERN u32 acpi_gbl_num_objects; | 359 | ACPI_EXTERN u32 acpi_gbl_num_objects; |
371 | |||
372 | 360 | ||
373 | ACPI_EXTERN u32 acpi_gbl_size_of_parse_tree; | 361 | ACPI_EXTERN u32 acpi_gbl_size_of_parse_tree; |
374 | ACPI_EXTERN u32 acpi_gbl_size_of_method_trees; | 362 | ACPI_EXTERN u32 acpi_gbl_size_of_method_trees; |
375 | ACPI_EXTERN u32 acpi_gbl_size_of_node_entries; | 363 | ACPI_EXTERN u32 acpi_gbl_size_of_node_entries; |
376 | ACPI_EXTERN u32 acpi_gbl_size_of_acpi_objects; | 364 | ACPI_EXTERN u32 acpi_gbl_size_of_acpi_objects; |
377 | 365 | ||
378 | #endif /* ACPI_DEBUGGER */ | 366 | #endif /* ACPI_DEBUGGER */ |
379 | 367 | ||
380 | #endif /* __ACGLOBAL_H__ */ | 368 | #endif /* __ACGLOBAL_H__ */ |
diff --git a/include/acpi/achware.h b/include/acpi/achware.h index cf5de4625a71..3644d7248e7e 100644 --- a/include/acpi/achware.h +++ b/include/acpi/achware.h | |||
@@ -44,7 +44,6 @@ | |||
44 | #ifndef __ACHWARE_H__ | 44 | #ifndef __ACHWARE_H__ |
45 | #define __ACHWARE_H__ | 45 | #define __ACHWARE_H__ |
46 | 46 | ||
47 | |||
48 | /* PM Timer ticks per second (HZ) */ | 47 | /* PM Timer ticks per second (HZ) */ |
49 | 48 | ||
50 | #define PM_TIMER_FREQUENCY 3579545 | 49 | #define PM_TIMER_FREQUENCY 3579545 |
@@ -57,126 +56,78 @@ | |||
57 | #define ACPI_SST_SLEEPING 3 | 56 | #define ACPI_SST_SLEEPING 3 |
58 | #define ACPI_SST_SLEEP_CONTEXT 4 | 57 | #define ACPI_SST_SLEEP_CONTEXT 4 |
59 | 58 | ||
60 | |||
61 | /* Prototypes */ | 59 | /* Prototypes */ |
62 | 60 | ||
63 | |||
64 | /* | 61 | /* |
65 | * hwacpi - high level functions | 62 | * hwacpi - high level functions |
66 | */ | 63 | */ |
67 | acpi_status | 64 | acpi_status acpi_hw_initialize(void); |
68 | acpi_hw_initialize ( | ||
69 | void); | ||
70 | 65 | ||
71 | acpi_status | 66 | acpi_status acpi_hw_set_mode(u32 mode); |
72 | acpi_hw_set_mode ( | ||
73 | u32 mode); | ||
74 | |||
75 | u32 | ||
76 | acpi_hw_get_mode ( | ||
77 | void); | ||
78 | 67 | ||
68 | u32 acpi_hw_get_mode(void); | ||
79 | 69 | ||
80 | /* | 70 | /* |
81 | * hwregs - ACPI Register I/O | 71 | * hwregs - ACPI Register I/O |
82 | */ | 72 | */ |
83 | struct acpi_bit_register_info * | 73 | struct acpi_bit_register_info *acpi_hw_get_bit_register_info(u32 register_id); |
84 | acpi_hw_get_bit_register_info ( | ||
85 | u32 register_id); | ||
86 | |||
87 | acpi_status | ||
88 | acpi_hw_register_read ( | ||
89 | u8 use_lock, | ||
90 | u32 register_id, | ||
91 | u32 *return_value); | ||
92 | 74 | ||
93 | acpi_status | 75 | acpi_status |
94 | acpi_hw_register_write ( | 76 | acpi_hw_register_read(u8 use_lock, u32 register_id, u32 * return_value); |
95 | u8 use_lock, | ||
96 | u32 register_id, | ||
97 | u32 value); | ||
98 | 77 | ||
99 | acpi_status | 78 | acpi_status acpi_hw_register_write(u8 use_lock, u32 register_id, u32 value); |
100 | acpi_hw_low_level_read ( | ||
101 | u32 width, | ||
102 | u32 *value, | ||
103 | struct acpi_generic_address *reg); | ||
104 | 79 | ||
105 | acpi_status | 80 | acpi_status |
106 | acpi_hw_low_level_write ( | 81 | acpi_hw_low_level_read(u32 width, |
107 | u32 width, | 82 | u32 * value, struct acpi_generic_address *reg); |
108 | u32 value, | ||
109 | struct acpi_generic_address *reg); | ||
110 | 83 | ||
111 | acpi_status | 84 | acpi_status |
112 | acpi_hw_clear_acpi_status ( | 85 | acpi_hw_low_level_write(u32 width, u32 value, struct acpi_generic_address *reg); |
113 | u32 flags); | ||
114 | 86 | ||
87 | acpi_status acpi_hw_clear_acpi_status(u32 flags); | ||
115 | 88 | ||
116 | /* | 89 | /* |
117 | * hwgpe - GPE support | 90 | * hwgpe - GPE support |
118 | */ | 91 | */ |
119 | acpi_status | 92 | acpi_status |
120 | acpi_hw_write_gpe_enable_reg ( | 93 | acpi_hw_write_gpe_enable_reg(struct acpi_gpe_event_info *gpe_event_info); |
121 | struct acpi_gpe_event_info *gpe_event_info); | ||
122 | 94 | ||
123 | acpi_status | 95 | acpi_status |
124 | acpi_hw_disable_gpe_block ( | 96 | acpi_hw_disable_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info, |
125 | struct acpi_gpe_xrupt_info *gpe_xrupt_info, | 97 | struct acpi_gpe_block_info *gpe_block); |
126 | struct acpi_gpe_block_info *gpe_block); | ||
127 | 98 | ||
128 | acpi_status | 99 | acpi_status acpi_hw_clear_gpe(struct acpi_gpe_event_info *gpe_event_info); |
129 | acpi_hw_clear_gpe ( | ||
130 | struct acpi_gpe_event_info *gpe_event_info); | ||
131 | 100 | ||
132 | acpi_status | 101 | acpi_status |
133 | acpi_hw_clear_gpe_block ( | 102 | acpi_hw_clear_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info, |
134 | struct acpi_gpe_xrupt_info *gpe_xrupt_info, | 103 | struct acpi_gpe_block_info *gpe_block); |
135 | struct acpi_gpe_block_info *gpe_block); | ||
136 | 104 | ||
137 | #ifdef ACPI_FUTURE_USAGE | 105 | #ifdef ACPI_FUTURE_USAGE |
138 | acpi_status | 106 | acpi_status |
139 | acpi_hw_get_gpe_status ( | 107 | acpi_hw_get_gpe_status(struct acpi_gpe_event_info *gpe_event_info, |
140 | struct acpi_gpe_event_info *gpe_event_info, | 108 | acpi_event_status * event_status); |
141 | acpi_event_status *event_status); | 109 | #endif /* ACPI_FUTURE_USAGE */ |
142 | #endif /* ACPI_FUTURE_USAGE */ | ||
143 | 110 | ||
144 | acpi_status | 111 | acpi_status acpi_hw_disable_all_gpes(void); |
145 | acpi_hw_disable_all_gpes ( | ||
146 | void); | ||
147 | 112 | ||
148 | acpi_status | 113 | acpi_status acpi_hw_enable_all_runtime_gpes(void); |
149 | acpi_hw_enable_all_runtime_gpes ( | ||
150 | void); | ||
151 | 114 | ||
152 | acpi_status | 115 | acpi_status acpi_hw_enable_all_wakeup_gpes(void); |
153 | acpi_hw_enable_all_wakeup_gpes ( | ||
154 | void); | ||
155 | 116 | ||
156 | acpi_status | 117 | acpi_status |
157 | acpi_hw_enable_runtime_gpe_block ( | 118 | acpi_hw_enable_runtime_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info, |
158 | struct acpi_gpe_xrupt_info *gpe_xrupt_info, | 119 | struct acpi_gpe_block_info *gpe_block); |
159 | struct acpi_gpe_block_info *gpe_block); | ||
160 | |||
161 | 120 | ||
162 | #ifdef ACPI_FUTURE_USAGE | 121 | #ifdef ACPI_FUTURE_USAGE |
163 | /* | 122 | /* |
164 | * hwtimer - ACPI Timer prototypes | 123 | * hwtimer - ACPI Timer prototypes |
165 | */ | 124 | */ |
166 | acpi_status | 125 | acpi_status acpi_get_timer_resolution(u32 * resolution); |
167 | acpi_get_timer_resolution ( | ||
168 | u32 *resolution); | ||
169 | 126 | ||
170 | acpi_status | 127 | acpi_status acpi_get_timer(u32 * ticks); |
171 | acpi_get_timer ( | ||
172 | u32 *ticks); | ||
173 | 128 | ||
174 | acpi_status | 129 | acpi_status |
175 | acpi_get_timer_duration ( | 130 | acpi_get_timer_duration(u32 start_ticks, u32 end_ticks, u32 * time_elapsed); |
176 | u32 start_ticks, | 131 | #endif /* ACPI_FUTURE_USAGE */ |
177 | u32 end_ticks, | ||
178 | u32 *time_elapsed); | ||
179 | #endif /* ACPI_FUTURE_USAGE */ | ||
180 | |||
181 | 132 | ||
182 | #endif /* __ACHWARE_H__ */ | 133 | #endif /* __ACHWARE_H__ */ |
diff --git a/include/acpi/acinterp.h b/include/acpi/acinterp.h index 5c7172477a0f..2c9c1a1d1b7f 100644 --- a/include/acpi/acinterp.h +++ b/include/acpi/acinterp.h | |||
@@ -44,29 +44,22 @@ | |||
44 | #ifndef __ACINTERP_H__ | 44 | #ifndef __ACINTERP_H__ |
45 | #define __ACINTERP_H__ | 45 | #define __ACINTERP_H__ |
46 | 46 | ||
47 | |||
48 | #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])) |
49 | 48 | ||
50 | |||
51 | /* | 49 | /* |
52 | * exconvrt - object conversion | 50 | * exconvrt - object conversion |
53 | */ | 51 | */ |
54 | acpi_status | 52 | acpi_status |
55 | acpi_ex_convert_to_integer ( | 53 | acpi_ex_convert_to_integer(union acpi_operand_object *obj_desc, |
56 | union acpi_operand_object *obj_desc, | 54 | union acpi_operand_object **result_desc, u32 flags); |
57 | union acpi_operand_object **result_desc, | ||
58 | u32 flags); | ||
59 | 55 | ||
60 | acpi_status | 56 | acpi_status |
61 | acpi_ex_convert_to_buffer ( | 57 | acpi_ex_convert_to_buffer(union acpi_operand_object *obj_desc, |
62 | union acpi_operand_object *obj_desc, | 58 | union acpi_operand_object **result_desc); |
63 | union acpi_operand_object **result_desc); | ||
64 | 59 | ||
65 | acpi_status | 60 | acpi_status |
66 | acpi_ex_convert_to_string ( | 61 | acpi_ex_convert_to_string(union acpi_operand_object *obj_desc, |
67 | union acpi_operand_object *obj_desc, | 62 | union acpi_operand_object **result_desc, u32 type); |
68 | union acpi_operand_object **result_desc, | ||
69 | u32 type); | ||
70 | 63 | ||
71 | /* Types for ->String conversion */ | 64 | /* Types for ->String conversion */ |
72 | 65 | ||
@@ -76,587 +69,412 @@ acpi_ex_convert_to_string ( | |||
76 | #define ACPI_EXPLICIT_CONVERT_DECIMAL 0x00000003 | 69 | #define ACPI_EXPLICIT_CONVERT_DECIMAL 0x00000003 |
77 | 70 | ||
78 | acpi_status | 71 | acpi_status |
79 | acpi_ex_convert_to_target_type ( | 72 | acpi_ex_convert_to_target_type(acpi_object_type destination_type, |
80 | acpi_object_type destination_type, | 73 | union acpi_operand_object *source_desc, |
81 | union acpi_operand_object *source_desc, | 74 | union acpi_operand_object **result_desc, |
82 | union acpi_operand_object **result_desc, | 75 | struct acpi_walk_state *walk_state); |
83 | struct acpi_walk_state *walk_state); | ||
84 | |||
85 | 76 | ||
86 | /* | 77 | /* |
87 | * exfield - ACPI AML (p-code) execution - field manipulation | 78 | * exfield - ACPI AML (p-code) execution - field manipulation |
88 | */ | 79 | */ |
89 | acpi_status | 80 | acpi_status |
90 | acpi_ex_common_buffer_setup ( | 81 | acpi_ex_common_buffer_setup(union acpi_operand_object *obj_desc, |
91 | union acpi_operand_object *obj_desc, | 82 | u32 buffer_length, u32 * datum_count); |
92 | u32 buffer_length, | ||
93 | u32 *datum_count); | ||
94 | 83 | ||
95 | acpi_status | 84 | acpi_status |
96 | acpi_ex_write_with_update_rule ( | 85 | acpi_ex_write_with_update_rule(union acpi_operand_object *obj_desc, |
97 | union acpi_operand_object *obj_desc, | 86 | acpi_integer mask, |
98 | acpi_integer mask, | 87 | acpi_integer field_value, |
99 | acpi_integer field_value, | 88 | u32 field_datum_byte_offset); |
100 | u32 field_datum_byte_offset); | ||
101 | 89 | ||
102 | void | 90 | void |
103 | acpi_ex_get_buffer_datum( | 91 | acpi_ex_get_buffer_datum(acpi_integer * datum, |
104 | acpi_integer *datum, | 92 | void *buffer, |
105 | void *buffer, | 93 | u32 buffer_length, |
106 | u32 buffer_length, | 94 | u32 byte_granularity, u32 buffer_offset); |
107 | u32 byte_granularity, | ||
108 | u32 buffer_offset); | ||
109 | 95 | ||
110 | void | 96 | void |
111 | acpi_ex_set_buffer_datum ( | 97 | acpi_ex_set_buffer_datum(acpi_integer merged_datum, |
112 | acpi_integer merged_datum, | 98 | void *buffer, |
113 | void *buffer, | 99 | u32 buffer_length, |
114 | u32 buffer_length, | 100 | u32 byte_granularity, u32 buffer_offset); |
115 | u32 byte_granularity, | ||
116 | u32 buffer_offset); | ||
117 | 101 | ||
118 | acpi_status | 102 | acpi_status |
119 | acpi_ex_read_data_from_field ( | 103 | acpi_ex_read_data_from_field(struct acpi_walk_state *walk_state, |
120 | struct acpi_walk_state *walk_state, | 104 | union acpi_operand_object *obj_desc, |
121 | union acpi_operand_object *obj_desc, | 105 | union acpi_operand_object **ret_buffer_desc); |
122 | union acpi_operand_object **ret_buffer_desc); | ||
123 | 106 | ||
124 | acpi_status | 107 | acpi_status |
125 | acpi_ex_write_data_to_field ( | 108 | acpi_ex_write_data_to_field(union acpi_operand_object *source_desc, |
126 | union acpi_operand_object *source_desc, | 109 | union acpi_operand_object *obj_desc, |
127 | union acpi_operand_object *obj_desc, | 110 | union acpi_operand_object **result_desc); |
128 | union acpi_operand_object **result_desc); | ||
129 | |||
130 | 111 | ||
131 | /* | 112 | /* |
132 | * exfldio - low level field I/O | 113 | * exfldio - low level field I/O |
133 | */ | 114 | */ |
134 | acpi_status | 115 | acpi_status |
135 | acpi_ex_extract_from_field ( | 116 | acpi_ex_extract_from_field(union acpi_operand_object *obj_desc, |
136 | union acpi_operand_object *obj_desc, | 117 | void *buffer, u32 buffer_length); |
137 | void *buffer, | ||
138 | u32 buffer_length); | ||
139 | 118 | ||
140 | acpi_status | 119 | acpi_status |
141 | acpi_ex_insert_into_field ( | 120 | acpi_ex_insert_into_field(union acpi_operand_object *obj_desc, |
142 | union acpi_operand_object *obj_desc, | 121 | void *buffer, u32 buffer_length); |
143 | void *buffer, | ||
144 | u32 buffer_length); | ||
145 | 122 | ||
146 | acpi_status | 123 | acpi_status |
147 | acpi_ex_access_region ( | 124 | acpi_ex_access_region(union acpi_operand_object *obj_desc, |
148 | union acpi_operand_object *obj_desc, | 125 | u32 field_datum_byte_offset, |
149 | u32 field_datum_byte_offset, | 126 | acpi_integer * value, u32 read_write); |
150 | acpi_integer *value, | ||
151 | u32 read_write); | ||
152 | |||
153 | 127 | ||
154 | /* | 128 | /* |
155 | * exmisc - misc support routines | 129 | * exmisc - misc support routines |
156 | */ | 130 | */ |
157 | acpi_status | 131 | acpi_status |
158 | acpi_ex_get_object_reference ( | 132 | acpi_ex_get_object_reference(union acpi_operand_object *obj_desc, |
159 | union acpi_operand_object *obj_desc, | 133 | union acpi_operand_object **return_desc, |
160 | union acpi_operand_object **return_desc, | 134 | struct acpi_walk_state *walk_state); |
161 | struct acpi_walk_state *walk_state); | ||
162 | 135 | ||
163 | acpi_status | 136 | acpi_status |
164 | acpi_ex_concat_template ( | 137 | acpi_ex_concat_template(union acpi_operand_object *obj_desc, |
165 | union acpi_operand_object *obj_desc, | 138 | union acpi_operand_object *obj_desc2, |
166 | union acpi_operand_object *obj_desc2, | 139 | union acpi_operand_object **actual_return_desc, |
167 | union acpi_operand_object **actual_return_desc, | 140 | struct acpi_walk_state *walk_state); |
168 | struct acpi_walk_state *walk_state); | ||
169 | 141 | ||
170 | acpi_status | 142 | acpi_status |
171 | acpi_ex_do_concatenate ( | 143 | acpi_ex_do_concatenate(union acpi_operand_object *obj_desc, |
172 | union acpi_operand_object *obj_desc, | 144 | union acpi_operand_object *obj_desc2, |
173 | union acpi_operand_object *obj_desc2, | 145 | union acpi_operand_object **actual_return_desc, |
174 | union acpi_operand_object **actual_return_desc, | 146 | struct acpi_walk_state *walk_state); |
175 | struct acpi_walk_state *walk_state); | ||
176 | 147 | ||
177 | acpi_status | 148 | acpi_status |
178 | acpi_ex_do_logical_numeric_op ( | 149 | acpi_ex_do_logical_numeric_op(u16 opcode, |
179 | u16 opcode, | 150 | acpi_integer integer0, |
180 | acpi_integer integer0, | 151 | acpi_integer integer1, u8 * logical_result); |
181 | acpi_integer integer1, | ||
182 | u8 *logical_result); | ||
183 | 152 | ||
184 | acpi_status | 153 | acpi_status |
185 | acpi_ex_do_logical_op ( | 154 | acpi_ex_do_logical_op(u16 opcode, |
186 | u16 opcode, | 155 | union acpi_operand_object *operand0, |
187 | union acpi_operand_object *operand0, | 156 | union acpi_operand_object *operand1, u8 * logical_result); |
188 | union acpi_operand_object *operand1, | ||
189 | u8 *logical_result); | ||
190 | 157 | ||
191 | acpi_integer | 158 | acpi_integer |
192 | acpi_ex_do_math_op ( | 159 | acpi_ex_do_math_op(u16 opcode, acpi_integer operand0, acpi_integer operand1); |
193 | u16 opcode, | ||
194 | acpi_integer operand0, | ||
195 | acpi_integer operand1); | ||
196 | 160 | ||
197 | acpi_status | 161 | acpi_status acpi_ex_create_mutex(struct acpi_walk_state *walk_state); |
198 | acpi_ex_create_mutex ( | ||
199 | struct acpi_walk_state *walk_state); | ||
200 | 162 | ||
201 | acpi_status | 163 | acpi_status acpi_ex_create_processor(struct acpi_walk_state *walk_state); |
202 | acpi_ex_create_processor ( | ||
203 | struct acpi_walk_state *walk_state); | ||
204 | 164 | ||
205 | acpi_status | 165 | acpi_status acpi_ex_create_power_resource(struct acpi_walk_state *walk_state); |
206 | acpi_ex_create_power_resource ( | ||
207 | struct acpi_walk_state *walk_state); | ||
208 | 166 | ||
209 | acpi_status | 167 | acpi_status |
210 | acpi_ex_create_region ( | 168 | acpi_ex_create_region(u8 * aml_start, |
211 | u8 *aml_start, | 169 | u32 aml_length, |
212 | u32 aml_length, | 170 | u8 region_space, struct acpi_walk_state *walk_state); |
213 | u8 region_space, | ||
214 | struct acpi_walk_state *walk_state); | ||
215 | 171 | ||
216 | acpi_status | 172 | acpi_status acpi_ex_create_table_region(struct acpi_walk_state *walk_state); |
217 | acpi_ex_create_table_region ( | ||
218 | struct acpi_walk_state *walk_state); | ||
219 | 173 | ||
220 | acpi_status | 174 | acpi_status acpi_ex_create_event(struct acpi_walk_state *walk_state); |
221 | acpi_ex_create_event ( | ||
222 | struct acpi_walk_state *walk_state); | ||
223 | 175 | ||
224 | acpi_status | 176 | acpi_status acpi_ex_create_alias(struct acpi_walk_state *walk_state); |
225 | acpi_ex_create_alias ( | ||
226 | struct acpi_walk_state *walk_state); | ||
227 | 177 | ||
228 | acpi_status | 178 | acpi_status |
229 | acpi_ex_create_method ( | 179 | acpi_ex_create_method(u8 * aml_start, |
230 | u8 *aml_start, | 180 | u32 aml_length, struct acpi_walk_state *walk_state); |
231 | u32 aml_length, | ||
232 | struct acpi_walk_state *walk_state); | ||
233 | |||
234 | 181 | ||
235 | /* | 182 | /* |
236 | * exconfig - dynamic table load/unload | 183 | * exconfig - dynamic table load/unload |
237 | */ | 184 | */ |
238 | acpi_status | 185 | acpi_status |
239 | acpi_ex_load_op ( | 186 | acpi_ex_load_op(union acpi_operand_object *obj_desc, |
240 | union acpi_operand_object *obj_desc, | 187 | union acpi_operand_object *target, |
241 | union acpi_operand_object *target, | 188 | struct acpi_walk_state *walk_state); |
242 | struct acpi_walk_state *walk_state); | ||
243 | 189 | ||
244 | acpi_status | 190 | acpi_status |
245 | acpi_ex_load_table_op ( | 191 | acpi_ex_load_table_op(struct acpi_walk_state *walk_state, |
246 | struct acpi_walk_state *walk_state, | 192 | union acpi_operand_object **return_desc); |
247 | union acpi_operand_object **return_desc); | ||
248 | |||
249 | acpi_status | ||
250 | acpi_ex_unload_table ( | ||
251 | union acpi_operand_object *ddb_handle); | ||
252 | 193 | ||
194 | acpi_status acpi_ex_unload_table(union acpi_operand_object *ddb_handle); | ||
253 | 195 | ||
254 | /* | 196 | /* |
255 | * exmutex - mutex support | 197 | * exmutex - mutex support |
256 | */ | 198 | */ |
257 | acpi_status | 199 | acpi_status |
258 | acpi_ex_acquire_mutex ( | 200 | acpi_ex_acquire_mutex(union acpi_operand_object *time_desc, |
259 | union acpi_operand_object *time_desc, | 201 | union acpi_operand_object *obj_desc, |
260 | union acpi_operand_object *obj_desc, | 202 | struct acpi_walk_state *walk_state); |
261 | struct acpi_walk_state *walk_state); | ||
262 | 203 | ||
263 | acpi_status | 204 | acpi_status |
264 | acpi_ex_release_mutex ( | 205 | acpi_ex_release_mutex(union acpi_operand_object *obj_desc, |
265 | union acpi_operand_object *obj_desc, | 206 | struct acpi_walk_state *walk_state); |
266 | struct acpi_walk_state *walk_state); | ||
267 | 207 | ||
268 | void | 208 | void acpi_ex_release_all_mutexes(struct acpi_thread_state *thread); |
269 | acpi_ex_release_all_mutexes ( | ||
270 | struct acpi_thread_state *thread); | ||
271 | |||
272 | void | ||
273 | acpi_ex_unlink_mutex ( | ||
274 | union acpi_operand_object *obj_desc); | ||
275 | 209 | ||
210 | void acpi_ex_unlink_mutex(union acpi_operand_object *obj_desc); | ||
276 | 211 | ||
277 | /* | 212 | /* |
278 | * exprep - ACPI AML execution - prep utilities | 213 | * exprep - ACPI AML execution - prep utilities |
279 | */ | 214 | */ |
280 | acpi_status | 215 | acpi_status |
281 | acpi_ex_prep_common_field_object ( | 216 | acpi_ex_prep_common_field_object(union acpi_operand_object *obj_desc, |
282 | union acpi_operand_object *obj_desc, | 217 | u8 field_flags, |
283 | u8 field_flags, | 218 | u8 field_attribute, |
284 | u8 field_attribute, | 219 | u32 field_bit_position, u32 field_bit_length); |
285 | u32 field_bit_position, | ||
286 | u32 field_bit_length); | ||
287 | |||
288 | acpi_status | ||
289 | acpi_ex_prep_field_value ( | ||
290 | struct acpi_create_field_info *info); | ||
291 | 220 | ||
221 | acpi_status acpi_ex_prep_field_value(struct acpi_create_field_info *info); | ||
292 | 222 | ||
293 | /* | 223 | /* |
294 | * exsystem - Interface to OS services | 224 | * exsystem - Interface to OS services |
295 | */ | 225 | */ |
296 | acpi_status | 226 | acpi_status |
297 | acpi_ex_system_do_notify_op ( | 227 | acpi_ex_system_do_notify_op(union acpi_operand_object *value, |
298 | union acpi_operand_object *value, | 228 | union acpi_operand_object *obj_desc); |
299 | union acpi_operand_object *obj_desc); | ||
300 | 229 | ||
301 | acpi_status | 230 | acpi_status acpi_ex_system_do_suspend(acpi_integer time); |
302 | acpi_ex_system_do_suspend( | ||
303 | acpi_integer time); | ||
304 | 231 | ||
305 | acpi_status | 232 | acpi_status acpi_ex_system_do_stall(u32 time); |
306 | acpi_ex_system_do_stall ( | ||
307 | u32 time); | ||
308 | 233 | ||
309 | acpi_status | 234 | acpi_status |
310 | acpi_ex_system_acquire_mutex( | 235 | acpi_ex_system_acquire_mutex(union acpi_operand_object *time, |
311 | union acpi_operand_object *time, | 236 | union acpi_operand_object *obj_desc); |
312 | union acpi_operand_object *obj_desc); | ||
313 | 237 | ||
314 | acpi_status | 238 | acpi_status acpi_ex_system_release_mutex(union acpi_operand_object *obj_desc); |
315 | acpi_ex_system_release_mutex( | ||
316 | union acpi_operand_object *obj_desc); | ||
317 | 239 | ||
318 | acpi_status | 240 | acpi_status acpi_ex_system_signal_event(union acpi_operand_object *obj_desc); |
319 | acpi_ex_system_signal_event( | ||
320 | union acpi_operand_object *obj_desc); | ||
321 | 241 | ||
322 | acpi_status | 242 | acpi_status |
323 | acpi_ex_system_wait_event( | 243 | acpi_ex_system_wait_event(union acpi_operand_object *time, |
324 | union acpi_operand_object *time, | 244 | union acpi_operand_object *obj_desc); |
325 | union acpi_operand_object *obj_desc); | ||
326 | 245 | ||
327 | acpi_status | 246 | acpi_status acpi_ex_system_reset_event(union acpi_operand_object *obj_desc); |
328 | acpi_ex_system_reset_event( | ||
329 | union acpi_operand_object *obj_desc); | ||
330 | |||
331 | acpi_status | ||
332 | acpi_ex_system_wait_semaphore ( | ||
333 | acpi_handle semaphore, | ||
334 | u16 timeout); | ||
335 | 247 | ||
248 | acpi_status acpi_ex_system_wait_semaphore(acpi_handle semaphore, u16 timeout); | ||
336 | 249 | ||
337 | /* | 250 | /* |
338 | * exoparg1 - ACPI AML execution, 1 operand | 251 | * exoparg1 - ACPI AML execution, 1 operand |
339 | */ | 252 | */ |
340 | acpi_status | 253 | acpi_status acpi_ex_opcode_0A_0T_1R(struct acpi_walk_state *walk_state); |
341 | acpi_ex_opcode_0A_0T_1R ( | ||
342 | struct acpi_walk_state *walk_state); | ||
343 | 254 | ||
344 | acpi_status | 255 | acpi_status acpi_ex_opcode_1A_0T_0R(struct acpi_walk_state *walk_state); |
345 | acpi_ex_opcode_1A_0T_0R ( | ||
346 | struct acpi_walk_state *walk_state); | ||
347 | 256 | ||
348 | acpi_status | 257 | acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state); |
349 | acpi_ex_opcode_1A_0T_1R ( | ||
350 | struct acpi_walk_state *walk_state); | ||
351 | 258 | ||
352 | acpi_status | 259 | acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state); |
353 | acpi_ex_opcode_1A_1T_1R ( | ||
354 | struct acpi_walk_state *walk_state); | ||
355 | 260 | ||
356 | acpi_status | 261 | acpi_status acpi_ex_opcode_1A_1T_0R(struct acpi_walk_state *walk_state); |
357 | acpi_ex_opcode_1A_1T_0R ( | ||
358 | struct acpi_walk_state *walk_state); | ||
359 | 262 | ||
360 | /* | 263 | /* |
361 | * exoparg2 - ACPI AML execution, 2 operands | 264 | * exoparg2 - ACPI AML execution, 2 operands |
362 | */ | 265 | */ |
363 | acpi_status | 266 | acpi_status acpi_ex_opcode_2A_0T_0R(struct acpi_walk_state *walk_state); |
364 | acpi_ex_opcode_2A_0T_0R ( | ||
365 | struct acpi_walk_state *walk_state); | ||
366 | 267 | ||
367 | acpi_status | 268 | acpi_status acpi_ex_opcode_2A_0T_1R(struct acpi_walk_state *walk_state); |
368 | acpi_ex_opcode_2A_0T_1R ( | ||
369 | struct acpi_walk_state *walk_state); | ||
370 | 269 | ||
371 | acpi_status | 270 | acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state); |
372 | acpi_ex_opcode_2A_1T_1R ( | ||
373 | struct acpi_walk_state *walk_state); | ||
374 | |||
375 | acpi_status | ||
376 | acpi_ex_opcode_2A_2T_1R ( | ||
377 | struct acpi_walk_state *walk_state); | ||
378 | 271 | ||
272 | acpi_status acpi_ex_opcode_2A_2T_1R(struct acpi_walk_state *walk_state); | ||
379 | 273 | ||
380 | /* | 274 | /* |
381 | * exoparg3 - ACPI AML execution, 3 operands | 275 | * exoparg3 - ACPI AML execution, 3 operands |
382 | */ | 276 | */ |
383 | acpi_status | 277 | acpi_status acpi_ex_opcode_3A_0T_0R(struct acpi_walk_state *walk_state); |
384 | acpi_ex_opcode_3A_0T_0R ( | ||
385 | struct acpi_walk_state *walk_state); | ||
386 | |||
387 | acpi_status | ||
388 | acpi_ex_opcode_3A_1T_1R ( | ||
389 | struct acpi_walk_state *walk_state); | ||
390 | 278 | ||
279 | acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state); | ||
391 | 280 | ||
392 | /* | 281 | /* |
393 | * exoparg6 - ACPI AML execution, 6 operands | 282 | * exoparg6 - ACPI AML execution, 6 operands |
394 | */ | 283 | */ |
395 | acpi_status | 284 | acpi_status acpi_ex_opcode_6A_0T_1R(struct acpi_walk_state *walk_state); |
396 | acpi_ex_opcode_6A_0T_1R ( | ||
397 | struct acpi_walk_state *walk_state); | ||
398 | |||
399 | 285 | ||
400 | /* | 286 | /* |
401 | * exresolv - Object resolution and get value functions | 287 | * exresolv - Object resolution and get value functions |
402 | */ | 288 | */ |
403 | acpi_status | 289 | acpi_status |
404 | acpi_ex_resolve_to_value ( | 290 | acpi_ex_resolve_to_value(union acpi_operand_object **stack_ptr, |
405 | union acpi_operand_object **stack_ptr, | 291 | struct acpi_walk_state *walk_state); |
406 | struct acpi_walk_state *walk_state); | ||
407 | 292 | ||
408 | acpi_status | 293 | acpi_status |
409 | acpi_ex_resolve_multiple ( | 294 | acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state, |
410 | struct acpi_walk_state *walk_state, | 295 | union acpi_operand_object *operand, |
411 | union acpi_operand_object *operand, | 296 | acpi_object_type * return_type, |
412 | acpi_object_type *return_type, | 297 | union acpi_operand_object **return_desc); |
413 | union acpi_operand_object **return_desc); | ||
414 | |||
415 | 298 | ||
416 | /* | 299 | /* |
417 | * exresnte - resolve namespace node | 300 | * exresnte - resolve namespace node |
418 | */ | 301 | */ |
419 | acpi_status | 302 | acpi_status |
420 | acpi_ex_resolve_node_to_value ( | 303 | acpi_ex_resolve_node_to_value(struct acpi_namespace_node **stack_ptr, |
421 | struct acpi_namespace_node **stack_ptr, | 304 | struct acpi_walk_state *walk_state); |
422 | struct acpi_walk_state *walk_state); | ||
423 | |||
424 | 305 | ||
425 | /* | 306 | /* |
426 | * exresop - resolve operand to value | 307 | * exresop - resolve operand to value |
427 | */ | 308 | */ |
428 | acpi_status | 309 | acpi_status |
429 | acpi_ex_resolve_operands ( | 310 | acpi_ex_resolve_operands(u16 opcode, |
430 | u16 opcode, | 311 | union acpi_operand_object **stack_ptr, |
431 | union acpi_operand_object **stack_ptr, | 312 | struct acpi_walk_state *walk_state); |
432 | struct acpi_walk_state *walk_state); | ||
433 | |||
434 | 313 | ||
435 | /* | 314 | /* |
436 | * exdump - Interpreter debug output routines | 315 | * exdump - Interpreter debug output routines |
437 | */ | 316 | */ |
438 | void | 317 | void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth); |
439 | acpi_ex_dump_operand ( | ||
440 | union acpi_operand_object *obj_desc, | ||
441 | u32 depth); | ||
442 | 318 | ||
443 | void | 319 | void |
444 | acpi_ex_dump_operands ( | 320 | acpi_ex_dump_operands(union acpi_operand_object **operands, |
445 | union acpi_operand_object **operands, | 321 | acpi_interpreter_mode interpreter_mode, |
446 | acpi_interpreter_mode interpreter_mode, | 322 | char *ident, |
447 | char *ident, | 323 | u32 num_levels, |
448 | u32 num_levels, | 324 | char *note, char *module_name, u32 line_number); |
449 | char *note, | ||
450 | char *module_name, | ||
451 | u32 line_number); | ||
452 | 325 | ||
453 | #ifdef ACPI_FUTURE_USAGE | 326 | #ifdef ACPI_FUTURE_USAGE |
454 | void | 327 | void |
455 | acpi_ex_dump_object_descriptor ( | 328 | acpi_ex_dump_object_descriptor(union acpi_operand_object *object, u32 flags); |
456 | union acpi_operand_object *object, | ||
457 | u32 flags); | ||
458 | |||
459 | void | ||
460 | acpi_ex_dump_node ( | ||
461 | struct acpi_namespace_node *node, | ||
462 | u32 flags); | ||
463 | #endif /* ACPI_FUTURE_USAGE */ | ||
464 | 329 | ||
330 | void acpi_ex_dump_node(struct acpi_namespace_node *node, u32 flags); | ||
331 | #endif /* ACPI_FUTURE_USAGE */ | ||
465 | 332 | ||
466 | /* | 333 | /* |
467 | * exnames - AML namestring support | 334 | * exnames - AML namestring support |
468 | */ | 335 | */ |
469 | acpi_status | 336 | acpi_status |
470 | acpi_ex_get_name_string ( | 337 | acpi_ex_get_name_string(acpi_object_type data_type, |
471 | acpi_object_type data_type, | 338 | u8 * in_aml_address, |
472 | u8 *in_aml_address, | 339 | char **out_name_string, u32 * out_name_length); |
473 | char **out_name_string, | ||
474 | u32 *out_name_length); | ||
475 | |||
476 | 340 | ||
477 | /* | 341 | /* |
478 | * exstore - Object store support | 342 | * exstore - Object store support |
479 | */ | 343 | */ |
480 | acpi_status | 344 | acpi_status |
481 | acpi_ex_store ( | 345 | acpi_ex_store(union acpi_operand_object *val_desc, |
482 | union acpi_operand_object *val_desc, | 346 | union acpi_operand_object *dest_desc, |
483 | union acpi_operand_object *dest_desc, | 347 | struct acpi_walk_state *walk_state); |
484 | struct acpi_walk_state *walk_state); | ||
485 | 348 | ||
486 | acpi_status | 349 | acpi_status |
487 | acpi_ex_store_object_to_node ( | 350 | acpi_ex_store_object_to_node(union acpi_operand_object *source_desc, |
488 | union acpi_operand_object *source_desc, | 351 | struct acpi_namespace_node *node, |
489 | struct acpi_namespace_node *node, | 352 | struct acpi_walk_state *walk_state, |
490 | struct acpi_walk_state *walk_state, | 353 | u8 implicit_conversion); |
491 | u8 implicit_conversion); | ||
492 | 354 | ||
493 | #define ACPI_IMPLICIT_CONVERSION TRUE | 355 | #define ACPI_IMPLICIT_CONVERSION TRUE |
494 | #define ACPI_NO_IMPLICIT_CONVERSION FALSE | 356 | #define ACPI_NO_IMPLICIT_CONVERSION FALSE |
495 | 357 | ||
496 | |||
497 | /* | 358 | /* |
498 | * exstoren - resolve/store object | 359 | * exstoren - resolve/store object |
499 | */ | 360 | */ |
500 | acpi_status | 361 | acpi_status |
501 | acpi_ex_resolve_object ( | 362 | acpi_ex_resolve_object(union acpi_operand_object **source_desc_ptr, |
502 | union acpi_operand_object **source_desc_ptr, | 363 | acpi_object_type target_type, |
503 | acpi_object_type target_type, | 364 | struct acpi_walk_state *walk_state); |
504 | struct acpi_walk_state *walk_state); | ||
505 | 365 | ||
506 | acpi_status | 366 | acpi_status |
507 | acpi_ex_store_object_to_object ( | 367 | acpi_ex_store_object_to_object(union acpi_operand_object *source_desc, |
508 | union acpi_operand_object *source_desc, | 368 | union acpi_operand_object *dest_desc, |
509 | union acpi_operand_object *dest_desc, | 369 | union acpi_operand_object **new_desc, |
510 | union acpi_operand_object **new_desc, | 370 | struct acpi_walk_state *walk_state); |
511 | struct acpi_walk_state *walk_state); | ||
512 | |||
513 | 371 | ||
514 | /* | 372 | /* |
515 | * exstorob - store object - buffer/string | 373 | * exstorob - store object - buffer/string |
516 | */ | 374 | */ |
517 | acpi_status | 375 | acpi_status |
518 | acpi_ex_store_buffer_to_buffer ( | 376 | acpi_ex_store_buffer_to_buffer(union acpi_operand_object *source_desc, |
519 | union acpi_operand_object *source_desc, | 377 | union acpi_operand_object *target_desc); |
520 | union acpi_operand_object *target_desc); | ||
521 | 378 | ||
522 | acpi_status | 379 | acpi_status |
523 | acpi_ex_store_string_to_string ( | 380 | acpi_ex_store_string_to_string(union acpi_operand_object *source_desc, |
524 | union acpi_operand_object *source_desc, | 381 | union acpi_operand_object *target_desc); |
525 | union acpi_operand_object *target_desc); | ||
526 | |||
527 | 382 | ||
528 | /* | 383 | /* |
529 | * excopy - object copy | 384 | * excopy - object copy |
530 | */ | 385 | */ |
531 | acpi_status | 386 | acpi_status |
532 | acpi_ex_copy_integer_to_index_field ( | 387 | acpi_ex_copy_integer_to_index_field(union acpi_operand_object *source_desc, |
533 | union acpi_operand_object *source_desc, | 388 | union acpi_operand_object *target_desc); |
534 | union acpi_operand_object *target_desc); | ||
535 | 389 | ||
536 | acpi_status | 390 | acpi_status |
537 | acpi_ex_copy_integer_to_bank_field ( | 391 | acpi_ex_copy_integer_to_bank_field(union acpi_operand_object *source_desc, |
538 | union acpi_operand_object *source_desc, | 392 | union acpi_operand_object *target_desc); |
539 | union acpi_operand_object *target_desc); | ||
540 | 393 | ||
541 | acpi_status | 394 | acpi_status |
542 | acpi_ex_copy_data_to_named_field ( | 395 | acpi_ex_copy_data_to_named_field(union acpi_operand_object *source_desc, |
543 | union acpi_operand_object *source_desc, | 396 | struct acpi_namespace_node *node); |
544 | struct acpi_namespace_node *node); | ||
545 | 397 | ||
546 | acpi_status | 398 | acpi_status |
547 | acpi_ex_copy_integer_to_buffer_field ( | 399 | acpi_ex_copy_integer_to_buffer_field(union acpi_operand_object *source_desc, |
548 | union acpi_operand_object *source_desc, | 400 | union acpi_operand_object *target_desc); |
549 | union acpi_operand_object *target_desc); | ||
550 | |||
551 | 401 | ||
552 | /* | 402 | /* |
553 | * exutils - interpreter/scanner utilities | 403 | * exutils - interpreter/scanner utilities |
554 | */ | 404 | */ |
555 | acpi_status | 405 | acpi_status acpi_ex_enter_interpreter(void); |
556 | acpi_ex_enter_interpreter ( | ||
557 | void); | ||
558 | 406 | ||
559 | void | 407 | void acpi_ex_exit_interpreter(void); |
560 | acpi_ex_exit_interpreter ( | ||
561 | void); | ||
562 | 408 | ||
563 | void | 409 | void acpi_ex_truncate_for32bit_table(union acpi_operand_object *obj_desc); |
564 | acpi_ex_truncate_for32bit_table ( | ||
565 | union acpi_operand_object *obj_desc); | ||
566 | 410 | ||
567 | u8 | 411 | u8 acpi_ex_acquire_global_lock(u32 rule); |
568 | acpi_ex_acquire_global_lock ( | ||
569 | u32 rule); | ||
570 | 412 | ||
571 | void | 413 | void acpi_ex_release_global_lock(u8 locked); |
572 | acpi_ex_release_global_lock ( | ||
573 | u8 locked); | ||
574 | 414 | ||
575 | void | 415 | void acpi_ex_eisa_id_to_string(u32 numeric_id, char *out_string); |
576 | acpi_ex_eisa_id_to_string ( | ||
577 | u32 numeric_id, | ||
578 | char *out_string); | ||
579 | |||
580 | void | ||
581 | acpi_ex_unsigned_integer_to_string ( | ||
582 | acpi_integer value, | ||
583 | char *out_string); | ||
584 | 416 | ||
417 | void acpi_ex_unsigned_integer_to_string(acpi_integer value, char *out_string); | ||
585 | 418 | ||
586 | /* | 419 | /* |
587 | * exregion - default op_region handlers | 420 | * exregion - default op_region handlers |
588 | */ | 421 | */ |
589 | acpi_status | 422 | acpi_status |
590 | acpi_ex_system_memory_space_handler ( | 423 | acpi_ex_system_memory_space_handler(u32 function, |
591 | u32 function, | 424 | acpi_physical_address address, |
592 | acpi_physical_address address, | 425 | u32 bit_width, |
593 | u32 bit_width, | 426 | acpi_integer * value, |
594 | acpi_integer *value, | 427 | void *handler_context, |
595 | void *handler_context, | 428 | void *region_context); |
596 | void *region_context); | 429 | |
597 | 430 | acpi_status | |
598 | acpi_status | 431 | acpi_ex_system_io_space_handler(u32 function, |
599 | acpi_ex_system_io_space_handler ( | 432 | acpi_physical_address address, |
600 | u32 function, | 433 | u32 bit_width, |
601 | acpi_physical_address address, | 434 | acpi_integer * value, |
602 | u32 bit_width, | 435 | void *handler_context, void *region_context); |
603 | acpi_integer *value, | 436 | |
604 | void *handler_context, | 437 | acpi_status |
605 | void *region_context); | 438 | acpi_ex_pci_config_space_handler(u32 function, |
606 | 439 | acpi_physical_address address, | |
607 | acpi_status | 440 | u32 bit_width, |
608 | acpi_ex_pci_config_space_handler ( | 441 | acpi_integer * value, |
609 | u32 function, | 442 | void *handler_context, void *region_context); |
610 | acpi_physical_address address, | 443 | |
611 | u32 bit_width, | 444 | acpi_status |
612 | acpi_integer *value, | 445 | acpi_ex_cmos_space_handler(u32 function, |
613 | void *handler_context, | 446 | acpi_physical_address address, |
614 | void *region_context); | 447 | u32 bit_width, |
615 | 448 | acpi_integer * value, | |
616 | acpi_status | 449 | void *handler_context, void *region_context); |
617 | acpi_ex_cmos_space_handler ( | 450 | |
618 | u32 function, | 451 | acpi_status |
619 | acpi_physical_address address, | 452 | acpi_ex_pci_bar_space_handler(u32 function, |
620 | u32 bit_width, | 453 | acpi_physical_address address, |
621 | acpi_integer *value, | 454 | u32 bit_width, |
622 | void *handler_context, | 455 | acpi_integer * value, |
623 | void *region_context); | 456 | void *handler_context, void *region_context); |
624 | 457 | ||
625 | acpi_status | 458 | acpi_status |
626 | acpi_ex_pci_bar_space_handler ( | 459 | acpi_ex_embedded_controller_space_handler(u32 function, |
627 | u32 function, | 460 | acpi_physical_address address, |
628 | acpi_physical_address address, | 461 | u32 bit_width, |
629 | u32 bit_width, | 462 | acpi_integer * value, |
630 | acpi_integer *value, | 463 | void *handler_context, |
631 | void *handler_context, | 464 | void *region_context); |
632 | void *region_context); | 465 | |
633 | 466 | acpi_status | |
634 | acpi_status | 467 | acpi_ex_sm_bus_space_handler(u32 function, |
635 | acpi_ex_embedded_controller_space_handler ( | 468 | acpi_physical_address address, |
636 | u32 function, | 469 | u32 bit_width, |
637 | acpi_physical_address address, | 470 | acpi_integer * value, |
638 | u32 bit_width, | 471 | void *handler_context, void *region_context); |
639 | acpi_integer *value, | 472 | |
640 | void *handler_context, | 473 | acpi_status |
641 | void *region_context); | 474 | acpi_ex_data_table_space_handler(u32 function, |
642 | 475 | acpi_physical_address address, | |
643 | acpi_status | 476 | u32 bit_width, |
644 | acpi_ex_sm_bus_space_handler ( | 477 | acpi_integer * value, |
645 | u32 function, | 478 | void *handler_context, void *region_context); |
646 | acpi_physical_address address, | 479 | |
647 | u32 bit_width, | 480 | #endif /* __INTERP_H__ */ |
648 | acpi_integer *value, | ||
649 | void *handler_context, | ||
650 | void *region_context); | ||
651 | |||
652 | |||
653 | acpi_status | ||
654 | acpi_ex_data_table_space_handler ( | ||
655 | u32 function, | ||
656 | acpi_physical_address address, | ||
657 | u32 bit_width, | ||
658 | acpi_integer *value, | ||
659 | void *handler_context, | ||
660 | void *region_context); | ||
661 | |||
662 | #endif /* __INTERP_H__ */ | ||
diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h index 4d2635698e10..9fba0fddda90 100644 --- a/include/acpi/aclocal.h +++ b/include/acpi/aclocal.h | |||
@@ -44,24 +44,20 @@ | |||
44 | #ifndef __ACLOCAL_H__ | 44 | #ifndef __ACLOCAL_H__ |
45 | #define __ACLOCAL_H__ | 45 | #define __ACLOCAL_H__ |
46 | 46 | ||
47 | #define ACPI_WAIT_FOREVER 0xFFFF /* u16, as per ACPI spec */ | ||
47 | 48 | ||
48 | #define ACPI_WAIT_FOREVER 0xFFFF /* u16, as per ACPI spec */ | 49 | typedef void *acpi_mutex; |
49 | 50 | typedef u32 acpi_mutex_handle; | |
50 | typedef void * acpi_mutex; | ||
51 | typedef u32 acpi_mutex_handle; | ||
52 | |||
53 | 51 | ||
54 | /* Total number of aml opcodes defined */ | 52 | /* Total number of aml opcodes defined */ |
55 | 53 | ||
56 | #define AML_NUM_OPCODES 0x7F | 54 | #define AML_NUM_OPCODES 0x7F |
57 | 55 | ||
58 | |||
59 | /* Forward declarations */ | 56 | /* Forward declarations */ |
60 | 57 | ||
61 | struct acpi_walk_state ; | 58 | struct acpi_walk_state; |
62 | struct acpi_obj_mutex; | 59 | struct acpi_obj_mutex; |
63 | union acpi_parse_object ; | 60 | union acpi_parse_object; |
64 | |||
65 | 61 | ||
66 | /***************************************************************************** | 62 | /***************************************************************************** |
67 | * | 63 | * |
@@ -69,7 +65,6 @@ union acpi_parse_object ; | |||
69 | * | 65 | * |
70 | ****************************************************************************/ | 66 | ****************************************************************************/ |
71 | 67 | ||
72 | |||
73 | /* | 68 | /* |
74 | * Predefined handles for the mutex objects used within the subsystem | 69 | * Predefined handles for the mutex objects used within the subsystem |
75 | * All mutex objects are automatically created by acpi_ut_mutex_initialize. | 70 | * All mutex objects are automatically created by acpi_ut_mutex_initialize. |
@@ -96,14 +91,12 @@ union acpi_parse_object ; | |||
96 | #define MAX_MUTEX 12 | 91 | #define MAX_MUTEX 12 |
97 | #define NUM_MUTEX MAX_MUTEX+1 | 92 | #define NUM_MUTEX MAX_MUTEX+1 |
98 | 93 | ||
99 | |||
100 | #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) | 94 | #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) |
101 | #ifdef DEFINE_ACPI_GLOBALS | 95 | #ifdef DEFINE_ACPI_GLOBALS |
102 | 96 | ||
103 | /* Names for the mutexes used in the subsystem */ | 97 | /* Names for the mutexes used in the subsystem */ |
104 | 98 | ||
105 | static char *acpi_gbl_mutex_names[] = | 99 | static char *acpi_gbl_mutex_names[] = { |
106 | { | ||
107 | "ACPI_MTX_Execute", | 100 | "ACPI_MTX_Execute", |
108 | "ACPI_MTX_Interpreter", | 101 | "ACPI_MTX_Interpreter", |
109 | "ACPI_MTX_Parser", | 102 | "ACPI_MTX_Parser", |
@@ -122,10 +115,9 @@ static char *acpi_gbl_mutex_names[] = | |||
122 | #endif | 115 | #endif |
123 | #endif | 116 | #endif |
124 | 117 | ||
125 | |||
126 | /* Owner IDs are used to track namespace nodes for selective deletion */ | 118 | /* Owner IDs are used to track namespace nodes for selective deletion */ |
127 | 119 | ||
128 | typedef u8 acpi_owner_id; | 120 | typedef u8 acpi_owner_id; |
129 | #define ACPI_OWNER_ID_MAX 0xFF | 121 | #define ACPI_OWNER_ID_MAX 0xFF |
130 | 122 | ||
131 | /* This Thread ID means that the mutex is not in use (unlocked) */ | 123 | /* This Thread ID means that the mutex is not in use (unlocked) */ |
@@ -134,20 +126,17 @@ typedef u8 acpi_owner_id; | |||
134 | 126 | ||
135 | /* Table for the global mutexes */ | 127 | /* Table for the global mutexes */ |
136 | 128 | ||
137 | struct acpi_mutex_info | 129 | struct acpi_mutex_info { |
138 | { | 130 | acpi_mutex mutex; |
139 | acpi_mutex mutex; | 131 | u32 use_count; |
140 | u32 use_count; | 132 | u32 thread_id; |
141 | u32 thread_id; | ||
142 | }; | 133 | }; |
143 | 134 | ||
144 | |||
145 | /* Lock flag parameter for various interfaces */ | 135 | /* Lock flag parameter for various interfaces */ |
146 | 136 | ||
147 | #define ACPI_MTX_DO_NOT_LOCK 0 | 137 | #define ACPI_MTX_DO_NOT_LOCK 0 |
148 | #define ACPI_MTX_LOCK 1 | 138 | #define ACPI_MTX_LOCK 1 |
149 | 139 | ||
150 | |||
151 | /* Field access granularities */ | 140 | /* Field access granularities */ |
152 | 141 | ||
153 | #define ACPI_FIELD_BYTE_GRANULARITY 1 | 142 | #define ACPI_FIELD_BYTE_GRANULARITY 1 |
@@ -155,7 +144,6 @@ struct acpi_mutex_info | |||
155 | #define ACPI_FIELD_DWORD_GRANULARITY 4 | 144 | #define ACPI_FIELD_DWORD_GRANULARITY 4 |
156 | #define ACPI_FIELD_QWORD_GRANULARITY 8 | 145 | #define ACPI_FIELD_QWORD_GRANULARITY 8 |
157 | 146 | ||
158 | |||
159 | /***************************************************************************** | 147 | /***************************************************************************** |
160 | * | 148 | * |
161 | * Namespace typedefs and structs | 149 | * Namespace typedefs and structs |
@@ -164,15 +152,12 @@ struct acpi_mutex_info | |||
164 | 152 | ||
165 | /* Operational modes of the AML interpreter/scanner */ | 153 | /* Operational modes of the AML interpreter/scanner */ |
166 | 154 | ||
167 | typedef enum | 155 | typedef enum { |
168 | { | 156 | ACPI_IMODE_LOAD_PASS1 = 0x01, |
169 | ACPI_IMODE_LOAD_PASS1 = 0x01, | 157 | ACPI_IMODE_LOAD_PASS2 = 0x02, |
170 | ACPI_IMODE_LOAD_PASS2 = 0x02, | 158 | ACPI_IMODE_EXECUTE = 0x0E |
171 | ACPI_IMODE_EXECUTE = 0x0E | ||
172 | |||
173 | } acpi_interpreter_mode; | 159 | } acpi_interpreter_mode; |
174 | 160 | ||
175 | |||
176 | /* | 161 | /* |
177 | * The Node describes a named object that appears in the AML | 162 | * The Node describes a named object that appears in the AML |
178 | * An acpi_node is used to store Nodes. | 163 | * An acpi_node is used to store Nodes. |
@@ -180,41 +165,37 @@ typedef enum | |||
180 | * data_type is used to differentiate between internal descriptors, and MUST | 165 | * data_type is used to differentiate between internal descriptors, and MUST |
181 | * be the first byte in this structure. | 166 | * be the first byte in this structure. |
182 | */ | 167 | */ |
183 | union acpi_name_union | 168 | union acpi_name_union { |
184 | { | 169 | u32 integer; |
185 | u32 integer; | 170 | char ascii[4]; |
186 | char ascii[4]; | 171 | }; |
187 | }; | 172 | |
188 | 173 | struct acpi_namespace_node { | |
189 | struct acpi_namespace_node | 174 | u8 descriptor; /* Used to differentiate object descriptor types */ |
190 | { | 175 | u8 type; /* Type associated with this name */ |
191 | u8 descriptor; /* Used to differentiate object descriptor types */ | 176 | u16 reference_count; /* Current count of references and children */ |
192 | u8 type; /* Type associated with this name */ | 177 | union acpi_name_union name; /* ACPI Name, always 4 chars per ACPI spec */ |
193 | u16 reference_count; /* Current count of references and children */ | 178 | union acpi_operand_object *object; /* Pointer to attached ACPI object (optional) */ |
194 | union acpi_name_union name; /* ACPI Name, always 4 chars per ACPI spec */ | 179 | struct acpi_namespace_node *child; /* First child */ |
195 | union acpi_operand_object *object; /* Pointer to attached ACPI object (optional) */ | 180 | struct acpi_namespace_node *peer; /* Next peer */ |
196 | struct acpi_namespace_node *child; /* First child */ | 181 | u8 owner_id; /* Who created this node */ |
197 | struct acpi_namespace_node *peer; /* Next peer*/ | 182 | u8 flags; |
198 | u8 owner_id; /* Who created this node */ | ||
199 | u8 flags; | ||
200 | 183 | ||
201 | /* Fields used by the ASL compiler only */ | 184 | /* Fields used by the ASL compiler only */ |
202 | 185 | ||
203 | #ifdef ACPI_ASL_COMPILER | 186 | #ifdef ACPI_ASL_COMPILER |
204 | u32 value; | 187 | u32 value; |
205 | union acpi_parse_object *op; | 188 | union acpi_parse_object *op; |
206 | #endif | 189 | #endif |
207 | }; | 190 | }; |
208 | 191 | ||
209 | |||
210 | #define ACPI_ENTRY_NOT_FOUND NULL | 192 | #define ACPI_ENTRY_NOT_FOUND NULL |
211 | 193 | ||
212 | |||
213 | /* Node flags */ | 194 | /* Node flags */ |
214 | 195 | ||
215 | #define ANOBJ_RESERVED 0x01 | 196 | #define ANOBJ_RESERVED 0x01 |
216 | #define ANOBJ_END_OF_PEER_LIST 0x02 | 197 | #define ANOBJ_END_OF_PEER_LIST 0x02 |
217 | #define ANOBJ_DATA_WIDTH_32 0x04 /* Parent table is 64-bits */ | 198 | #define ANOBJ_DATA_WIDTH_32 0x04 /* Parent table is 64-bits */ |
218 | #define ANOBJ_METHOD_ARG 0x08 | 199 | #define ANOBJ_METHOD_ARG 0x08 |
219 | #define ANOBJ_METHOD_LOCAL 0x10 | 200 | #define ANOBJ_METHOD_LOCAL 0x10 |
220 | #define ANOBJ_METHOD_NO_RETVAL 0x20 | 201 | #define ANOBJ_METHOD_NO_RETVAL 0x20 |
@@ -224,91 +205,77 @@ struct acpi_namespace_node | |||
224 | /* | 205 | /* |
225 | * ACPI Table Descriptor. One per ACPI table | 206 | * ACPI Table Descriptor. One per ACPI table |
226 | */ | 207 | */ |
227 | struct acpi_table_desc | 208 | struct acpi_table_desc { |
228 | { | 209 | struct acpi_table_desc *prev; |
229 | struct acpi_table_desc *prev; | 210 | struct acpi_table_desc *next; |
230 | struct acpi_table_desc *next; | 211 | struct acpi_table_desc *installed_desc; |
231 | struct acpi_table_desc *installed_desc; | 212 | struct acpi_table_header *pointer; |
232 | struct acpi_table_header *pointer; | 213 | u8 *aml_start; |
233 | u8 *aml_start; | 214 | u64 physical_address; |
234 | u64 physical_address; | 215 | u32 aml_length; |
235 | u32 aml_length; | 216 | acpi_size length; |
236 | acpi_size length; | 217 | acpi_owner_id owner_id; |
237 | acpi_owner_id owner_id; | 218 | u8 type; |
238 | u8 type; | 219 | u8 allocation; |
239 | u8 allocation; | 220 | u8 loaded_into_namespace; |
240 | u8 loaded_into_namespace; | ||
241 | }; | 221 | }; |
242 | 222 | ||
243 | struct acpi_table_list | 223 | struct acpi_table_list { |
244 | { | 224 | struct acpi_table_desc *next; |
245 | struct acpi_table_desc *next; | 225 | u32 count; |
246 | u32 count; | ||
247 | }; | 226 | }; |
248 | 227 | ||
249 | 228 | struct acpi_find_context { | |
250 | struct acpi_find_context | 229 | char *search_for; |
251 | { | 230 | acpi_handle *list; |
252 | char *search_for; | 231 | u32 *count; |
253 | acpi_handle *list; | ||
254 | u32 *count; | ||
255 | }; | 232 | }; |
256 | 233 | ||
257 | 234 | struct acpi_ns_search_data { | |
258 | struct acpi_ns_search_data | 235 | struct acpi_namespace_node *node; |
259 | { | ||
260 | struct acpi_namespace_node *node; | ||
261 | }; | 236 | }; |
262 | 237 | ||
263 | |||
264 | /* | 238 | /* |
265 | * Predefined Namespace items | 239 | * Predefined Namespace items |
266 | */ | 240 | */ |
267 | struct acpi_predefined_names | 241 | struct acpi_predefined_names { |
268 | { | 242 | char *name; |
269 | char *name; | 243 | u8 type; |
270 | u8 type; | 244 | char *val; |
271 | char *val; | ||
272 | }; | 245 | }; |
273 | 246 | ||
274 | |||
275 | /* Object types used during package copies */ | 247 | /* Object types used during package copies */ |
276 | 248 | ||
277 | |||
278 | #define ACPI_COPY_TYPE_SIMPLE 0 | 249 | #define ACPI_COPY_TYPE_SIMPLE 0 |
279 | #define ACPI_COPY_TYPE_PACKAGE 1 | 250 | #define ACPI_COPY_TYPE_PACKAGE 1 |
280 | 251 | ||
281 | /* Info structure used to convert external<->internal namestrings */ | 252 | /* Info structure used to convert external<->internal namestrings */ |
282 | 253 | ||
283 | struct acpi_namestring_info | 254 | struct acpi_namestring_info { |
284 | { | 255 | char *external_name; |
285 | char *external_name; | 256 | char *next_external_char; |
286 | char *next_external_char; | 257 | char *internal_name; |
287 | char *internal_name; | 258 | u32 length; |
288 | u32 length; | 259 | u32 num_segments; |
289 | u32 num_segments; | 260 | u32 num_carats; |
290 | u32 num_carats; | 261 | u8 fully_qualified; |
291 | u8 fully_qualified; | ||
292 | }; | 262 | }; |
293 | 263 | ||
294 | |||
295 | /* Field creation info */ | 264 | /* Field creation info */ |
296 | 265 | ||
297 | struct acpi_create_field_info | 266 | struct acpi_create_field_info { |
298 | { | 267 | struct acpi_namespace_node *region_node; |
299 | struct acpi_namespace_node *region_node; | 268 | struct acpi_namespace_node *field_node; |
300 | struct acpi_namespace_node *field_node; | 269 | struct acpi_namespace_node *register_node; |
301 | struct acpi_namespace_node *register_node; | 270 | struct acpi_namespace_node *data_register_node; |
302 | struct acpi_namespace_node *data_register_node; | 271 | u32 bank_value; |
303 | u32 bank_value; | 272 | u32 field_bit_position; |
304 | u32 field_bit_position; | 273 | u32 field_bit_length; |
305 | u32 field_bit_length; | 274 | u8 field_flags; |
306 | u8 field_flags; | 275 | u8 attribute; |
307 | u8 attribute; | 276 | u8 field_type; |
308 | u8 field_type; | ||
309 | }; | 277 | }; |
310 | 278 | ||
311 | |||
312 | /***************************************************************************** | 279 | /***************************************************************************** |
313 | * | 280 | * |
314 | * Event typedefs and structs | 281 | * Event typedefs and structs |
@@ -317,108 +284,95 @@ struct acpi_create_field_info | |||
317 | 284 | ||
318 | /* Dispatch info for each GPE -- either a method or handler, cannot be both */ | 285 | /* Dispatch info for each GPE -- either a method or handler, cannot be both */ |
319 | 286 | ||
320 | struct acpi_handler_info | 287 | struct acpi_handler_info { |
321 | { | 288 | acpi_event_handler address; /* Address of handler, if any */ |
322 | acpi_event_handler address; /* Address of handler, if any */ | 289 | void *context; /* Context to be passed to handler */ |
323 | void *context; /* Context to be passed to handler */ | 290 | struct acpi_namespace_node *method_node; /* Method node for this GPE level (saved) */ |
324 | struct acpi_namespace_node *method_node; /* Method node for this GPE level (saved) */ | ||
325 | }; | 291 | }; |
326 | 292 | ||
327 | union acpi_gpe_dispatch_info | 293 | union acpi_gpe_dispatch_info { |
328 | { | 294 | struct acpi_namespace_node *method_node; /* Method node for this GPE level */ |
329 | struct acpi_namespace_node *method_node; /* Method node for this GPE level */ | 295 | struct acpi_handler_info *handler; |
330 | struct acpi_handler_info *handler; | ||
331 | }; | 296 | }; |
332 | 297 | ||
333 | /* | 298 | /* |
334 | * Information about a GPE, one per each GPE in an array. | 299 | * Information about a GPE, one per each GPE in an array. |
335 | * NOTE: Important to keep this struct as small as possible. | 300 | * NOTE: Important to keep this struct as small as possible. |
336 | */ | 301 | */ |
337 | struct acpi_gpe_event_info | 302 | struct acpi_gpe_event_info { |
338 | { | 303 | union acpi_gpe_dispatch_info dispatch; /* Either Method or Handler */ |
339 | union acpi_gpe_dispatch_info dispatch; /* Either Method or Handler */ | 304 | struct acpi_gpe_register_info *register_info; /* Backpointer to register info */ |
340 | struct acpi_gpe_register_info *register_info; /* Backpointer to register info */ | 305 | u8 flags; /* Misc info about this GPE */ |
341 | u8 flags; /* Misc info about this GPE */ | 306 | u8 register_bit; /* This GPE bit within the register */ |
342 | u8 register_bit; /* This GPE bit within the register */ | ||
343 | }; | 307 | }; |
344 | 308 | ||
345 | /* Information about a GPE register pair, one per each status/enable pair in an array */ | 309 | /* Information about a GPE register pair, one per each status/enable pair in an array */ |
346 | 310 | ||
347 | struct acpi_gpe_register_info | 311 | struct acpi_gpe_register_info { |
348 | { | 312 | struct acpi_generic_address status_address; /* Address of status reg */ |
349 | struct acpi_generic_address status_address; /* Address of status reg */ | 313 | struct acpi_generic_address enable_address; /* Address of enable reg */ |
350 | struct acpi_generic_address enable_address; /* Address of enable reg */ | 314 | u8 enable_for_wake; /* GPEs to keep enabled when sleeping */ |
351 | u8 enable_for_wake; /* GPEs to keep enabled when sleeping */ | 315 | u8 enable_for_run; /* GPEs to keep enabled when running */ |
352 | u8 enable_for_run; /* GPEs to keep enabled when running */ | 316 | u8 base_gpe_number; /* Base GPE number for this register */ |
353 | u8 base_gpe_number; /* Base GPE number for this register */ | ||
354 | }; | 317 | }; |
355 | 318 | ||
356 | /* | 319 | /* |
357 | * Information about a GPE register block, one per each installed block -- | 320 | * Information about a GPE register block, one per each installed block -- |
358 | * GPE0, GPE1, and one per each installed GPE Block Device. | 321 | * GPE0, GPE1, and one per each installed GPE Block Device. |
359 | */ | 322 | */ |
360 | struct acpi_gpe_block_info | 323 | struct acpi_gpe_block_info { |
361 | { | 324 | struct acpi_namespace_node *node; |
362 | struct acpi_namespace_node *node; | 325 | struct acpi_gpe_block_info *previous; |
363 | struct acpi_gpe_block_info *previous; | 326 | struct acpi_gpe_block_info *next; |
364 | struct acpi_gpe_block_info *next; | 327 | struct acpi_gpe_xrupt_info *xrupt_block; /* Backpointer to interrupt block */ |
365 | struct acpi_gpe_xrupt_info *xrupt_block; /* Backpointer to interrupt block */ | 328 | struct acpi_gpe_register_info *register_info; /* One per GPE register pair */ |
366 | struct acpi_gpe_register_info *register_info; /* One per GPE register pair */ | 329 | struct acpi_gpe_event_info *event_info; /* One for each GPE */ |
367 | struct acpi_gpe_event_info *event_info; /* One for each GPE */ | 330 | struct acpi_generic_address block_address; /* Base address of the block */ |
368 | struct acpi_generic_address block_address; /* Base address of the block */ | 331 | u32 register_count; /* Number of register pairs in block */ |
369 | u32 register_count; /* Number of register pairs in block */ | 332 | u8 block_base_number; /* Base GPE number for this block */ |
370 | u8 block_base_number;/* Base GPE number for this block */ | ||
371 | }; | 333 | }; |
372 | 334 | ||
373 | /* Information about GPE interrupt handlers, one per each interrupt level used for GPEs */ | 335 | /* Information about GPE interrupt handlers, one per each interrupt level used for GPEs */ |
374 | 336 | ||
375 | struct acpi_gpe_xrupt_info | 337 | struct acpi_gpe_xrupt_info { |
376 | { | 338 | struct acpi_gpe_xrupt_info *previous; |
377 | struct acpi_gpe_xrupt_info *previous; | 339 | struct acpi_gpe_xrupt_info *next; |
378 | struct acpi_gpe_xrupt_info *next; | 340 | struct acpi_gpe_block_info *gpe_block_list_head; /* List of GPE blocks for this xrupt */ |
379 | struct acpi_gpe_block_info *gpe_block_list_head; /* List of GPE blocks for this xrupt */ | 341 | u32 interrupt_number; /* System interrupt number */ |
380 | u32 interrupt_number; /* System interrupt number */ | ||
381 | }; | 342 | }; |
382 | 343 | ||
383 | 344 | struct acpi_gpe_walk_info { | |
384 | struct acpi_gpe_walk_info | 345 | struct acpi_namespace_node *gpe_device; |
385 | { | 346 | struct acpi_gpe_block_info *gpe_block; |
386 | struct acpi_namespace_node *gpe_device; | ||
387 | struct acpi_gpe_block_info *gpe_block; | ||
388 | }; | 347 | }; |
389 | 348 | ||
390 | 349 | typedef acpi_status(*ACPI_GPE_CALLBACK) (struct acpi_gpe_xrupt_info * | |
391 | typedef acpi_status (*ACPI_GPE_CALLBACK) ( | 350 | gpe_xrupt_info, |
392 | struct acpi_gpe_xrupt_info *gpe_xrupt_info, | 351 | struct acpi_gpe_block_info * |
393 | struct acpi_gpe_block_info *gpe_block); | 352 | gpe_block); |
394 | |||
395 | 353 | ||
396 | /* Information about each particular fixed event */ | 354 | /* Information about each particular fixed event */ |
397 | 355 | ||
398 | struct acpi_fixed_event_handler | 356 | struct acpi_fixed_event_handler { |
399 | { | 357 | acpi_event_handler handler; /* Address of handler. */ |
400 | acpi_event_handler handler; /* Address of handler. */ | 358 | void *context; /* Context to be passed to handler */ |
401 | void *context; /* Context to be passed to handler */ | ||
402 | }; | 359 | }; |
403 | 360 | ||
404 | struct acpi_fixed_event_info | 361 | struct acpi_fixed_event_info { |
405 | { | 362 | u8 status_register_id; |
406 | u8 status_register_id; | 363 | u8 enable_register_id; |
407 | u8 enable_register_id; | 364 | u16 status_bit_mask; |
408 | u16 status_bit_mask; | 365 | u16 enable_bit_mask; |
409 | u16 enable_bit_mask; | ||
410 | }; | 366 | }; |
411 | 367 | ||
412 | /* Information used during field processing */ | 368 | /* Information used during field processing */ |
413 | 369 | ||
414 | struct acpi_field_info | 370 | struct acpi_field_info { |
415 | { | 371 | u8 skip_field; |
416 | u8 skip_field; | 372 | u8 field_flag; |
417 | u8 field_flag; | 373 | u32 pkg_length; |
418 | u32 pkg_length; | ||
419 | }; | 374 | }; |
420 | 375 | ||
421 | |||
422 | /***************************************************************************** | 376 | /***************************************************************************** |
423 | * | 377 | * |
424 | * Generic "state" object for stacks | 378 | * Generic "state" object for stacks |
@@ -431,7 +385,6 @@ struct acpi_field_info | |||
431 | #define ACPI_CONTROL_PREDICATE_FALSE 0xC3 | 385 | #define ACPI_CONTROL_PREDICATE_FALSE 0xC3 |
432 | #define ACPI_CONTROL_PREDICATE_TRUE 0xC4 | 386 | #define ACPI_CONTROL_PREDICATE_TRUE 0xC4 |
433 | 387 | ||
434 | |||
435 | #define ACPI_STATE_COMMON /* Two 32-bit fields and a pointer */\ | 388 | #define ACPI_STATE_COMMON /* Two 32-bit fields and a pointer */\ |
436 | u8 data_type; /* To differentiate various internal objs */\ | 389 | u8 data_type; /* To differentiate various internal objs */\ |
437 | u8 flags; \ | 390 | u8 flags; \ |
@@ -440,147 +393,112 @@ struct acpi_field_info | |||
440 | u16 reserved; \ | 393 | u16 reserved; \ |
441 | void *next; \ | 394 | void *next; \ |
442 | 395 | ||
443 | struct acpi_common_state | 396 | struct acpi_common_state { |
444 | { | 397 | ACPI_STATE_COMMON}; |
445 | ACPI_STATE_COMMON | ||
446 | }; | ||
447 | |||
448 | 398 | ||
449 | /* | 399 | /* |
450 | * Update state - used to traverse complex objects such as packages | 400 | * Update state - used to traverse complex objects such as packages |
451 | */ | 401 | */ |
452 | struct acpi_update_state | 402 | struct acpi_update_state { |
453 | { | 403 | ACPI_STATE_COMMON union acpi_operand_object *object; |
454 | ACPI_STATE_COMMON | ||
455 | union acpi_operand_object *object; | ||
456 | }; | 404 | }; |
457 | 405 | ||
458 | |||
459 | /* | 406 | /* |
460 | * Pkg state - used to traverse nested package structures | 407 | * Pkg state - used to traverse nested package structures |
461 | */ | 408 | */ |
462 | struct acpi_pkg_state | 409 | struct acpi_pkg_state { |
463 | { | 410 | ACPI_STATE_COMMON union acpi_operand_object *source_object; |
464 | ACPI_STATE_COMMON | 411 | union acpi_operand_object *dest_object; |
465 | union acpi_operand_object *source_object; | 412 | struct acpi_walk_state *walk_state; |
466 | union acpi_operand_object *dest_object; | 413 | void *this_target_obj; |
467 | struct acpi_walk_state *walk_state; | 414 | u32 num_packages; |
468 | void *this_target_obj; | 415 | u16 index; |
469 | u32 num_packages; | ||
470 | u16 index; | ||
471 | }; | 416 | }; |
472 | 417 | ||
473 | |||
474 | /* | 418 | /* |
475 | * Control state - one per if/else and while constructs. | 419 | * Control state - one per if/else and while constructs. |
476 | * Allows nesting of these constructs | 420 | * Allows nesting of these constructs |
477 | */ | 421 | */ |
478 | struct acpi_control_state | 422 | struct acpi_control_state { |
479 | { | 423 | ACPI_STATE_COMMON union acpi_parse_object *predicate_op; |
480 | ACPI_STATE_COMMON | 424 | u8 *aml_predicate_start; /* Start of if/while predicate */ |
481 | union acpi_parse_object *predicate_op; | 425 | u8 *package_end; /* End of if/while block */ |
482 | u8 *aml_predicate_start; /* Start of if/while predicate */ | 426 | u16 opcode; |
483 | u8 *package_end; /* End of if/while block */ | ||
484 | u16 opcode; | ||
485 | }; | 427 | }; |
486 | 428 | ||
487 | |||
488 | /* | 429 | /* |
489 | * Scope state - current scope during namespace lookups | 430 | * Scope state - current scope during namespace lookups |
490 | */ | 431 | */ |
491 | struct acpi_scope_state | 432 | struct acpi_scope_state { |
492 | { | 433 | ACPI_STATE_COMMON struct acpi_namespace_node *node; |
493 | ACPI_STATE_COMMON | ||
494 | struct acpi_namespace_node *node; | ||
495 | }; | 434 | }; |
496 | 435 | ||
497 | 436 | struct acpi_pscope_state { | |
498 | struct acpi_pscope_state | 437 | ACPI_STATE_COMMON union acpi_parse_object *op; /* Current op being parsed */ |
499 | { | 438 | u8 *arg_end; /* Current argument end */ |
500 | ACPI_STATE_COMMON | 439 | u8 *pkg_end; /* Current package end */ |
501 | union acpi_parse_object *op; /* Current op being parsed */ | 440 | u32 arg_list; /* Next argument to parse */ |
502 | u8 *arg_end; /* Current argument end */ | 441 | u32 arg_count; /* Number of fixed arguments */ |
503 | u8 *pkg_end; /* Current package end */ | ||
504 | u32 arg_list; /* Next argument to parse */ | ||
505 | u32 arg_count; /* Number of fixed arguments */ | ||
506 | }; | 442 | }; |
507 | 443 | ||
508 | |||
509 | /* | 444 | /* |
510 | * Thread state - one per thread across multiple walk states. Multiple walk | 445 | * Thread state - one per thread across multiple walk states. Multiple walk |
511 | * states are created when there are nested control methods executing. | 446 | * states are created when there are nested control methods executing. |
512 | */ | 447 | */ |
513 | struct acpi_thread_state | 448 | struct acpi_thread_state { |
514 | { | 449 | ACPI_STATE_COMMON struct acpi_walk_state *walk_state_list; /* Head of list of walk_states for this thread */ |
515 | ACPI_STATE_COMMON | 450 | union acpi_operand_object *acquired_mutex_list; /* List of all currently acquired mutexes */ |
516 | struct acpi_walk_state *walk_state_list; /* Head of list of walk_states for this thread */ | 451 | u32 thread_id; /* Running thread ID */ |
517 | union acpi_operand_object *acquired_mutex_list; /* List of all currently acquired mutexes */ | 452 | u8 current_sync_level; /* Mutex Sync (nested acquire) level */ |
518 | u32 thread_id; /* Running thread ID */ | ||
519 | u8 current_sync_level; /* Mutex Sync (nested acquire) level */ | ||
520 | }; | 453 | }; |
521 | 454 | ||
522 | |||
523 | /* | 455 | /* |
524 | * Result values - used to accumulate the results of nested | 456 | * Result values - used to accumulate the results of nested |
525 | * AML arguments | 457 | * AML arguments |
526 | */ | 458 | */ |
527 | struct acpi_result_values | 459 | struct acpi_result_values { |
528 | { | ||
529 | ACPI_STATE_COMMON | 460 | ACPI_STATE_COMMON |
530 | union acpi_operand_object *obj_desc [ACPI_OBJ_NUM_OPERANDS]; | 461 | union acpi_operand_object *obj_desc[ACPI_OBJ_NUM_OPERANDS]; |
531 | u8 num_results; | 462 | u8 num_results; |
532 | u8 last_insert; | 463 | u8 last_insert; |
533 | }; | 464 | }; |
534 | 465 | ||
535 | |||
536 | typedef | 466 | typedef |
537 | acpi_status (*acpi_parse_downwards) ( | 467 | acpi_status(*acpi_parse_downwards) (struct acpi_walk_state * walk_state, |
538 | struct acpi_walk_state *walk_state, | 468 | union acpi_parse_object ** out_op); |
539 | union acpi_parse_object **out_op); | ||
540 | |||
541 | typedef | ||
542 | acpi_status (*acpi_parse_upwards) ( | ||
543 | struct acpi_walk_state *walk_state); | ||
544 | 469 | ||
470 | typedef acpi_status(*acpi_parse_upwards) (struct acpi_walk_state * walk_state); | ||
545 | 471 | ||
546 | /* | 472 | /* |
547 | * Notify info - used to pass info to the deferred notify | 473 | * Notify info - used to pass info to the deferred notify |
548 | * handler/dispatcher. | 474 | * handler/dispatcher. |
549 | */ | 475 | */ |
550 | struct acpi_notify_info | 476 | struct acpi_notify_info { |
551 | { | 477 | ACPI_STATE_COMMON struct acpi_namespace_node *node; |
552 | ACPI_STATE_COMMON | 478 | union acpi_operand_object *handler_obj; |
553 | struct acpi_namespace_node *node; | ||
554 | union acpi_operand_object *handler_obj; | ||
555 | }; | 479 | }; |
556 | 480 | ||
557 | |||
558 | /* Generic state is union of structs above */ | 481 | /* Generic state is union of structs above */ |
559 | 482 | ||
560 | union acpi_generic_state | 483 | union acpi_generic_state { |
561 | { | 484 | struct acpi_common_state common; |
562 | struct acpi_common_state common; | 485 | struct acpi_control_state control; |
563 | struct acpi_control_state control; | 486 | struct acpi_update_state update; |
564 | struct acpi_update_state update; | 487 | struct acpi_scope_state scope; |
565 | struct acpi_scope_state scope; | 488 | struct acpi_pscope_state parse_scope; |
566 | struct acpi_pscope_state parse_scope; | 489 | struct acpi_pkg_state pkg; |
567 | struct acpi_pkg_state pkg; | 490 | struct acpi_thread_state thread; |
568 | struct acpi_thread_state thread; | 491 | struct acpi_result_values results; |
569 | struct acpi_result_values results; | 492 | struct acpi_notify_info notify; |
570 | struct acpi_notify_info notify; | ||
571 | }; | 493 | }; |
572 | 494 | ||
573 | |||
574 | /***************************************************************************** | 495 | /***************************************************************************** |
575 | * | 496 | * |
576 | * Interpreter typedefs and structs | 497 | * Interpreter typedefs and structs |
577 | * | 498 | * |
578 | ****************************************************************************/ | 499 | ****************************************************************************/ |
579 | 500 | ||
580 | typedef | 501 | typedef acpi_status(*ACPI_EXECUTE_OP) (struct acpi_walk_state * walk_state); |
581 | acpi_status (*ACPI_EXECUTE_OP) ( | ||
582 | struct acpi_walk_state *walk_state); | ||
583 | |||
584 | 502 | ||
585 | /***************************************************************************** | 503 | /***************************************************************************** |
586 | * | 504 | * |
@@ -591,28 +509,26 @@ acpi_status (*ACPI_EXECUTE_OP) ( | |||
591 | /* | 509 | /* |
592 | * AML opcode, name, and argument layout | 510 | * AML opcode, name, and argument layout |
593 | */ | 511 | */ |
594 | struct acpi_opcode_info | 512 | struct acpi_opcode_info { |
595 | { | ||
596 | #if defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUG_OUTPUT) | 513 | #if defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUG_OUTPUT) |
597 | char *name; /* Opcode name (disassembler/debug only) */ | 514 | char *name; /* Opcode name (disassembler/debug only) */ |
598 | #endif | 515 | #endif |
599 | u32 parse_args; /* Grammar/Parse time arguments */ | 516 | u32 parse_args; /* Grammar/Parse time arguments */ |
600 | u32 runtime_args; /* Interpret time arguments */ | 517 | u32 runtime_args; /* Interpret time arguments */ |
601 | u32 flags; /* Misc flags */ | 518 | u32 flags; /* Misc flags */ |
602 | u8 object_type; /* Corresponding internal object type */ | 519 | u8 object_type; /* Corresponding internal object type */ |
603 | u8 class; /* Opcode class */ | 520 | u8 class; /* Opcode class */ |
604 | u8 type; /* Opcode type */ | 521 | u8 type; /* Opcode type */ |
605 | }; | 522 | }; |
606 | 523 | ||
607 | union acpi_parse_value | 524 | union acpi_parse_value { |
608 | { | 525 | acpi_integer integer; /* Integer constant (Up to 64 bits) */ |
609 | acpi_integer integer; /* Integer constant (Up to 64 bits) */ | 526 | struct uint64_struct integer64; /* Structure overlay for 2 32-bit Dwords */ |
610 | struct uint64_struct integer64; /* Structure overlay for 2 32-bit Dwords */ | 527 | u32 size; /* bytelist or field size */ |
611 | u32 size; /* bytelist or field size */ | 528 | char *string; /* NULL terminated string */ |
612 | char *string; /* NULL terminated string */ | 529 | u8 *buffer; /* buffer or string */ |
613 | u8 *buffer; /* buffer or string */ | 530 | char *name; /* NULL terminated string */ |
614 | char *name; /* NULL terminated string */ | 531 | union acpi_parse_object *arg; /* arguments and contained ops */ |
615 | union acpi_parse_object *arg; /* arguments and contained ops */ | ||
616 | }; | 532 | }; |
617 | 533 | ||
618 | #define ACPI_PARSE_COMMON \ | 534 | #define ACPI_PARSE_COMMON \ |
@@ -641,84 +557,72 @@ union acpi_parse_value | |||
641 | /* | 557 | /* |
642 | * generic operation (for example: If, While, Store) | 558 | * generic operation (for example: If, While, Store) |
643 | */ | 559 | */ |
644 | struct acpi_parse_obj_common | 560 | struct acpi_parse_obj_common { |
645 | { | 561 | ACPI_PARSE_COMMON}; |
646 | ACPI_PARSE_COMMON | ||
647 | }; | ||
648 | |||
649 | 562 | ||
650 | /* | 563 | /* |
651 | * Extended Op for named ops (Scope, Method, etc.), deferred ops (Methods and op_regions), | 564 | * Extended Op for named ops (Scope, Method, etc.), deferred ops (Methods and op_regions), |
652 | * and bytelists. | 565 | * and bytelists. |
653 | */ | 566 | */ |
654 | struct acpi_parse_obj_named | 567 | struct acpi_parse_obj_named { |
655 | { | 568 | ACPI_PARSE_COMMON u8 * path; |
656 | ACPI_PARSE_COMMON | 569 | u8 *data; /* AML body or bytelist data */ |
657 | u8 *path; | 570 | u32 length; /* AML length */ |
658 | u8 *data; /* AML body or bytelist data */ | 571 | u32 name; /* 4-byte name or zero if no name */ |
659 | u32 length; /* AML length */ | ||
660 | u32 name; /* 4-byte name or zero if no name */ | ||
661 | }; | 572 | }; |
662 | 573 | ||
663 | |||
664 | /* The parse node is the fundamental element of the parse tree */ | 574 | /* The parse node is the fundamental element of the parse tree */ |
665 | 575 | ||
666 | struct acpi_parse_obj_asl | 576 | struct acpi_parse_obj_asl { |
667 | { | 577 | ACPI_PARSE_COMMON union acpi_parse_object *child; |
668 | ACPI_PARSE_COMMON | 578 | union acpi_parse_object *parent_method; |
669 | union acpi_parse_object *child; | 579 | char *filename; |
670 | union acpi_parse_object *parent_method; | 580 | char *external_name; |
671 | char *filename; | 581 | char *namepath; |
672 | char *external_name; | 582 | char name_seg[4]; |
673 | char *namepath; | 583 | u32 extra_value; |
674 | char name_seg[4]; | 584 | u32 column; |
675 | u32 extra_value; | 585 | u32 line_number; |
676 | u32 column; | 586 | u32 logical_line_number; |
677 | u32 line_number; | 587 | u32 logical_byte_offset; |
678 | u32 logical_line_number; | 588 | u32 end_line; |
679 | u32 logical_byte_offset; | 589 | u32 end_logical_line; |
680 | u32 end_line; | 590 | u32 acpi_btype; |
681 | u32 end_logical_line; | 591 | u32 aml_length; |
682 | u32 acpi_btype; | 592 | u32 aml_subtree_length; |
683 | u32 aml_length; | 593 | u32 final_aml_length; |
684 | u32 aml_subtree_length; | 594 | u32 final_aml_offset; |
685 | u32 final_aml_length; | 595 | u32 compile_flags; |
686 | u32 final_aml_offset; | 596 | u16 parse_opcode; |
687 | u32 compile_flags; | 597 | u8 aml_opcode_length; |
688 | u16 parse_opcode; | 598 | u8 aml_pkg_len_bytes; |
689 | u8 aml_opcode_length; | 599 | u8 extra; |
690 | u8 aml_pkg_len_bytes; | 600 | char parse_op_name[12]; |
691 | u8 extra; | 601 | }; |
692 | char parse_op_name[12]; | 602 | |
693 | }; | 603 | union acpi_parse_object { |
694 | 604 | struct acpi_parse_obj_common common; | |
695 | union acpi_parse_object | 605 | struct acpi_parse_obj_named named; |
696 | { | 606 | struct acpi_parse_obj_asl asl; |
697 | struct acpi_parse_obj_common common; | ||
698 | struct acpi_parse_obj_named named; | ||
699 | struct acpi_parse_obj_asl asl; | ||
700 | }; | 607 | }; |
701 | 608 | ||
702 | |||
703 | /* | 609 | /* |
704 | * Parse state - one state per parser invocation and each control | 610 | * Parse state - one state per parser invocation and each control |
705 | * method. | 611 | * method. |
706 | */ | 612 | */ |
707 | struct acpi_parse_state | 613 | struct acpi_parse_state { |
708 | { | 614 | u32 aml_size; |
709 | u32 aml_size; | 615 | u8 *aml_start; /* First AML byte */ |
710 | u8 *aml_start; /* First AML byte */ | 616 | u8 *aml; /* Next AML byte */ |
711 | u8 *aml; /* Next AML byte */ | 617 | u8 *aml_end; /* (last + 1) AML byte */ |
712 | u8 *aml_end; /* (last + 1) AML byte */ | 618 | u8 *pkg_start; /* Current package begin */ |
713 | u8 *pkg_start; /* Current package begin */ | 619 | u8 *pkg_end; /* Current package end */ |
714 | u8 *pkg_end; /* Current package end */ | 620 | union acpi_parse_object *start_op; /* Root of parse tree */ |
715 | union acpi_parse_object *start_op; /* Root of parse tree */ | 621 | struct acpi_namespace_node *start_node; |
716 | struct acpi_namespace_node *start_node; | 622 | union acpi_generic_state *scope; /* Current scope */ |
717 | union acpi_generic_state *scope; /* Current scope */ | 623 | union acpi_parse_object *start_scope; |
718 | union acpi_parse_object *start_scope; | ||
719 | }; | 624 | }; |
720 | 625 | ||
721 | |||
722 | /* Parse object flags */ | 626 | /* Parse object flags */ |
723 | 627 | ||
724 | #define ACPI_PARSEOP_GENERIC 0x01 | 628 | #define ACPI_PARSEOP_GENERIC 0x01 |
@@ -734,7 +638,6 @@ struct acpi_parse_state | |||
734 | #define ACPI_PARSEOP_EMPTY_TERMLIST 0x04 | 638 | #define ACPI_PARSEOP_EMPTY_TERMLIST 0x04 |
735 | #define ACPI_PARSEOP_SPECIAL 0x10 | 639 | #define ACPI_PARSEOP_SPECIAL 0x10 |
736 | 640 | ||
737 | |||
738 | /***************************************************************************** | 641 | /***************************************************************************** |
739 | * | 642 | * |
740 | * Hardware (ACPI registers) and PNP | 643 | * Hardware (ACPI registers) and PNP |
@@ -744,14 +647,12 @@ struct acpi_parse_state | |||
744 | #define PCI_ROOT_HID_STRING "PNP0A03" | 647 | #define PCI_ROOT_HID_STRING "PNP0A03" |
745 | #define PCI_EXPRESS_ROOT_HID_STRING "PNP0A08" | 648 | #define PCI_EXPRESS_ROOT_HID_STRING "PNP0A08" |
746 | 649 | ||
747 | struct acpi_bit_register_info | 650 | struct acpi_bit_register_info { |
748 | { | 651 | u8 parent_register; |
749 | u8 parent_register; | 652 | u8 bit_position; |
750 | u8 bit_position; | 653 | u16 access_bit_mask; |
751 | u16 access_bit_mask; | ||
752 | }; | 654 | }; |
753 | 655 | ||
754 | |||
755 | /* | 656 | /* |
756 | * Register IDs | 657 | * Register IDs |
757 | * These are the full ACPI registers | 658 | * These are the full ACPI registers |
@@ -766,7 +667,6 @@ struct acpi_bit_register_info | |||
766 | #define ACPI_REGISTER_PROCESSOR_BLOCK 0x08 | 667 | #define ACPI_REGISTER_PROCESSOR_BLOCK 0x08 |
767 | #define ACPI_REGISTER_SMI_COMMAND_BLOCK 0x09 | 668 | #define ACPI_REGISTER_SMI_COMMAND_BLOCK 0x09 |
768 | 669 | ||
769 | |||
770 | /* Masks used to access the bit_registers */ | 670 | /* Masks used to access the bit_registers */ |
771 | 671 | ||
772 | #define ACPI_BITMASK_TIMER_STATUS 0x0001 | 672 | #define ACPI_BITMASK_TIMER_STATUS 0x0001 |
@@ -775,7 +675,7 @@ struct acpi_bit_register_info | |||
775 | #define ACPI_BITMASK_POWER_BUTTON_STATUS 0x0100 | 675 | #define ACPI_BITMASK_POWER_BUTTON_STATUS 0x0100 |
776 | #define ACPI_BITMASK_SLEEP_BUTTON_STATUS 0x0200 | 676 | #define ACPI_BITMASK_SLEEP_BUTTON_STATUS 0x0200 |
777 | #define ACPI_BITMASK_RT_CLOCK_STATUS 0x0400 | 677 | #define ACPI_BITMASK_RT_CLOCK_STATUS 0x0400 |
778 | #define ACPI_BITMASK_PCIEXP_WAKE_STATUS 0x4000 /* ACPI 3.0 */ | 678 | #define ACPI_BITMASK_PCIEXP_WAKE_STATUS 0x4000 /* ACPI 3.0 */ |
779 | #define ACPI_BITMASK_WAKE_STATUS 0x8000 | 679 | #define ACPI_BITMASK_WAKE_STATUS 0x8000 |
780 | 680 | ||
781 | #define ACPI_BITMASK_ALL_FIXED_STATUS (ACPI_BITMASK_TIMER_STATUS | \ | 681 | #define ACPI_BITMASK_ALL_FIXED_STATUS (ACPI_BITMASK_TIMER_STATUS | \ |
@@ -791,7 +691,7 @@ struct acpi_bit_register_info | |||
791 | #define ACPI_BITMASK_POWER_BUTTON_ENABLE 0x0100 | 691 | #define ACPI_BITMASK_POWER_BUTTON_ENABLE 0x0100 |
792 | #define ACPI_BITMASK_SLEEP_BUTTON_ENABLE 0x0200 | 692 | #define ACPI_BITMASK_SLEEP_BUTTON_ENABLE 0x0200 |
793 | #define ACPI_BITMASK_RT_CLOCK_ENABLE 0x0400 | 693 | #define ACPI_BITMASK_RT_CLOCK_ENABLE 0x0400 |
794 | #define ACPI_BITMASK_PCIEXP_WAKE_DISABLE 0x4000 /* ACPI 3.0 */ | 694 | #define ACPI_BITMASK_PCIEXP_WAKE_DISABLE 0x4000 /* ACPI 3.0 */ |
795 | 695 | ||
796 | #define ACPI_BITMASK_SCI_ENABLE 0x0001 | 696 | #define ACPI_BITMASK_SCI_ENABLE 0x0001 |
797 | #define ACPI_BITMASK_BUS_MASTER_RLD 0x0002 | 697 | #define ACPI_BITMASK_BUS_MASTER_RLD 0x0002 |
@@ -801,7 +701,6 @@ struct acpi_bit_register_info | |||
801 | 701 | ||
802 | #define ACPI_BITMASK_ARB_DISABLE 0x0001 | 702 | #define ACPI_BITMASK_ARB_DISABLE 0x0001 |
803 | 703 | ||
804 | |||
805 | /* Raw bit position of each bit_register */ | 704 | /* Raw bit position of each bit_register */ |
806 | 705 | ||
807 | #define ACPI_BITPOSITION_TIMER_STATUS 0x00 | 706 | #define ACPI_BITPOSITION_TIMER_STATUS 0x00 |
@@ -810,7 +709,7 @@ struct acpi_bit_register_info | |||
810 | #define ACPI_BITPOSITION_POWER_BUTTON_STATUS 0x08 | 709 | #define ACPI_BITPOSITION_POWER_BUTTON_STATUS 0x08 |
811 | #define ACPI_BITPOSITION_SLEEP_BUTTON_STATUS 0x09 | 710 | #define ACPI_BITPOSITION_SLEEP_BUTTON_STATUS 0x09 |
812 | #define ACPI_BITPOSITION_RT_CLOCK_STATUS 0x0A | 711 | #define ACPI_BITPOSITION_RT_CLOCK_STATUS 0x0A |
813 | #define ACPI_BITPOSITION_PCIEXP_WAKE_STATUS 0x0E /* ACPI 3.0 */ | 712 | #define ACPI_BITPOSITION_PCIEXP_WAKE_STATUS 0x0E /* ACPI 3.0 */ |
814 | #define ACPI_BITPOSITION_WAKE_STATUS 0x0F | 713 | #define ACPI_BITPOSITION_WAKE_STATUS 0x0F |
815 | 714 | ||
816 | #define ACPI_BITPOSITION_TIMER_ENABLE 0x00 | 715 | #define ACPI_BITPOSITION_TIMER_ENABLE 0x00 |
@@ -818,7 +717,7 @@ struct acpi_bit_register_info | |||
818 | #define ACPI_BITPOSITION_POWER_BUTTON_ENABLE 0x08 | 717 | #define ACPI_BITPOSITION_POWER_BUTTON_ENABLE 0x08 |
819 | #define ACPI_BITPOSITION_SLEEP_BUTTON_ENABLE 0x09 | 718 | #define ACPI_BITPOSITION_SLEEP_BUTTON_ENABLE 0x09 |
820 | #define ACPI_BITPOSITION_RT_CLOCK_ENABLE 0x0A | 719 | #define ACPI_BITPOSITION_RT_CLOCK_ENABLE 0x0A |
821 | #define ACPI_BITPOSITION_PCIEXP_WAKE_DISABLE 0x0E /* ACPI 3.0 */ | 720 | #define ACPI_BITPOSITION_PCIEXP_WAKE_DISABLE 0x0E /* ACPI 3.0 */ |
822 | 721 | ||
823 | #define ACPI_BITPOSITION_SCI_ENABLE 0x00 | 722 | #define ACPI_BITPOSITION_SCI_ENABLE 0x00 |
824 | #define ACPI_BITPOSITION_BUS_MASTER_RLD 0x01 | 723 | #define ACPI_BITPOSITION_BUS_MASTER_RLD 0x01 |
@@ -828,7 +727,6 @@ struct acpi_bit_register_info | |||
828 | 727 | ||
829 | #define ACPI_BITPOSITION_ARB_DISABLE 0x00 | 728 | #define ACPI_BITPOSITION_ARB_DISABLE 0x00 |
830 | 729 | ||
831 | |||
832 | /***************************************************************************** | 730 | /***************************************************************************** |
833 | * | 731 | * |
834 | * Resource descriptors | 732 | * Resource descriptors |
@@ -847,8 +745,7 @@ struct acpi_bit_register_info | |||
847 | #define ACPI_RDESC_TYPE_SMALL 0x00 | 745 | #define ACPI_RDESC_TYPE_SMALL 0x00 |
848 | 746 | ||
849 | #define ACPI_RDESC_TYPE_MASK 0x80 | 747 | #define ACPI_RDESC_TYPE_MASK 0x80 |
850 | #define ACPI_RDESC_SMALL_MASK 0x78 /* Only bits 6:3 contain the type */ | 748 | #define ACPI_RDESC_SMALL_MASK 0x78 /* Only bits 6:3 contain the type */ |
851 | |||
852 | 749 | ||
853 | /* | 750 | /* |
854 | * Small resource descriptor types | 751 | * Small resource descriptor types |
@@ -877,7 +774,6 @@ struct acpi_bit_register_info | |||
877 | #define ACPI_RDESC_TYPE_QWORD_ADDRESS_SPACE 0x8A | 774 | #define ACPI_RDESC_TYPE_QWORD_ADDRESS_SPACE 0x8A |
878 | #define ACPI_RDESC_TYPE_EXTENDED_ADDRESS_SPACE 0x8B | 775 | #define ACPI_RDESC_TYPE_EXTENDED_ADDRESS_SPACE 0x8B |
879 | 776 | ||
880 | |||
881 | /***************************************************************************** | 777 | /***************************************************************************** |
882 | * | 778 | * |
883 | * Miscellaneous | 779 | * Miscellaneous |
@@ -886,35 +782,30 @@ struct acpi_bit_register_info | |||
886 | 782 | ||
887 | #define ACPI_ASCII_ZERO 0x30 | 783 | #define ACPI_ASCII_ZERO 0x30 |
888 | 784 | ||
889 | |||
890 | /***************************************************************************** | 785 | /***************************************************************************** |
891 | * | 786 | * |
892 | * Debugger | 787 | * Debugger |
893 | * | 788 | * |
894 | ****************************************************************************/ | 789 | ****************************************************************************/ |
895 | 790 | ||
896 | struct acpi_db_method_info | 791 | struct acpi_db_method_info { |
897 | { | 792 | acpi_handle thread_gate; |
898 | acpi_handle thread_gate; | 793 | char *name; |
899 | char *name; | 794 | char **args; |
900 | char **args; | 795 | u32 flags; |
901 | u32 flags; | 796 | u32 num_loops; |
902 | u32 num_loops; | 797 | char pathname[128]; |
903 | char pathname[128]; | ||
904 | }; | 798 | }; |
905 | 799 | ||
906 | struct acpi_integrity_info | 800 | struct acpi_integrity_info { |
907 | { | 801 | u32 nodes; |
908 | u32 nodes; | 802 | u32 objects; |
909 | u32 objects; | ||
910 | }; | 803 | }; |
911 | 804 | ||
912 | |||
913 | #define ACPI_DB_REDIRECTABLE_OUTPUT 0x01 | 805 | #define ACPI_DB_REDIRECTABLE_OUTPUT 0x01 |
914 | #define ACPI_DB_CONSOLE_OUTPUT 0x02 | 806 | #define ACPI_DB_CONSOLE_OUTPUT 0x02 |
915 | #define ACPI_DB_DUPLICATE_OUTPUT 0x03 | 807 | #define ACPI_DB_DUPLICATE_OUTPUT 0x03 |
916 | 808 | ||
917 | |||
918 | /***************************************************************************** | 809 | /***************************************************************************** |
919 | * | 810 | * |
920 | * Debug | 811 | * Debug |
@@ -936,43 +827,36 @@ struct acpi_integrity_info | |||
936 | char module[ACPI_MAX_MODULE_NAME]; \ | 827 | char module[ACPI_MAX_MODULE_NAME]; \ |
937 | u8 alloc_type; | 828 | u8 alloc_type; |
938 | 829 | ||
939 | struct acpi_debug_mem_header | 830 | struct acpi_debug_mem_header { |
940 | { | 831 | ACPI_COMMON_DEBUG_MEM_HEADER}; |
941 | ACPI_COMMON_DEBUG_MEM_HEADER | ||
942 | }; | ||
943 | 832 | ||
944 | struct acpi_debug_mem_block | 833 | struct acpi_debug_mem_block { |
945 | { | 834 | ACPI_COMMON_DEBUG_MEM_HEADER u64 user_space; |
946 | ACPI_COMMON_DEBUG_MEM_HEADER | ||
947 | u64 user_space; | ||
948 | }; | 835 | }; |
949 | 836 | ||
950 | |||
951 | #define ACPI_MEM_LIST_GLOBAL 0 | 837 | #define ACPI_MEM_LIST_GLOBAL 0 |
952 | #define ACPI_MEM_LIST_NSNODE 1 | 838 | #define ACPI_MEM_LIST_NSNODE 1 |
953 | #define ACPI_MEM_LIST_MAX 1 | 839 | #define ACPI_MEM_LIST_MAX 1 |
954 | #define ACPI_NUM_MEM_LISTS 2 | 840 | #define ACPI_NUM_MEM_LISTS 2 |
955 | 841 | ||
956 | 842 | struct acpi_memory_list { | |
957 | struct acpi_memory_list | 843 | char *list_name; |
958 | { | 844 | void *list_head; |
959 | char *list_name; | 845 | u16 object_size; |
960 | void *list_head; | 846 | u16 max_depth; |
961 | u16 object_size; | 847 | u16 current_depth; |
962 | u16 max_depth; | 848 | u16 link_offset; |
963 | u16 current_depth; | ||
964 | u16 link_offset; | ||
965 | 849 | ||
966 | #ifdef ACPI_DBG_TRACK_ALLOCATIONS | 850 | #ifdef ACPI_DBG_TRACK_ALLOCATIONS |
967 | 851 | ||
968 | /* Statistics for debug memory tracking only */ | 852 | /* Statistics for debug memory tracking only */ |
969 | 853 | ||
970 | u32 total_allocated; | 854 | u32 total_allocated; |
971 | u32 total_freed; | 855 | u32 total_freed; |
972 | u32 current_total_size; | 856 | u32 current_total_size; |
973 | u32 requests; | 857 | u32 requests; |
974 | u32 hits; | 858 | u32 hits; |
975 | #endif | 859 | #endif |
976 | }; | 860 | }; |
977 | 861 | ||
978 | #endif /* __ACLOCAL_H__ */ | 862 | #endif /* __ACLOCAL_H__ */ |
diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h index fcdef0a4b01b..702cc4e57f5f 100644 --- a/include/acpi/acmacros.h +++ b/include/acpi/acmacros.h | |||
@@ -44,7 +44,6 @@ | |||
44 | #ifndef __ACMACROS_H__ | 44 | #ifndef __ACMACROS_H__ |
45 | #define __ACMACROS_H__ | 45 | #define __ACMACROS_H__ |
46 | 46 | ||
47 | |||
48 | /* | 47 | /* |
49 | * Data manipulation macros | 48 | * Data manipulation macros |
50 | */ | 49 | */ |
@@ -57,7 +56,6 @@ | |||
57 | #define ACPI_CLEAR_BIT(target,bit) ((target) &= ~(bit)) | 56 | #define ACPI_CLEAR_BIT(target,bit) ((target) &= ~(bit)) |
58 | #define ACPI_MIN(a,b) (((a)<(b))?(a):(b)) | 57 | #define ACPI_MIN(a,b) (((a)<(b))?(a):(b)) |
59 | 58 | ||
60 | |||
61 | #if ACPI_MACHINE_WIDTH == 16 | 59 | #if ACPI_MACHINE_WIDTH == 16 |
62 | 60 | ||
63 | /* | 61 | /* |
@@ -168,7 +166,7 @@ | |||
168 | 166 | ||
169 | /* 32-bit source, 16/32/64 destination */ | 167 | /* 32-bit source, 16/32/64 destination */ |
170 | 168 | ||
171 | #define ACPI_MOVE_32_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ | 169 | #define ACPI_MOVE_32_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ |
172 | 170 | ||
173 | #define ACPI_MOVE_32_TO_32(d,s) {(( u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[3];\ | 171 | #define ACPI_MOVE_32_TO_32(d,s) {(( u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[3];\ |
174 | (( u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[2];\ | 172 | (( u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[2];\ |
@@ -183,9 +181,9 @@ | |||
183 | 181 | ||
184 | /* 64-bit source, 16/32/64 destination */ | 182 | /* 64-bit source, 16/32/64 destination */ |
185 | 183 | ||
186 | #define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ | 184 | #define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ |
187 | 185 | ||
188 | #define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */ | 186 | #define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */ |
189 | 187 | ||
190 | #define ACPI_MOVE_64_TO_64(d,s) {(( u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[7];\ | 188 | #define ACPI_MOVE_64_TO_64(d,s) {(( u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[7];\ |
191 | (( u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[6];\ | 189 | (( u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[6];\ |
@@ -219,14 +217,14 @@ | |||
219 | 217 | ||
220 | /* 32-bit source, 16/32/64 destination */ | 218 | /* 32-bit source, 16/32/64 destination */ |
221 | 219 | ||
222 | #define ACPI_MOVE_32_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ | 220 | #define ACPI_MOVE_32_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ |
223 | #define ACPI_MOVE_32_TO_32(d,s) *(u32 *)(void *)(d) = *(u32 *)(void *)(s) | 221 | #define ACPI_MOVE_32_TO_32(d,s) *(u32 *)(void *)(d) = *(u32 *)(void *)(s) |
224 | #define ACPI_MOVE_32_TO_64(d,s) ACPI_MOVE_32_TO_32(d,s) | 222 | #define ACPI_MOVE_32_TO_64(d,s) ACPI_MOVE_32_TO_32(d,s) |
225 | 223 | ||
226 | /* 64-bit source, 16/32/64 destination */ | 224 | /* 64-bit source, 16/32/64 destination */ |
227 | 225 | ||
228 | #define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ | 226 | #define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ |
229 | #define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */ | 227 | #define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */ |
230 | #define ACPI_MOVE_64_TO_64(d,s) ACPI_MOVE_32_TO_32(d,s) | 228 | #define ACPI_MOVE_64_TO_64(d,s) ACPI_MOVE_32_TO_32(d,s) |
231 | 229 | ||
232 | #else | 230 | #else |
@@ -238,14 +236,14 @@ | |||
238 | 236 | ||
239 | /* 32-bit source, 16/32/64 destination */ | 237 | /* 32-bit source, 16/32/64 destination */ |
240 | 238 | ||
241 | #define ACPI_MOVE_32_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ | 239 | #define ACPI_MOVE_32_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ |
242 | #define ACPI_MOVE_32_TO_32(d,s) *(u32 *)(void *)(d) = *(u32 *)(void *)(s) | 240 | #define ACPI_MOVE_32_TO_32(d,s) *(u32 *)(void *)(d) = *(u32 *)(void *)(s) |
243 | #define ACPI_MOVE_32_TO_64(d,s) *(u64 *)(void *)(d) = *(u32 *)(void *)(s) | 241 | #define ACPI_MOVE_32_TO_64(d,s) *(u64 *)(void *)(d) = *(u32 *)(void *)(s) |
244 | 242 | ||
245 | /* 64-bit source, 16/32/64 destination */ | 243 | /* 64-bit source, 16/32/64 destination */ |
246 | 244 | ||
247 | #define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ | 245 | #define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ |
248 | #define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */ | 246 | #define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */ |
249 | #define ACPI_MOVE_64_TO_64(d,s) *(u64 *)(void *)(d) = *(u64 *)(void *)(s) | 247 | #define ACPI_MOVE_64_TO_64(d,s) *(u64 *)(void *)(d) = *(u64 *)(void *)(s) |
250 | #endif | 248 | #endif |
251 | 249 | ||
@@ -266,7 +264,7 @@ | |||
266 | 264 | ||
267 | /* 32-bit source, 16/32/64 destination */ | 265 | /* 32-bit source, 16/32/64 destination */ |
268 | 266 | ||
269 | #define ACPI_MOVE_32_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ | 267 | #define ACPI_MOVE_32_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ |
270 | 268 | ||
271 | #define ACPI_MOVE_32_TO_32(d,s) {(( u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[0];\ | 269 | #define ACPI_MOVE_32_TO_32(d,s) {(( u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[0];\ |
272 | (( u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[1];\ | 270 | (( u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[1];\ |
@@ -277,8 +275,8 @@ | |||
277 | 275 | ||
278 | /* 64-bit source, 16/32/64 destination */ | 276 | /* 64-bit source, 16/32/64 destination */ |
279 | 277 | ||
280 | #define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ | 278 | #define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ |
281 | #define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */ | 279 | #define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */ |
282 | #define ACPI_MOVE_64_TO_64(d,s) {(( u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[0];\ | 280 | #define ACPI_MOVE_64_TO_64(d,s) {(( u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[0];\ |
283 | (( u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[1];\ | 281 | (( u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[1];\ |
284 | (( u8 *)(void *)(d))[2] = ((u8 *)(void *)(s))[2];\ | 282 | (( u8 *)(void *)(d))[2] = ((u8 *)(void *)(s))[2];\ |
@@ -305,7 +303,6 @@ | |||
305 | #error unknown ACPI_MACHINE_WIDTH | 303 | #error unknown ACPI_MACHINE_WIDTH |
306 | #endif | 304 | #endif |
307 | 305 | ||
308 | |||
309 | /* | 306 | /* |
310 | * Fast power-of-two math macros for non-optimized compilers | 307 | * Fast power-of-two math macros for non-optimized compilers |
311 | */ | 308 | */ |
@@ -329,7 +326,6 @@ | |||
329 | #define ACPI_MUL_16(a) _ACPI_MUL(a,4) | 326 | #define ACPI_MUL_16(a) _ACPI_MUL(a,4) |
330 | #define ACPI_MOD_16(a) _ACPI_MOD(a,16) | 327 | #define ACPI_MOD_16(a) _ACPI_MOD(a,16) |
331 | 328 | ||
332 | |||
333 | /* | 329 | /* |
334 | * Rounding macros (Power of two boundaries only) | 330 | * Rounding macros (Power of two boundaries only) |
335 | */ | 331 | */ |
@@ -344,7 +340,6 @@ | |||
344 | #define ACPI_ROUND_UP_to_64_bITS(a) ACPI_ROUND_UP(a,8) | 340 | #define ACPI_ROUND_UP_to_64_bITS(a) ACPI_ROUND_UP(a,8) |
345 | #define ACPI_ROUND_UP_TO_NATIVE_WORD(a) ACPI_ROUND_UP(a,ALIGNED_ADDRESS_BOUNDARY) | 341 | #define ACPI_ROUND_UP_TO_NATIVE_WORD(a) ACPI_ROUND_UP(a,ALIGNED_ADDRESS_BOUNDARY) |
346 | 342 | ||
347 | |||
348 | #define ACPI_ROUND_BITS_UP_TO_BYTES(a) ACPI_DIV_8((a) + 7) | 343 | #define ACPI_ROUND_BITS_UP_TO_BYTES(a) ACPI_DIV_8((a) + 7) |
349 | #define ACPI_ROUND_BITS_DOWN_TO_BYTES(a) ACPI_DIV_8((a)) | 344 | #define ACPI_ROUND_BITS_DOWN_TO_BYTES(a) ACPI_DIV_8((a)) |
350 | 345 | ||
@@ -365,7 +360,6 @@ | |||
365 | 360 | ||
366 | #define ACPI_IS_OCTAL_DIGIT(d) (((char)(d) >= '0') && ((char)(d) <= '7')) | 361 | #define ACPI_IS_OCTAL_DIGIT(d) (((char)(d) >= '0') && ((char)(d) <= '7')) |
367 | 362 | ||
368 | |||
369 | /* Bitfields within ACPI registers */ | 363 | /* Bitfields within ACPI registers */ |
370 | 364 | ||
371 | #define ACPI_REGISTER_PREPARE_BITS(val, pos, mask) ((val << pos) & mask) | 365 | #define ACPI_REGISTER_PREPARE_BITS(val, pos, mask) ((val << pos) & mask) |
@@ -381,7 +375,6 @@ | |||
381 | #define ACPI_GET_DESCRIPTOR_TYPE(d) (((union acpi_descriptor *)(void *)(d))->descriptor_id) | 375 | #define ACPI_GET_DESCRIPTOR_TYPE(d) (((union acpi_descriptor *)(void *)(d))->descriptor_id) |
382 | #define ACPI_SET_DESCRIPTOR_TYPE(d,t) (((union acpi_descriptor *)(void *)(d))->descriptor_id = t) | 376 | #define ACPI_SET_DESCRIPTOR_TYPE(d,t) (((union acpi_descriptor *)(void *)(d))->descriptor_id = t) |
383 | 377 | ||
384 | |||
385 | /* Macro to test the object type */ | 378 | /* Macro to test the object type */ |
386 | 379 | ||
387 | #define ACPI_GET_OBJECT_TYPE(d) (((union acpi_operand_object *)(void *)(d))->common.type) | 380 | #define ACPI_GET_OBJECT_TYPE(d) (((union acpi_operand_object *)(void *)(d))->common.type) |
@@ -430,7 +423,6 @@ | |||
430 | #define GET_CURRENT_ARG_TYPE(list) (list & ((u32) 0x1F)) | 423 | #define GET_CURRENT_ARG_TYPE(list) (list & ((u32) 0x1F)) |
431 | #define INCREMENT_ARG_LIST(list) (list >>= ((u32) ARG_TYPE_WIDTH)) | 424 | #define INCREMENT_ARG_LIST(list) (list >>= ((u32) ARG_TYPE_WIDTH)) |
432 | 425 | ||
433 | |||
434 | /* | 426 | /* |
435 | * Reporting macros that are never compiled out | 427 | * Reporting macros that are never compiled out |
436 | */ | 428 | */ |
@@ -554,20 +546,17 @@ | |||
554 | #define ACPI_DEBUG_ONLY_MEMBERS(a) a; | 546 | #define ACPI_DEBUG_ONLY_MEMBERS(a) a; |
555 | #define _VERBOSE_STRUCTURES | 547 | #define _VERBOSE_STRUCTURES |
556 | 548 | ||
557 | |||
558 | /* Stack and buffer dumping */ | 549 | /* Stack and buffer dumping */ |
559 | 550 | ||
560 | #define ACPI_DUMP_STACK_ENTRY(a) acpi_ex_dump_operand((a),0) | 551 | #define ACPI_DUMP_STACK_ENTRY(a) acpi_ex_dump_operand((a),0) |
561 | #define ACPI_DUMP_OPERANDS(a,b,c,d,e) acpi_ex_dump_operands(a,b,c,d,e,_acpi_module_name,__LINE__) | 552 | #define ACPI_DUMP_OPERANDS(a,b,c,d,e) acpi_ex_dump_operands(a,b,c,d,e,_acpi_module_name,__LINE__) |
562 | 553 | ||
563 | |||
564 | #define ACPI_DUMP_ENTRY(a,b) acpi_ns_dump_entry (a,b) | 554 | #define ACPI_DUMP_ENTRY(a,b) acpi_ns_dump_entry (a,b) |
565 | #define ACPI_DUMP_PATHNAME(a,b,c,d) acpi_ns_dump_pathname(a,b,c,d) | 555 | #define ACPI_DUMP_PATHNAME(a,b,c,d) acpi_ns_dump_pathname(a,b,c,d) |
566 | #define ACPI_DUMP_RESOURCE_LIST(a) acpi_rs_dump_resource_list(a) | 556 | #define ACPI_DUMP_RESOURCE_LIST(a) acpi_rs_dump_resource_list(a) |
567 | #define ACPI_DUMP_BUFFER(a,b) acpi_ut_dump_buffer((u8 *)a,b,DB_BYTE_DISPLAY,_COMPONENT) | 557 | #define ACPI_DUMP_BUFFER(a,b) acpi_ut_dump_buffer((u8 *)a,b,DB_BYTE_DISPLAY,_COMPONENT) |
568 | #define ACPI_BREAK_MSG(a) acpi_os_signal (ACPI_SIGNAL_BREAKPOINT,(a)) | 558 | #define ACPI_BREAK_MSG(a) acpi_os_signal (ACPI_SIGNAL_BREAKPOINT,(a)) |
569 | 559 | ||
570 | |||
571 | /* | 560 | /* |
572 | * Generate INT3 on ACPI_ERROR (Debug only!) | 561 | * Generate INT3 on ACPI_ERROR (Debug only!) |
573 | */ | 562 | */ |
@@ -588,7 +577,6 @@ | |||
588 | #define ACPI_DEBUG_PRINT(pl) acpi_ut_debug_print ACPI_PARAM_LIST(pl) | 577 | #define ACPI_DEBUG_PRINT(pl) acpi_ut_debug_print ACPI_PARAM_LIST(pl) |
589 | #define ACPI_DEBUG_PRINT_RAW(pl) acpi_ut_debug_print_raw ACPI_PARAM_LIST(pl) | 578 | #define ACPI_DEBUG_PRINT_RAW(pl) acpi_ut_debug_print_raw ACPI_PARAM_LIST(pl) |
590 | 579 | ||
591 | |||
592 | #else | 580 | #else |
593 | /* | 581 | /* |
594 | * This is the non-debug case -- make everything go away, | 582 | * This is the non-debug case -- make everything go away, |
@@ -639,7 +627,6 @@ | |||
639 | #define ACPI_DEBUGGER_EXEC(a) | 627 | #define ACPI_DEBUGGER_EXEC(a) |
640 | #endif | 628 | #endif |
641 | 629 | ||
642 | |||
643 | /* | 630 | /* |
644 | * For 16-bit code, we want to shrink some things even though | 631 | * For 16-bit code, we want to shrink some things even though |
645 | * we are using ACPI_DEBUG_OUTPUT to get the debug output | 632 | * we are using ACPI_DEBUG_OUTPUT to get the debug output |
@@ -650,7 +637,6 @@ | |||
650 | #define ACPI_DEBUG_ONLY_MEMBERS(a) | 637 | #define ACPI_DEBUG_ONLY_MEMBERS(a) |
651 | #endif | 638 | #endif |
652 | 639 | ||
653 | |||
654 | #ifdef ACPI_DEBUG_OUTPUT | 640 | #ifdef ACPI_DEBUG_OUTPUT |
655 | /* | 641 | /* |
656 | * 1) Set name to blanks | 642 | * 1) Set name to blanks |
@@ -663,7 +649,6 @@ | |||
663 | #define ACPI_ADD_OBJECT_NAME(a,b) | 649 | #define ACPI_ADD_OBJECT_NAME(a,b) |
664 | #endif | 650 | #endif |
665 | 651 | ||
666 | |||
667 | /* | 652 | /* |
668 | * Memory allocation tracking (DEBUG ONLY) | 653 | * Memory allocation tracking (DEBUG ONLY) |
669 | */ | 654 | */ |
@@ -685,6 +670,6 @@ | |||
685 | #define ACPI_MEM_FREE(a) acpi_ut_free_and_track(a,_COMPONENT,_acpi_module_name,__LINE__) | 670 | #define ACPI_MEM_FREE(a) acpi_ut_free_and_track(a,_COMPONENT,_acpi_module_name,__LINE__) |
686 | #define ACPI_MEM_TRACKING(a) a | 671 | #define ACPI_MEM_TRACKING(a) a |
687 | 672 | ||
688 | #endif /* ACPI_DBG_TRACK_ALLOCATIONS */ | 673 | #endif /* ACPI_DBG_TRACK_ALLOCATIONS */ |
689 | 674 | ||
690 | #endif /* ACMACROS_H */ | 675 | #endif /* ACMACROS_H */ |
diff --git a/include/acpi/acnames.h b/include/acpi/acnames.h index 280e9ed76674..79152fbc8f8c 100644 --- a/include/acpi/acnames.h +++ b/include/acpi/acnames.h | |||
@@ -71,9 +71,9 @@ | |||
71 | 71 | ||
72 | /* Definitions of the predefined namespace names */ | 72 | /* Definitions of the predefined namespace names */ |
73 | 73 | ||
74 | #define ACPI_UNKNOWN_NAME (u32) 0x3F3F3F3F /* Unknown name is "????" */ | 74 | #define ACPI_UNKNOWN_NAME (u32) 0x3F3F3F3F /* Unknown name is "????" */ |
75 | #define ACPI_ROOT_NAME (u32) 0x5F5F5F5C /* Root name is "\___" */ | 75 | #define ACPI_ROOT_NAME (u32) 0x5F5F5F5C /* Root name is "\___" */ |
76 | #define ACPI_SYS_BUS_NAME (u32) 0x5F53425F /* Sys bus name is "_SB_" */ | 76 | #define ACPI_SYS_BUS_NAME (u32) 0x5F53425F /* Sys bus name is "_SB_" */ |
77 | 77 | ||
78 | #define ACPI_NS_ROOT_PATH "\\" | 78 | #define ACPI_NS_ROOT_PATH "\\" |
79 | #define ACPI_NS_SYSTEM_BUS "_SB_" | 79 | #define ACPI_NS_SYSTEM_BUS "_SB_" |
@@ -83,7 +83,4 @@ | |||
83 | #define ACPI_FUNCTION_PREFIX2 'ipca' | 83 | #define ACPI_FUNCTION_PREFIX2 'ipca' |
84 | /*! [End] no source code translation !*/ | 84 | /*! [End] no source code translation !*/ |
85 | 85 | ||
86 | 86 | #endif /* __ACNAMES_H__ */ | |
87 | #endif /* __ACNAMES_H__ */ | ||
88 | |||
89 | |||
diff --git a/include/acpi/acnamesp.h b/include/acpi/acnamesp.h index 0c9ba707925b..dd3501f7e5d6 100644 --- a/include/acpi/acnamesp.h +++ b/include/acpi/acnamesp.h | |||
@@ -44,7 +44,6 @@ | |||
44 | #ifndef __ACNAMESP_H__ | 44 | #ifndef __ACNAMESP_H__ |
45 | #define __ACNAMESP_H__ | 45 | #define __ACNAMESP_H__ |
46 | 46 | ||
47 | |||
48 | /* To search the entire name space, pass this as search_base */ | 47 | /* To search the entire name space, pass this as search_base */ |
49 | 48 | ||
50 | #define ACPI_NS_ALL ((acpi_handle)0) | 49 | #define ACPI_NS_ALL ((acpi_handle)0) |
@@ -54,8 +53,8 @@ | |||
54 | * and should be one-to-one with values of acpi_object_type | 53 | * and should be one-to-one with values of acpi_object_type |
55 | */ | 54 | */ |
56 | #define ACPI_NS_NORMAL 0 | 55 | #define ACPI_NS_NORMAL 0 |
57 | #define ACPI_NS_NEWSCOPE 1 /* a definition of this type opens a name scope */ | 56 | #define ACPI_NS_NEWSCOPE 1 /* a definition of this type opens a name scope */ |
58 | #define ACPI_NS_LOCAL 2 /* suppress search of enclosing scopes */ | 57 | #define ACPI_NS_LOCAL 2 /* suppress search of enclosing scopes */ |
59 | 58 | ||
60 | /* Flags for acpi_ns_lookup, acpi_ns_search_and_enter */ | 59 | /* Flags for acpi_ns_lookup, acpi_ns_search_and_enter */ |
61 | 60 | ||
@@ -68,357 +67,237 @@ | |||
68 | #define ACPI_NS_WALK_UNLOCK TRUE | 67 | #define ACPI_NS_WALK_UNLOCK TRUE |
69 | #define ACPI_NS_WALK_NO_UNLOCK FALSE | 68 | #define ACPI_NS_WALK_NO_UNLOCK FALSE |
70 | 69 | ||
71 | |||
72 | /* | 70 | /* |
73 | * nsinit - Namespace initialization | 71 | * nsinit - Namespace initialization |
74 | */ | 72 | */ |
75 | acpi_status | 73 | acpi_status acpi_ns_initialize_objects(void); |
76 | acpi_ns_initialize_objects ( | ||
77 | void); | ||
78 | |||
79 | acpi_status | ||
80 | acpi_ns_initialize_devices ( | ||
81 | void); | ||
82 | 74 | ||
75 | acpi_status acpi_ns_initialize_devices(void); | ||
83 | 76 | ||
84 | /* | 77 | /* |
85 | * nsload - Namespace loading | 78 | * nsload - Namespace loading |
86 | */ | 79 | */ |
87 | acpi_status | 80 | acpi_status acpi_ns_load_namespace(void); |
88 | acpi_ns_load_namespace ( | ||
89 | void); | ||
90 | 81 | ||
91 | acpi_status | 82 | acpi_status |
92 | acpi_ns_load_table ( | 83 | acpi_ns_load_table(struct acpi_table_desc *table_desc, |
93 | struct acpi_table_desc *table_desc, | 84 | struct acpi_namespace_node *node); |
94 | struct acpi_namespace_node *node); | ||
95 | |||
96 | 85 | ||
97 | /* | 86 | /* |
98 | * nswalk - walk the namespace | 87 | * nswalk - walk the namespace |
99 | */ | 88 | */ |
100 | acpi_status | 89 | acpi_status |
101 | acpi_ns_walk_namespace ( | 90 | acpi_ns_walk_namespace(acpi_object_type type, |
102 | acpi_object_type type, | 91 | acpi_handle start_object, |
103 | acpi_handle start_object, | 92 | u32 max_depth, |
104 | u32 max_depth, | 93 | u8 unlock_before_callback, |
105 | u8 unlock_before_callback, | 94 | acpi_walk_callback user_function, |
106 | acpi_walk_callback user_function, | 95 | void *context, void **return_value); |
107 | void *context, | 96 | |
108 | void **return_value); | 97 | struct acpi_namespace_node *acpi_ns_get_next_node(acpi_object_type type, |
109 | 98 | struct acpi_namespace_node | |
110 | struct acpi_namespace_node * | 99 | *parent, |
111 | acpi_ns_get_next_node ( | 100 | struct acpi_namespace_node |
112 | acpi_object_type type, | 101 | *child); |
113 | struct acpi_namespace_node *parent, | ||
114 | struct acpi_namespace_node *child); | ||
115 | |||
116 | 102 | ||
117 | /* | 103 | /* |
118 | * nsparse - table parsing | 104 | * nsparse - table parsing |
119 | */ | 105 | */ |
120 | acpi_status | 106 | acpi_status |
121 | acpi_ns_parse_table ( | 107 | acpi_ns_parse_table(struct acpi_table_desc *table_desc, |
122 | struct acpi_table_desc *table_desc, | 108 | struct acpi_namespace_node *scope); |
123 | struct acpi_namespace_node *scope); | ||
124 | 109 | ||
125 | acpi_status | 110 | acpi_status |
126 | acpi_ns_one_complete_parse ( | 111 | acpi_ns_one_complete_parse(u8 pass_number, struct acpi_table_desc *table_desc); |
127 | u8 pass_number, | ||
128 | struct acpi_table_desc *table_desc); | ||
129 | |||
130 | 112 | ||
131 | /* | 113 | /* |
132 | * nsaccess - Top-level namespace access | 114 | * nsaccess - Top-level namespace access |
133 | */ | 115 | */ |
134 | acpi_status | 116 | acpi_status acpi_ns_root_initialize(void); |
135 | acpi_ns_root_initialize ( | ||
136 | void); | ||
137 | 117 | ||
138 | acpi_status | 118 | acpi_status |
139 | acpi_ns_lookup ( | 119 | acpi_ns_lookup(union acpi_generic_state *scope_info, |
140 | union acpi_generic_state *scope_info, | 120 | char *name, |
141 | char *name, | 121 | acpi_object_type type, |
142 | acpi_object_type type, | 122 | acpi_interpreter_mode interpreter_mode, |
143 | acpi_interpreter_mode interpreter_mode, | 123 | u32 flags, |
144 | u32 flags, | 124 | struct acpi_walk_state *walk_state, |
145 | struct acpi_walk_state *walk_state, | 125 | struct acpi_namespace_node **ret_node); |
146 | struct acpi_namespace_node **ret_node); | ||
147 | |||
148 | 126 | ||
149 | /* | 127 | /* |
150 | * nsalloc - Named object allocation/deallocation | 128 | * nsalloc - Named object allocation/deallocation |
151 | */ | 129 | */ |
152 | struct acpi_namespace_node * | 130 | struct acpi_namespace_node *acpi_ns_create_node(u32 name); |
153 | acpi_ns_create_node ( | ||
154 | u32 name); | ||
155 | |||
156 | void | ||
157 | acpi_ns_delete_node ( | ||
158 | struct acpi_namespace_node *node); | ||
159 | 131 | ||
160 | void | 132 | void acpi_ns_delete_node(struct acpi_namespace_node *node); |
161 | acpi_ns_delete_namespace_subtree ( | ||
162 | struct acpi_namespace_node *parent_handle); | ||
163 | 133 | ||
164 | void | 134 | void |
165 | acpi_ns_delete_namespace_by_owner ( | 135 | acpi_ns_delete_namespace_subtree(struct acpi_namespace_node *parent_handle); |
166 | acpi_owner_id owner_id); | ||
167 | 136 | ||
168 | void | 137 | void acpi_ns_delete_namespace_by_owner(acpi_owner_id owner_id); |
169 | acpi_ns_detach_object ( | ||
170 | struct acpi_namespace_node *node); | ||
171 | 138 | ||
172 | void | 139 | void acpi_ns_detach_object(struct acpi_namespace_node *node); |
173 | acpi_ns_delete_children ( | ||
174 | struct acpi_namespace_node *parent); | ||
175 | 140 | ||
176 | int | 141 | void acpi_ns_delete_children(struct acpi_namespace_node *parent); |
177 | acpi_ns_compare_names ( | ||
178 | char *name1, | ||
179 | char *name2); | ||
180 | 142 | ||
143 | int acpi_ns_compare_names(char *name1, char *name2); | ||
181 | 144 | ||
182 | /* | 145 | /* |
183 | * nsdump - Namespace dump/print utilities | 146 | * nsdump - Namespace dump/print utilities |
184 | */ | 147 | */ |
185 | #ifdef ACPI_FUTURE_USAGE | 148 | #ifdef ACPI_FUTURE_USAGE |
186 | void | 149 | void acpi_ns_dump_tables(acpi_handle search_base, u32 max_depth); |
187 | acpi_ns_dump_tables ( | 150 | #endif /* ACPI_FUTURE_USAGE */ |
188 | acpi_handle search_base, | ||
189 | u32 max_depth); | ||
190 | #endif /* ACPI_FUTURE_USAGE */ | ||
191 | 151 | ||
192 | void | 152 | void acpi_ns_dump_entry(acpi_handle handle, u32 debug_level); |
193 | acpi_ns_dump_entry ( | ||
194 | acpi_handle handle, | ||
195 | u32 debug_level); | ||
196 | 153 | ||
197 | void | 154 | void |
198 | acpi_ns_dump_pathname ( | 155 | acpi_ns_dump_pathname(acpi_handle handle, char *msg, u32 level, u32 component); |
199 | acpi_handle handle, | ||
200 | char *msg, | ||
201 | u32 level, | ||
202 | u32 component); | ||
203 | 156 | ||
204 | void | 157 | void acpi_ns_print_pathname(u32 num_segments, char *pathname); |
205 | acpi_ns_print_pathname ( | ||
206 | u32 num_segments, | ||
207 | char *pathname); | ||
208 | 158 | ||
209 | acpi_status | 159 | acpi_status |
210 | acpi_ns_dump_one_object ( | 160 | acpi_ns_dump_one_object(acpi_handle obj_handle, |
211 | acpi_handle obj_handle, | 161 | u32 level, void *context, void **return_value); |
212 | u32 level, | ||
213 | void *context, | ||
214 | void **return_value); | ||
215 | 162 | ||
216 | #ifdef ACPI_FUTURE_USAGE | 163 | #ifdef ACPI_FUTURE_USAGE |
217 | void | 164 | void |
218 | acpi_ns_dump_objects ( | 165 | acpi_ns_dump_objects(acpi_object_type type, |
219 | acpi_object_type type, | 166 | u8 display_type, |
220 | u8 display_type, | 167 | u32 max_depth, |
221 | u32 max_depth, | 168 | acpi_owner_id owner_id, acpi_handle start_handle); |
222 | acpi_owner_id owner_id, | 169 | #endif /* ACPI_FUTURE_USAGE */ |
223 | acpi_handle start_handle); | ||
224 | #endif /* ACPI_FUTURE_USAGE */ | ||
225 | |||
226 | 170 | ||
227 | /* | 171 | /* |
228 | * nseval - Namespace evaluation functions | 172 | * nseval - Namespace evaluation functions |
229 | */ | 173 | */ |
230 | acpi_status | 174 | acpi_status acpi_ns_evaluate_by_handle(struct acpi_parameter_info *info); |
231 | acpi_ns_evaluate_by_handle ( | ||
232 | struct acpi_parameter_info *info); | ||
233 | 175 | ||
234 | acpi_status | 176 | acpi_status |
235 | acpi_ns_evaluate_by_name ( | 177 | acpi_ns_evaluate_by_name(char *pathname, struct acpi_parameter_info *info); |
236 | char *pathname, | ||
237 | struct acpi_parameter_info *info); | ||
238 | 178 | ||
239 | acpi_status | 179 | acpi_status |
240 | acpi_ns_evaluate_relative ( | 180 | acpi_ns_evaluate_relative(char *pathname, struct acpi_parameter_info *info); |
241 | char *pathname, | ||
242 | struct acpi_parameter_info *info); | ||
243 | |||
244 | 181 | ||
245 | /* | 182 | /* |
246 | * nsnames - Name and Scope manipulation | 183 | * nsnames - Name and Scope manipulation |
247 | */ | 184 | */ |
248 | u32 | 185 | u32 acpi_ns_opens_scope(acpi_object_type type); |
249 | acpi_ns_opens_scope ( | ||
250 | acpi_object_type type); | ||
251 | 186 | ||
252 | char * | 187 | char *acpi_ns_get_external_pathname(struct acpi_namespace_node *node); |
253 | acpi_ns_get_external_pathname ( | ||
254 | struct acpi_namespace_node *node); | ||
255 | 188 | ||
256 | char * | 189 | char *acpi_ns_name_of_current_scope(struct acpi_walk_state *walk_state); |
257 | acpi_ns_name_of_current_scope ( | ||
258 | struct acpi_walk_state *walk_state); | ||
259 | 190 | ||
260 | acpi_status | 191 | acpi_status |
261 | acpi_ns_handle_to_pathname ( | 192 | acpi_ns_handle_to_pathname(acpi_handle target_handle, |
262 | acpi_handle target_handle, | 193 | struct acpi_buffer *buffer); |
263 | struct acpi_buffer *buffer); | ||
264 | 194 | ||
265 | u8 | 195 | u8 |
266 | acpi_ns_pattern_match ( | 196 | acpi_ns_pattern_match(struct acpi_namespace_node *obj_node, char *search_for); |
267 | struct acpi_namespace_node *obj_node, | ||
268 | char *search_for); | ||
269 | 197 | ||
270 | acpi_status | 198 | acpi_status |
271 | acpi_ns_get_node_by_path ( | 199 | acpi_ns_get_node_by_path(char *external_pathname, |
272 | char *external_pathname, | 200 | struct acpi_namespace_node *in_prefix_node, |
273 | struct acpi_namespace_node *in_prefix_node, | 201 | u32 flags, struct acpi_namespace_node **out_node); |
274 | u32 flags, | ||
275 | struct acpi_namespace_node **out_node); | ||
276 | |||
277 | acpi_size | ||
278 | acpi_ns_get_pathname_length ( | ||
279 | struct acpi_namespace_node *node); | ||
280 | 202 | ||
203 | acpi_size acpi_ns_get_pathname_length(struct acpi_namespace_node *node); | ||
281 | 204 | ||
282 | /* | 205 | /* |
283 | * nsobject - Object management for namespace nodes | 206 | * nsobject - Object management for namespace nodes |
284 | */ | 207 | */ |
285 | acpi_status | 208 | acpi_status |
286 | acpi_ns_attach_object ( | 209 | acpi_ns_attach_object(struct acpi_namespace_node *node, |
287 | struct acpi_namespace_node *node, | 210 | union acpi_operand_object *object, acpi_object_type type); |
288 | union acpi_operand_object *object, | ||
289 | acpi_object_type type); | ||
290 | 211 | ||
291 | union acpi_operand_object * | 212 | union acpi_operand_object *acpi_ns_get_attached_object(struct |
292 | acpi_ns_get_attached_object ( | 213 | acpi_namespace_node |
293 | struct acpi_namespace_node *node); | 214 | *node); |
294 | 215 | ||
295 | union acpi_operand_object * | 216 | union acpi_operand_object *acpi_ns_get_secondary_object(union |
296 | acpi_ns_get_secondary_object ( | 217 | acpi_operand_object |
297 | union acpi_operand_object *obj_desc); | 218 | *obj_desc); |
298 | 219 | ||
299 | acpi_status | 220 | acpi_status |
300 | acpi_ns_attach_data ( | 221 | acpi_ns_attach_data(struct acpi_namespace_node *node, |
301 | struct acpi_namespace_node *node, | 222 | acpi_object_handler handler, void *data); |
302 | acpi_object_handler handler, | ||
303 | void *data); | ||
304 | 223 | ||
305 | acpi_status | 224 | acpi_status |
306 | acpi_ns_detach_data ( | 225 | acpi_ns_detach_data(struct acpi_namespace_node *node, |
307 | struct acpi_namespace_node *node, | 226 | acpi_object_handler handler); |
308 | acpi_object_handler handler); | ||
309 | 227 | ||
310 | acpi_status | 228 | acpi_status |
311 | acpi_ns_get_attached_data ( | 229 | acpi_ns_get_attached_data(struct acpi_namespace_node *node, |
312 | struct acpi_namespace_node *node, | 230 | acpi_object_handler handler, void **data); |
313 | acpi_object_handler handler, | ||
314 | void **data); | ||
315 | |||
316 | 231 | ||
317 | /* | 232 | /* |
318 | * nssearch - Namespace searching and entry | 233 | * nssearch - Namespace searching and entry |
319 | */ | 234 | */ |
320 | acpi_status | 235 | acpi_status |
321 | acpi_ns_search_and_enter ( | 236 | acpi_ns_search_and_enter(u32 entry_name, |
322 | u32 entry_name, | 237 | struct acpi_walk_state *walk_state, |
323 | struct acpi_walk_state *walk_state, | 238 | struct acpi_namespace_node *node, |
324 | struct acpi_namespace_node *node, | 239 | acpi_interpreter_mode interpreter_mode, |
325 | acpi_interpreter_mode interpreter_mode, | 240 | acpi_object_type type, |
326 | acpi_object_type type, | 241 | u32 flags, struct acpi_namespace_node **ret_node); |
327 | u32 flags, | ||
328 | struct acpi_namespace_node **ret_node); | ||
329 | 242 | ||
330 | acpi_status | 243 | acpi_status |
331 | acpi_ns_search_node ( | 244 | acpi_ns_search_node(u32 entry_name, |
332 | u32 entry_name, | 245 | struct acpi_namespace_node *node, |
333 | struct acpi_namespace_node *node, | 246 | acpi_object_type type, |
334 | acpi_object_type type, | 247 | struct acpi_namespace_node **ret_node); |
335 | struct acpi_namespace_node **ret_node); | ||
336 | 248 | ||
337 | void | 249 | void |
338 | acpi_ns_install_node ( | 250 | acpi_ns_install_node(struct acpi_walk_state *walk_state, |
339 | struct acpi_walk_state *walk_state, | 251 | struct acpi_namespace_node *parent_node, |
340 | struct acpi_namespace_node *parent_node, | 252 | struct acpi_namespace_node *node, acpi_object_type type); |
341 | struct acpi_namespace_node *node, | ||
342 | acpi_object_type type); | ||
343 | |||
344 | 253 | ||
345 | /* | 254 | /* |
346 | * nsutils - Utility functions | 255 | * nsutils - Utility functions |
347 | */ | 256 | */ |
348 | u8 | 257 | u8 acpi_ns_valid_root_prefix(char prefix); |
349 | acpi_ns_valid_root_prefix ( | ||
350 | char prefix); | ||
351 | 258 | ||
352 | acpi_object_type | 259 | acpi_object_type acpi_ns_get_type(struct acpi_namespace_node *node); |
353 | acpi_ns_get_type ( | ||
354 | struct acpi_namespace_node *node); | ||
355 | 260 | ||
356 | u32 | 261 | u32 acpi_ns_local(acpi_object_type type); |
357 | acpi_ns_local ( | ||
358 | acpi_object_type type); | ||
359 | 262 | ||
360 | void | 263 | void |
361 | acpi_ns_report_error ( | 264 | acpi_ns_report_error(char *module_name, |
362 | char *module_name, | 265 | u32 line_number, |
363 | u32 line_number, | 266 | u32 component_id, |
364 | u32 component_id, | 267 | char *internal_name, acpi_status lookup_status); |
365 | char *internal_name, | ||
366 | acpi_status lookup_status); | ||
367 | 268 | ||
368 | void | 269 | void |
369 | acpi_ns_report_method_error ( | 270 | acpi_ns_report_method_error(char *module_name, |
370 | char *module_name, | 271 | u32 line_number, |
371 | u32 line_number, | 272 | u32 component_id, |
372 | u32 component_id, | 273 | char *message, |
373 | char *message, | 274 | struct acpi_namespace_node *node, |
374 | struct acpi_namespace_node *node, | 275 | char *path, acpi_status lookup_status); |
375 | char *path, | ||
376 | acpi_status lookup_status); | ||
377 | 276 | ||
378 | void | 277 | void acpi_ns_print_node_pathname(struct acpi_namespace_node *node, char *msg); |
379 | acpi_ns_print_node_pathname ( | ||
380 | struct acpi_namespace_node *node, | ||
381 | char *msg); | ||
382 | 278 | ||
383 | acpi_status | 279 | acpi_status acpi_ns_build_internal_name(struct acpi_namestring_info *info); |
384 | acpi_ns_build_internal_name ( | ||
385 | struct acpi_namestring_info *info); | ||
386 | 280 | ||
387 | void | 281 | void acpi_ns_get_internal_name_length(struct acpi_namestring_info *info); |
388 | acpi_ns_get_internal_name_length ( | ||
389 | struct acpi_namestring_info *info); | ||
390 | 282 | ||
391 | acpi_status | 283 | acpi_status acpi_ns_internalize_name(char *dotted_name, char **converted_name); |
392 | acpi_ns_internalize_name ( | ||
393 | char *dotted_name, | ||
394 | char **converted_name); | ||
395 | 284 | ||
396 | acpi_status | 285 | acpi_status |
397 | acpi_ns_externalize_name ( | 286 | acpi_ns_externalize_name(u32 internal_name_length, |
398 | u32 internal_name_length, | 287 | char *internal_name, |
399 | char *internal_name, | 288 | u32 * converted_name_length, char **converted_name); |
400 | u32 *converted_name_length, | ||
401 | char **converted_name); | ||
402 | 289 | ||
403 | struct acpi_namespace_node * | 290 | struct acpi_namespace_node *acpi_ns_map_handle_to_node(acpi_handle handle); |
404 | acpi_ns_map_handle_to_node ( | ||
405 | acpi_handle handle); | ||
406 | 291 | ||
407 | acpi_handle | 292 | acpi_handle acpi_ns_convert_entry_to_handle(struct acpi_namespace_node *node); |
408 | acpi_ns_convert_entry_to_handle( | ||
409 | struct acpi_namespace_node *node); | ||
410 | |||
411 | void | ||
412 | acpi_ns_terminate ( | ||
413 | void); | ||
414 | 293 | ||
415 | struct acpi_namespace_node * | 294 | void acpi_ns_terminate(void); |
416 | acpi_ns_get_parent_node ( | ||
417 | struct acpi_namespace_node *node); | ||
418 | 295 | ||
296 | struct acpi_namespace_node *acpi_ns_get_parent_node(struct acpi_namespace_node | ||
297 | *node); | ||
419 | 298 | ||
420 | struct acpi_namespace_node * | 299 | struct acpi_namespace_node *acpi_ns_get_next_valid_node(struct |
421 | acpi_ns_get_next_valid_node ( | 300 | acpi_namespace_node |
422 | struct acpi_namespace_node *node); | 301 | *node); |
423 | 302 | ||
424 | #endif /* __ACNAMESP_H__ */ | 303 | #endif /* __ACNAMESP_H__ */ |
diff --git a/include/acpi/acobject.h b/include/acpi/acobject.h index 34f9d1f1f79b..4a326ba6d482 100644 --- a/include/acpi/acobject.h +++ b/include/acpi/acobject.h | |||
@@ -45,7 +45,6 @@ | |||
45 | #ifndef _ACOBJECT_H | 45 | #ifndef _ACOBJECT_H |
46 | #define _ACOBJECT_H | 46 | #define _ACOBJECT_H |
47 | 47 | ||
48 | |||
49 | /* | 48 | /* |
50 | * The union acpi_operand_object is used to pass AML operands from the dispatcher | 49 | * The union acpi_operand_object is used to pass AML operands from the dispatcher |
51 | * to the interpreter, and to keep track of the various handlers such as | 50 | * to the interpreter, and to keep track of the various handlers such as |
@@ -81,7 +80,6 @@ | |||
81 | #define AOPOBJ_SETUP_COMPLETE 0x10 | 80 | #define AOPOBJ_SETUP_COMPLETE 0x10 |
82 | #define AOPOBJ_SINGLE_DATUM 0x20 | 81 | #define AOPOBJ_SINGLE_DATUM 0x20 |
83 | 82 | ||
84 | |||
85 | /* | 83 | /* |
86 | * Common bitfield for the field objects | 84 | * Common bitfield for the field objects |
87 | * "Field Datum" -- a datum from the actual field object | 85 | * "Field Datum" -- a datum from the actual field object |
@@ -96,8 +94,7 @@ | |||
96 | u8 start_field_bit_offset;/* Bit offset within first field datum (0-63) */\ | 94 | u8 start_field_bit_offset;/* Bit offset within first field datum (0-63) */\ |
97 | u8 access_bit_width; /* Read/Write size in bits (8-64) */\ | 95 | u8 access_bit_width; /* Read/Write size in bits (8-64) */\ |
98 | u32 value; /* Value to store into the Bank or Index register */\ | 96 | u32 value; /* Value to store into the Bank or Index register */\ |
99 | struct acpi_namespace_node *node; /* Link back to parent node */ | 97 | struct acpi_namespace_node *node; /* Link back to parent node */ |
100 | |||
101 | 98 | ||
102 | /* | 99 | /* |
103 | * Fields common to both Strings and Buffers | 100 | * Fields common to both Strings and Buffers |
@@ -105,15 +102,13 @@ | |||
105 | #define ACPI_COMMON_BUFFER_INFO \ | 102 | #define ACPI_COMMON_BUFFER_INFO \ |
106 | u32 length; | 103 | u32 length; |
107 | 104 | ||
108 | |||
109 | /* | 105 | /* |
110 | * Common fields for objects that support ASL notifications | 106 | * Common fields for objects that support ASL notifications |
111 | */ | 107 | */ |
112 | #define ACPI_COMMON_NOTIFY_INFO \ | 108 | #define ACPI_COMMON_NOTIFY_INFO \ |
113 | union acpi_operand_object *system_notify; /* Handler for system notifies */\ | 109 | union acpi_operand_object *system_notify; /* Handler for system notifies */\ |
114 | union acpi_operand_object *device_notify; /* Handler for driver notifies */\ | 110 | union acpi_operand_object *device_notify; /* Handler for driver notifies */\ |
115 | union acpi_operand_object *handler; /* Handler for Address space */ | 111 | union acpi_operand_object *handler; /* Handler for Address space */ |
116 | |||
117 | 112 | ||
118 | /****************************************************************************** | 113 | /****************************************************************************** |
119 | * | 114 | * |
@@ -121,161 +116,110 @@ | |||
121 | * | 116 | * |
122 | *****************************************************************************/ | 117 | *****************************************************************************/ |
123 | 118 | ||
124 | struct acpi_object_common | 119 | struct acpi_object_common { |
125 | { | 120 | ACPI_OBJECT_COMMON_HEADER}; |
126 | ACPI_OBJECT_COMMON_HEADER | ||
127 | }; | ||
128 | 121 | ||
129 | 122 | struct acpi_object_integer { | |
130 | struct acpi_object_integer | 123 | ACPI_OBJECT_COMMON_HEADER acpi_integer value; |
131 | { | ||
132 | ACPI_OBJECT_COMMON_HEADER | ||
133 | acpi_integer value; | ||
134 | }; | 124 | }; |
135 | 125 | ||
136 | |||
137 | /* | 126 | /* |
138 | * Note: The String and Buffer object must be identical through the Pointer | 127 | * Note: The String and Buffer object must be identical through the Pointer |
139 | * element. There is code that depends on this. | 128 | * element. There is code that depends on this. |
140 | */ | 129 | */ |
141 | struct acpi_object_string /* Null terminated, ASCII characters only */ | 130 | struct acpi_object_string { /* Null terminated, ASCII characters only */ |
142 | { | 131 | ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_BUFFER_INFO char *pointer; /* String in AML stream or allocated string */ |
143 | ACPI_OBJECT_COMMON_HEADER | ||
144 | ACPI_COMMON_BUFFER_INFO | ||
145 | char *pointer; /* String in AML stream or allocated string */ | ||
146 | }; | 132 | }; |
147 | 133 | ||
148 | 134 | struct acpi_object_buffer { | |
149 | struct acpi_object_buffer | 135 | ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_BUFFER_INFO u8 * pointer; /* Buffer in AML stream or allocated buffer */ |
150 | { | 136 | struct acpi_namespace_node *node; /* Link back to parent node */ |
151 | ACPI_OBJECT_COMMON_HEADER | 137 | u8 *aml_start; |
152 | ACPI_COMMON_BUFFER_INFO | 138 | u32 aml_length; |
153 | u8 *pointer; /* Buffer in AML stream or allocated buffer */ | ||
154 | struct acpi_namespace_node *node; /* Link back to parent node */ | ||
155 | u8 *aml_start; | ||
156 | u32 aml_length; | ||
157 | }; | 139 | }; |
158 | 140 | ||
159 | 141 | struct acpi_object_package { | |
160 | struct acpi_object_package | 142 | ACPI_OBJECT_COMMON_HEADER u32 count; /* # of elements in package */ |
161 | { | 143 | u32 aml_length; |
162 | ACPI_OBJECT_COMMON_HEADER | 144 | u8 *aml_start; |
163 | 145 | struct acpi_namespace_node *node; /* Link back to parent node */ | |
164 | u32 count; /* # of elements in package */ | 146 | union acpi_operand_object **elements; /* Array of pointers to acpi_objects */ |
165 | u32 aml_length; | ||
166 | u8 *aml_start; | ||
167 | struct acpi_namespace_node *node; /* Link back to parent node */ | ||
168 | union acpi_operand_object **elements; /* Array of pointers to acpi_objects */ | ||
169 | }; | 147 | }; |
170 | 148 | ||
171 | |||
172 | /****************************************************************************** | 149 | /****************************************************************************** |
173 | * | 150 | * |
174 | * Complex data types | 151 | * Complex data types |
175 | * | 152 | * |
176 | *****************************************************************************/ | 153 | *****************************************************************************/ |
177 | 154 | ||
178 | struct acpi_object_event | 155 | struct acpi_object_event { |
179 | { | 156 | ACPI_OBJECT_COMMON_HEADER void *semaphore; |
180 | ACPI_OBJECT_COMMON_HEADER | ||
181 | void *semaphore; | ||
182 | }; | 157 | }; |
183 | 158 | ||
184 | |||
185 | #define ACPI_INFINITE_CONCURRENCY 0xFF | 159 | #define ACPI_INFINITE_CONCURRENCY 0xFF |
186 | 160 | ||
187 | typedef | 161 | typedef |
188 | acpi_status (*ACPI_INTERNAL_METHOD) ( | 162 | acpi_status(*ACPI_INTERNAL_METHOD) (struct acpi_walk_state * walk_state); |
189 | struct acpi_walk_state *walk_state); | 163 | |
190 | 164 | struct acpi_object_method { | |
191 | struct acpi_object_method | 165 | ACPI_OBJECT_COMMON_HEADER u8 method_flags; |
192 | { | 166 | u8 param_count; |
193 | ACPI_OBJECT_COMMON_HEADER | 167 | u32 aml_length; |
194 | u8 method_flags; | 168 | void *semaphore; |
195 | u8 param_count; | 169 | u8 *aml_start; |
196 | u32 aml_length; | 170 | ACPI_INTERNAL_METHOD implementation; |
197 | void *semaphore; | 171 | u8 concurrency; |
198 | u8 *aml_start; | 172 | u8 thread_count; |
199 | ACPI_INTERNAL_METHOD implementation; | 173 | acpi_owner_id owner_id; |
200 | u8 concurrency; | ||
201 | u8 thread_count; | ||
202 | acpi_owner_id owner_id; | ||
203 | }; | 174 | }; |
204 | 175 | ||
205 | 176 | struct acpi_object_mutex { | |
206 | struct acpi_object_mutex | 177 | ACPI_OBJECT_COMMON_HEADER u8 sync_level; /* 0-15, specified in Mutex() call */ |
207 | { | 178 | u16 acquisition_depth; /* Allow multiple Acquires, same thread */ |
208 | ACPI_OBJECT_COMMON_HEADER | 179 | struct acpi_thread_state *owner_thread; /* Current owner of the mutex */ |
209 | u8 sync_level; /* 0-15, specified in Mutex() call */ | 180 | void *semaphore; /* Actual OS synchronization object */ |
210 | u16 acquisition_depth; /* Allow multiple Acquires, same thread */ | 181 | union acpi_operand_object *prev; /* Link for list of acquired mutexes */ |
211 | struct acpi_thread_state *owner_thread; /* Current owner of the mutex */ | 182 | union acpi_operand_object *next; /* Link for list of acquired mutexes */ |
212 | void *semaphore; /* Actual OS synchronization object */ | 183 | struct acpi_namespace_node *node; /* Containing namespace node */ |
213 | union acpi_operand_object *prev; /* Link for list of acquired mutexes */ | 184 | u8 original_sync_level; /* Owner's original sync level (0-15) */ |
214 | union acpi_operand_object *next; /* Link for list of acquired mutexes */ | ||
215 | struct acpi_namespace_node *node; /* Containing namespace node */ | ||
216 | u8 original_sync_level; /* Owner's original sync level (0-15) */ | ||
217 | }; | 185 | }; |
218 | 186 | ||
219 | 187 | struct acpi_object_region { | |
220 | struct acpi_object_region | 188 | ACPI_OBJECT_COMMON_HEADER u8 space_id; |
221 | { | 189 | union acpi_operand_object *handler; /* Handler for region access */ |
222 | ACPI_OBJECT_COMMON_HEADER | 190 | struct acpi_namespace_node *node; /* Containing namespace node */ |
223 | 191 | union acpi_operand_object *next; | |
224 | u8 space_id; | 192 | u32 length; |
225 | union acpi_operand_object *handler; /* Handler for region access */ | 193 | acpi_physical_address address; |
226 | struct acpi_namespace_node *node; /* Containing namespace node */ | ||
227 | union acpi_operand_object *next; | ||
228 | u32 length; | ||
229 | acpi_physical_address address; | ||
230 | }; | 194 | }; |
231 | 195 | ||
232 | |||
233 | /****************************************************************************** | 196 | /****************************************************************************** |
234 | * | 197 | * |
235 | * Objects that can be notified. All share a common notify_info area. | 198 | * Objects that can be notified. All share a common notify_info area. |
236 | * | 199 | * |
237 | *****************************************************************************/ | 200 | *****************************************************************************/ |
238 | 201 | ||
239 | struct acpi_object_notify_common /* COMMON NOTIFY for POWER, PROCESSOR, DEVICE, and THERMAL */ | 202 | struct acpi_object_notify_common { /* COMMON NOTIFY for POWER, PROCESSOR, DEVICE, and THERMAL */ |
240 | { | 203 | ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_NOTIFY_INFO}; |
241 | ACPI_OBJECT_COMMON_HEADER | ||
242 | ACPI_COMMON_NOTIFY_INFO | ||
243 | }; | ||
244 | |||
245 | |||
246 | struct acpi_object_device | ||
247 | { | ||
248 | ACPI_OBJECT_COMMON_HEADER | ||
249 | ACPI_COMMON_NOTIFY_INFO | ||
250 | struct acpi_gpe_block_info *gpe_block; | ||
251 | }; | ||
252 | |||
253 | 204 | ||
254 | struct acpi_object_power_resource | 205 | struct acpi_object_device { |
255 | { | ||
256 | ACPI_OBJECT_COMMON_HEADER | 206 | ACPI_OBJECT_COMMON_HEADER |
257 | ACPI_COMMON_NOTIFY_INFO | 207 | ACPI_COMMON_NOTIFY_INFO struct acpi_gpe_block_info *gpe_block; |
258 | u32 system_level; | ||
259 | u32 resource_order; | ||
260 | }; | 208 | }; |
261 | 209 | ||
262 | 210 | struct acpi_object_power_resource { | |
263 | struct acpi_object_processor | 211 | ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_NOTIFY_INFO u32 system_level; |
264 | { | 212 | u32 resource_order; |
265 | ACPI_OBJECT_COMMON_HEADER | ||
266 | ACPI_COMMON_NOTIFY_INFO | ||
267 | u32 proc_id; | ||
268 | u32 length; | ||
269 | acpi_io_address address; | ||
270 | }; | 213 | }; |
271 | 214 | ||
272 | 215 | struct acpi_object_processor { | |
273 | struct acpi_object_thermal_zone | 216 | ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_NOTIFY_INFO u32 proc_id; |
274 | { | 217 | u32 length; |
275 | ACPI_OBJECT_COMMON_HEADER | 218 | acpi_io_address address; |
276 | ACPI_COMMON_NOTIFY_INFO | ||
277 | }; | 219 | }; |
278 | 220 | ||
221 | struct acpi_object_thermal_zone { | ||
222 | ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_NOTIFY_INFO}; | ||
279 | 223 | ||
280 | /****************************************************************************** | 224 | /****************************************************************************** |
281 | * | 225 | * |
@@ -283,90 +227,63 @@ struct acpi_object_thermal_zone | |||
283 | * | 227 | * |
284 | *****************************************************************************/ | 228 | *****************************************************************************/ |
285 | 229 | ||
286 | struct acpi_object_field_common /* COMMON FIELD (for BUFFER, REGION, BANK, and INDEX fields) */ | 230 | struct acpi_object_field_common { /* COMMON FIELD (for BUFFER, REGION, BANK, and INDEX fields) */ |
287 | { | 231 | ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO union acpi_operand_object *region_obj; /* Containing Operation Region object */ |
288 | ACPI_OBJECT_COMMON_HEADER | 232 | /* (REGION/BANK fields only) */ |
289 | ACPI_COMMON_FIELD_INFO | ||
290 | union acpi_operand_object *region_obj; /* Containing Operation Region object */ | ||
291 | /* (REGION/BANK fields only) */ | ||
292 | }; | 233 | }; |
293 | 234 | ||
294 | 235 | struct acpi_object_region_field { | |
295 | struct acpi_object_region_field | 236 | ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO union acpi_operand_object *region_obj; /* Containing op_region object */ |
296 | { | ||
297 | ACPI_OBJECT_COMMON_HEADER | ||
298 | ACPI_COMMON_FIELD_INFO | ||
299 | union acpi_operand_object *region_obj; /* Containing op_region object */ | ||
300 | }; | 237 | }; |
301 | 238 | ||
302 | 239 | struct acpi_object_bank_field { | |
303 | struct acpi_object_bank_field | 240 | ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO union acpi_operand_object *region_obj; /* Containing op_region object */ |
304 | { | 241 | union acpi_operand_object *bank_obj; /* bank_select Register object */ |
305 | ACPI_OBJECT_COMMON_HEADER | ||
306 | ACPI_COMMON_FIELD_INFO | ||
307 | union acpi_operand_object *region_obj; /* Containing op_region object */ | ||
308 | union acpi_operand_object *bank_obj; /* bank_select Register object */ | ||
309 | }; | 242 | }; |
310 | 243 | ||
311 | 244 | struct acpi_object_index_field { | |
312 | struct acpi_object_index_field | 245 | ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO |
313 | { | 246 | /* |
314 | ACPI_OBJECT_COMMON_HEADER | 247 | * No "region_obj" pointer needed since the Index and Data registers |
315 | ACPI_COMMON_FIELD_INFO | 248 | * are each field definitions unto themselves. |
316 | 249 | */ | |
317 | /* | 250 | union acpi_operand_object *index_obj; /* Index register */ |
318 | * No "region_obj" pointer needed since the Index and Data registers | 251 | union acpi_operand_object *data_obj; /* Data register */ |
319 | * are each field definitions unto themselves. | ||
320 | */ | ||
321 | union acpi_operand_object *index_obj; /* Index register */ | ||
322 | union acpi_operand_object *data_obj; /* Data register */ | ||
323 | }; | 252 | }; |
324 | 253 | ||
325 | |||
326 | /* The buffer_field is different in that it is part of a Buffer, not an op_region */ | 254 | /* The buffer_field is different in that it is part of a Buffer, not an op_region */ |
327 | 255 | ||
328 | struct acpi_object_buffer_field | 256 | struct acpi_object_buffer_field { |
329 | { | 257 | ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO union acpi_operand_object *buffer_obj; /* Containing Buffer object */ |
330 | ACPI_OBJECT_COMMON_HEADER | ||
331 | ACPI_COMMON_FIELD_INFO | ||
332 | union acpi_operand_object *buffer_obj; /* Containing Buffer object */ | ||
333 | }; | 258 | }; |
334 | 259 | ||
335 | |||
336 | /****************************************************************************** | 260 | /****************************************************************************** |
337 | * | 261 | * |
338 | * Objects for handlers | 262 | * Objects for handlers |
339 | * | 263 | * |
340 | *****************************************************************************/ | 264 | *****************************************************************************/ |
341 | 265 | ||
342 | struct acpi_object_notify_handler | 266 | struct acpi_object_notify_handler { |
343 | { | 267 | ACPI_OBJECT_COMMON_HEADER struct acpi_namespace_node *node; /* Parent device */ |
344 | ACPI_OBJECT_COMMON_HEADER | 268 | acpi_notify_handler handler; |
345 | struct acpi_namespace_node *node; /* Parent device */ | 269 | void *context; |
346 | acpi_notify_handler handler; | ||
347 | void *context; | ||
348 | }; | 270 | }; |
349 | 271 | ||
350 | |||
351 | /* Flags for address handler */ | 272 | /* Flags for address handler */ |
352 | 273 | ||
353 | #define ACPI_ADDR_HANDLER_DEFAULT_INSTALLED 0x1 | 274 | #define ACPI_ADDR_HANDLER_DEFAULT_INSTALLED 0x1 |
354 | 275 | ||
355 | 276 | struct acpi_object_addr_handler { | |
356 | struct acpi_object_addr_handler | 277 | ACPI_OBJECT_COMMON_HEADER u8 space_id; |
357 | { | 278 | u16 hflags; |
358 | ACPI_OBJECT_COMMON_HEADER | 279 | acpi_adr_space_handler handler; |
359 | u8 space_id; | 280 | struct acpi_namespace_node *node; /* Parent device */ |
360 | u16 hflags; | 281 | void *context; |
361 | acpi_adr_space_handler handler; | 282 | acpi_adr_space_setup setup; |
362 | struct acpi_namespace_node *node; /* Parent device */ | 283 | union acpi_operand_object *region_list; /* regions using this handler */ |
363 | void *context; | 284 | union acpi_operand_object *next; |
364 | acpi_adr_space_setup setup; | ||
365 | union acpi_operand_object *region_list; /* regions using this handler */ | ||
366 | union acpi_operand_object *next; | ||
367 | }; | 285 | }; |
368 | 286 | ||
369 | |||
370 | /****************************************************************************** | 287 | /****************************************************************************** |
371 | * | 288 | * |
372 | * Special internal objects | 289 | * Special internal objects |
@@ -377,18 +294,15 @@ struct acpi_object_addr_handler | |||
377 | * The Reference object type is used for these opcodes: | 294 | * The Reference object type is used for these opcodes: |
378 | * Arg[0-6], Local[0-7], index_op, name_op, zero_op, one_op, ones_op, debug_op | 295 | * Arg[0-6], Local[0-7], index_op, name_op, zero_op, one_op, ones_op, debug_op |
379 | */ | 296 | */ |
380 | struct acpi_object_reference | 297 | struct acpi_object_reference { |
381 | { | 298 | ACPI_OBJECT_COMMON_HEADER u8 target_type; /* Used for index_op */ |
382 | ACPI_OBJECT_COMMON_HEADER | 299 | u16 opcode; |
383 | u8 target_type; /* Used for index_op */ | 300 | u32 offset; /* Used for arg_op, local_op, and index_op */ |
384 | u16 opcode; | 301 | void *object; /* name_op=>HANDLE to obj, index_op=>union acpi_operand_object */ |
385 | u32 offset; /* Used for arg_op, local_op, and index_op */ | 302 | struct acpi_namespace_node *node; |
386 | void *object; /* name_op=>HANDLE to obj, index_op=>union acpi_operand_object */ | 303 | union acpi_operand_object **where; |
387 | struct acpi_namespace_node *node; | ||
388 | union acpi_operand_object **where; | ||
389 | }; | 304 | }; |
390 | 305 | ||
391 | |||
392 | /* | 306 | /* |
393 | * Extra object is used as additional storage for types that | 307 | * Extra object is used as additional storage for types that |
394 | * have AML code in their declarations (term_args) that must be | 308 | * have AML code in their declarations (term_args) that must be |
@@ -396,73 +310,62 @@ struct acpi_object_reference | |||
396 | * | 310 | * |
397 | * Currently: Region and field_unit types | 311 | * Currently: Region and field_unit types |
398 | */ | 312 | */ |
399 | struct acpi_object_extra | 313 | struct acpi_object_extra { |
400 | { | 314 | ACPI_OBJECT_COMMON_HEADER u8 byte_fill1; |
401 | ACPI_OBJECT_COMMON_HEADER | 315 | u16 word_fill1; |
402 | u8 byte_fill1; | 316 | u32 aml_length; |
403 | u16 word_fill1; | 317 | u8 *aml_start; |
404 | u32 aml_length; | 318 | struct acpi_namespace_node *method_REG; /* _REG method for this region (if any) */ |
405 | u8 *aml_start; | 319 | void *region_context; /* Region-specific data */ |
406 | struct acpi_namespace_node *method_REG; /* _REG method for this region (if any) */ | ||
407 | void *region_context; /* Region-specific data */ | ||
408 | }; | 320 | }; |
409 | 321 | ||
410 | |||
411 | /* Additional data that can be attached to namespace nodes */ | 322 | /* Additional data that can be attached to namespace nodes */ |
412 | 323 | ||
413 | struct acpi_object_data | 324 | struct acpi_object_data { |
414 | { | 325 | ACPI_OBJECT_COMMON_HEADER acpi_object_handler handler; |
415 | ACPI_OBJECT_COMMON_HEADER | 326 | void *pointer; |
416 | acpi_object_handler handler; | ||
417 | void *pointer; | ||
418 | }; | 327 | }; |
419 | 328 | ||
420 | |||
421 | /* Structure used when objects are cached for reuse */ | 329 | /* Structure used when objects are cached for reuse */ |
422 | 330 | ||
423 | struct acpi_object_cache_list | 331 | struct acpi_object_cache_list { |
424 | { | 332 | ACPI_OBJECT_COMMON_HEADER union acpi_operand_object *next; /* Link for object cache and internal lists */ |
425 | ACPI_OBJECT_COMMON_HEADER | ||
426 | union acpi_operand_object *next; /* Link for object cache and internal lists*/ | ||
427 | }; | 333 | }; |
428 | 334 | ||
429 | |||
430 | /****************************************************************************** | 335 | /****************************************************************************** |
431 | * | 336 | * |
432 | * union acpi_operand_object Descriptor - a giant union of all of the above | 337 | * union acpi_operand_object Descriptor - a giant union of all of the above |
433 | * | 338 | * |
434 | *****************************************************************************/ | 339 | *****************************************************************************/ |
435 | 340 | ||
436 | union acpi_operand_object | 341 | union acpi_operand_object { |
437 | { | 342 | struct acpi_object_common common; |
438 | struct acpi_object_common common; | 343 | struct acpi_object_integer integer; |
439 | struct acpi_object_integer integer; | 344 | struct acpi_object_string string; |
440 | struct acpi_object_string string; | 345 | struct acpi_object_buffer buffer; |
441 | struct acpi_object_buffer buffer; | 346 | struct acpi_object_package package; |
442 | struct acpi_object_package package; | 347 | struct acpi_object_event event; |
443 | struct acpi_object_event event; | 348 | struct acpi_object_method method; |
444 | struct acpi_object_method method; | 349 | struct acpi_object_mutex mutex; |
445 | struct acpi_object_mutex mutex; | 350 | struct acpi_object_region region; |
446 | struct acpi_object_region region; | 351 | struct acpi_object_notify_common common_notify; |
447 | struct acpi_object_notify_common common_notify; | 352 | struct acpi_object_device device; |
448 | struct acpi_object_device device; | 353 | struct acpi_object_power_resource power_resource; |
449 | struct acpi_object_power_resource power_resource; | 354 | struct acpi_object_processor processor; |
450 | struct acpi_object_processor processor; | 355 | struct acpi_object_thermal_zone thermal_zone; |
451 | struct acpi_object_thermal_zone thermal_zone; | 356 | struct acpi_object_field_common common_field; |
452 | struct acpi_object_field_common common_field; | 357 | struct acpi_object_region_field field; |
453 | struct acpi_object_region_field field; | 358 | struct acpi_object_buffer_field buffer_field; |
454 | struct acpi_object_buffer_field buffer_field; | 359 | struct acpi_object_bank_field bank_field; |
455 | struct acpi_object_bank_field bank_field; | 360 | struct acpi_object_index_field index_field; |
456 | struct acpi_object_index_field index_field; | 361 | struct acpi_object_notify_handler notify; |
457 | struct acpi_object_notify_handler notify; | 362 | struct acpi_object_addr_handler address_space; |
458 | struct acpi_object_addr_handler address_space; | 363 | struct acpi_object_reference reference; |
459 | struct acpi_object_reference reference; | 364 | struct acpi_object_extra extra; |
460 | struct acpi_object_extra extra; | 365 | struct acpi_object_data data; |
461 | struct acpi_object_data data; | 366 | struct acpi_object_cache_list cache; |
462 | struct acpi_object_cache_list cache; | ||
463 | }; | 367 | }; |
464 | 368 | ||
465 | |||
466 | /****************************************************************************** | 369 | /****************************************************************************** |
467 | * | 370 | * |
468 | * union acpi_descriptor - objects that share a common descriptor identifier | 371 | * union acpi_descriptor - objects that share a common descriptor identifier |
@@ -471,7 +374,7 @@ union acpi_operand_object | |||
471 | 374 | ||
472 | /* Object descriptor types */ | 375 | /* Object descriptor types */ |
473 | 376 | ||
474 | #define ACPI_DESC_TYPE_CACHED 0x01 /* Used only when object is cached */ | 377 | #define ACPI_DESC_TYPE_CACHED 0x01 /* Used only when object is cached */ |
475 | #define ACPI_DESC_TYPE_STATE 0x02 | 378 | #define ACPI_DESC_TYPE_STATE 0x02 |
476 | #define ACPI_DESC_TYPE_STATE_UPDATE 0x03 | 379 | #define ACPI_DESC_TYPE_STATE_UPDATE 0x03 |
477 | #define ACPI_DESC_TYPE_STATE_PACKAGE 0x04 | 380 | #define ACPI_DESC_TYPE_STATE_PACKAGE 0x04 |
@@ -488,14 +391,11 @@ union acpi_operand_object | |||
488 | #define ACPI_DESC_TYPE_NAMED 0x0F | 391 | #define ACPI_DESC_TYPE_NAMED 0x0F |
489 | #define ACPI_DESC_TYPE_MAX 0x0F | 392 | #define ACPI_DESC_TYPE_MAX 0x0F |
490 | 393 | ||
491 | 394 | union acpi_descriptor { | |
492 | union acpi_descriptor | 395 | u8 descriptor_id; /* To differentiate various internal objs */ |
493 | { | 396 | union acpi_operand_object object; |
494 | u8 descriptor_id; /* To differentiate various internal objs */\ | 397 | struct acpi_namespace_node node; |
495 | union acpi_operand_object object; | 398 | union acpi_parse_object op; |
496 | struct acpi_namespace_node node; | ||
497 | union acpi_parse_object op; | ||
498 | }; | 399 | }; |
499 | 400 | ||
500 | 401 | #endif /* _ACOBJECT_H */ | |
501 | #endif /* _ACOBJECT_H */ | ||
diff --git a/include/acpi/acopcode.h b/include/acpi/acopcode.h index 093f697e8c54..64da42992199 100644 --- a/include/acpi/acopcode.h +++ b/include/acpi/acopcode.h | |||
@@ -62,7 +62,6 @@ | |||
62 | #define _NAM 0x6C | 62 | #define _NAM 0x6C |
63 | #define _PFX 0x6D | 63 | #define _PFX 0x6D |
64 | 64 | ||
65 | |||
66 | /* | 65 | /* |
67 | * All AML opcodes and the parse-time arguments for each. Used by the AML | 66 | * All AML opcodes and the parse-time arguments for each. Used by the AML |
68 | * parser Each list is compressed into a 32-bit number and stored in the | 67 | * parser Each list is compressed into a 32-bit number and stored in the |
@@ -191,7 +190,6 @@ | |||
191 | #define ARGP_WORD_OP ARGP_LIST1 (ARGP_WORDDATA) | 190 | #define ARGP_WORD_OP ARGP_LIST1 (ARGP_WORDDATA) |
192 | #define ARGP_ZERO_OP ARG_NONE | 191 | #define ARGP_ZERO_OP ARG_NONE |
193 | 192 | ||
194 | |||
195 | /* | 193 | /* |
196 | * All AML opcodes and the runtime arguments for each. Used by the AML | 194 | * All AML opcodes and the runtime arguments for each. Used by the AML |
197 | * interpreter Each list is compressed into a 32-bit number and stored | 195 | * interpreter Each list is compressed into a 32-bit number and stored |
@@ -322,4 +320,4 @@ | |||
322 | #define ARGI_WORD_OP ARGI_INVALID_OPCODE | 320 | #define ARGI_WORD_OP ARGI_INVALID_OPCODE |
323 | #define ARGI_ZERO_OP ARG_NONE | 321 | #define ARGI_ZERO_OP ARG_NONE |
324 | 322 | ||
325 | #endif /* __ACOPCODE_H__ */ | 323 | #endif /* __ACOPCODE_H__ */ |
diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h index d7e828cb84b3..68d7edf0f697 100644 --- a/include/acpi/acoutput.h +++ b/include/acpi/acoutput.h | |||
@@ -73,12 +73,10 @@ | |||
73 | #define ACPI_ALL_COMPONENTS 0x00003FFF | 73 | #define ACPI_ALL_COMPONENTS 0x00003FFF |
74 | #define ACPI_COMPONENT_DEFAULT (ACPI_ALL_COMPONENTS) | 74 | #define ACPI_COMPONENT_DEFAULT (ACPI_ALL_COMPONENTS) |
75 | 75 | ||
76 | |||
77 | /* Component IDs reserved for ACPI drivers */ | 76 | /* Component IDs reserved for ACPI drivers */ |
78 | 77 | ||
79 | #define ACPI_ALL_DRIVERS 0xFFFF0000 | 78 | #define ACPI_ALL_DRIVERS 0xFFFF0000 |
80 | 79 | ||
81 | |||
82 | /* | 80 | /* |
83 | * Raw debug output levels, do not use these in the DEBUG_PRINT macros | 81 | * Raw debug output levels, do not use these in the DEBUG_PRINT macros |
84 | */ | 82 | */ |
@@ -132,7 +130,6 @@ | |||
132 | 130 | ||
133 | #define ACPI_LV_VERBOSE 0xF0000000 | 131 | #define ACPI_LV_VERBOSE 0xF0000000 |
134 | 132 | ||
135 | |||
136 | /* | 133 | /* |
137 | * Debug level macros that are used in the DEBUG_PRINT macros | 134 | * Debug level macros that are used in the DEBUG_PRINT macros |
138 | */ | 135 | */ |
@@ -147,7 +144,6 @@ | |||
147 | #define ACPI_DB_INFO ACPI_DEBUG_LEVEL (ACPI_LV_INFO) | 144 | #define ACPI_DB_INFO ACPI_DEBUG_LEVEL (ACPI_LV_INFO) |
148 | #define ACPI_DB_ALL_EXCEPTIONS ACPI_DEBUG_LEVEL (ACPI_LV_ALL_EXCEPTIONS) | 145 | #define ACPI_DB_ALL_EXCEPTIONS ACPI_DEBUG_LEVEL (ACPI_LV_ALL_EXCEPTIONS) |
149 | 146 | ||
150 | |||
151 | /* Trace level -- also used in the global "debug_level" */ | 147 | /* Trace level -- also used in the global "debug_level" */ |
152 | 148 | ||
153 | #define ACPI_DB_INIT_NAMES ACPI_DEBUG_LEVEL (ACPI_LV_INIT_NAMES) | 149 | #define ACPI_DB_INIT_NAMES ACPI_DEBUG_LEVEL (ACPI_LV_INIT_NAMES) |
@@ -174,12 +170,10 @@ | |||
174 | 170 | ||
175 | #define ACPI_DB_ALL ACPI_DEBUG_LEVEL (ACPI_LV_ALL) | 171 | #define ACPI_DB_ALL ACPI_DEBUG_LEVEL (ACPI_LV_ALL) |
176 | 172 | ||
177 | |||
178 | /* Defaults for debug_level, debug and normal */ | 173 | /* Defaults for debug_level, debug and normal */ |
179 | 174 | ||
180 | #define ACPI_DEBUG_DEFAULT (ACPI_LV_INIT | ACPI_LV_WARN | ACPI_LV_ERROR | ACPI_LV_DEBUG_OBJECT) | 175 | #define ACPI_DEBUG_DEFAULT (ACPI_LV_INIT | ACPI_LV_WARN | ACPI_LV_ERROR | ACPI_LV_DEBUG_OBJECT) |
181 | #define ACPI_NORMAL_DEFAULT (ACPI_LV_INIT | ACPI_LV_WARN | ACPI_LV_ERROR | ACPI_LV_DEBUG_OBJECT) | 176 | #define ACPI_NORMAL_DEFAULT (ACPI_LV_INIT | ACPI_LV_WARN | ACPI_LV_ERROR | ACPI_LV_DEBUG_OBJECT) |
182 | #define ACPI_DEBUG_ALL (ACPI_LV_AML_DISASSEMBLE | ACPI_LV_ALL_EXCEPTIONS | ACPI_LV_ALL) | 177 | #define ACPI_DEBUG_ALL (ACPI_LV_AML_DISASSEMBLE | ACPI_LV_ALL_EXCEPTIONS | ACPI_LV_ALL) |
183 | 178 | ||
184 | 179 | #endif /* __ACOUTPUT_H__ */ | |
185 | #endif /* __ACOUTPUT_H__ */ | ||
diff --git a/include/acpi/acparser.h b/include/acpi/acparser.h index f692ad56cd82..d352d40de1f3 100644 --- a/include/acpi/acparser.h +++ b/include/acpi/acparser.h | |||
@@ -41,18 +41,15 @@ | |||
41 | * POSSIBILITY OF SUCH DAMAGES. | 41 | * POSSIBILITY OF SUCH DAMAGES. |
42 | */ | 42 | */ |
43 | 43 | ||
44 | |||
45 | #ifndef __ACPARSER_H__ | 44 | #ifndef __ACPARSER_H__ |
46 | #define __ACPARSER_H__ | 45 | #define __ACPARSER_H__ |
47 | 46 | ||
48 | |||
49 | #define OP_HAS_RETURN_VALUE 1 | 47 | #define OP_HAS_RETURN_VALUE 1 |
50 | 48 | ||
51 | /* variable # arguments */ | 49 | /* variable # arguments */ |
52 | 50 | ||
53 | #define ACPI_VAR_ARGS ACPI_UINT32_MAX | 51 | #define ACPI_VAR_ARGS ACPI_UINT32_MAX |
54 | 52 | ||
55 | |||
56 | #define ACPI_PARSE_DELETE_TREE 0x0001 | 53 | #define ACPI_PARSE_DELETE_TREE 0x0001 |
57 | #define ACPI_PARSE_NO_TREE_DELETE 0x0000 | 54 | #define ACPI_PARSE_NO_TREE_DELETE 0x0000 |
58 | #define ACPI_PARSE_TREE_MASK 0x0001 | 55 | #define ACPI_PARSE_TREE_MASK 0x0001 |
@@ -65,266 +62,171 @@ | |||
65 | #define ACPI_PARSE_DEFERRED_OP 0x0100 | 62 | #define ACPI_PARSE_DEFERRED_OP 0x0100 |
66 | #define ACPI_PARSE_DISASSEMBLE 0x0200 | 63 | #define ACPI_PARSE_DISASSEMBLE 0x0200 |
67 | 64 | ||
68 | |||
69 | /****************************************************************************** | 65 | /****************************************************************************** |
70 | * | 66 | * |
71 | * Parser interfaces | 67 | * Parser interfaces |
72 | * | 68 | * |
73 | *****************************************************************************/ | 69 | *****************************************************************************/ |
74 | 70 | ||
75 | |||
76 | /* | 71 | /* |
77 | * psxface - Parser external interfaces | 72 | * psxface - Parser external interfaces |
78 | */ | 73 | */ |
79 | acpi_status | 74 | acpi_status acpi_ps_execute_method(struct acpi_parameter_info *info); |
80 | acpi_ps_execute_method ( | ||
81 | struct acpi_parameter_info *info); | ||
82 | |||
83 | 75 | ||
84 | /* | 76 | /* |
85 | * psargs - Parse AML opcode arguments | 77 | * psargs - Parse AML opcode arguments |
86 | */ | 78 | */ |
87 | u8 * | 79 | u8 *acpi_ps_get_next_package_end(struct acpi_parse_state *parser_state); |
88 | acpi_ps_get_next_package_end ( | ||
89 | struct acpi_parse_state *parser_state); | ||
90 | 80 | ||
91 | char * | 81 | char *acpi_ps_get_next_namestring(struct acpi_parse_state *parser_state); |
92 | acpi_ps_get_next_namestring ( | ||
93 | struct acpi_parse_state *parser_state); | ||
94 | 82 | ||
95 | void | 83 | void |
96 | acpi_ps_get_next_simple_arg ( | 84 | acpi_ps_get_next_simple_arg(struct acpi_parse_state *parser_state, |
97 | struct acpi_parse_state *parser_state, | 85 | u32 arg_type, union acpi_parse_object *arg); |
98 | u32 arg_type, | ||
99 | union acpi_parse_object *arg); | ||
100 | 86 | ||
101 | acpi_status | 87 | acpi_status |
102 | acpi_ps_get_next_namepath ( | 88 | acpi_ps_get_next_namepath(struct acpi_walk_state *walk_state, |
103 | struct acpi_walk_state *walk_state, | 89 | struct acpi_parse_state *parser_state, |
104 | struct acpi_parse_state *parser_state, | 90 | union acpi_parse_object *arg, u8 method_call); |
105 | union acpi_parse_object *arg, | ||
106 | u8 method_call); | ||
107 | 91 | ||
108 | acpi_status | 92 | acpi_status |
109 | acpi_ps_get_next_arg ( | 93 | acpi_ps_get_next_arg(struct acpi_walk_state *walk_state, |
110 | struct acpi_walk_state *walk_state, | 94 | struct acpi_parse_state *parser_state, |
111 | struct acpi_parse_state *parser_state, | 95 | u32 arg_type, union acpi_parse_object **return_arg); |
112 | u32 arg_type, | ||
113 | union acpi_parse_object **return_arg); | ||
114 | |||
115 | 96 | ||
116 | /* | 97 | /* |
117 | * psfind | 98 | * psfind |
118 | */ | 99 | */ |
119 | union acpi_parse_object * | 100 | union acpi_parse_object *acpi_ps_find_name(union acpi_parse_object *scope, |
120 | acpi_ps_find_name ( | 101 | u32 name, u32 opcode); |
121 | union acpi_parse_object *scope, | ||
122 | u32 name, | ||
123 | u32 opcode); | ||
124 | |||
125 | union acpi_parse_object* | ||
126 | acpi_ps_get_parent ( | ||
127 | union acpi_parse_object *op); | ||
128 | 102 | ||
103 | union acpi_parse_object *acpi_ps_get_parent(union acpi_parse_object *op); | ||
129 | 104 | ||
130 | /* | 105 | /* |
131 | * psopcode - AML Opcode information | 106 | * psopcode - AML Opcode information |
132 | */ | 107 | */ |
133 | const struct acpi_opcode_info * | 108 | const struct acpi_opcode_info *acpi_ps_get_opcode_info(u16 opcode); |
134 | acpi_ps_get_opcode_info ( | ||
135 | u16 opcode); | ||
136 | |||
137 | char * | ||
138 | acpi_ps_get_opcode_name ( | ||
139 | u16 opcode); | ||
140 | 109 | ||
110 | char *acpi_ps_get_opcode_name(u16 opcode); | ||
141 | 111 | ||
142 | /* | 112 | /* |
143 | * psparse - top level parsing routines | 113 | * psparse - top level parsing routines |
144 | */ | 114 | */ |
145 | acpi_status | 115 | acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state); |
146 | acpi_ps_parse_aml ( | ||
147 | struct acpi_walk_state *walk_state); | ||
148 | 116 | ||
149 | u32 | 117 | u32 acpi_ps_get_opcode_size(u32 opcode); |
150 | acpi_ps_get_opcode_size ( | ||
151 | u32 opcode); | ||
152 | 118 | ||
153 | u16 | 119 | u16 acpi_ps_peek_opcode(struct acpi_parse_state *state); |
154 | acpi_ps_peek_opcode ( | ||
155 | struct acpi_parse_state *state); | ||
156 | 120 | ||
157 | acpi_status | 121 | acpi_status |
158 | acpi_ps_complete_this_op ( | 122 | acpi_ps_complete_this_op(struct acpi_walk_state *walk_state, |
159 | struct acpi_walk_state *walk_state, | 123 | union acpi_parse_object *op); |
160 | union acpi_parse_object *op); | ||
161 | 124 | ||
162 | acpi_status | 125 | acpi_status |
163 | acpi_ps_next_parse_state ( | 126 | acpi_ps_next_parse_state(struct acpi_walk_state *walk_state, |
164 | struct acpi_walk_state *walk_state, | 127 | union acpi_parse_object *op, |
165 | union acpi_parse_object *op, | 128 | acpi_status callback_status); |
166 | acpi_status callback_status); | ||
167 | |||
168 | 129 | ||
169 | /* | 130 | /* |
170 | * psloop - main parse loop | 131 | * psloop - main parse loop |
171 | */ | 132 | */ |
172 | acpi_status | 133 | acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state); |
173 | acpi_ps_parse_loop ( | ||
174 | struct acpi_walk_state *walk_state); | ||
175 | |||
176 | 134 | ||
177 | /* | 135 | /* |
178 | * psscope - Scope stack management routines | 136 | * psscope - Scope stack management routines |
179 | */ | 137 | */ |
180 | acpi_status | 138 | acpi_status |
181 | acpi_ps_init_scope ( | 139 | acpi_ps_init_scope(struct acpi_parse_state *parser_state, |
182 | struct acpi_parse_state *parser_state, | 140 | union acpi_parse_object *root); |
183 | union acpi_parse_object *root); | ||
184 | 141 | ||
185 | union acpi_parse_object * | 142 | union acpi_parse_object *acpi_ps_get_parent_scope(struct acpi_parse_state |
186 | acpi_ps_get_parent_scope ( | 143 | *state); |
187 | struct acpi_parse_state *state); | ||
188 | 144 | ||
189 | u8 | 145 | u8 acpi_ps_has_completed_scope(struct acpi_parse_state *parser_state); |
190 | acpi_ps_has_completed_scope ( | ||
191 | struct acpi_parse_state *parser_state); | ||
192 | 146 | ||
193 | void | 147 | void |
194 | acpi_ps_pop_scope ( | 148 | acpi_ps_pop_scope(struct acpi_parse_state *parser_state, |
195 | struct acpi_parse_state *parser_state, | 149 | union acpi_parse_object **op, |
196 | union acpi_parse_object **op, | 150 | u32 * arg_list, u32 * arg_count); |
197 | u32 *arg_list, | ||
198 | u32 *arg_count); | ||
199 | 151 | ||
200 | acpi_status | 152 | acpi_status |
201 | acpi_ps_push_scope ( | 153 | acpi_ps_push_scope(struct acpi_parse_state *parser_state, |
202 | struct acpi_parse_state *parser_state, | 154 | union acpi_parse_object *op, |
203 | union acpi_parse_object *op, | 155 | u32 remaining_args, u32 arg_count); |
204 | u32 remaining_args, | ||
205 | u32 arg_count); | ||
206 | |||
207 | void | ||
208 | acpi_ps_cleanup_scope ( | ||
209 | struct acpi_parse_state *state); | ||
210 | 156 | ||
157 | void acpi_ps_cleanup_scope(struct acpi_parse_state *state); | ||
211 | 158 | ||
212 | /* | 159 | /* |
213 | * pstree - parse tree manipulation routines | 160 | * pstree - parse tree manipulation routines |
214 | */ | 161 | */ |
215 | void | 162 | void |
216 | acpi_ps_append_arg( | 163 | acpi_ps_append_arg(union acpi_parse_object *op, union acpi_parse_object *arg); |
217 | union acpi_parse_object *op, | ||
218 | union acpi_parse_object *arg); | ||
219 | |||
220 | union acpi_parse_object* | ||
221 | acpi_ps_find ( | ||
222 | union acpi_parse_object *scope, | ||
223 | char *path, | ||
224 | u16 opcode, | ||
225 | u32 create); | ||
226 | |||
227 | union acpi_parse_object * | ||
228 | acpi_ps_get_arg( | ||
229 | union acpi_parse_object *op, | ||
230 | u32 argn); | ||
231 | 164 | ||
232 | #ifdef ACPI_FUTURE_USAGE | 165 | union acpi_parse_object *acpi_ps_find(union acpi_parse_object *scope, |
233 | union acpi_parse_object * | 166 | char *path, u16 opcode, u32 create); |
234 | acpi_ps_get_depth_next ( | 167 | |
235 | union acpi_parse_object *origin, | 168 | union acpi_parse_object *acpi_ps_get_arg(union acpi_parse_object *op, u32 argn); |
236 | union acpi_parse_object *op); | ||
237 | #endif /* ACPI_FUTURE_USAGE */ | ||
238 | 169 | ||
170 | #ifdef ACPI_FUTURE_USAGE | ||
171 | union acpi_parse_object *acpi_ps_get_depth_next(union acpi_parse_object *origin, | ||
172 | union acpi_parse_object *op); | ||
173 | #endif /* ACPI_FUTURE_USAGE */ | ||
239 | 174 | ||
240 | /* | 175 | /* |
241 | * pswalk - parse tree walk routines | 176 | * pswalk - parse tree walk routines |
242 | */ | 177 | */ |
243 | acpi_status | 178 | acpi_status |
244 | acpi_ps_walk_parsed_aml ( | 179 | acpi_ps_walk_parsed_aml(union acpi_parse_object *start_op, |
245 | union acpi_parse_object *start_op, | 180 | union acpi_parse_object *end_op, |
246 | union acpi_parse_object *end_op, | 181 | union acpi_operand_object *mth_desc, |
247 | union acpi_operand_object *mth_desc, | 182 | struct acpi_namespace_node *start_node, |
248 | struct acpi_namespace_node *start_node, | 183 | union acpi_operand_object **params, |
249 | union acpi_operand_object **params, | 184 | union acpi_operand_object **caller_return_desc, |
250 | union acpi_operand_object **caller_return_desc, | 185 | acpi_owner_id owner_id, |
251 | acpi_owner_id owner_id, | 186 | acpi_parse_downwards descending_callback, |
252 | acpi_parse_downwards descending_callback, | 187 | acpi_parse_upwards ascending_callback); |
253 | acpi_parse_upwards ascending_callback); | ||
254 | |||
255 | acpi_status | ||
256 | acpi_ps_get_next_walk_op ( | ||
257 | struct acpi_walk_state *walk_state, | ||
258 | union acpi_parse_object *op, | ||
259 | acpi_parse_upwards ascending_callback); | ||
260 | 188 | ||
261 | acpi_status | 189 | acpi_status |
262 | acpi_ps_delete_completed_op ( | 190 | acpi_ps_get_next_walk_op(struct acpi_walk_state *walk_state, |
263 | struct acpi_walk_state *walk_state); | 191 | union acpi_parse_object *op, |
192 | acpi_parse_upwards ascending_callback); | ||
264 | 193 | ||
265 | void | 194 | acpi_status acpi_ps_delete_completed_op(struct acpi_walk_state *walk_state); |
266 | acpi_ps_delete_parse_tree ( | ||
267 | union acpi_parse_object *root); | ||
268 | 195 | ||
196 | void acpi_ps_delete_parse_tree(union acpi_parse_object *root); | ||
269 | 197 | ||
270 | /* | 198 | /* |
271 | * psutils - parser utilities | 199 | * psutils - parser utilities |
272 | */ | 200 | */ |
273 | union acpi_parse_object * | 201 | union acpi_parse_object *acpi_ps_create_scope_op(void); |
274 | acpi_ps_create_scope_op ( | ||
275 | void); | ||
276 | 202 | ||
277 | void | 203 | void acpi_ps_init_op(union acpi_parse_object *op, u16 opcode); |
278 | acpi_ps_init_op ( | ||
279 | union acpi_parse_object *op, | ||
280 | u16 opcode); | ||
281 | 204 | ||
282 | union acpi_parse_object * | 205 | union acpi_parse_object *acpi_ps_alloc_op(u16 opcode); |
283 | acpi_ps_alloc_op ( | ||
284 | u16 opcode); | ||
285 | 206 | ||
286 | void | 207 | void acpi_ps_free_op(union acpi_parse_object *op); |
287 | acpi_ps_free_op ( | ||
288 | union acpi_parse_object *op); | ||
289 | 208 | ||
290 | u8 | 209 | u8 acpi_ps_is_leading_char(u32 c); |
291 | acpi_ps_is_leading_char ( | ||
292 | u32 c); | ||
293 | 210 | ||
294 | u8 | 211 | u8 acpi_ps_is_prefix_char(u32 c); |
295 | acpi_ps_is_prefix_char ( | ||
296 | u32 c); | ||
297 | 212 | ||
298 | #ifdef ACPI_FUTURE_USAGE | 213 | #ifdef ACPI_FUTURE_USAGE |
299 | u32 | 214 | u32 acpi_ps_get_name(union acpi_parse_object *op); |
300 | acpi_ps_get_name( | 215 | #endif /* ACPI_FUTURE_USAGE */ |
301 | union acpi_parse_object *op); | ||
302 | #endif /* ACPI_FUTURE_USAGE */ | ||
303 | |||
304 | void | ||
305 | acpi_ps_set_name( | ||
306 | union acpi_parse_object *op, | ||
307 | u32 name); | ||
308 | 216 | ||
217 | void acpi_ps_set_name(union acpi_parse_object *op, u32 name); | ||
309 | 218 | ||
310 | /* | 219 | /* |
311 | * psdump - display parser tree | 220 | * psdump - display parser tree |
312 | */ | 221 | */ |
313 | u32 | 222 | u32 |
314 | acpi_ps_sprint_path ( | 223 | acpi_ps_sprint_path(char *buffer_start, |
315 | char *buffer_start, | 224 | u32 buffer_size, union acpi_parse_object *op); |
316 | u32 buffer_size, | ||
317 | union acpi_parse_object *op); | ||
318 | 225 | ||
319 | u32 | 226 | u32 |
320 | acpi_ps_sprint_op ( | 227 | acpi_ps_sprint_op(char *buffer_start, |
321 | char *buffer_start, | 228 | u32 buffer_size, union acpi_parse_object *op); |
322 | u32 buffer_size, | ||
323 | union acpi_parse_object *op); | ||
324 | |||
325 | void | ||
326 | acpi_ps_show ( | ||
327 | union acpi_parse_object *op); | ||
328 | 229 | ||
230 | void acpi_ps_show(union acpi_parse_object *op); | ||
329 | 231 | ||
330 | #endif /* __ACPARSER_H__ */ | 232 | #endif /* __ACPARSER_H__ */ |
diff --git a/include/acpi/acpi.h b/include/acpi/acpi.h index a69d78942040..ccf34f9dac64 100644 --- a/include/acpi/acpi.h +++ b/include/acpi/acpi.h | |||
@@ -49,22 +49,21 @@ | |||
49 | * We put them here because we don't want to duplicate them | 49 | * We put them here because we don't want to duplicate them |
50 | * in the rest of the source code again and again. | 50 | * in the rest of the source code again and again. |
51 | */ | 51 | */ |
52 | #include "acnames.h" /* Global ACPI names and strings */ | 52 | #include "acnames.h" /* Global ACPI names and strings */ |
53 | #include "acconfig.h" /* Configuration constants */ | 53 | #include "acconfig.h" /* Configuration constants */ |
54 | #include "platform/acenv.h" /* Target environment specific items */ | 54 | #include "platform/acenv.h" /* Target environment specific items */ |
55 | #include "actypes.h" /* Fundamental common data types */ | 55 | #include "actypes.h" /* Fundamental common data types */ |
56 | #include "acexcep.h" /* ACPI exception codes */ | 56 | #include "acexcep.h" /* ACPI exception codes */ |
57 | #include "acmacros.h" /* C macros */ | 57 | #include "acmacros.h" /* C macros */ |
58 | #include "actbl.h" /* ACPI table definitions */ | 58 | #include "actbl.h" /* ACPI table definitions */ |
59 | #include "aclocal.h" /* Internal data types */ | 59 | #include "aclocal.h" /* Internal data types */ |
60 | #include "acoutput.h" /* Error output and Debug macros */ | 60 | #include "acoutput.h" /* Error output and Debug macros */ |
61 | #include "acpiosxf.h" /* Interfaces to the ACPI-to-OS layer*/ | 61 | #include "acpiosxf.h" /* Interfaces to the ACPI-to-OS layer */ |
62 | #include "acpixf.h" /* ACPI core subsystem external interfaces */ | 62 | #include "acpixf.h" /* ACPI core subsystem external interfaces */ |
63 | #include "acobject.h" /* ACPI internal object */ | 63 | #include "acobject.h" /* ACPI internal object */ |
64 | #include "acstruct.h" /* Common structures */ | 64 | #include "acstruct.h" /* Common structures */ |
65 | #include "acglobal.h" /* All global variables */ | 65 | #include "acglobal.h" /* All global variables */ |
66 | #include "achware.h" /* Hardware defines and interfaces */ | 66 | #include "achware.h" /* Hardware defines and interfaces */ |
67 | #include "acutils.h" /* Utility interfaces */ | 67 | #include "acutils.h" /* Utility interfaces */ |
68 | 68 | ||
69 | 69 | #endif /* __ACPI_H__ */ | |
70 | #endif /* __ACPI_H__ */ | ||
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 8d0e1290bc76..4f4b2baa7176 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
@@ -35,48 +35,41 @@ | |||
35 | /* TBD: Make dynamic */ | 35 | /* TBD: Make dynamic */ |
36 | #define ACPI_MAX_HANDLES 10 | 36 | #define ACPI_MAX_HANDLES 10 |
37 | struct acpi_handle_list { | 37 | struct acpi_handle_list { |
38 | u32 count; | 38 | u32 count; |
39 | acpi_handle handles[ACPI_MAX_HANDLES]; | 39 | acpi_handle handles[ACPI_MAX_HANDLES]; |
40 | }; | 40 | }; |
41 | 41 | ||
42 | |||
43 | /* acpi_utils.h */ | 42 | /* acpi_utils.h */ |
44 | acpi_status | 43 | acpi_status |
45 | acpi_extract_package ( | 44 | acpi_extract_package(union acpi_object *package, |
46 | union acpi_object *package, | 45 | struct acpi_buffer *format, struct acpi_buffer *buffer); |
47 | struct acpi_buffer *format, | ||
48 | struct acpi_buffer *buffer); | ||
49 | acpi_status | 46 | acpi_status |
50 | acpi_evaluate_integer ( | 47 | acpi_evaluate_integer(acpi_handle handle, |
51 | acpi_handle handle, | 48 | acpi_string pathname, |
52 | acpi_string pathname, | 49 | struct acpi_object_list *arguments, unsigned long *data); |
53 | struct acpi_object_list *arguments, | ||
54 | unsigned long *data); | ||
55 | acpi_status | 50 | acpi_status |
56 | acpi_evaluate_reference ( | 51 | acpi_evaluate_reference(acpi_handle handle, |
57 | acpi_handle handle, | 52 | acpi_string pathname, |
58 | acpi_string pathname, | 53 | struct acpi_object_list *arguments, |
59 | struct acpi_object_list *arguments, | 54 | struct acpi_handle_list *list); |
60 | struct acpi_handle_list *list); | ||
61 | |||
62 | 55 | ||
63 | #ifdef CONFIG_ACPI_BUS | 56 | #ifdef CONFIG_ACPI_BUS |
64 | 57 | ||
65 | #include <linux/proc_fs.h> | 58 | #include <linux/proc_fs.h> |
66 | 59 | ||
67 | #define ACPI_BUS_FILE_ROOT "acpi" | 60 | #define ACPI_BUS_FILE_ROOT "acpi" |
68 | extern struct proc_dir_entry *acpi_root_dir; | 61 | extern struct proc_dir_entry *acpi_root_dir; |
69 | extern FADT_DESCRIPTOR acpi_fadt; | 62 | extern FADT_DESCRIPTOR acpi_fadt; |
70 | 63 | ||
71 | enum acpi_bus_removal_type { | 64 | enum acpi_bus_removal_type { |
72 | ACPI_BUS_REMOVAL_NORMAL = 0, | 65 | ACPI_BUS_REMOVAL_NORMAL = 0, |
73 | ACPI_BUS_REMOVAL_EJECT, | 66 | ACPI_BUS_REMOVAL_EJECT, |
74 | ACPI_BUS_REMOVAL_SUPRISE, | 67 | ACPI_BUS_REMOVAL_SUPRISE, |
75 | ACPI_BUS_REMOVAL_TYPE_COUNT | 68 | ACPI_BUS_REMOVAL_TYPE_COUNT |
76 | }; | 69 | }; |
77 | 70 | ||
78 | enum acpi_bus_device_type { | 71 | enum acpi_bus_device_type { |
79 | ACPI_BUS_TYPE_DEVICE = 0, | 72 | ACPI_BUS_TYPE_DEVICE = 0, |
80 | ACPI_BUS_TYPE_POWER, | 73 | ACPI_BUS_TYPE_POWER, |
81 | ACPI_BUS_TYPE_PROCESSOR, | 74 | ACPI_BUS_TYPE_PROCESSOR, |
82 | ACPI_BUS_TYPE_THERMAL, | 75 | ACPI_BUS_TYPE_THERMAL, |
@@ -89,61 +82,60 @@ enum acpi_bus_device_type { | |||
89 | struct acpi_driver; | 82 | struct acpi_driver; |
90 | struct acpi_device; | 83 | struct acpi_device; |
91 | 84 | ||
92 | |||
93 | /* | 85 | /* |
94 | * ACPI Driver | 86 | * ACPI Driver |
95 | * ----------- | 87 | * ----------- |
96 | */ | 88 | */ |
97 | 89 | ||
98 | typedef int (*acpi_op_add) (struct acpi_device *device); | 90 | typedef int (*acpi_op_add) (struct acpi_device * device); |
99 | typedef int (*acpi_op_remove) (struct acpi_device *device, int type); | 91 | typedef int (*acpi_op_remove) (struct acpi_device * device, int type); |
100 | typedef int (*acpi_op_lock) (struct acpi_device *device, int type); | 92 | typedef int (*acpi_op_lock) (struct acpi_device * device, int type); |
101 | typedef int (*acpi_op_start) (struct acpi_device *device); | 93 | typedef int (*acpi_op_start) (struct acpi_device * device); |
102 | typedef int (*acpi_op_stop) (struct acpi_device *device, int type); | 94 | typedef int (*acpi_op_stop) (struct acpi_device * device, int type); |
103 | typedef int (*acpi_op_suspend) (struct acpi_device *device, int state); | 95 | typedef int (*acpi_op_suspend) (struct acpi_device * device, int state); |
104 | typedef int (*acpi_op_resume) (struct acpi_device *device, int state); | 96 | typedef int (*acpi_op_resume) (struct acpi_device * device, int state); |
105 | typedef int (*acpi_op_scan) (struct acpi_device *device); | 97 | typedef int (*acpi_op_scan) (struct acpi_device * device); |
106 | typedef int (*acpi_op_bind) (struct acpi_device *device); | 98 | typedef int (*acpi_op_bind) (struct acpi_device * device); |
107 | typedef int (*acpi_op_unbind) (struct acpi_device *device); | 99 | typedef int (*acpi_op_unbind) (struct acpi_device * device); |
108 | typedef int (*acpi_op_match) (struct acpi_device *device, | 100 | typedef int (*acpi_op_match) (struct acpi_device * device, |
109 | struct acpi_driver *driver); | 101 | struct acpi_driver * driver); |
110 | 102 | ||
111 | struct acpi_bus_ops { | 103 | struct acpi_bus_ops { |
112 | u32 acpi_op_add:1; | 104 | u32 acpi_op_add:1; |
113 | u32 acpi_op_remove:1; | 105 | u32 acpi_op_remove:1; |
114 | u32 acpi_op_lock:1; | 106 | u32 acpi_op_lock:1; |
115 | u32 acpi_op_start:1; | 107 | u32 acpi_op_start:1; |
116 | u32 acpi_op_stop:1; | 108 | u32 acpi_op_stop:1; |
117 | u32 acpi_op_suspend:1; | 109 | u32 acpi_op_suspend:1; |
118 | u32 acpi_op_resume:1; | 110 | u32 acpi_op_resume:1; |
119 | u32 acpi_op_scan:1; | 111 | u32 acpi_op_scan:1; |
120 | u32 acpi_op_bind:1; | 112 | u32 acpi_op_bind:1; |
121 | u32 acpi_op_unbind:1; | 113 | u32 acpi_op_unbind:1; |
122 | u32 acpi_op_match:1; | 114 | u32 acpi_op_match:1; |
123 | u32 reserved:21; | 115 | u32 reserved:21; |
124 | }; | 116 | }; |
125 | 117 | ||
126 | struct acpi_device_ops { | 118 | struct acpi_device_ops { |
127 | acpi_op_add add; | 119 | acpi_op_add add; |
128 | acpi_op_remove remove; | 120 | acpi_op_remove remove; |
129 | acpi_op_lock lock; | 121 | acpi_op_lock lock; |
130 | acpi_op_start start; | 122 | acpi_op_start start; |
131 | acpi_op_stop stop; | 123 | acpi_op_stop stop; |
132 | acpi_op_suspend suspend; | 124 | acpi_op_suspend suspend; |
133 | acpi_op_resume resume; | 125 | acpi_op_resume resume; |
134 | acpi_op_scan scan; | 126 | acpi_op_scan scan; |
135 | acpi_op_bind bind; | 127 | acpi_op_bind bind; |
136 | acpi_op_unbind unbind; | 128 | acpi_op_unbind unbind; |
137 | acpi_op_match match; | 129 | acpi_op_match match; |
138 | }; | 130 | }; |
139 | 131 | ||
140 | struct acpi_driver { | 132 | struct acpi_driver { |
141 | struct list_head node; | 133 | struct list_head node; |
142 | char name[80]; | 134 | char name[80]; |
143 | char class[80]; | 135 | char class[80]; |
144 | atomic_t references; | 136 | atomic_t references; |
145 | char *ids; /* Supported Hardware IDs */ | 137 | char *ids; /* Supported Hardware IDs */ |
146 | struct acpi_device_ops ops; | 138 | struct acpi_device_ops ops; |
147 | }; | 139 | }; |
148 | 140 | ||
149 | /* | 141 | /* |
@@ -154,60 +146,57 @@ struct acpi_driver { | |||
154 | /* Status (_STA) */ | 146 | /* Status (_STA) */ |
155 | 147 | ||
156 | struct acpi_device_status { | 148 | struct acpi_device_status { |
157 | u32 present:1; | 149 | u32 present:1; |
158 | u32 enabled:1; | 150 | u32 enabled:1; |
159 | u32 show_in_ui:1; | 151 | u32 show_in_ui:1; |
160 | u32 functional:1; | 152 | u32 functional:1; |
161 | u32 battery_present:1; | 153 | u32 battery_present:1; |
162 | u32 reserved:27; | 154 | u32 reserved:27; |
163 | }; | 155 | }; |
164 | 156 | ||
165 | |||
166 | /* Flags */ | 157 | /* Flags */ |
167 | 158 | ||
168 | struct acpi_device_flags { | 159 | struct acpi_device_flags { |
169 | u32 dynamic_status:1; | 160 | u32 dynamic_status:1; |
170 | u32 hardware_id:1; | 161 | u32 hardware_id:1; |
171 | u32 compatible_ids:1; | 162 | u32 compatible_ids:1; |
172 | u32 bus_address:1; | 163 | u32 bus_address:1; |
173 | u32 unique_id:1; | 164 | u32 unique_id:1; |
174 | u32 removable:1; | 165 | u32 removable:1; |
175 | u32 ejectable:1; | 166 | u32 ejectable:1; |
176 | u32 lockable:1; | 167 | u32 lockable:1; |
177 | u32 suprise_removal_ok:1; | 168 | u32 suprise_removal_ok:1; |
178 | u32 power_manageable:1; | 169 | u32 power_manageable:1; |
179 | u32 performance_manageable:1; | 170 | u32 performance_manageable:1; |
180 | u32 wake_capable:1; /* Wakeup(_PRW) supported? */ | 171 | u32 wake_capable:1; /* Wakeup(_PRW) supported? */ |
181 | u32 reserved:20; | 172 | u32 reserved:20; |
182 | }; | 173 | }; |
183 | 174 | ||
184 | |||
185 | /* File System */ | 175 | /* File System */ |
186 | 176 | ||
187 | struct acpi_device_dir { | 177 | struct acpi_device_dir { |
188 | struct proc_dir_entry *entry; | 178 | struct proc_dir_entry *entry; |
189 | }; | 179 | }; |
190 | 180 | ||
191 | #define acpi_device_dir(d) ((d)->dir.entry) | 181 | #define acpi_device_dir(d) ((d)->dir.entry) |
192 | 182 | ||
193 | |||
194 | /* Plug and Play */ | 183 | /* Plug and Play */ |
195 | 184 | ||
196 | typedef char acpi_bus_id[5]; | 185 | typedef char acpi_bus_id[5]; |
197 | typedef unsigned long acpi_bus_address; | 186 | typedef unsigned long acpi_bus_address; |
198 | typedef char acpi_hardware_id[9]; | 187 | typedef char acpi_hardware_id[9]; |
199 | typedef char acpi_unique_id[9]; | 188 | typedef char acpi_unique_id[9]; |
200 | typedef char acpi_device_name[40]; | 189 | typedef char acpi_device_name[40]; |
201 | typedef char acpi_device_class[20]; | 190 | typedef char acpi_device_class[20]; |
202 | 191 | ||
203 | struct acpi_device_pnp { | 192 | struct acpi_device_pnp { |
204 | acpi_bus_id bus_id; /* Object name */ | 193 | acpi_bus_id bus_id; /* Object name */ |
205 | acpi_bus_address bus_address; /* _ADR */ | 194 | acpi_bus_address bus_address; /* _ADR */ |
206 | acpi_hardware_id hardware_id; /* _HID */ | 195 | acpi_hardware_id hardware_id; /* _HID */ |
207 | struct acpi_compatible_id_list *cid_list; /* _CIDs */ | 196 | struct acpi_compatible_id_list *cid_list; /* _CIDs */ |
208 | acpi_unique_id unique_id; /* _UID */ | 197 | acpi_unique_id unique_id; /* _UID */ |
209 | acpi_device_name device_name; /* Driver-determined */ | 198 | acpi_device_name device_name; /* Driver-determined */ |
210 | acpi_device_class device_class; /* " */ | 199 | acpi_device_class device_class; /* " */ |
211 | }; | 200 | }; |
212 | 201 | ||
213 | #define acpi_device_bid(d) ((d)->pnp.bus_id) | 202 | #define acpi_device_bid(d) ((d)->pnp.bus_id) |
@@ -217,114 +206,111 @@ struct acpi_device_pnp { | |||
217 | #define acpi_device_name(d) ((d)->pnp.device_name) | 206 | #define acpi_device_name(d) ((d)->pnp.device_name) |
218 | #define acpi_device_class(d) ((d)->pnp.device_class) | 207 | #define acpi_device_class(d) ((d)->pnp.device_class) |
219 | 208 | ||
220 | |||
221 | /* Power Management */ | 209 | /* Power Management */ |
222 | 210 | ||
223 | struct acpi_device_power_flags { | 211 | struct acpi_device_power_flags { |
224 | u32 explicit_get:1; /* _PSC present? */ | 212 | u32 explicit_get:1; /* _PSC present? */ |
225 | u32 power_resources:1; /* Power resources */ | 213 | u32 power_resources:1; /* Power resources */ |
226 | u32 inrush_current:1; /* Serialize Dx->D0 */ | 214 | u32 inrush_current:1; /* Serialize Dx->D0 */ |
227 | u32 power_removed:1; /* Optimize Dx->D0 */ | 215 | u32 power_removed:1; /* Optimize Dx->D0 */ |
228 | u32 reserved:28; | 216 | u32 reserved:28; |
229 | }; | 217 | }; |
230 | 218 | ||
231 | struct acpi_device_power_state { | 219 | struct acpi_device_power_state { |
232 | struct { | 220 | struct { |
233 | u8 valid:1; | 221 | u8 valid:1; |
234 | u8 explicit_set:1; /* _PSx present? */ | 222 | u8 explicit_set:1; /* _PSx present? */ |
235 | u8 reserved:6; | 223 | u8 reserved:6; |
236 | } flags; | 224 | } flags; |
237 | int power; /* % Power (compared to D0) */ | 225 | int power; /* % Power (compared to D0) */ |
238 | int latency; /* Dx->D0 time (microseconds) */ | 226 | int latency; /* Dx->D0 time (microseconds) */ |
239 | struct acpi_handle_list resources; /* Power resources referenced */ | 227 | struct acpi_handle_list resources; /* Power resources referenced */ |
240 | }; | 228 | }; |
241 | 229 | ||
242 | struct acpi_device_power { | 230 | struct acpi_device_power { |
243 | int state; /* Current state */ | 231 | int state; /* Current state */ |
244 | struct acpi_device_power_flags flags; | 232 | struct acpi_device_power_flags flags; |
245 | struct acpi_device_power_state states[4]; /* Power states (D0-D3) */ | 233 | struct acpi_device_power_state states[4]; /* Power states (D0-D3) */ |
246 | }; | 234 | }; |
247 | 235 | ||
248 | |||
249 | /* Performance Management */ | 236 | /* Performance Management */ |
250 | 237 | ||
251 | struct acpi_device_perf_flags { | 238 | struct acpi_device_perf_flags { |
252 | u8 reserved:8; | 239 | u8 reserved:8; |
253 | }; | 240 | }; |
254 | 241 | ||
255 | struct acpi_device_perf_state { | 242 | struct acpi_device_perf_state { |
256 | struct { | 243 | struct { |
257 | u8 valid:1; | 244 | u8 valid:1; |
258 | u8 reserved:7; | 245 | u8 reserved:7; |
259 | } flags; | 246 | } flags; |
260 | u8 power; /* % Power (compared to P0) */ | 247 | u8 power; /* % Power (compared to P0) */ |
261 | u8 performance; /* % Performance ( " ) */ | 248 | u8 performance; /* % Performance ( " ) */ |
262 | int latency; /* Px->P0 time (microseconds) */ | 249 | int latency; /* Px->P0 time (microseconds) */ |
263 | }; | 250 | }; |
264 | 251 | ||
265 | struct acpi_device_perf { | 252 | struct acpi_device_perf { |
266 | int state; | 253 | int state; |
267 | struct acpi_device_perf_flags flags; | 254 | struct acpi_device_perf_flags flags; |
268 | int state_count; | 255 | int state_count; |
269 | struct acpi_device_perf_state *states; | 256 | struct acpi_device_perf_state *states; |
270 | }; | 257 | }; |
271 | 258 | ||
272 | /* Wakeup Management */ | 259 | /* Wakeup Management */ |
273 | struct acpi_device_wakeup_flags { | 260 | struct acpi_device_wakeup_flags { |
274 | u8 valid:1; /* Can successfully enable wakeup? */ | 261 | u8 valid:1; /* Can successfully enable wakeup? */ |
275 | u8 run_wake:1; /* Run-Wake GPE devices */ | 262 | u8 run_wake:1; /* Run-Wake GPE devices */ |
276 | }; | 263 | }; |
277 | 264 | ||
278 | struct acpi_device_wakeup_state { | 265 | struct acpi_device_wakeup_state { |
279 | u8 enabled:1; | 266 | u8 enabled:1; |
280 | u8 active:1; | 267 | u8 active:1; |
281 | }; | 268 | }; |
282 | 269 | ||
283 | struct acpi_device_wakeup { | 270 | struct acpi_device_wakeup { |
284 | acpi_handle gpe_device; | 271 | acpi_handle gpe_device; |
285 | acpi_integer gpe_number;; | 272 | acpi_integer gpe_number;; |
286 | acpi_integer sleep_state; | 273 | acpi_integer sleep_state; |
287 | struct acpi_handle_list resources; | 274 | struct acpi_handle_list resources; |
288 | struct acpi_device_wakeup_state state; | 275 | struct acpi_device_wakeup_state state; |
289 | struct acpi_device_wakeup_flags flags; | 276 | struct acpi_device_wakeup_flags flags; |
290 | }; | 277 | }; |
291 | 278 | ||
292 | /* Device */ | 279 | /* Device */ |
293 | 280 | ||
294 | struct acpi_device { | 281 | struct acpi_device { |
295 | acpi_handle handle; | 282 | acpi_handle handle; |
296 | struct acpi_device *parent; | 283 | struct acpi_device *parent; |
297 | struct list_head children; | 284 | struct list_head children; |
298 | struct list_head node; | 285 | struct list_head node; |
299 | struct list_head wakeup_list; | 286 | struct list_head wakeup_list; |
300 | struct list_head g_list; | 287 | struct list_head g_list; |
301 | struct acpi_device_status status; | 288 | struct acpi_device_status status; |
302 | struct acpi_device_flags flags; | 289 | struct acpi_device_flags flags; |
303 | struct acpi_device_pnp pnp; | 290 | struct acpi_device_pnp pnp; |
304 | struct acpi_device_power power; | 291 | struct acpi_device_power power; |
305 | struct acpi_device_wakeup wakeup; | 292 | struct acpi_device_wakeup wakeup; |
306 | struct acpi_device_perf performance; | 293 | struct acpi_device_perf performance; |
307 | struct acpi_device_dir dir; | 294 | struct acpi_device_dir dir; |
308 | struct acpi_device_ops ops; | 295 | struct acpi_device_ops ops; |
309 | struct acpi_driver *driver; | 296 | struct acpi_driver *driver; |
310 | void *driver_data; | 297 | void *driver_data; |
311 | struct kobject kobj; | 298 | struct kobject kobj; |
312 | }; | 299 | }; |
313 | 300 | ||
314 | #define acpi_driver_data(d) ((d)->driver_data) | 301 | #define acpi_driver_data(d) ((d)->driver_data) |
315 | 302 | ||
316 | |||
317 | /* | 303 | /* |
318 | * Events | 304 | * Events |
319 | * ------ | 305 | * ------ |
320 | */ | 306 | */ |
321 | 307 | ||
322 | struct acpi_bus_event { | 308 | struct acpi_bus_event { |
323 | struct list_head node; | 309 | struct list_head node; |
324 | acpi_device_class device_class; | 310 | acpi_device_class device_class; |
325 | acpi_bus_id bus_id; | 311 | acpi_bus_id bus_id; |
326 | u32 type; | 312 | u32 type; |
327 | u32 data; | 313 | u32 data; |
328 | }; | 314 | }; |
329 | 315 | ||
330 | extern struct subsystem acpi_subsys; | 316 | extern struct subsystem acpi_subsys; |
@@ -335,34 +321,32 @@ extern struct subsystem acpi_subsys; | |||
335 | 321 | ||
336 | int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device); | 322 | int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device); |
337 | void acpi_bus_data_handler(acpi_handle handle, u32 function, void *context); | 323 | void acpi_bus_data_handler(acpi_handle handle, u32 function, void *context); |
338 | int acpi_bus_get_status (struct acpi_device *device); | 324 | int acpi_bus_get_status(struct acpi_device *device); |
339 | int acpi_bus_get_power (acpi_handle handle, int *state); | 325 | int acpi_bus_get_power(acpi_handle handle, int *state); |
340 | int acpi_bus_set_power (acpi_handle handle, int state); | 326 | int acpi_bus_set_power(acpi_handle handle, int state); |
341 | int acpi_bus_generate_event (struct acpi_device *device, u8 type, int data); | 327 | int acpi_bus_generate_event(struct acpi_device *device, u8 type, int data); |
342 | int acpi_bus_receive_event (struct acpi_bus_event *event); | 328 | int acpi_bus_receive_event(struct acpi_bus_event *event); |
343 | int acpi_bus_register_driver (struct acpi_driver *driver); | 329 | int acpi_bus_register_driver(struct acpi_driver *driver); |
344 | int acpi_bus_unregister_driver (struct acpi_driver *driver); | 330 | int acpi_bus_unregister_driver(struct acpi_driver *driver); |
345 | int acpi_bus_add (struct acpi_device **child, struct acpi_device *parent, | 331 | int acpi_bus_add(struct acpi_device **child, struct acpi_device *parent, |
346 | acpi_handle handle, int type); | 332 | acpi_handle handle, int type); |
347 | int acpi_bus_start (struct acpi_device *device); | 333 | int acpi_bus_start(struct acpi_device *device); |
348 | 334 | ||
349 | 335 | int acpi_match_ids(struct acpi_device *device, char *ids); | |
350 | int acpi_match_ids (struct acpi_device *device, char *ids); | ||
351 | int acpi_create_dir(struct acpi_device *); | 336 | int acpi_create_dir(struct acpi_device *); |
352 | void acpi_remove_dir(struct acpi_device *); | 337 | void acpi_remove_dir(struct acpi_device *); |
353 | 338 | ||
354 | |||
355 | /* | 339 | /* |
356 | * Bind physical devices with ACPI devices | 340 | * Bind physical devices with ACPI devices |
357 | */ | 341 | */ |
358 | #include <linux/device.h> | 342 | #include <linux/device.h> |
359 | struct acpi_bus_type { | 343 | struct acpi_bus_type { |
360 | struct list_head list; | 344 | struct list_head list; |
361 | struct bus_type *bus; | 345 | struct bus_type *bus; |
362 | /* For general devices under the bus*/ | 346 | /* For general devices under the bus */ |
363 | int (*find_device)(struct device *, acpi_handle*); | 347 | int (*find_device) (struct device *, acpi_handle *); |
364 | /* For bridges, such as PCI root bridge, IDE controller */ | 348 | /* For bridges, such as PCI root bridge, IDE controller */ |
365 | int (*find_bridge)(struct device *, acpi_handle *); | 349 | int (*find_bridge) (struct device *, acpi_handle *); |
366 | }; | 350 | }; |
367 | int register_acpi_bus_type(struct acpi_bus_type *); | 351 | int register_acpi_bus_type(struct acpi_bus_type *); |
368 | int unregister_acpi_bus_type(struct acpi_bus_type *); | 352 | int unregister_acpi_bus_type(struct acpi_bus_type *); |
@@ -372,6 +356,6 @@ acpi_handle acpi_get_child(acpi_handle, acpi_integer); | |||
372 | acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int); | 356 | acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int); |
373 | #define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->firmware_data)) | 357 | #define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->firmware_data)) |
374 | 358 | ||
375 | #endif /*CONFIG_ACPI_BUS*/ | 359 | #endif /*CONFIG_ACPI_BUS */ |
376 | 360 | ||
377 | #endif /*__ACPI_BUS_H__*/ | 361 | #endif /*__ACPI_BUS_H__*/ |
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h index 579fe191b7e7..e976cb109b13 100644 --- a/include/acpi/acpi_drivers.h +++ b/include/acpi/acpi_drivers.h | |||
@@ -29,7 +29,6 @@ | |||
29 | #include <linux/acpi.h> | 29 | #include <linux/acpi.h> |
30 | #include <acpi/acpi_bus.h> | 30 | #include <acpi/acpi_bus.h> |
31 | 31 | ||
32 | |||
33 | #define ACPI_MAX_STRING 80 | 32 | #define ACPI_MAX_STRING 80 |
34 | 33 | ||
35 | #define ACPI_BUS_COMPONENT 0x00010000 | 34 | #define ACPI_BUS_COMPONENT 0x00010000 |
@@ -44,7 +43,6 @@ | |||
44 | #define ACPI_BUTTON_HID_POWERF "ACPI_FPB" | 43 | #define ACPI_BUTTON_HID_POWERF "ACPI_FPB" |
45 | #define ACPI_BUTTON_HID_SLEEPF "ACPI_FSB" | 44 | #define ACPI_BUTTON_HID_SLEEPF "ACPI_FSB" |
46 | 45 | ||
47 | |||
48 | /* -------------------------------------------------------------------------- | 46 | /* -------------------------------------------------------------------------- |
49 | PCI | 47 | PCI |
50 | -------------------------------------------------------------------------- */ | 48 | -------------------------------------------------------------------------- */ |
@@ -55,49 +53,49 @@ | |||
55 | 53 | ||
56 | /* ACPI PCI Interrupt Link (pci_link.c) */ | 54 | /* ACPI PCI Interrupt Link (pci_link.c) */ |
57 | 55 | ||
58 | int acpi_irq_penalty_init (void); | 56 | int acpi_irq_penalty_init(void); |
59 | int acpi_pci_link_allocate_irq (acpi_handle handle, int index, int *edge_level, | 57 | int acpi_pci_link_allocate_irq(acpi_handle handle, int index, int *edge_level, |
60 | int *active_high_low, char **name); | 58 | int *active_high_low, char **name); |
61 | int acpi_pci_link_free_irq(acpi_handle handle); | 59 | int acpi_pci_link_free_irq(acpi_handle handle); |
62 | 60 | ||
63 | /* ACPI PCI Interrupt Routing (pci_irq.c) */ | 61 | /* ACPI PCI Interrupt Routing (pci_irq.c) */ |
64 | 62 | ||
65 | int acpi_pci_irq_add_prt (acpi_handle handle, int segment, int bus); | 63 | int acpi_pci_irq_add_prt(acpi_handle handle, int segment, int bus); |
66 | void acpi_pci_irq_del_prt (int segment, int bus); | 64 | void acpi_pci_irq_del_prt(int segment, int bus); |
67 | 65 | ||
68 | /* ACPI PCI Device Binding (pci_bind.c) */ | 66 | /* ACPI PCI Device Binding (pci_bind.c) */ |
69 | 67 | ||
70 | struct pci_bus; | 68 | struct pci_bus; |
71 | 69 | ||
72 | acpi_status acpi_get_pci_id (acpi_handle handle, struct acpi_pci_id *id); | 70 | acpi_status acpi_get_pci_id(acpi_handle handle, struct acpi_pci_id *id); |
73 | int acpi_pci_bind (struct acpi_device *device); | 71 | int acpi_pci_bind(struct acpi_device *device); |
74 | int acpi_pci_unbind (struct acpi_device *device); | 72 | int acpi_pci_unbind(struct acpi_device *device); |
75 | int acpi_pci_bind_root (struct acpi_device *device, struct acpi_pci_id *id, struct pci_bus *bus); | 73 | int acpi_pci_bind_root(struct acpi_device *device, struct acpi_pci_id *id, |
74 | struct pci_bus *bus); | ||
76 | 75 | ||
77 | /* Arch-defined function to add a bus to the system */ | 76 | /* Arch-defined function to add a bus to the system */ |
78 | 77 | ||
79 | struct pci_bus *pci_acpi_scan_root(struct acpi_device *device, int domain, int bus); | 78 | struct pci_bus *pci_acpi_scan_root(struct acpi_device *device, int domain, |
80 | 79 | int bus); | |
81 | #endif /*CONFIG_ACPI_PCI*/ | ||
82 | 80 | ||
81 | #endif /*CONFIG_ACPI_PCI */ | ||
83 | 82 | ||
84 | /* -------------------------------------------------------------------------- | 83 | /* -------------------------------------------------------------------------- |
85 | Power Resource | 84 | Power Resource |
86 | -------------------------------------------------------------------------- */ | 85 | -------------------------------------------------------------------------- */ |
87 | 86 | ||
88 | #ifdef CONFIG_ACPI_POWER | 87 | #ifdef CONFIG_ACPI_POWER |
89 | int acpi_enable_wakeup_device_power (struct acpi_device *dev); | 88 | int acpi_enable_wakeup_device_power(struct acpi_device *dev); |
90 | int acpi_disable_wakeup_device_power (struct acpi_device *dev); | 89 | int acpi_disable_wakeup_device_power(struct acpi_device *dev); |
91 | int acpi_power_get_inferred_state (struct acpi_device *device); | 90 | int acpi_power_get_inferred_state(struct acpi_device *device); |
92 | int acpi_power_transition (struct acpi_device *device, int state); | 91 | int acpi_power_transition(struct acpi_device *device, int state); |
93 | #endif | 92 | #endif |
94 | 93 | ||
95 | |||
96 | /* -------------------------------------------------------------------------- | 94 | /* -------------------------------------------------------------------------- |
97 | Embedded Controller | 95 | Embedded Controller |
98 | -------------------------------------------------------------------------- */ | 96 | -------------------------------------------------------------------------- */ |
99 | #ifdef CONFIG_ACPI_EC | 97 | #ifdef CONFIG_ACPI_EC |
100 | int acpi_ec_ecdt_probe (void); | 98 | int acpi_ec_ecdt_probe(void); |
101 | #endif | 99 | #endif |
102 | 100 | ||
103 | /* -------------------------------------------------------------------------- | 101 | /* -------------------------------------------------------------------------- |
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index 819a53f83cfa..98e0b8cd14ed 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h | |||
@@ -7,7 +7,6 @@ | |||
7 | * | 7 | * |
8 | *****************************************************************************/ | 8 | *****************************************************************************/ |
9 | 9 | ||
10 | |||
11 | /* | 10 | /* |
12 | * Copyright (C) 2000 - 2005, R. Byron Moore | 11 | * Copyright (C) 2000 - 2005, R. Byron Moore |
13 | * All rights reserved. | 12 | * All rights reserved. |
@@ -51,7 +50,6 @@ | |||
51 | #include "platform/acenv.h" | 50 | #include "platform/acenv.h" |
52 | #include "actypes.h" | 51 | #include "actypes.h" |
53 | 52 | ||
54 | |||
55 | /* Priorities for acpi_os_queue_for_execution */ | 53 | /* Priorities for acpi_os_queue_for_execution */ |
56 | 54 | ||
57 | #define OSD_PRIORITY_GPE 1 | 55 | #define OSD_PRIORITY_GPE 1 |
@@ -62,227 +60,136 @@ | |||
62 | #define ACPI_NO_UNIT_LIMIT ((u32) -1) | 60 | #define ACPI_NO_UNIT_LIMIT ((u32) -1) |
63 | #define ACPI_MUTEX_SEM 1 | 61 | #define ACPI_MUTEX_SEM 1 |
64 | 62 | ||
65 | |||
66 | /* Functions for acpi_os_signal */ | 63 | /* Functions for acpi_os_signal */ |
67 | 64 | ||
68 | #define ACPI_SIGNAL_FATAL 0 | 65 | #define ACPI_SIGNAL_FATAL 0 |
69 | #define ACPI_SIGNAL_BREAKPOINT 1 | 66 | #define ACPI_SIGNAL_BREAKPOINT 1 |
70 | 67 | ||
71 | struct acpi_signal_fatal_info | 68 | struct acpi_signal_fatal_info { |
72 | { | 69 | u32 type; |
73 | u32 type; | 70 | u32 code; |
74 | u32 code; | 71 | u32 argument; |
75 | u32 argument; | ||
76 | }; | 72 | }; |
77 | 73 | ||
78 | |||
79 | /* | 74 | /* |
80 | * OSL Initialization and shutdown primitives | 75 | * OSL Initialization and shutdown primitives |
81 | */ | 76 | */ |
82 | acpi_status | 77 | acpi_status acpi_os_initialize(void); |
83 | acpi_os_initialize ( | ||
84 | void); | ||
85 | |||
86 | acpi_status | ||
87 | acpi_os_terminate ( | ||
88 | void); | ||
89 | 78 | ||
79 | acpi_status acpi_os_terminate(void); | ||
90 | 80 | ||
91 | /* | 81 | /* |
92 | * ACPI Table interfaces | 82 | * ACPI Table interfaces |
93 | */ | 83 | */ |
94 | acpi_status | 84 | acpi_status acpi_os_get_root_pointer(u32 flags, struct acpi_pointer *address); |
95 | acpi_os_get_root_pointer ( | ||
96 | u32 flags, | ||
97 | struct acpi_pointer *address); | ||
98 | 85 | ||
99 | acpi_status | 86 | acpi_status |
100 | acpi_os_predefined_override ( | 87 | acpi_os_predefined_override(const struct acpi_predefined_names *init_val, |
101 | const struct acpi_predefined_names *init_val, | 88 | acpi_string * new_val); |
102 | acpi_string *new_val); | ||
103 | 89 | ||
104 | acpi_status | 90 | acpi_status |
105 | acpi_os_table_override ( | 91 | acpi_os_table_override(struct acpi_table_header *existing_table, |
106 | struct acpi_table_header *existing_table, | 92 | struct acpi_table_header **new_table); |
107 | struct acpi_table_header **new_table); | ||
108 | |||
109 | 93 | ||
110 | /* | 94 | /* |
111 | * Synchronization primitives | 95 | * Synchronization primitives |
112 | */ | 96 | */ |
113 | acpi_status | 97 | acpi_status |
114 | acpi_os_create_semaphore ( | 98 | acpi_os_create_semaphore(u32 max_units, |
115 | u32 max_units, | 99 | u32 initial_units, acpi_handle * out_handle); |
116 | u32 initial_units, | ||
117 | acpi_handle *out_handle); | ||
118 | |||
119 | acpi_status | ||
120 | acpi_os_delete_semaphore ( | ||
121 | acpi_handle handle); | ||
122 | 100 | ||
123 | acpi_status | 101 | acpi_status acpi_os_delete_semaphore(acpi_handle handle); |
124 | acpi_os_wait_semaphore ( | ||
125 | acpi_handle handle, | ||
126 | u32 units, | ||
127 | u16 timeout); | ||
128 | 102 | ||
129 | acpi_status | 103 | acpi_status acpi_os_wait_semaphore(acpi_handle handle, u32 units, u16 timeout); |
130 | acpi_os_signal_semaphore ( | ||
131 | acpi_handle handle, | ||
132 | u32 units); | ||
133 | 104 | ||
134 | acpi_status | 105 | acpi_status acpi_os_signal_semaphore(acpi_handle handle, u32 units); |
135 | acpi_os_create_lock ( | ||
136 | acpi_handle *out_handle); | ||
137 | 106 | ||
138 | void | 107 | acpi_status acpi_os_create_lock(acpi_handle * out_handle); |
139 | acpi_os_delete_lock ( | ||
140 | acpi_handle handle); | ||
141 | 108 | ||
142 | unsigned long | 109 | void acpi_os_delete_lock(acpi_handle handle); |
143 | acpi_os_acquire_lock ( | ||
144 | acpi_handle handle); | ||
145 | 110 | ||
146 | void | 111 | unsigned long acpi_os_acquire_lock(acpi_handle handle); |
147 | acpi_os_release_lock ( | ||
148 | acpi_handle handle, | ||
149 | unsigned long flags); | ||
150 | 112 | ||
113 | void acpi_os_release_lock(acpi_handle handle, unsigned long flags); | ||
151 | 114 | ||
152 | /* | 115 | /* |
153 | * Memory allocation and mapping | 116 | * Memory allocation and mapping |
154 | */ | 117 | */ |
155 | void * | 118 | void *acpi_os_allocate(acpi_size size); |
156 | acpi_os_allocate ( | ||
157 | acpi_size size); | ||
158 | 119 | ||
159 | void | 120 | void acpi_os_free(void *memory); |
160 | acpi_os_free ( | ||
161 | void * memory); | ||
162 | 121 | ||
163 | acpi_status | 122 | acpi_status |
164 | acpi_os_map_memory ( | 123 | acpi_os_map_memory(acpi_physical_address physical_address, |
165 | acpi_physical_address physical_address, | 124 | acpi_size size, void __iomem ** logical_address); |
166 | acpi_size size, | ||
167 | void __iomem **logical_address); | ||
168 | 125 | ||
169 | void | 126 | void acpi_os_unmap_memory(void __iomem * logical_address, acpi_size size); |
170 | acpi_os_unmap_memory ( | ||
171 | void __iomem *logical_address, | ||
172 | acpi_size size); | ||
173 | 127 | ||
174 | #ifdef ACPI_FUTURE_USAGE | 128 | #ifdef ACPI_FUTURE_USAGE |
175 | acpi_status | 129 | acpi_status |
176 | acpi_os_get_physical_address ( | 130 | acpi_os_get_physical_address(void *logical_address, |
177 | void *logical_address, | 131 | acpi_physical_address * physical_address); |
178 | acpi_physical_address *physical_address); | ||
179 | #endif | 132 | #endif |
180 | 133 | ||
181 | |||
182 | |||
183 | /* | 134 | /* |
184 | * Memory/Object Cache | 135 | * Memory/Object Cache |
185 | */ | 136 | */ |
186 | acpi_status | 137 | acpi_status |
187 | acpi_os_create_cache ( | 138 | acpi_os_create_cache(char *cache_name, |
188 | char *cache_name, | 139 | u16 object_size, |
189 | u16 object_size, | 140 | u16 max_depth, acpi_cache_t ** return_cache); |
190 | u16 max_depth, | ||
191 | acpi_cache_t **return_cache); | ||
192 | 141 | ||
193 | acpi_status | 142 | acpi_status acpi_os_delete_cache(acpi_cache_t * cache); |
194 | acpi_os_delete_cache ( | ||
195 | acpi_cache_t *cache); | ||
196 | 143 | ||
197 | acpi_status | 144 | acpi_status acpi_os_purge_cache(acpi_cache_t * cache); |
198 | acpi_os_purge_cache ( | ||
199 | acpi_cache_t *cache); | ||
200 | 145 | ||
201 | void * | 146 | void *acpi_os_acquire_object(acpi_cache_t * cache); |
202 | acpi_os_acquire_object ( | ||
203 | acpi_cache_t *cache); | ||
204 | 147 | ||
205 | acpi_status | 148 | acpi_status acpi_os_release_object(acpi_cache_t * cache, void *object); |
206 | acpi_os_release_object ( | ||
207 | acpi_cache_t *cache, | ||
208 | void *object); | ||
209 | 149 | ||
210 | /* | 150 | /* |
211 | * Interrupt handlers | 151 | * Interrupt handlers |
212 | */ | 152 | */ |
213 | acpi_status | 153 | acpi_status |
214 | acpi_os_install_interrupt_handler ( | 154 | acpi_os_install_interrupt_handler(u32 gsi, |
215 | u32 gsi, | 155 | acpi_osd_handler service_routine, |
216 | acpi_osd_handler service_routine, | 156 | void *context); |
217 | void *context); | ||
218 | 157 | ||
219 | acpi_status | 158 | acpi_status |
220 | acpi_os_remove_interrupt_handler ( | 159 | acpi_os_remove_interrupt_handler(u32 gsi, acpi_osd_handler service_routine); |
221 | u32 gsi, | ||
222 | acpi_osd_handler service_routine); | ||
223 | |||
224 | 160 | ||
225 | /* | 161 | /* |
226 | * Threads and Scheduling | 162 | * Threads and Scheduling |
227 | */ | 163 | */ |
228 | u32 | 164 | u32 acpi_os_get_thread_id(void); |
229 | acpi_os_get_thread_id ( | ||
230 | void); | ||
231 | 165 | ||
232 | acpi_status | 166 | acpi_status |
233 | acpi_os_queue_for_execution ( | 167 | acpi_os_queue_for_execution(u32 priority, |
234 | u32 priority, | 168 | acpi_osd_exec_callback function, void *context); |
235 | acpi_osd_exec_callback function, | ||
236 | void *context); | ||
237 | |||
238 | void | ||
239 | acpi_os_wait_events_complete( | ||
240 | void * context); | ||
241 | 169 | ||
242 | void | 170 | void acpi_os_wait_events_complete(void *context); |
243 | acpi_os_wait_events_complete ( | ||
244 | void *context); | ||
245 | 171 | ||
246 | void | 172 | void acpi_os_wait_events_complete(void *context); |
247 | acpi_os_sleep ( | ||
248 | acpi_integer milliseconds); | ||
249 | 173 | ||
250 | void | 174 | void acpi_os_sleep(acpi_integer milliseconds); |
251 | acpi_os_stall ( | ||
252 | u32 microseconds); | ||
253 | 175 | ||
176 | void acpi_os_stall(u32 microseconds); | ||
254 | 177 | ||
255 | /* | 178 | /* |
256 | * Platform and hardware-independent I/O interfaces | 179 | * Platform and hardware-independent I/O interfaces |
257 | */ | 180 | */ |
258 | acpi_status | 181 | acpi_status acpi_os_read_port(acpi_io_address address, u32 * value, u32 width); |
259 | acpi_os_read_port ( | ||
260 | acpi_io_address address, | ||
261 | u32 *value, | ||
262 | u32 width); | ||
263 | |||
264 | acpi_status | ||
265 | acpi_os_write_port ( | ||
266 | acpi_io_address address, | ||
267 | u32 value, | ||
268 | u32 width); | ||
269 | 182 | ||
183 | acpi_status acpi_os_write_port(acpi_io_address address, u32 value, u32 width); | ||
270 | 184 | ||
271 | /* | 185 | /* |
272 | * Platform and hardware-independent physical memory interfaces | 186 | * Platform and hardware-independent physical memory interfaces |
273 | */ | 187 | */ |
274 | acpi_status | 188 | acpi_status |
275 | acpi_os_read_memory ( | 189 | acpi_os_read_memory(acpi_physical_address address, u32 * value, u32 width); |
276 | acpi_physical_address address, | ||
277 | u32 *value, | ||
278 | u32 width); | ||
279 | 190 | ||
280 | acpi_status | 191 | acpi_status |
281 | acpi_os_write_memory ( | 192 | acpi_os_write_memory(acpi_physical_address address, u32 value, u32 width); |
282 | acpi_physical_address address, | ||
283 | u32 value, | ||
284 | u32 width); | ||
285 | |||
286 | 193 | ||
287 | /* | 194 | /* |
288 | * Platform and hardware-independent PCI configuration space access | 195 | * Platform and hardware-independent PCI configuration space access |
@@ -290,111 +197,69 @@ acpi_os_write_memory ( | |||
290 | * certain compilers complain. | 197 | * certain compilers complain. |
291 | */ | 198 | */ |
292 | acpi_status | 199 | acpi_status |
293 | acpi_os_read_pci_configuration ( | 200 | acpi_os_read_pci_configuration(struct acpi_pci_id *pci_id, |
294 | struct acpi_pci_id *pci_id, | 201 | u32 reg, void *value, u32 width); |
295 | u32 reg, | ||
296 | void *value, | ||
297 | u32 width); | ||
298 | 202 | ||
299 | acpi_status | 203 | acpi_status |
300 | acpi_os_write_pci_configuration ( | 204 | acpi_os_write_pci_configuration(struct acpi_pci_id *pci_id, |
301 | struct acpi_pci_id *pci_id, | 205 | u32 reg, acpi_integer value, u32 width); |
302 | u32 reg, | ||
303 | acpi_integer value, | ||
304 | u32 width); | ||
305 | 206 | ||
306 | /* | 207 | /* |
307 | * Interim function needed for PCI IRQ routing | 208 | * Interim function needed for PCI IRQ routing |
308 | */ | 209 | */ |
309 | void | 210 | void |
310 | acpi_os_derive_pci_id( | 211 | acpi_os_derive_pci_id(acpi_handle rhandle, |
311 | acpi_handle rhandle, | 212 | acpi_handle chandle, struct acpi_pci_id **pci_id); |
312 | acpi_handle chandle, | ||
313 | struct acpi_pci_id **pci_id); | ||
314 | 213 | ||
315 | /* | 214 | /* |
316 | * Miscellaneous | 215 | * Miscellaneous |
317 | */ | 216 | */ |
318 | u8 | 217 | u8 acpi_os_readable(void *pointer, acpi_size length); |
319 | acpi_os_readable ( | ||
320 | void *pointer, | ||
321 | acpi_size length); | ||
322 | 218 | ||
323 | #ifdef ACPI_FUTURE_USAGE | 219 | #ifdef ACPI_FUTURE_USAGE |
324 | u8 | 220 | u8 acpi_os_writable(void *pointer, acpi_size length); |
325 | acpi_os_writable ( | ||
326 | void *pointer, | ||
327 | acpi_size length); | ||
328 | #endif | 221 | #endif |
329 | 222 | ||
330 | u64 | 223 | u64 acpi_os_get_timer(void); |
331 | acpi_os_get_timer ( | ||
332 | void); | ||
333 | 224 | ||
334 | acpi_status | 225 | acpi_status acpi_os_signal(u32 function, void *info); |
335 | acpi_os_signal ( | ||
336 | u32 function, | ||
337 | void *info); | ||
338 | 226 | ||
339 | /* | 227 | /* |
340 | * Debug print routines | 228 | * Debug print routines |
341 | */ | 229 | */ |
342 | void ACPI_INTERNAL_VAR_XFACE | 230 | void ACPI_INTERNAL_VAR_XFACE acpi_os_printf(const char *format, ...); |
343 | acpi_os_printf ( | ||
344 | const char *format, | ||
345 | ...); | ||
346 | |||
347 | void | ||
348 | acpi_os_vprintf ( | ||
349 | const char *format, | ||
350 | va_list args); | ||
351 | 231 | ||
352 | void | 232 | void acpi_os_vprintf(const char *format, va_list args); |
353 | acpi_os_redirect_output ( | ||
354 | void *destination); | ||
355 | 233 | ||
234 | void acpi_os_redirect_output(void *destination); | ||
356 | 235 | ||
357 | #ifdef ACPI_FUTURE_USAGE | 236 | #ifdef ACPI_FUTURE_USAGE |
358 | /* | 237 | /* |
359 | * Debug input | 238 | * Debug input |
360 | */ | 239 | */ |
361 | u32 | 240 | u32 acpi_os_get_line(char *buffer); |
362 | acpi_os_get_line ( | ||
363 | char *buffer); | ||
364 | #endif | 241 | #endif |
365 | 242 | ||
366 | |||
367 | /* | 243 | /* |
368 | * Directory manipulation | 244 | * Directory manipulation |
369 | */ | 245 | */ |
370 | void * | 246 | void *acpi_os_open_directory(char *pathname, |
371 | acpi_os_open_directory ( | 247 | char *wildcard_spec, char requested_file_type); |
372 | char *pathname, | ||
373 | char *wildcard_spec, | ||
374 | char requested_file_type); | ||
375 | 248 | ||
376 | /* requeste_file_type values */ | 249 | /* requeste_file_type values */ |
377 | 250 | ||
378 | #define REQUEST_FILE_ONLY 0 | 251 | #define REQUEST_FILE_ONLY 0 |
379 | #define REQUEST_DIR_ONLY 1 | 252 | #define REQUEST_DIR_ONLY 1 |
380 | 253 | ||
254 | char *acpi_os_get_next_filename(void *dir_handle); | ||
381 | 255 | ||
382 | char * | 256 | void acpi_os_close_directory(void *dir_handle); |
383 | acpi_os_get_next_filename ( | ||
384 | void *dir_handle); | ||
385 | |||
386 | void | ||
387 | acpi_os_close_directory ( | ||
388 | void *dir_handle); | ||
389 | 257 | ||
390 | /* | 258 | /* |
391 | * Debug | 259 | * Debug |
392 | */ | 260 | */ |
393 | void | 261 | void |
394 | acpi_os_dbg_assert( | 262 | acpi_os_dbg_assert(void *failed_assertion, |
395 | void *failed_assertion, | 263 | void *file_name, u32 line_number, char *message); |
396 | void *file_name, | ||
397 | u32 line_number, | ||
398 | char *message); | ||
399 | 264 | ||
400 | #endif /* __ACPIOSXF_H__ */ | 265 | #endif /* __ACPIOSXF_H__ */ |
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index 9ca212d73fb5..2a9dbc13b0f2 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h | |||
@@ -42,447 +42,283 @@ | |||
42 | * POSSIBILITY OF SUCH DAMAGES. | 42 | * POSSIBILITY OF SUCH DAMAGES. |
43 | */ | 43 | */ |
44 | 44 | ||
45 | |||
46 | #ifndef __ACXFACE_H__ | 45 | #ifndef __ACXFACE_H__ |
47 | #define __ACXFACE_H__ | 46 | #define __ACXFACE_H__ |
48 | 47 | ||
49 | #include "actypes.h" | 48 | #include "actypes.h" |
50 | #include "actbl.h" | 49 | #include "actbl.h" |
51 | 50 | ||
52 | |||
53 | /* | 51 | /* |
54 | * Global interfaces | 52 | * Global interfaces |
55 | */ | 53 | */ |
56 | acpi_status | 54 | acpi_status acpi_initialize_subsystem(void); |
57 | acpi_initialize_subsystem ( | ||
58 | void); | ||
59 | 55 | ||
60 | acpi_status | 56 | acpi_status acpi_enable_subsystem(u32 flags); |
61 | acpi_enable_subsystem ( | ||
62 | u32 flags); | ||
63 | 57 | ||
64 | acpi_status | 58 | acpi_status acpi_initialize_objects(u32 flags); |
65 | acpi_initialize_objects ( | ||
66 | u32 flags); | ||
67 | 59 | ||
68 | acpi_status | 60 | acpi_status acpi_terminate(void); |
69 | acpi_terminate ( | ||
70 | void); | ||
71 | 61 | ||
72 | #ifdef ACPI_FUTURE_USAGE | 62 | #ifdef ACPI_FUTURE_USAGE |
73 | acpi_status | 63 | acpi_status acpi_subsystem_status(void); |
74 | acpi_subsystem_status ( | ||
75 | void); | ||
76 | #endif | 64 | #endif |
77 | 65 | ||
78 | acpi_status | 66 | acpi_status acpi_enable(void); |
79 | acpi_enable ( | ||
80 | void); | ||
81 | 67 | ||
82 | acpi_status | 68 | acpi_status acpi_disable(void); |
83 | acpi_disable ( | ||
84 | void); | ||
85 | 69 | ||
86 | #ifdef ACPI_FUTURE_USAGE | 70 | #ifdef ACPI_FUTURE_USAGE |
87 | acpi_status | 71 | acpi_status acpi_get_system_info(struct acpi_buffer *ret_buffer); |
88 | acpi_get_system_info ( | ||
89 | struct acpi_buffer *ret_buffer); | ||
90 | #endif | 72 | #endif |
91 | 73 | ||
92 | const char * | 74 | const char *acpi_format_exception(acpi_status exception); |
93 | acpi_format_exception ( | ||
94 | acpi_status exception); | ||
95 | 75 | ||
96 | acpi_status | 76 | acpi_status acpi_purge_cached_objects(void); |
97 | acpi_purge_cached_objects ( | ||
98 | void); | ||
99 | 77 | ||
100 | #ifdef ACPI_FUTURE_USAGE | 78 | #ifdef ACPI_FUTURE_USAGE |
101 | acpi_status | 79 | acpi_status |
102 | acpi_install_initialization_handler ( | 80 | acpi_install_initialization_handler(acpi_init_handler handler, u32 function); |
103 | acpi_init_handler handler, | ||
104 | u32 function); | ||
105 | #endif | 81 | #endif |
106 | 82 | ||
107 | /* | 83 | /* |
108 | * ACPI Memory managment | 84 | * ACPI Memory managment |
109 | */ | 85 | */ |
110 | void * | 86 | void *acpi_allocate(u32 size); |
111 | acpi_allocate ( | ||
112 | u32 size); | ||
113 | |||
114 | void * | ||
115 | acpi_callocate ( | ||
116 | u32 size); | ||
117 | 87 | ||
118 | void | 88 | void *acpi_callocate(u32 size); |
119 | acpi_free ( | ||
120 | void *address); | ||
121 | 89 | ||
90 | void acpi_free(void *address); | ||
122 | 91 | ||
123 | /* | 92 | /* |
124 | * ACPI table manipulation interfaces | 93 | * ACPI table manipulation interfaces |
125 | */ | 94 | */ |
126 | acpi_status | 95 | acpi_status |
127 | acpi_find_root_pointer ( | 96 | acpi_find_root_pointer(u32 flags, struct acpi_pointer *rsdp_address); |
128 | u32 flags, | ||
129 | struct acpi_pointer *rsdp_address); | ||
130 | 97 | ||
131 | acpi_status | 98 | acpi_status acpi_load_tables(void); |
132 | acpi_load_tables ( | ||
133 | void); | ||
134 | 99 | ||
135 | #ifdef ACPI_FUTURE_USAGE | 100 | #ifdef ACPI_FUTURE_USAGE |
136 | acpi_status | 101 | acpi_status acpi_load_table(struct acpi_table_header *table_ptr); |
137 | acpi_load_table ( | ||
138 | struct acpi_table_header *table_ptr); | ||
139 | 102 | ||
140 | acpi_status | 103 | acpi_status acpi_unload_table(acpi_table_type table_type); |
141 | acpi_unload_table ( | ||
142 | acpi_table_type table_type); | ||
143 | 104 | ||
144 | acpi_status | 105 | acpi_status |
145 | acpi_get_table_header ( | 106 | acpi_get_table_header(acpi_table_type table_type, |
146 | acpi_table_type table_type, | 107 | u32 instance, struct acpi_table_header *out_table_header); |
147 | u32 instance, | 108 | #endif /* ACPI_FUTURE_USAGE */ |
148 | struct acpi_table_header *out_table_header); | ||
149 | #endif /* ACPI_FUTURE_USAGE */ | ||
150 | 109 | ||
151 | acpi_status | 110 | acpi_status |
152 | acpi_get_table ( | 111 | acpi_get_table(acpi_table_type table_type, |
153 | acpi_table_type table_type, | 112 | u32 instance, struct acpi_buffer *ret_buffer); |
154 | u32 instance, | ||
155 | struct acpi_buffer *ret_buffer); | ||
156 | 113 | ||
157 | acpi_status | 114 | acpi_status |
158 | acpi_get_firmware_table ( | 115 | acpi_get_firmware_table(acpi_string signature, |
159 | acpi_string signature, | 116 | u32 instance, |
160 | u32 instance, | 117 | u32 flags, struct acpi_table_header **table_pointer); |
161 | u32 flags, | ||
162 | struct acpi_table_header **table_pointer); | ||
163 | |||
164 | 118 | ||
165 | /* | 119 | /* |
166 | * Namespace and name interfaces | 120 | * Namespace and name interfaces |
167 | */ | 121 | */ |
168 | acpi_status | 122 | acpi_status |
169 | acpi_walk_namespace ( | 123 | acpi_walk_namespace(acpi_object_type type, |
170 | acpi_object_type type, | 124 | acpi_handle start_object, |
171 | acpi_handle start_object, | 125 | u32 max_depth, |
172 | u32 max_depth, | 126 | acpi_walk_callback user_function, |
173 | acpi_walk_callback user_function, | 127 | void *context, void **return_value); |
174 | void *context, | ||
175 | void **return_value); | ||
176 | 128 | ||
177 | acpi_status | 129 | acpi_status |
178 | acpi_get_devices ( | 130 | acpi_get_devices(char *HID, |
179 | char *HID, | 131 | acpi_walk_callback user_function, |
180 | acpi_walk_callback user_function, | 132 | void *context, void **return_value); |
181 | void *context, | ||
182 | void **return_value); | ||
183 | 133 | ||
184 | acpi_status | 134 | acpi_status |
185 | acpi_get_name ( | 135 | acpi_get_name(acpi_handle handle, |
186 | acpi_handle handle, | 136 | u32 name_type, struct acpi_buffer *ret_path_ptr); |
187 | u32 name_type, | ||
188 | struct acpi_buffer *ret_path_ptr); | ||
189 | 137 | ||
190 | acpi_status | 138 | acpi_status |
191 | acpi_get_handle ( | 139 | acpi_get_handle(acpi_handle parent, |
192 | acpi_handle parent, | 140 | acpi_string pathname, acpi_handle * ret_handle); |
193 | acpi_string pathname, | ||
194 | acpi_handle *ret_handle); | ||
195 | 141 | ||
196 | acpi_status | 142 | acpi_status |
197 | acpi_attach_data ( | 143 | acpi_attach_data(acpi_handle obj_handle, |
198 | acpi_handle obj_handle, | 144 | acpi_object_handler handler, void *data); |
199 | acpi_object_handler handler, | ||
200 | void *data); | ||
201 | 145 | ||
202 | acpi_status | 146 | acpi_status |
203 | acpi_detach_data ( | 147 | acpi_detach_data(acpi_handle obj_handle, acpi_object_handler handler); |
204 | acpi_handle obj_handle, | ||
205 | acpi_object_handler handler); | ||
206 | 148 | ||
207 | acpi_status | 149 | acpi_status |
208 | acpi_get_data ( | 150 | acpi_get_data(acpi_handle obj_handle, acpi_object_handler handler, void **data); |
209 | acpi_handle obj_handle, | ||
210 | acpi_object_handler handler, | ||
211 | void **data); | ||
212 | |||
213 | 151 | ||
214 | /* | 152 | /* |
215 | * Object manipulation and enumeration | 153 | * Object manipulation and enumeration |
216 | */ | 154 | */ |
217 | acpi_status | 155 | acpi_status |
218 | acpi_evaluate_object ( | 156 | acpi_evaluate_object(acpi_handle object, |
219 | acpi_handle object, | 157 | acpi_string pathname, |
220 | acpi_string pathname, | 158 | struct acpi_object_list *parameter_objects, |
221 | struct acpi_object_list *parameter_objects, | 159 | struct acpi_buffer *return_object_buffer); |
222 | struct acpi_buffer *return_object_buffer); | ||
223 | 160 | ||
224 | #ifdef ACPI_FUTURE_USAGE | 161 | #ifdef ACPI_FUTURE_USAGE |
225 | acpi_status | 162 | acpi_status |
226 | acpi_evaluate_object_typed ( | 163 | acpi_evaluate_object_typed(acpi_handle object, |
227 | acpi_handle object, | 164 | acpi_string pathname, |
228 | acpi_string pathname, | 165 | struct acpi_object_list *external_params, |
229 | struct acpi_object_list *external_params, | 166 | struct acpi_buffer *return_buffer, |
230 | struct acpi_buffer *return_buffer, | 167 | acpi_object_type return_type); |
231 | acpi_object_type return_type); | ||
232 | #endif | 168 | #endif |
233 | 169 | ||
234 | acpi_status | 170 | acpi_status |
235 | acpi_get_object_info ( | 171 | acpi_get_object_info(acpi_handle handle, struct acpi_buffer *return_buffer); |
236 | acpi_handle handle, | ||
237 | struct acpi_buffer *return_buffer); | ||
238 | 172 | ||
239 | acpi_status | 173 | acpi_status |
240 | acpi_get_next_object ( | 174 | acpi_get_next_object(acpi_object_type type, |
241 | acpi_object_type type, | 175 | acpi_handle parent, |
242 | acpi_handle parent, | 176 | acpi_handle child, acpi_handle * out_handle); |
243 | acpi_handle child, | ||
244 | acpi_handle *out_handle); | ||
245 | 177 | ||
246 | acpi_status | 178 | acpi_status acpi_get_type(acpi_handle object, acpi_object_type * out_type); |
247 | acpi_get_type ( | ||
248 | acpi_handle object, | ||
249 | acpi_object_type *out_type); | ||
250 | |||
251 | acpi_status | ||
252 | acpi_get_parent ( | ||
253 | acpi_handle object, | ||
254 | acpi_handle *out_handle); | ||
255 | 179 | ||
180 | acpi_status acpi_get_parent(acpi_handle object, acpi_handle * out_handle); | ||
256 | 181 | ||
257 | /* | 182 | /* |
258 | * Event handler interfaces | 183 | * Event handler interfaces |
259 | */ | 184 | */ |
260 | acpi_status | 185 | acpi_status |
261 | acpi_install_fixed_event_handler ( | 186 | acpi_install_fixed_event_handler(u32 acpi_event, |
262 | u32 acpi_event, | 187 | acpi_event_handler handler, void *context); |
263 | acpi_event_handler handler, | ||
264 | void *context); | ||
265 | 188 | ||
266 | acpi_status | 189 | acpi_status |
267 | acpi_remove_fixed_event_handler ( | 190 | acpi_remove_fixed_event_handler(u32 acpi_event, acpi_event_handler handler); |
268 | u32 acpi_event, | ||
269 | acpi_event_handler handler); | ||
270 | 191 | ||
271 | acpi_status | 192 | acpi_status |
272 | acpi_install_notify_handler ( | 193 | acpi_install_notify_handler(acpi_handle device, |
273 | acpi_handle device, | 194 | u32 handler_type, |
274 | u32 handler_type, | 195 | acpi_notify_handler handler, void *context); |
275 | acpi_notify_handler handler, | ||
276 | void *context); | ||
277 | 196 | ||
278 | acpi_status | 197 | acpi_status |
279 | acpi_remove_notify_handler ( | 198 | acpi_remove_notify_handler(acpi_handle device, |
280 | acpi_handle device, | 199 | u32 handler_type, acpi_notify_handler handler); |
281 | u32 handler_type, | ||
282 | acpi_notify_handler handler); | ||
283 | 200 | ||
284 | acpi_status | 201 | acpi_status |
285 | acpi_install_address_space_handler ( | 202 | acpi_install_address_space_handler(acpi_handle device, |
286 | acpi_handle device, | 203 | acpi_adr_space_type space_id, |
287 | acpi_adr_space_type space_id, | 204 | acpi_adr_space_handler handler, |
288 | acpi_adr_space_handler handler, | 205 | acpi_adr_space_setup setup, void *context); |
289 | acpi_adr_space_setup setup, | ||
290 | void *context); | ||
291 | 206 | ||
292 | acpi_status | 207 | acpi_status |
293 | acpi_remove_address_space_handler ( | 208 | acpi_remove_address_space_handler(acpi_handle device, |
294 | acpi_handle device, | 209 | acpi_adr_space_type space_id, |
295 | acpi_adr_space_type space_id, | 210 | acpi_adr_space_handler handler); |
296 | acpi_adr_space_handler handler); | ||
297 | 211 | ||
298 | acpi_status | 212 | acpi_status |
299 | acpi_install_gpe_handler ( | 213 | acpi_install_gpe_handler(acpi_handle gpe_device, |
300 | acpi_handle gpe_device, | 214 | u32 gpe_number, |
301 | u32 gpe_number, | 215 | u32 type, acpi_event_handler address, void *context); |
302 | u32 type, | ||
303 | acpi_event_handler address, | ||
304 | void *context); | ||
305 | 216 | ||
306 | #ifdef ACPI_FUTURE_USAGE | 217 | #ifdef ACPI_FUTURE_USAGE |
307 | acpi_status | 218 | acpi_status acpi_install_exception_handler(acpi_exception_handler handler); |
308 | acpi_install_exception_handler ( | ||
309 | acpi_exception_handler handler); | ||
310 | #endif | 219 | #endif |
311 | 220 | ||
312 | |||
313 | /* | 221 | /* |
314 | * Event interfaces | 222 | * Event interfaces |
315 | */ | 223 | */ |
316 | acpi_status | 224 | acpi_status acpi_acquire_global_lock(u16 timeout, u32 * handle); |
317 | acpi_acquire_global_lock ( | ||
318 | u16 timeout, | ||
319 | u32 *handle); | ||
320 | 225 | ||
321 | acpi_status | 226 | acpi_status acpi_release_global_lock(u32 handle); |
322 | acpi_release_global_lock ( | ||
323 | u32 handle); | ||
324 | 227 | ||
325 | acpi_status | 228 | acpi_status |
326 | acpi_remove_gpe_handler ( | 229 | acpi_remove_gpe_handler(acpi_handle gpe_device, |
327 | acpi_handle gpe_device, | 230 | u32 gpe_number, acpi_event_handler address); |
328 | u32 gpe_number, | ||
329 | acpi_event_handler address); | ||
330 | 231 | ||
331 | acpi_status | 232 | acpi_status acpi_enable_event(u32 event, u32 flags); |
332 | acpi_enable_event ( | ||
333 | u32 event, | ||
334 | u32 flags); | ||
335 | 233 | ||
336 | acpi_status | 234 | acpi_status acpi_disable_event(u32 event, u32 flags); |
337 | acpi_disable_event ( | ||
338 | u32 event, | ||
339 | u32 flags); | ||
340 | 235 | ||
341 | acpi_status | 236 | acpi_status acpi_clear_event(u32 event); |
342 | acpi_clear_event ( | ||
343 | u32 event); | ||
344 | 237 | ||
345 | #ifdef ACPI_FUTURE_USAGE | 238 | #ifdef ACPI_FUTURE_USAGE |
346 | acpi_status | 239 | acpi_status acpi_get_event_status(u32 event, acpi_event_status * event_status); |
347 | acpi_get_event_status ( | 240 | #endif /* ACPI_FUTURE_USAGE */ |
348 | u32 event, | ||
349 | acpi_event_status *event_status); | ||
350 | #endif /* ACPI_FUTURE_USAGE */ | ||
351 | 241 | ||
352 | acpi_status | 242 | acpi_status acpi_set_gpe_type(acpi_handle gpe_device, u32 gpe_number, u8 type); |
353 | acpi_set_gpe_type ( | ||
354 | acpi_handle gpe_device, | ||
355 | u32 gpe_number, | ||
356 | u8 type); | ||
357 | 243 | ||
358 | acpi_status | 244 | acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number, u32 flags); |
359 | acpi_enable_gpe ( | ||
360 | acpi_handle gpe_device, | ||
361 | u32 gpe_number, | ||
362 | u32 flags); | ||
363 | 245 | ||
364 | acpi_status | 246 | acpi_status acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number, u32 flags); |
365 | acpi_disable_gpe ( | ||
366 | acpi_handle gpe_device, | ||
367 | u32 gpe_number, | ||
368 | u32 flags); | ||
369 | 247 | ||
370 | acpi_status | 248 | acpi_status acpi_clear_gpe(acpi_handle gpe_device, u32 gpe_number, u32 flags); |
371 | acpi_clear_gpe ( | ||
372 | acpi_handle gpe_device, | ||
373 | u32 gpe_number, | ||
374 | u32 flags); | ||
375 | 249 | ||
376 | #ifdef ACPI_FUTURE_USAGE | 250 | #ifdef ACPI_FUTURE_USAGE |
377 | acpi_status | 251 | acpi_status |
378 | acpi_get_gpe_status ( | 252 | acpi_get_gpe_status(acpi_handle gpe_device, |
379 | acpi_handle gpe_device, | 253 | u32 gpe_number, |
380 | u32 gpe_number, | 254 | u32 flags, acpi_event_status * event_status); |
381 | u32 flags, | 255 | #endif /* ACPI_FUTURE_USAGE */ |
382 | acpi_event_status *event_status); | ||
383 | #endif /* ACPI_FUTURE_USAGE */ | ||
384 | 256 | ||
385 | acpi_status | 257 | acpi_status |
386 | acpi_install_gpe_block ( | 258 | acpi_install_gpe_block(acpi_handle gpe_device, |
387 | acpi_handle gpe_device, | 259 | struct acpi_generic_address *gpe_block_address, |
388 | struct acpi_generic_address *gpe_block_address, | 260 | u32 register_count, u32 interrupt_number); |
389 | u32 register_count, | ||
390 | u32 interrupt_number); | ||
391 | |||
392 | acpi_status | ||
393 | acpi_remove_gpe_block ( | ||
394 | acpi_handle gpe_device); | ||
395 | 261 | ||
262 | acpi_status acpi_remove_gpe_block(acpi_handle gpe_device); | ||
396 | 263 | ||
397 | /* | 264 | /* |
398 | * Resource interfaces | 265 | * Resource interfaces |
399 | */ | 266 | */ |
400 | typedef | 267 | typedef |
401 | acpi_status (*ACPI_WALK_RESOURCE_CALLBACK) ( | 268 | acpi_status(*ACPI_WALK_RESOURCE_CALLBACK) (struct acpi_resource * resource, |
402 | struct acpi_resource *resource, | 269 | void *context); |
403 | void *context); | ||
404 | |||
405 | 270 | ||
406 | acpi_status | 271 | acpi_status |
407 | acpi_get_current_resources( | 272 | acpi_get_current_resources(acpi_handle device_handle, |
408 | acpi_handle device_handle, | 273 | struct acpi_buffer *ret_buffer); |
409 | struct acpi_buffer *ret_buffer); | ||
410 | 274 | ||
411 | #ifdef ACPI_FUTURE_USAGE | 275 | #ifdef ACPI_FUTURE_USAGE |
412 | acpi_status | 276 | acpi_status |
413 | acpi_get_possible_resources( | 277 | acpi_get_possible_resources(acpi_handle device_handle, |
414 | acpi_handle device_handle, | 278 | struct acpi_buffer *ret_buffer); |
415 | struct acpi_buffer *ret_buffer); | ||
416 | #endif | 279 | #endif |
417 | 280 | ||
418 | acpi_status | 281 | acpi_status |
419 | acpi_walk_resources ( | 282 | acpi_walk_resources(acpi_handle device_handle, |
420 | acpi_handle device_handle, | 283 | char *path, |
421 | char *path, | 284 | ACPI_WALK_RESOURCE_CALLBACK user_function, void *context); |
422 | ACPI_WALK_RESOURCE_CALLBACK user_function, | ||
423 | void *context); | ||
424 | 285 | ||
425 | acpi_status | 286 | acpi_status |
426 | acpi_set_current_resources ( | 287 | acpi_set_current_resources(acpi_handle device_handle, |
427 | acpi_handle device_handle, | 288 | struct acpi_buffer *in_buffer); |
428 | struct acpi_buffer *in_buffer); | ||
429 | 289 | ||
430 | acpi_status | 290 | acpi_status |
431 | acpi_get_irq_routing_table ( | 291 | acpi_get_irq_routing_table(acpi_handle bus_device_handle, |
432 | acpi_handle bus_device_handle, | 292 | struct acpi_buffer *ret_buffer); |
433 | struct acpi_buffer *ret_buffer); | ||
434 | 293 | ||
435 | acpi_status | 294 | acpi_status |
436 | acpi_resource_to_address64 ( | 295 | acpi_resource_to_address64(struct acpi_resource *resource, |
437 | struct acpi_resource *resource, | 296 | struct acpi_resource_address64 *out); |
438 | struct acpi_resource_address64 *out); | ||
439 | 297 | ||
440 | /* | 298 | /* |
441 | * Hardware (ACPI device) interfaces | 299 | * Hardware (ACPI device) interfaces |
442 | */ | 300 | */ |
443 | acpi_status | 301 | acpi_status acpi_get_register(u32 register_id, u32 * return_value, u32 flags); |
444 | acpi_get_register ( | ||
445 | u32 register_id, | ||
446 | u32 *return_value, | ||
447 | u32 flags); | ||
448 | 302 | ||
449 | acpi_status | 303 | acpi_status acpi_set_register(u32 register_id, u32 value, u32 flags); |
450 | acpi_set_register ( | ||
451 | u32 register_id, | ||
452 | u32 value, | ||
453 | u32 flags); | ||
454 | 304 | ||
455 | acpi_status | 305 | acpi_status |
456 | acpi_set_firmware_waking_vector ( | 306 | acpi_set_firmware_waking_vector(acpi_physical_address physical_address); |
457 | acpi_physical_address physical_address); | ||
458 | 307 | ||
459 | #ifdef ACPI_FUTURE_USAGE | 308 | #ifdef ACPI_FUTURE_USAGE |
460 | acpi_status | 309 | acpi_status |
461 | acpi_get_firmware_waking_vector ( | 310 | acpi_get_firmware_waking_vector(acpi_physical_address * physical_address); |
462 | acpi_physical_address *physical_address); | ||
463 | #endif | 311 | #endif |
464 | 312 | ||
465 | acpi_status | 313 | acpi_status |
466 | acpi_get_sleep_type_data ( | 314 | acpi_get_sleep_type_data(u8 sleep_state, u8 * slp_typ_a, u8 * slp_typ_b); |
467 | u8 sleep_state, | ||
468 | u8 *slp_typ_a, | ||
469 | u8 *slp_typ_b); | ||
470 | 315 | ||
471 | acpi_status | 316 | acpi_status acpi_enter_sleep_state_prep(u8 sleep_state); |
472 | acpi_enter_sleep_state_prep ( | ||
473 | u8 sleep_state); | ||
474 | 317 | ||
475 | acpi_status asmlinkage | 318 | acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state); |
476 | acpi_enter_sleep_state ( | ||
477 | u8 sleep_state); | ||
478 | 319 | ||
479 | acpi_status asmlinkage | 320 | acpi_status asmlinkage acpi_enter_sleep_state_s4bios(void); |
480 | acpi_enter_sleep_state_s4bios ( | ||
481 | void); | ||
482 | |||
483 | acpi_status | ||
484 | acpi_leave_sleep_state ( | ||
485 | u8 sleep_state); | ||
486 | 321 | ||
322 | acpi_status acpi_leave_sleep_state(u8 sleep_state); | ||
487 | 323 | ||
488 | #endif /* __ACXFACE_H__ */ | 324 | #endif /* __ACXFACE_H__ */ |
diff --git a/include/acpi/acresrc.h b/include/acpi/acresrc.h index ed679264c12c..38e798b05d08 100644 --- a/include/acpi/acresrc.h +++ b/include/acpi/acresrc.h | |||
@@ -44,303 +44,216 @@ | |||
44 | #ifndef __ACRESRC_H__ | 44 | #ifndef __ACRESRC_H__ |
45 | #define __ACRESRC_H__ | 45 | #define __ACRESRC_H__ |
46 | 46 | ||
47 | |||
48 | /* | 47 | /* |
49 | * Function prototypes called from Acpi* APIs | 48 | * Function prototypes called from Acpi* APIs |
50 | */ | 49 | */ |
51 | acpi_status | 50 | acpi_status |
52 | acpi_rs_get_prt_method_data ( | 51 | acpi_rs_get_prt_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer); |
53 | acpi_handle handle, | ||
54 | struct acpi_buffer *ret_buffer); | ||
55 | |||
56 | 52 | ||
57 | acpi_status | 53 | acpi_status |
58 | acpi_rs_get_crs_method_data ( | 54 | acpi_rs_get_crs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer); |
59 | acpi_handle handle, | ||
60 | struct acpi_buffer *ret_buffer); | ||
61 | 55 | ||
62 | #ifdef ACPI_FUTURE_USAGE | 56 | #ifdef ACPI_FUTURE_USAGE |
63 | acpi_status | 57 | acpi_status |
64 | acpi_rs_get_prs_method_data ( | 58 | acpi_rs_get_prs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer); |
65 | acpi_handle handle, | 59 | #endif /* ACPI_FUTURE_USAGE */ |
66 | struct acpi_buffer *ret_buffer); | ||
67 | #endif /* ACPI_FUTURE_USAGE */ | ||
68 | 60 | ||
69 | acpi_status | 61 | acpi_status |
70 | acpi_rs_get_method_data ( | 62 | acpi_rs_get_method_data(acpi_handle handle, |
71 | acpi_handle handle, | 63 | char *path, struct acpi_buffer *ret_buffer); |
72 | char *path, | ||
73 | struct acpi_buffer *ret_buffer); | ||
74 | 64 | ||
75 | acpi_status | 65 | acpi_status |
76 | acpi_rs_set_srs_method_data ( | 66 | acpi_rs_set_srs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer); |
77 | acpi_handle handle, | ||
78 | struct acpi_buffer *ret_buffer); | ||
79 | 67 | ||
80 | acpi_status | 68 | acpi_status |
81 | acpi_rs_create_resource_list ( | 69 | acpi_rs_create_resource_list(union acpi_operand_object *byte_stream_buffer, |
82 | union acpi_operand_object *byte_stream_buffer, | 70 | struct acpi_buffer *output_buffer); |
83 | struct acpi_buffer *output_buffer); | ||
84 | 71 | ||
85 | acpi_status | 72 | acpi_status |
86 | acpi_rs_create_byte_stream ( | 73 | acpi_rs_create_byte_stream(struct acpi_resource *linked_list_buffer, |
87 | struct acpi_resource *linked_list_buffer, | 74 | struct acpi_buffer *output_buffer); |
88 | struct acpi_buffer *output_buffer); | ||
89 | 75 | ||
90 | acpi_status | 76 | acpi_status |
91 | acpi_rs_create_pci_routing_table ( | 77 | acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object, |
92 | union acpi_operand_object *package_object, | 78 | struct acpi_buffer *output_buffer); |
93 | struct acpi_buffer *output_buffer); | ||
94 | |||
95 | 79 | ||
96 | /* | 80 | /* |
97 | * rsdump | 81 | * rsdump |
98 | */ | 82 | */ |
99 | #ifdef ACPI_FUTURE_USAGE | 83 | #ifdef ACPI_FUTURE_USAGE |
100 | void | 84 | void acpi_rs_dump_resource_list(struct acpi_resource *resource); |
101 | acpi_rs_dump_resource_list ( | ||
102 | struct acpi_resource *resource); | ||
103 | |||
104 | void | ||
105 | acpi_rs_dump_irq_list ( | ||
106 | u8 *route_table); | ||
107 | #endif /* ACPI_FUTURE_USAGE */ | ||
108 | 85 | ||
86 | void acpi_rs_dump_irq_list(u8 * route_table); | ||
87 | #endif /* ACPI_FUTURE_USAGE */ | ||
109 | 88 | ||
110 | /* | 89 | /* |
111 | * rscalc | 90 | * rscalc |
112 | */ | 91 | */ |
113 | acpi_status | 92 | acpi_status |
114 | acpi_rs_get_byte_stream_start ( | 93 | acpi_rs_get_byte_stream_start(u8 * byte_stream_buffer, |
115 | u8 *byte_stream_buffer, | 94 | u8 ** byte_stream_start, u32 * size); |
116 | u8 **byte_stream_start, | ||
117 | u32 *size); | ||
118 | 95 | ||
119 | acpi_status | 96 | acpi_status |
120 | acpi_rs_get_list_length ( | 97 | acpi_rs_get_list_length(u8 * byte_stream_buffer, |
121 | u8 *byte_stream_buffer, | 98 | u32 byte_stream_buffer_length, acpi_size * size_needed); |
122 | u32 byte_stream_buffer_length, | ||
123 | acpi_size *size_needed); | ||
124 | 99 | ||
125 | acpi_status | 100 | acpi_status |
126 | acpi_rs_get_byte_stream_length ( | 101 | acpi_rs_get_byte_stream_length(struct acpi_resource *linked_list_buffer, |
127 | struct acpi_resource *linked_list_buffer, | 102 | acpi_size * size_needed); |
128 | acpi_size *size_needed); | ||
129 | 103 | ||
130 | acpi_status | 104 | acpi_status |
131 | acpi_rs_get_pci_routing_table_length ( | 105 | acpi_rs_get_pci_routing_table_length(union acpi_operand_object *package_object, |
132 | union acpi_operand_object *package_object, | 106 | acpi_size * buffer_size_needed); |
133 | acpi_size *buffer_size_needed); | ||
134 | 107 | ||
135 | acpi_status | 108 | acpi_status |
136 | acpi_rs_byte_stream_to_list ( | 109 | acpi_rs_byte_stream_to_list(u8 * byte_stream_buffer, |
137 | u8 *byte_stream_buffer, | 110 | u32 byte_stream_buffer_length, u8 * output_buffer); |
138 | u32 byte_stream_buffer_length, | ||
139 | u8 *output_buffer); | ||
140 | 111 | ||
141 | acpi_status | 112 | acpi_status |
142 | acpi_rs_list_to_byte_stream ( | 113 | acpi_rs_list_to_byte_stream(struct acpi_resource *linked_list, |
143 | struct acpi_resource *linked_list, | 114 | acpi_size byte_stream_size_needed, |
144 | acpi_size byte_stream_size_needed, | 115 | u8 * output_buffer); |
145 | u8 *output_buffer); | ||
146 | 116 | ||
147 | acpi_status | 117 | acpi_status |
148 | acpi_rs_io_resource ( | 118 | acpi_rs_io_resource(u8 * byte_stream_buffer, |
149 | u8 *byte_stream_buffer, | 119 | acpi_size * bytes_consumed, |
150 | acpi_size *bytes_consumed, | 120 | u8 ** output_buffer, acpi_size * structure_size); |
151 | u8 **output_buffer, | ||
152 | acpi_size *structure_size); | ||
153 | 121 | ||
154 | acpi_status | 122 | acpi_status |
155 | acpi_rs_fixed_io_resource ( | 123 | acpi_rs_fixed_io_resource(u8 * byte_stream_buffer, |
156 | u8 *byte_stream_buffer, | 124 | acpi_size * bytes_consumed, |
157 | acpi_size *bytes_consumed, | 125 | u8 ** output_buffer, acpi_size * structure_size); |
158 | u8 **output_buffer, | ||
159 | acpi_size *structure_size); | ||
160 | 126 | ||
161 | acpi_status | 127 | acpi_status |
162 | acpi_rs_io_stream ( | 128 | acpi_rs_io_stream(struct acpi_resource *linked_list, |
163 | struct acpi_resource *linked_list, | 129 | u8 ** output_buffer, acpi_size * bytes_consumed); |
164 | u8 **output_buffer, | ||
165 | acpi_size *bytes_consumed); | ||
166 | 130 | ||
167 | acpi_status | 131 | acpi_status |
168 | acpi_rs_fixed_io_stream ( | 132 | acpi_rs_fixed_io_stream(struct acpi_resource *linked_list, |
169 | struct acpi_resource *linked_list, | 133 | u8 ** output_buffer, acpi_size * bytes_consumed); |
170 | u8 **output_buffer, | ||
171 | acpi_size *bytes_consumed); | ||
172 | 134 | ||
173 | acpi_status | 135 | acpi_status |
174 | acpi_rs_irq_resource ( | 136 | acpi_rs_irq_resource(u8 * byte_stream_buffer, |
175 | u8 *byte_stream_buffer, | 137 | acpi_size * bytes_consumed, |
176 | acpi_size *bytes_consumed, | 138 | u8 ** output_buffer, acpi_size * structure_size); |
177 | u8 **output_buffer, | ||
178 | acpi_size *structure_size); | ||
179 | 139 | ||
180 | acpi_status | 140 | acpi_status |
181 | acpi_rs_irq_stream ( | 141 | acpi_rs_irq_stream(struct acpi_resource *linked_list, |
182 | struct acpi_resource *linked_list, | 142 | u8 ** output_buffer, acpi_size * bytes_consumed); |
183 | u8 **output_buffer, | ||
184 | acpi_size *bytes_consumed); | ||
185 | 143 | ||
186 | acpi_status | 144 | acpi_status |
187 | acpi_rs_dma_resource ( | 145 | acpi_rs_dma_resource(u8 * byte_stream_buffer, |
188 | u8 *byte_stream_buffer, | 146 | acpi_size * bytes_consumed, |
189 | acpi_size *bytes_consumed, | 147 | u8 ** output_buffer, acpi_size * structure_size); |
190 | u8 **output_buffer, | ||
191 | acpi_size *structure_size); | ||
192 | 148 | ||
193 | acpi_status | 149 | acpi_status |
194 | acpi_rs_dma_stream ( | 150 | acpi_rs_dma_stream(struct acpi_resource *linked_list, |
195 | struct acpi_resource *linked_list, | 151 | u8 ** output_buffer, acpi_size * bytes_consumed); |
196 | u8 **output_buffer, | ||
197 | acpi_size *bytes_consumed); | ||
198 | 152 | ||
199 | acpi_status | 153 | acpi_status |
200 | acpi_rs_address16_resource ( | 154 | acpi_rs_address16_resource(u8 * byte_stream_buffer, |
201 | u8 *byte_stream_buffer, | 155 | acpi_size * bytes_consumed, |
202 | acpi_size *bytes_consumed, | 156 | u8 ** output_buffer, acpi_size * structure_size); |
203 | u8 **output_buffer, | ||
204 | acpi_size *structure_size); | ||
205 | 157 | ||
206 | acpi_status | 158 | acpi_status |
207 | acpi_rs_address16_stream ( | 159 | acpi_rs_address16_stream(struct acpi_resource *linked_list, |
208 | struct acpi_resource *linked_list, | 160 | u8 ** output_buffer, acpi_size * bytes_consumed); |
209 | u8 **output_buffer, | ||
210 | acpi_size *bytes_consumed); | ||
211 | 161 | ||
212 | acpi_status | 162 | acpi_status |
213 | acpi_rs_address32_resource ( | 163 | acpi_rs_address32_resource(u8 * byte_stream_buffer, |
214 | u8 *byte_stream_buffer, | 164 | acpi_size * bytes_consumed, |
215 | acpi_size *bytes_consumed, | 165 | u8 ** output_buffer, acpi_size * structure_size); |
216 | u8 **output_buffer, | ||
217 | acpi_size *structure_size); | ||
218 | 166 | ||
219 | acpi_status | 167 | acpi_status |
220 | acpi_rs_address32_stream ( | 168 | acpi_rs_address32_stream(struct acpi_resource *linked_list, |
221 | struct acpi_resource *linked_list, | 169 | u8 ** output_buffer, acpi_size * bytes_consumed); |
222 | u8 **output_buffer, | ||
223 | acpi_size *bytes_consumed); | ||
224 | 170 | ||
225 | acpi_status | 171 | acpi_status |
226 | acpi_rs_address64_resource ( | 172 | acpi_rs_address64_resource(u8 * byte_stream_buffer, |
227 | u8 *byte_stream_buffer, | 173 | acpi_size * bytes_consumed, |
228 | acpi_size *bytes_consumed, | 174 | u8 ** output_buffer, acpi_size * structure_size); |
229 | u8 **output_buffer, | ||
230 | acpi_size *structure_size); | ||
231 | 175 | ||
232 | acpi_status | 176 | acpi_status |
233 | acpi_rs_address64_stream ( | 177 | acpi_rs_address64_stream(struct acpi_resource *linked_list, |
234 | struct acpi_resource *linked_list, | 178 | u8 ** output_buffer, acpi_size * bytes_consumed); |
235 | u8 **output_buffer, | ||
236 | acpi_size *bytes_consumed); | ||
237 | 179 | ||
238 | acpi_status | 180 | acpi_status |
239 | acpi_rs_start_depend_fns_resource ( | 181 | acpi_rs_start_depend_fns_resource(u8 * byte_stream_buffer, |
240 | u8 *byte_stream_buffer, | 182 | acpi_size * bytes_consumed, |
241 | acpi_size *bytes_consumed, | 183 | u8 ** output_buffer, |
242 | u8 **output_buffer, | 184 | acpi_size * structure_size); |
243 | acpi_size *structure_size); | ||
244 | 185 | ||
245 | acpi_status | 186 | acpi_status |
246 | acpi_rs_end_depend_fns_resource ( | 187 | acpi_rs_end_depend_fns_resource(u8 * byte_stream_buffer, |
247 | u8 *byte_stream_buffer, | 188 | acpi_size * bytes_consumed, |
248 | acpi_size *bytes_consumed, | 189 | u8 ** output_buffer, |
249 | u8 **output_buffer, | 190 | acpi_size * structure_size); |
250 | acpi_size *structure_size); | ||
251 | 191 | ||
252 | acpi_status | 192 | acpi_status |
253 | acpi_rs_start_depend_fns_stream ( | 193 | acpi_rs_start_depend_fns_stream(struct acpi_resource *linked_list, |
254 | struct acpi_resource *linked_list, | 194 | u8 ** output_buffer, |
255 | u8 **output_buffer, | 195 | acpi_size * bytes_consumed); |
256 | acpi_size *bytes_consumed); | ||
257 | 196 | ||
258 | acpi_status | 197 | acpi_status |
259 | acpi_rs_end_depend_fns_stream ( | 198 | acpi_rs_end_depend_fns_stream(struct acpi_resource *linked_list, |
260 | struct acpi_resource *linked_list, | 199 | u8 ** output_buffer, acpi_size * bytes_consumed); |
261 | u8 **output_buffer, | ||
262 | acpi_size *bytes_consumed); | ||
263 | 200 | ||
264 | acpi_status | 201 | acpi_status |
265 | acpi_rs_memory24_resource ( | 202 | acpi_rs_memory24_resource(u8 * byte_stream_buffer, |
266 | u8 *byte_stream_buffer, | 203 | acpi_size * bytes_consumed, |
267 | acpi_size *bytes_consumed, | 204 | u8 ** output_buffer, acpi_size * structure_size); |
268 | u8 **output_buffer, | ||
269 | acpi_size *structure_size); | ||
270 | 205 | ||
271 | acpi_status | 206 | acpi_status |
272 | acpi_rs_memory24_stream ( | 207 | acpi_rs_memory24_stream(struct acpi_resource *linked_list, |
273 | struct acpi_resource *linked_list, | 208 | u8 ** output_buffer, acpi_size * bytes_consumed); |
274 | u8 **output_buffer, | ||
275 | acpi_size *bytes_consumed); | ||
276 | 209 | ||
277 | acpi_status | 210 | acpi_status |
278 | acpi_rs_memory32_range_resource ( | 211 | acpi_rs_memory32_range_resource(u8 * byte_stream_buffer, |
279 | u8 *byte_stream_buffer, | 212 | acpi_size * bytes_consumed, |
280 | acpi_size *bytes_consumed, | 213 | u8 ** output_buffer, |
281 | u8 **output_buffer, | 214 | acpi_size * structure_size); |
282 | acpi_size *structure_size); | ||
283 | 215 | ||
284 | acpi_status | 216 | acpi_status |
285 | acpi_rs_fixed_memory32_resource ( | 217 | acpi_rs_fixed_memory32_resource(u8 * byte_stream_buffer, |
286 | u8 *byte_stream_buffer, | 218 | acpi_size * bytes_consumed, |
287 | acpi_size *bytes_consumed, | 219 | u8 ** output_buffer, |
288 | u8 **output_buffer, | 220 | acpi_size * structure_size); |
289 | acpi_size *structure_size); | ||
290 | 221 | ||
291 | acpi_status | 222 | acpi_status |
292 | acpi_rs_memory32_range_stream ( | 223 | acpi_rs_memory32_range_stream(struct acpi_resource *linked_list, |
293 | struct acpi_resource *linked_list, | 224 | u8 ** output_buffer, acpi_size * bytes_consumed); |
294 | u8 **output_buffer, | ||
295 | acpi_size *bytes_consumed); | ||
296 | 225 | ||
297 | acpi_status | 226 | acpi_status |
298 | acpi_rs_fixed_memory32_stream ( | 227 | acpi_rs_fixed_memory32_stream(struct acpi_resource *linked_list, |
299 | struct acpi_resource *linked_list, | 228 | u8 ** output_buffer, acpi_size * bytes_consumed); |
300 | u8 **output_buffer, | ||
301 | acpi_size *bytes_consumed); | ||
302 | 229 | ||
303 | acpi_status | 230 | acpi_status |
304 | acpi_rs_extended_irq_resource ( | 231 | acpi_rs_extended_irq_resource(u8 * byte_stream_buffer, |
305 | u8 *byte_stream_buffer, | 232 | acpi_size * bytes_consumed, |
306 | acpi_size *bytes_consumed, | 233 | u8 ** output_buffer, acpi_size * structure_size); |
307 | u8 **output_buffer, | ||
308 | acpi_size *structure_size); | ||
309 | 234 | ||
310 | acpi_status | 235 | acpi_status |
311 | acpi_rs_extended_irq_stream ( | 236 | acpi_rs_extended_irq_stream(struct acpi_resource *linked_list, |
312 | struct acpi_resource *linked_list, | 237 | u8 ** output_buffer, acpi_size * bytes_consumed); |
313 | u8 **output_buffer, | ||
314 | acpi_size *bytes_consumed); | ||
315 | 238 | ||
316 | acpi_status | 239 | acpi_status |
317 | acpi_rs_end_tag_resource ( | 240 | acpi_rs_end_tag_resource(u8 * byte_stream_buffer, |
318 | u8 *byte_stream_buffer, | 241 | acpi_size * bytes_consumed, |
319 | acpi_size *bytes_consumed, | 242 | u8 ** output_buffer, acpi_size * structure_size); |
320 | u8 **output_buffer, | ||
321 | acpi_size *structure_size); | ||
322 | 243 | ||
323 | acpi_status | 244 | acpi_status |
324 | acpi_rs_end_tag_stream ( | 245 | acpi_rs_end_tag_stream(struct acpi_resource *linked_list, |
325 | struct acpi_resource *linked_list, | 246 | u8 ** output_buffer, acpi_size * bytes_consumed); |
326 | u8 **output_buffer, | ||
327 | acpi_size *bytes_consumed); | ||
328 | 247 | ||
329 | acpi_status | 248 | acpi_status |
330 | acpi_rs_vendor_resource ( | 249 | acpi_rs_vendor_resource(u8 * byte_stream_buffer, |
331 | u8 *byte_stream_buffer, | 250 | acpi_size * bytes_consumed, |
332 | acpi_size *bytes_consumed, | 251 | u8 ** output_buffer, acpi_size * structure_size); |
333 | u8 **output_buffer, | ||
334 | acpi_size *structure_size); | ||
335 | 252 | ||
336 | acpi_status | 253 | acpi_status |
337 | acpi_rs_vendor_stream ( | 254 | acpi_rs_vendor_stream(struct acpi_resource *linked_list, |
338 | struct acpi_resource *linked_list, | 255 | u8 ** output_buffer, acpi_size * bytes_consumed); |
339 | u8 **output_buffer, | ||
340 | acpi_size *bytes_consumed); | ||
341 | 256 | ||
342 | u8 | 257 | u8 acpi_rs_get_resource_type(u8 resource_start_byte); |
343 | acpi_rs_get_resource_type ( | ||
344 | u8 resource_start_byte); | ||
345 | 258 | ||
346 | #endif /* __ACRESRC_H__ */ | 259 | #endif /* __ACRESRC_H__ */ |
diff --git a/include/acpi/acstruct.h b/include/acpi/acstruct.h index 27b22bb3d229..99d235339801 100644 --- a/include/acpi/acstruct.h +++ b/include/acpi/acstruct.h | |||
@@ -44,14 +44,12 @@ | |||
44 | #ifndef __ACSTRUCT_H__ | 44 | #ifndef __ACSTRUCT_H__ |
45 | #define __ACSTRUCT_H__ | 45 | #define __ACSTRUCT_H__ |
46 | 46 | ||
47 | |||
48 | /***************************************************************************** | 47 | /***************************************************************************** |
49 | * | 48 | * |
50 | * Tree walking typedefs and structs | 49 | * Tree walking typedefs and structs |
51 | * | 50 | * |
52 | ****************************************************************************/ | 51 | ****************************************************************************/ |
53 | 52 | ||
54 | |||
55 | /* | 53 | /* |
56 | * Walk state - current state of a parse tree walk. Used for both a leisurely stroll through | 54 | * Walk state - current state of a parse tree walk. Used for both a leisurely stroll through |
57 | * the tree (for whatever reason), and for control method execution. | 55 | * the tree (for whatever reason), and for control method execution. |
@@ -65,97 +63,90 @@ | |||
65 | #define ACPI_WALK_CONST_REQUIRED 3 | 63 | #define ACPI_WALK_CONST_REQUIRED 3 |
66 | #define ACPI_WALK_CONST_OPTIONAL 4 | 64 | #define ACPI_WALK_CONST_OPTIONAL 4 |
67 | 65 | ||
68 | struct acpi_walk_state | 66 | struct acpi_walk_state { |
69 | { | 67 | u8 data_type; /* To differentiate various internal objs MUST BE FIRST! */ |
70 | u8 data_type; /* To differentiate various internal objs MUST BE FIRST!*/\ | 68 | u8 walk_type; |
71 | u8 walk_type; | 69 | acpi_owner_id owner_id; /* Owner of objects created during the walk */ |
72 | acpi_owner_id owner_id; /* Owner of objects created during the walk */ | 70 | u8 last_predicate; /* Result of last predicate */ |
73 | u8 last_predicate; /* Result of last predicate */ | 71 | u8 current_result; /* */ |
74 | u8 current_result; /* */ | 72 | u8 next_op_info; /* Info about next_op */ |
75 | u8 next_op_info; /* Info about next_op */ | 73 | u8 num_operands; /* Stack pointer for Operands[] array */ |
76 | u8 num_operands; /* Stack pointer for Operands[] array */ | 74 | u8 return_used; |
77 | u8 return_used; | 75 | u16 opcode; /* Current AML opcode */ |
78 | u16 opcode; /* Current AML opcode */ | 76 | u8 scope_depth; |
79 | u8 scope_depth; | 77 | u8 pass_number; /* Parse pass during table load */ |
80 | u8 pass_number; /* Parse pass during table load */ | 78 | u32 arg_count; /* push for fixed or var args */ |
81 | u32 arg_count; /* push for fixed or var args */ | 79 | u32 aml_offset; |
82 | u32 aml_offset; | 80 | u32 arg_types; |
83 | u32 arg_types; | 81 | u32 method_breakpoint; /* For single stepping */ |
84 | u32 method_breakpoint; /* For single stepping */ | 82 | u32 user_breakpoint; /* User AML breakpoint */ |
85 | u32 user_breakpoint; /* User AML breakpoint */ | 83 | u32 parse_flags; |
86 | u32 parse_flags; | 84 | u32 prev_arg_types; |
87 | u32 prev_arg_types; | 85 | |
88 | 86 | u8 *aml_last_while; | |
89 | u8 *aml_last_while; | 87 | struct acpi_namespace_node arguments[ACPI_METHOD_NUM_ARGS]; /* Control method arguments */ |
90 | struct acpi_namespace_node arguments[ACPI_METHOD_NUM_ARGS]; /* Control method arguments */ | 88 | union acpi_operand_object **caller_return_desc; |
91 | union acpi_operand_object **caller_return_desc; | 89 | union acpi_generic_state *control_state; /* List of control states (nested IFs) */ |
92 | union acpi_generic_state *control_state; /* List of control states (nested IFs) */ | 90 | struct acpi_namespace_node *deferred_node; /* Used when executing deferred opcodes */ |
93 | struct acpi_namespace_node *deferred_node; /* Used when executing deferred opcodes */ | 91 | struct acpi_gpe_event_info *gpe_event_info; /* Info for GPE (_Lxx/_Exx methods only */ |
94 | struct acpi_gpe_event_info *gpe_event_info; /* Info for GPE (_Lxx/_Exx methods only */ | 92 | union acpi_operand_object *implicit_return_obj; |
95 | union acpi_operand_object *implicit_return_obj; | 93 | struct acpi_namespace_node local_variables[ACPI_METHOD_NUM_LOCALS]; /* Control method locals */ |
96 | struct acpi_namespace_node local_variables[ACPI_METHOD_NUM_LOCALS]; /* Control method locals */ | 94 | struct acpi_namespace_node *method_call_node; /* Called method Node */ |
97 | struct acpi_namespace_node *method_call_node; /* Called method Node*/ | 95 | union acpi_parse_object *method_call_op; /* method_call Op if running a method */ |
98 | union acpi_parse_object *method_call_op; /* method_call Op if running a method */ | 96 | union acpi_operand_object *method_desc; /* Method descriptor if running a method */ |
99 | union acpi_operand_object *method_desc; /* Method descriptor if running a method */ | 97 | struct acpi_namespace_node *method_node; /* Method node if running a method. */ |
100 | struct acpi_namespace_node *method_node; /* Method node if running a method. */ | 98 | union acpi_parse_object *op; /* Current parser op */ |
101 | union acpi_parse_object *op; /* Current parser op */ | 99 | union acpi_operand_object *operands[ACPI_OBJ_NUM_OPERANDS + 1]; /* Operands passed to the interpreter (+1 for NULL terminator) */ |
102 | union acpi_operand_object *operands[ACPI_OBJ_NUM_OPERANDS+1]; /* Operands passed to the interpreter (+1 for NULL terminator) */ | 100 | const struct acpi_opcode_info *op_info; /* Info on current opcode */ |
103 | const struct acpi_opcode_info *op_info; /* Info on current opcode */ | 101 | union acpi_parse_object *origin; /* Start of walk [Obsolete] */ |
104 | union acpi_parse_object *origin; /* Start of walk [Obsolete] */ | 102 | union acpi_operand_object **params; |
105 | union acpi_operand_object **params; | 103 | struct acpi_parse_state parser_state; /* Current state of parser */ |
106 | struct acpi_parse_state parser_state; /* Current state of parser */ | 104 | union acpi_operand_object *result_obj; |
107 | union acpi_operand_object *result_obj; | 105 | union acpi_generic_state *results; /* Stack of accumulated results */ |
108 | union acpi_generic_state *results; /* Stack of accumulated results */ | 106 | union acpi_operand_object *return_desc; /* Return object, if any */ |
109 | union acpi_operand_object *return_desc; /* Return object, if any */ | 107 | union acpi_generic_state *scope_info; /* Stack of nested scopes */ |
110 | union acpi_generic_state *scope_info; /* Stack of nested scopes */ | 108 | |
111 | 109 | union acpi_parse_object *prev_op; /* Last op that was processed */ | |
112 | union acpi_parse_object *prev_op; /* Last op that was processed */ | 110 | union acpi_parse_object *next_op; /* next op to be processed */ |
113 | union acpi_parse_object *next_op; /* next op to be processed */ | 111 | acpi_parse_downwards descending_callback; |
114 | acpi_parse_downwards descending_callback; | 112 | acpi_parse_upwards ascending_callback; |
115 | acpi_parse_upwards ascending_callback; | 113 | struct acpi_thread_state *thread; |
116 | struct acpi_thread_state *thread; | 114 | struct acpi_walk_state *next; /* Next walk_state in list */ |
117 | struct acpi_walk_state *next; /* Next walk_state in list */ | ||
118 | }; | 115 | }; |
119 | 116 | ||
120 | |||
121 | /* Info used by acpi_ps_init_objects */ | 117 | /* Info used by acpi_ps_init_objects */ |
122 | 118 | ||
123 | struct acpi_init_walk_info | 119 | struct acpi_init_walk_info { |
124 | { | 120 | u16 method_count; |
125 | u16 method_count; | 121 | u16 device_count; |
126 | u16 device_count; | 122 | u16 op_region_count; |
127 | u16 op_region_count; | 123 | u16 field_count; |
128 | u16 field_count; | 124 | u16 buffer_count; |
129 | u16 buffer_count; | 125 | u16 package_count; |
130 | u16 package_count; | 126 | u16 op_region_init; |
131 | u16 op_region_init; | 127 | u16 field_init; |
132 | u16 field_init; | 128 | u16 buffer_init; |
133 | u16 buffer_init; | 129 | u16 package_init; |
134 | u16 package_init; | 130 | u16 object_count; |
135 | u16 object_count; | 131 | struct acpi_table_desc *table_desc; |
136 | struct acpi_table_desc *table_desc; | ||
137 | }; | 132 | }; |
138 | 133 | ||
139 | |||
140 | /* Info used by acpi_ns_initialize_devices */ | 134 | /* Info used by acpi_ns_initialize_devices */ |
141 | 135 | ||
142 | struct acpi_device_walk_info | 136 | struct acpi_device_walk_info { |
143 | { | 137 | u16 device_count; |
144 | u16 device_count; | 138 | u16 num_STA; |
145 | u16 num_STA; | 139 | u16 num_INI; |
146 | u16 num_INI; | 140 | struct acpi_table_desc *table_desc; |
147 | struct acpi_table_desc *table_desc; | ||
148 | }; | 141 | }; |
149 | 142 | ||
150 | |||
151 | /* TBD: [Restructure] Merge with struct above */ | 143 | /* TBD: [Restructure] Merge with struct above */ |
152 | 144 | ||
153 | struct acpi_walk_info | 145 | struct acpi_walk_info { |
154 | { | 146 | u32 debug_level; |
155 | u32 debug_level; | 147 | u32 count; |
156 | u32 count; | 148 | acpi_owner_id owner_id; |
157 | acpi_owner_id owner_id; | 149 | u8 display_type; |
158 | u8 display_type; | ||
159 | }; | 150 | }; |
160 | 151 | ||
161 | /* Display Types */ | 152 | /* Display Types */ |
@@ -166,56 +157,48 @@ struct acpi_walk_info | |||
166 | 157 | ||
167 | #define ACPI_DISPLAY_SHORT (u8) 2 | 158 | #define ACPI_DISPLAY_SHORT (u8) 2 |
168 | 159 | ||
169 | struct acpi_get_devices_info | 160 | struct acpi_get_devices_info { |
170 | { | 161 | acpi_walk_callback user_function; |
171 | acpi_walk_callback user_function; | 162 | void *context; |
172 | void *context; | 163 | char *hid; |
173 | char *hid; | ||
174 | }; | 164 | }; |
175 | 165 | ||
166 | union acpi_aml_operands { | ||
167 | union acpi_operand_object *operands[7]; | ||
176 | 168 | ||
177 | union acpi_aml_operands | 169 | struct { |
178 | { | 170 | struct acpi_object_integer *type; |
179 | union acpi_operand_object *operands[7]; | 171 | struct acpi_object_integer *code; |
180 | 172 | struct acpi_object_integer *argument; | |
181 | struct | ||
182 | { | ||
183 | struct acpi_object_integer *type; | ||
184 | struct acpi_object_integer *code; | ||
185 | struct acpi_object_integer *argument; | ||
186 | 173 | ||
187 | } fatal; | 174 | } fatal; |
188 | 175 | ||
189 | struct | 176 | struct { |
190 | { | 177 | union acpi_operand_object *source; |
191 | union acpi_operand_object *source; | 178 | struct acpi_object_integer *index; |
192 | struct acpi_object_integer *index; | 179 | union acpi_operand_object *target; |
193 | union acpi_operand_object *target; | ||
194 | 180 | ||
195 | } index; | 181 | } index; |
196 | 182 | ||
197 | struct | 183 | struct { |
198 | { | 184 | union acpi_operand_object *source; |
199 | union acpi_operand_object *source; | 185 | struct acpi_object_integer *index; |
200 | struct acpi_object_integer *index; | 186 | struct acpi_object_integer *length; |
201 | struct acpi_object_integer *length; | 187 | union acpi_operand_object *target; |
202 | union acpi_operand_object *target; | ||
203 | 188 | ||
204 | } mid; | 189 | } mid; |
205 | }; | 190 | }; |
206 | 191 | ||
207 | |||
208 | /* Internal method parameter list */ | 192 | /* Internal method parameter list */ |
209 | 193 | ||
210 | struct acpi_parameter_info | 194 | struct acpi_parameter_info { |
211 | { | 195 | struct acpi_namespace_node *node; |
212 | struct acpi_namespace_node *node; | 196 | union acpi_operand_object *obj_desc; |
213 | union acpi_operand_object *obj_desc; | 197 | union acpi_operand_object **parameters; |
214 | union acpi_operand_object **parameters; | 198 | union acpi_operand_object *return_object; |
215 | union acpi_operand_object *return_object; | 199 | u8 pass_number; |
216 | u8 pass_number; | 200 | u8 parameter_type; |
217 | u8 parameter_type; | 201 | u8 return_object_type; |
218 | u8 return_object_type; | ||
219 | }; | 202 | }; |
220 | 203 | ||
221 | /* Types for parameter_type above */ | 204 | /* Types for parameter_type above */ |
@@ -223,5 +206,4 @@ struct acpi_parameter_info | |||
223 | #define ACPI_PARAM_ARGS 0 | 206 | #define ACPI_PARAM_ARGS 0 |
224 | #define ACPI_PARAM_GPE 1 | 207 | #define ACPI_PARAM_GPE 1 |
225 | 208 | ||
226 | |||
227 | #endif | 209 | #endif |
diff --git a/include/acpi/actables.h b/include/acpi/actables.h index e6ceb1819643..f92c1858b808 100644 --- a/include/acpi/actables.h +++ b/include/acpi/actables.h | |||
@@ -44,154 +44,101 @@ | |||
44 | #ifndef __ACTABLES_H__ | 44 | #ifndef __ACTABLES_H__ |
45 | #define __ACTABLES_H__ | 45 | #define __ACTABLES_H__ |
46 | 46 | ||
47 | |||
48 | /* Used in acpi_tb_map_acpi_table for size parameter if table header is to be used */ | 47 | /* Used in acpi_tb_map_acpi_table for size parameter if table header is to be used */ |
49 | 48 | ||
50 | #define SIZE_IN_HEADER 0 | 49 | #define SIZE_IN_HEADER 0 |
51 | 50 | ||
52 | |||
53 | /* | 51 | /* |
54 | * tbconvrt - Table conversion routines | 52 | * tbconvrt - Table conversion routines |
55 | */ | 53 | */ |
56 | acpi_status | 54 | acpi_status acpi_tb_convert_to_xsdt(struct acpi_table_desc *table_info); |
57 | acpi_tb_convert_to_xsdt ( | ||
58 | struct acpi_table_desc *table_info); | ||
59 | 55 | ||
60 | acpi_status | 56 | acpi_status acpi_tb_convert_table_fadt(void); |
61 | acpi_tb_convert_table_fadt ( | ||
62 | void); | ||
63 | 57 | ||
64 | acpi_status | 58 | acpi_status acpi_tb_build_common_facs(struct acpi_table_desc *table_info); |
65 | acpi_tb_build_common_facs ( | ||
66 | struct acpi_table_desc *table_info); | ||
67 | 59 | ||
68 | u32 | 60 | u32 |
69 | acpi_tb_get_table_count ( | 61 | acpi_tb_get_table_count(struct rsdp_descriptor *RSDP, |
70 | struct rsdp_descriptor *RSDP, | 62 | struct acpi_table_header *RSDT); |
71 | struct acpi_table_header *RSDT); | ||
72 | |||
73 | 63 | ||
74 | /* | 64 | /* |
75 | * tbget - Table "get" routines | 65 | * tbget - Table "get" routines |
76 | */ | 66 | */ |
77 | acpi_status | 67 | acpi_status |
78 | acpi_tb_get_table ( | 68 | acpi_tb_get_table(struct acpi_pointer *address, |
79 | struct acpi_pointer *address, | 69 | struct acpi_table_desc *table_info); |
80 | struct acpi_table_desc *table_info); | ||
81 | |||
82 | acpi_status | ||
83 | acpi_tb_get_table_header ( | ||
84 | struct acpi_pointer *address, | ||
85 | struct acpi_table_header *return_header); | ||
86 | 70 | ||
87 | acpi_status | 71 | acpi_status |
88 | acpi_tb_get_table_body ( | 72 | acpi_tb_get_table_header(struct acpi_pointer *address, |
89 | struct acpi_pointer *address, | 73 | struct acpi_table_header *return_header); |
90 | struct acpi_table_header *header, | ||
91 | struct acpi_table_desc *table_info); | ||
92 | 74 | ||
93 | acpi_status | 75 | acpi_status |
94 | acpi_tb_get_table_ptr ( | 76 | acpi_tb_get_table_body(struct acpi_pointer *address, |
95 | acpi_table_type table_type, | 77 | struct acpi_table_header *header, |
96 | u32 instance, | 78 | struct acpi_table_desc *table_info); |
97 | struct acpi_table_header **table_ptr_loc); | ||
98 | 79 | ||
99 | acpi_status | 80 | acpi_status |
100 | acpi_tb_verify_rsdp ( | 81 | acpi_tb_get_table_ptr(acpi_table_type table_type, |
101 | struct acpi_pointer *address); | 82 | u32 instance, struct acpi_table_header **table_ptr_loc); |
102 | 83 | ||
103 | void | 84 | acpi_status acpi_tb_verify_rsdp(struct acpi_pointer *address); |
104 | acpi_tb_get_rsdt_address ( | ||
105 | struct acpi_pointer *out_address); | ||
106 | 85 | ||
107 | acpi_status | 86 | void acpi_tb_get_rsdt_address(struct acpi_pointer *out_address); |
108 | acpi_tb_validate_rsdt ( | ||
109 | struct acpi_table_header *table_ptr); | ||
110 | 87 | ||
88 | acpi_status acpi_tb_validate_rsdt(struct acpi_table_header *table_ptr); | ||
111 | 89 | ||
112 | /* | 90 | /* |
113 | * tbgetall - get multiple required tables | 91 | * tbgetall - get multiple required tables |
114 | */ | 92 | */ |
115 | acpi_status | 93 | acpi_status acpi_tb_get_required_tables(void); |
116 | acpi_tb_get_required_tables ( | ||
117 | void); | ||
118 | |||
119 | 94 | ||
120 | /* | 95 | /* |
121 | * tbinstall - Table installation | 96 | * tbinstall - Table installation |
122 | */ | 97 | */ |
123 | acpi_status | 98 | acpi_status acpi_tb_install_table(struct acpi_table_desc *table_info); |
124 | acpi_tb_install_table ( | ||
125 | struct acpi_table_desc *table_info); | ||
126 | 99 | ||
127 | acpi_status | 100 | acpi_status |
128 | acpi_tb_recognize_table ( | 101 | acpi_tb_recognize_table(struct acpi_table_desc *table_info, u8 search_type); |
129 | struct acpi_table_desc *table_info, | ||
130 | u8 search_type); | ||
131 | 102 | ||
132 | acpi_status | 103 | acpi_status |
133 | acpi_tb_init_table_descriptor ( | 104 | acpi_tb_init_table_descriptor(acpi_table_type table_type, |
134 | acpi_table_type table_type, | 105 | struct acpi_table_desc *table_info); |
135 | struct acpi_table_desc *table_info); | ||
136 | |||
137 | 106 | ||
138 | /* | 107 | /* |
139 | * tbremove - Table removal and deletion | 108 | * tbremove - Table removal and deletion |
140 | */ | 109 | */ |
141 | void | 110 | void acpi_tb_delete_all_tables(void); |
142 | acpi_tb_delete_all_tables ( | ||
143 | void); | ||
144 | |||
145 | void | ||
146 | acpi_tb_delete_tables_by_type ( | ||
147 | acpi_table_type type); | ||
148 | 111 | ||
149 | void | 112 | void acpi_tb_delete_tables_by_type(acpi_table_type type); |
150 | acpi_tb_delete_single_table ( | ||
151 | struct acpi_table_desc *table_desc); | ||
152 | 113 | ||
153 | struct acpi_table_desc * | 114 | void acpi_tb_delete_single_table(struct acpi_table_desc *table_desc); |
154 | acpi_tb_uninstall_table ( | ||
155 | struct acpi_table_desc *table_desc); | ||
156 | 115 | ||
116 | struct acpi_table_desc *acpi_tb_uninstall_table(struct acpi_table_desc | ||
117 | *table_desc); | ||
157 | 118 | ||
158 | /* | 119 | /* |
159 | * tbxfroot - RSDP, RSDT utilities | 120 | * tbxfroot - RSDP, RSDT utilities |
160 | */ | 121 | */ |
161 | acpi_status | 122 | acpi_status |
162 | acpi_tb_find_table ( | 123 | acpi_tb_find_table(char *signature, |
163 | char *signature, | 124 | char *oem_id, |
164 | char *oem_id, | 125 | char *oem_table_id, struct acpi_table_header **table_ptr); |
165 | char *oem_table_id, | ||
166 | struct acpi_table_header **table_ptr); | ||
167 | 126 | ||
168 | acpi_status | 127 | acpi_status acpi_tb_get_table_rsdt(void); |
169 | acpi_tb_get_table_rsdt ( | ||
170 | void); | ||
171 | |||
172 | acpi_status | ||
173 | acpi_tb_validate_rsdp ( | ||
174 | struct rsdp_descriptor *rsdp); | ||
175 | 128 | ||
129 | acpi_status acpi_tb_validate_rsdp(struct rsdp_descriptor *rsdp); | ||
176 | 130 | ||
177 | /* | 131 | /* |
178 | * tbutils - common table utilities | 132 | * tbutils - common table utilities |
179 | */ | 133 | */ |
180 | acpi_status | 134 | acpi_status acpi_tb_is_table_installed(struct acpi_table_desc *new_table_desc); |
181 | acpi_tb_is_table_installed ( | ||
182 | struct acpi_table_desc *new_table_desc); | ||
183 | 135 | ||
184 | acpi_status | 136 | acpi_status |
185 | acpi_tb_verify_table_checksum ( | 137 | acpi_tb_verify_table_checksum(struct acpi_table_header *table_header); |
186 | struct acpi_table_header *table_header); | ||
187 | 138 | ||
188 | u8 | 139 | u8 acpi_tb_generate_checksum(void *buffer, u32 length); |
189 | acpi_tb_generate_checksum ( | ||
190 | void *buffer, | ||
191 | u32 length); | ||
192 | 140 | ||
193 | acpi_status | 141 | acpi_status |
194 | acpi_tb_validate_table_header ( | 142 | acpi_tb_validate_table_header(struct acpi_table_header *table_header); |
195 | struct acpi_table_header *table_header); | ||
196 | 143 | ||
197 | #endif /* __ACTABLES_H__ */ | 144 | #endif /* __ACTABLES_H__ */ |
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h index c1e9110c3661..a46f406e1c94 100644 --- a/include/acpi/actbl.h +++ b/include/acpi/actbl.h | |||
@@ -44,27 +44,24 @@ | |||
44 | #ifndef __ACTBL_H__ | 44 | #ifndef __ACTBL_H__ |
45 | #define __ACTBL_H__ | 45 | #define __ACTBL_H__ |
46 | 46 | ||
47 | |||
48 | /* | 47 | /* |
49 | * Values for description table header signatures | 48 | * Values for description table header signatures |
50 | */ | 49 | */ |
51 | #define RSDP_NAME "RSDP" | 50 | #define RSDP_NAME "RSDP" |
52 | #define RSDP_SIG "RSD PTR " /* RSDT Pointer signature */ | 51 | #define RSDP_SIG "RSD PTR " /* RSDT Pointer signature */ |
53 | #define APIC_SIG "APIC" /* Multiple APIC Description Table */ | 52 | #define APIC_SIG "APIC" /* Multiple APIC Description Table */ |
54 | #define DSDT_SIG "DSDT" /* Differentiated System Description Table */ | 53 | #define DSDT_SIG "DSDT" /* Differentiated System Description Table */ |
55 | #define FADT_SIG "FACP" /* Fixed ACPI Description Table */ | 54 | #define FADT_SIG "FACP" /* Fixed ACPI Description Table */ |
56 | #define FACS_SIG "FACS" /* Firmware ACPI Control Structure */ | 55 | #define FACS_SIG "FACS" /* Firmware ACPI Control Structure */ |
57 | #define PSDT_SIG "PSDT" /* Persistent System Description Table */ | 56 | #define PSDT_SIG "PSDT" /* Persistent System Description Table */ |
58 | #define RSDT_SIG "RSDT" /* Root System Description Table */ | 57 | #define RSDT_SIG "RSDT" /* Root System Description Table */ |
59 | #define XSDT_SIG "XSDT" /* Extended System Description Table */ | 58 | #define XSDT_SIG "XSDT" /* Extended System Description Table */ |
60 | #define SSDT_SIG "SSDT" /* Secondary System Description Table */ | 59 | #define SSDT_SIG "SSDT" /* Secondary System Description Table */ |
61 | #define SBST_SIG "SBST" /* Smart Battery Specification Table */ | 60 | #define SBST_SIG "SBST" /* Smart Battery Specification Table */ |
62 | #define SPIC_SIG "SPIC" /* IOSAPIC table */ | 61 | #define SPIC_SIG "SPIC" /* IOSAPIC table */ |
63 | #define BOOT_SIG "BOOT" /* Boot table */ | 62 | #define BOOT_SIG "BOOT" /* Boot table */ |
64 | 63 | ||
65 | 64 | #define GL_OWNED 0x02 /* Ownership of global lock is bit 1 */ | |
66 | #define GL_OWNED 0x02 /* Ownership of global lock is bit 1 */ | ||
67 | |||
68 | 65 | ||
69 | /* | 66 | /* |
70 | * Common table types. The base code can remain | 67 | * Common table types. The base code can remain |
@@ -75,7 +72,6 @@ | |||
75 | #define FACS_DESCRIPTOR struct facs_descriptor_rev2 | 72 | #define FACS_DESCRIPTOR struct facs_descriptor_rev2 |
76 | #define FADT_DESCRIPTOR struct fadt_descriptor_rev2 | 73 | #define FADT_DESCRIPTOR struct fadt_descriptor_rev2 |
77 | 74 | ||
78 | |||
79 | #pragma pack(1) | 75 | #pragma pack(1) |
80 | 76 | ||
81 | /* | 77 | /* |
@@ -84,28 +80,24 @@ | |||
84 | * NOTE: The tables that are specific to ACPI versions (1.0, 2.0, etc.) | 80 | * NOTE: The tables that are specific to ACPI versions (1.0, 2.0, etc.) |
85 | * are in separate files. | 81 | * are in separate files. |
86 | */ | 82 | */ |
87 | struct rsdp_descriptor /* Root System Descriptor Pointer */ | 83 | struct rsdp_descriptor { /* Root System Descriptor Pointer */ |
88 | { | 84 | char signature[8]; /* ACPI signature, contains "RSD PTR " */ |
89 | char signature[8]; /* ACPI signature, contains "RSD PTR " */ | 85 | u8 checksum; /* ACPI 1.0 checksum */ |
90 | u8 checksum; /* ACPI 1.0 checksum */ | 86 | char oem_id[6]; /* OEM identification */ |
91 | char oem_id[6]; /* OEM identification */ | 87 | u8 revision; /* Must be (0) for ACPI 1.0 or (2) for ACPI 2.0+ */ |
92 | u8 revision; /* Must be (0) for ACPI 1.0 or (2) for ACPI 2.0+ */ | 88 | u32 rsdt_physical_address; /* 32-bit physical address of the RSDT */ |
93 | u32 rsdt_physical_address; /* 32-bit physical address of the RSDT */ | 89 | u32 length; /* XSDT Length in bytes, including header */ |
94 | u32 length; /* XSDT Length in bytes, including header */ | 90 | u64 xsdt_physical_address; /* 64-bit physical address of the XSDT */ |
95 | u64 xsdt_physical_address; /* 64-bit physical address of the XSDT */ | 91 | u8 extended_checksum; /* Checksum of entire table (ACPI 2.0) */ |
96 | u8 extended_checksum; /* Checksum of entire table (ACPI 2.0) */ | 92 | char reserved[3]; /* Reserved, must be zero */ |
97 | char reserved[3]; /* Reserved, must be zero */ | ||
98 | }; | 93 | }; |
99 | 94 | ||
100 | 95 | struct acpi_common_facs { /* Common FACS for internal use */ | |
101 | struct acpi_common_facs /* Common FACS for internal use */ | 96 | u32 *global_lock; |
102 | { | 97 | u64 *firmware_waking_vector; |
103 | u32 *global_lock; | 98 | u8 vector_width; |
104 | u64 *firmware_waking_vector; | ||
105 | u8 vector_width; | ||
106 | }; | 99 | }; |
107 | 100 | ||
108 | |||
109 | #define ACPI_TABLE_HEADER_DEF /* ACPI common table header */ \ | 101 | #define ACPI_TABLE_HEADER_DEF /* ACPI common table header */ \ |
110 | char signature[4]; /* ASCII table signature */\ | 102 | char signature[4]; /* ASCII table signature */\ |
111 | u32 length; /* Length of table in bytes, including this header */\ | 103 | u32 length; /* Length of table in bytes, including this header */\ |
@@ -115,14 +107,10 @@ struct acpi_common_facs /* Common FACS for internal use */ | |||
115 | char oem_table_id[8]; /* ASCII OEM table identification */\ | 107 | char oem_table_id[8]; /* ASCII OEM table identification */\ |
116 | u32 oem_revision; /* OEM revision number */\ | 108 | u32 oem_revision; /* OEM revision number */\ |
117 | char asl_compiler_id [4]; /* ASCII ASL compiler vendor ID */\ | 109 | char asl_compiler_id [4]; /* ASCII ASL compiler vendor ID */\ |
118 | u32 asl_compiler_revision; /* ASL compiler version */ | 110 | u32 asl_compiler_revision; /* ASL compiler version */ |
119 | |||
120 | |||
121 | struct acpi_table_header /* ACPI common table header */ | ||
122 | { | ||
123 | ACPI_TABLE_HEADER_DEF | ||
124 | }; | ||
125 | 111 | ||
112 | struct acpi_table_header { /* ACPI common table header */ | ||
113 | ACPI_TABLE_HEADER_DEF}; | ||
126 | 114 | ||
127 | /* | 115 | /* |
128 | * MADT values and structures | 116 | * MADT values and structures |
@@ -135,16 +123,15 @@ struct acpi_table_header /* ACPI common table header */ | |||
135 | 123 | ||
136 | /* Master MADT */ | 124 | /* Master MADT */ |
137 | 125 | ||
138 | struct multiple_apic_table | 126 | struct multiple_apic_table { |
139 | { | 127 | ACPI_TABLE_HEADER_DEF /* ACPI common table header */ |
140 | ACPI_TABLE_HEADER_DEF /* ACPI common table header */ | 128 | u32 local_apic_address; /* Physical address of local APIC */ |
141 | u32 local_apic_address; /* Physical address of local APIC */ | ||
142 | 129 | ||
143 | /* Flags (32 bits) */ | 130 | /* Flags (32 bits) */ |
144 | 131 | ||
145 | u8 PCATcompat : 1; /* 00: System also has dual 8259s */ | 132 | u8 PCATcompat:1; /* 00: System also has dual 8259s */ |
146 | u8 : 7; /* 01-07: Reserved, must be zero */ | 133 | u8:7; /* 01-07: Reserved, must be zero */ |
147 | u8 reserved1[3]; /* 08-31: Reserved, must be zero */ | 134 | u8 reserved1[3]; /* 08-31: Reserved, must be zero */ |
148 | }; | 135 | }; |
149 | 136 | ||
150 | /* Values for Type in APIC_HEADER_DEF */ | 137 | /* Values for Type in APIC_HEADER_DEF */ |
@@ -158,7 +145,7 @@ struct multiple_apic_table | |||
158 | #define APIC_IO_SAPIC 6 | 145 | #define APIC_IO_SAPIC 6 |
159 | #define APIC_LOCAL_SAPIC 7 | 146 | #define APIC_LOCAL_SAPIC 7 |
160 | #define APIC_XRUPT_SOURCE 8 | 147 | #define APIC_XRUPT_SOURCE 8 |
161 | #define APIC_RESERVED 9 /* 9 and greater are reserved */ | 148 | #define APIC_RESERVED 9 /* 9 and greater are reserved */ |
162 | 149 | ||
163 | /* | 150 | /* |
164 | * MADT sub-structures (Follow MULTIPLE_APIC_DESCRIPTION_TABLE) | 151 | * MADT sub-structures (Follow MULTIPLE_APIC_DESCRIPTION_TABLE) |
@@ -167,10 +154,8 @@ struct multiple_apic_table | |||
167 | u8 type; \ | 154 | u8 type; \ |
168 | u8 length; | 155 | u8 length; |
169 | 156 | ||
170 | struct apic_header | 157 | struct apic_header { |
171 | { | 158 | APIC_HEADER_DEF}; |
172 | APIC_HEADER_DEF | ||
173 | }; | ||
174 | 159 | ||
175 | /* Values for MPS INTI flags */ | 160 | /* Values for MPS INTI flags */ |
176 | 161 | ||
@@ -190,113 +175,84 @@ struct apic_header | |||
190 | u8 polarity : 2; /* 00-01: Polarity of APIC I/O input signals */\ | 175 | u8 polarity : 2; /* 00-01: Polarity of APIC I/O input signals */\ |
191 | u8 trigger_mode : 2; /* 02-03: Trigger mode of APIC input signals */\ | 176 | u8 trigger_mode : 2; /* 02-03: Trigger mode of APIC input signals */\ |
192 | u8 : 4; /* 04-07: Reserved, must be zero */\ | 177 | u8 : 4; /* 04-07: Reserved, must be zero */\ |
193 | u8 reserved1; /* 08-15: Reserved, must be zero */ | 178 | u8 reserved1; /* 08-15: Reserved, must be zero */ |
194 | 179 | ||
195 | #define LOCAL_APIC_FLAGS \ | 180 | #define LOCAL_APIC_FLAGS \ |
196 | u8 processor_enabled: 1; /* 00: Processor is usable if set */\ | 181 | u8 processor_enabled: 1; /* 00: Processor is usable if set */\ |
197 | u8 : 7; /* 01-07: Reserved, must be zero */\ | 182 | u8 : 7; /* 01-07: Reserved, must be zero */\ |
198 | u8 reserved2; /* 08-15: Reserved, must be zero */ | 183 | u8 reserved2; /* 08-15: Reserved, must be zero */ |
199 | 184 | ||
200 | /* Sub-structures for MADT */ | 185 | /* Sub-structures for MADT */ |
201 | 186 | ||
202 | struct madt_processor_apic | 187 | struct madt_processor_apic { |
203 | { | 188 | APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */ |
204 | APIC_HEADER_DEF | 189 | u8 local_apic_id; /* Processor's local APIC id */ |
205 | u8 processor_id; /* ACPI processor id */ | 190 | LOCAL_APIC_FLAGS}; |
206 | u8 local_apic_id; /* Processor's local APIC id */ | 191 | |
207 | LOCAL_APIC_FLAGS | 192 | struct madt_io_apic { |
193 | APIC_HEADER_DEF u8 io_apic_id; /* I/O APIC ID */ | ||
194 | u8 reserved; /* Reserved - must be zero */ | ||
195 | u32 address; /* APIC physical address */ | ||
196 | u32 interrupt; /* Global system interrupt where INTI | ||
197 | * lines start */ | ||
208 | }; | 198 | }; |
209 | 199 | ||
210 | struct madt_io_apic | 200 | struct madt_interrupt_override { |
211 | { | 201 | APIC_HEADER_DEF u8 bus; /* 0 - ISA */ |
212 | APIC_HEADER_DEF | 202 | u8 source; /* Interrupt source (IRQ) */ |
213 | u8 io_apic_id; /* I/O APIC ID */ | 203 | u32 interrupt; /* Global system interrupt */ |
214 | u8 reserved; /* Reserved - must be zero */ | 204 | MPS_INTI_FLAGS}; |
215 | u32 address; /* APIC physical address */ | ||
216 | u32 interrupt; /* Global system interrupt where INTI | ||
217 | * lines start */ | ||
218 | }; | ||
219 | |||
220 | struct madt_interrupt_override | ||
221 | { | ||
222 | APIC_HEADER_DEF | ||
223 | u8 bus; /* 0 - ISA */ | ||
224 | u8 source; /* Interrupt source (IRQ) */ | ||
225 | u32 interrupt; /* Global system interrupt */ | ||
226 | MPS_INTI_FLAGS | ||
227 | }; | ||
228 | 205 | ||
229 | struct madt_nmi_source | 206 | struct madt_nmi_source { |
230 | { | 207 | APIC_HEADER_DEF MPS_INTI_FLAGS u32 interrupt; /* Global system interrupt */ |
231 | APIC_HEADER_DEF | ||
232 | MPS_INTI_FLAGS | ||
233 | u32 interrupt; /* Global system interrupt */ | ||
234 | }; | 208 | }; |
235 | 209 | ||
236 | struct madt_local_apic_nmi | 210 | struct madt_local_apic_nmi { |
237 | { | 211 | APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */ |
238 | APIC_HEADER_DEF | 212 | MPS_INTI_FLAGS u8 lint; /* LINTn to which NMI is connected */ |
239 | u8 processor_id; /* ACPI processor id */ | ||
240 | MPS_INTI_FLAGS | ||
241 | u8 lint; /* LINTn to which NMI is connected */ | ||
242 | }; | 213 | }; |
243 | 214 | ||
244 | struct madt_address_override | 215 | struct madt_address_override { |
245 | { | 216 | APIC_HEADER_DEF u16 reserved; /* Reserved, must be zero */ |
246 | APIC_HEADER_DEF | 217 | u64 address; /* APIC physical address */ |
247 | u16 reserved; /* Reserved, must be zero */ | ||
248 | u64 address; /* APIC physical address */ | ||
249 | }; | 218 | }; |
250 | 219 | ||
251 | struct madt_io_sapic | 220 | struct madt_io_sapic { |
252 | { | 221 | APIC_HEADER_DEF u8 io_sapic_id; /* I/O SAPIC ID */ |
253 | APIC_HEADER_DEF | 222 | u8 reserved; /* Reserved, must be zero */ |
254 | u8 io_sapic_id; /* I/O SAPIC ID */ | 223 | u32 interrupt_base; /* Glocal interrupt for SAPIC start */ |
255 | u8 reserved; /* Reserved, must be zero */ | 224 | u64 address; /* SAPIC physical address */ |
256 | u32 interrupt_base; /* Glocal interrupt for SAPIC start */ | ||
257 | u64 address; /* SAPIC physical address */ | ||
258 | }; | 225 | }; |
259 | 226 | ||
260 | struct madt_local_sapic | 227 | struct madt_local_sapic { |
261 | { | 228 | APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */ |
262 | APIC_HEADER_DEF | 229 | u8 local_sapic_id; /* SAPIC ID */ |
263 | u8 processor_id; /* ACPI processor id */ | 230 | u8 local_sapic_eid; /* SAPIC EID */ |
264 | u8 local_sapic_id; /* SAPIC ID */ | 231 | u8 reserved[3]; /* Reserved, must be zero */ |
265 | u8 local_sapic_eid; /* SAPIC EID */ | 232 | LOCAL_APIC_FLAGS u32 processor_uID; /* Numeric UID - ACPI 3.0 */ |
266 | u8 reserved[3]; /* Reserved, must be zero */ | 233 | char processor_uIDstring[1]; /* String UID - ACPI 3.0 */ |
267 | LOCAL_APIC_FLAGS | ||
268 | u32 processor_uID; /* Numeric UID - ACPI 3.0 */ | ||
269 | char processor_uIDstring[1]; /* String UID - ACPI 3.0 */ | ||
270 | }; | 234 | }; |
271 | 235 | ||
272 | struct madt_interrupt_source | 236 | struct madt_interrupt_source { |
273 | { | 237 | APIC_HEADER_DEF MPS_INTI_FLAGS u8 interrupt_type; /* 1=PMI, 2=INIT, 3=corrected */ |
274 | APIC_HEADER_DEF | 238 | u8 processor_id; /* Processor ID */ |
275 | MPS_INTI_FLAGS | 239 | u8 processor_eid; /* Processor EID */ |
276 | u8 interrupt_type; /* 1=PMI, 2=INIT, 3=corrected */ | 240 | u8 io_sapic_vector; /* Vector value for PMI interrupts */ |
277 | u8 processor_id; /* Processor ID */ | 241 | u32 interrupt; /* Global system interrupt */ |
278 | u8 processor_eid; /* Processor EID */ | 242 | u32 flags; /* Interrupt Source Flags */ |
279 | u8 io_sapic_vector; /* Vector value for PMI interrupts */ | ||
280 | u32 interrupt; /* Global system interrupt */ | ||
281 | u32 flags; /* Interrupt Source Flags */ | ||
282 | }; | 243 | }; |
283 | 244 | ||
284 | |||
285 | /* | 245 | /* |
286 | * Smart Battery | 246 | * Smart Battery |
287 | */ | 247 | */ |
288 | struct smart_battery_table | 248 | struct smart_battery_table { |
289 | { | 249 | ACPI_TABLE_HEADER_DEF u32 warning_level; |
290 | ACPI_TABLE_HEADER_DEF | 250 | u32 low_level; |
291 | u32 warning_level; | 251 | u32 critical_level; |
292 | u32 low_level; | ||
293 | u32 critical_level; | ||
294 | }; | 252 | }; |
295 | 253 | ||
296 | |||
297 | #pragma pack() | 254 | #pragma pack() |
298 | 255 | ||
299 | |||
300 | /* | 256 | /* |
301 | * ACPI Table information. We save the table address, length, | 257 | * ACPI Table information. We save the table address, length, |
302 | * and type of memory allocation (mapped or allocated) for each | 258 | * and type of memory allocation (mapped or allocated) for each |
@@ -320,39 +276,35 @@ struct smart_battery_table | |||
320 | 276 | ||
321 | /* Data about each known table type */ | 277 | /* Data about each known table type */ |
322 | 278 | ||
323 | struct acpi_table_support | 279 | struct acpi_table_support { |
324 | { | 280 | char *name; |
325 | char *name; | 281 | char *signature; |
326 | char *signature; | 282 | void **global_ptr; |
327 | void **global_ptr; | 283 | u8 sig_length; |
328 | u8 sig_length; | 284 | u8 flags; |
329 | u8 flags; | ||
330 | }; | 285 | }; |
331 | 286 | ||
332 | |||
333 | /* | 287 | /* |
334 | * Get the ACPI version-specific tables | 288 | * Get the ACPI version-specific tables |
335 | */ | 289 | */ |
336 | #include "actbl1.h" /* Acpi 1.0 table definitions */ | 290 | #include "actbl1.h" /* Acpi 1.0 table definitions */ |
337 | #include "actbl2.h" /* Acpi 2.0 table definitions */ | 291 | #include "actbl2.h" /* Acpi 2.0 table definitions */ |
338 | 292 | ||
339 | extern u8 acpi_fadt_is_v1; /* is set to 1 if FADT is revision 1, | 293 | extern u8 acpi_fadt_is_v1; /* is set to 1 if FADT is revision 1, |
340 | * needed for certain workarounds */ | 294 | * needed for certain workarounds */ |
341 | 295 | ||
342 | #pragma pack(1) | 296 | #pragma pack(1) |
343 | /* | 297 | /* |
344 | * High performance timer | 298 | * High performance timer |
345 | */ | 299 | */ |
346 | struct hpet_table | 300 | struct hpet_table { |
347 | { | 301 | ACPI_TABLE_HEADER_DEF u32 hardware_id; |
348 | ACPI_TABLE_HEADER_DEF | 302 | struct acpi_generic_address base_address; |
349 | u32 hardware_id; | 303 | u8 hpet_number; |
350 | struct acpi_generic_address base_address; | 304 | u16 clock_tick; |
351 | u8 hpet_number; | 305 | u8 attributes; |
352 | u16 clock_tick; | ||
353 | u8 attributes; | ||
354 | }; | 306 | }; |
355 | 307 | ||
356 | #pragma pack() | 308 | #pragma pack() |
357 | 309 | ||
358 | #endif /* __ACTBL_H__ */ | 310 | #endif /* __ACTBL_H__ */ |
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h index 93c175a4f446..67312c3a915a 100644 --- a/include/acpi/actbl1.h +++ b/include/acpi/actbl1.h | |||
@@ -49,94 +49,87 @@ | |||
49 | /* | 49 | /* |
50 | * ACPI 1.0 Root System Description Table (RSDT) | 50 | * ACPI 1.0 Root System Description Table (RSDT) |
51 | */ | 51 | */ |
52 | struct rsdt_descriptor_rev1 | 52 | struct rsdt_descriptor_rev1 { |
53 | { | 53 | ACPI_TABLE_HEADER_DEF /* ACPI common table header */ |
54 | ACPI_TABLE_HEADER_DEF /* ACPI common table header */ | 54 | u32 table_offset_entry[1]; /* Array of pointers to ACPI tables */ |
55 | u32 table_offset_entry[1]; /* Array of pointers to ACPI tables */ | ||
56 | }; | 55 | }; |
57 | 56 | ||
58 | |||
59 | /* | 57 | /* |
60 | * ACPI 1.0 Firmware ACPI Control Structure (FACS) | 58 | * ACPI 1.0 Firmware ACPI Control Structure (FACS) |
61 | */ | 59 | */ |
62 | struct facs_descriptor_rev1 | 60 | struct facs_descriptor_rev1 { |
63 | { | 61 | char signature[4]; /* ASCII table signature */ |
64 | char signature[4]; /* ASCII table signature */ | 62 | u32 length; /* Length of structure in bytes */ |
65 | u32 length; /* Length of structure in bytes */ | 63 | u32 hardware_signature; /* Hardware configuration signature */ |
66 | u32 hardware_signature; /* Hardware configuration signature */ | 64 | u32 firmware_waking_vector; /* ACPI OS waking vector */ |
67 | u32 firmware_waking_vector; /* ACPI OS waking vector */ | 65 | u32 global_lock; /* Global Lock */ |
68 | u32 global_lock; /* Global Lock */ | ||
69 | 66 | ||
70 | /* Flags (32 bits) */ | 67 | /* Flags (32 bits) */ |
71 | 68 | ||
72 | u8 S4bios_f : 1; /* 00: S4BIOS support is present */ | 69 | u8 S4bios_f:1; /* 00: S4BIOS support is present */ |
73 | u8 : 7; /* 01-07: Reserved, must be zero */ | 70 | u8:7; /* 01-07: Reserved, must be zero */ |
74 | u8 reserved1[3]; /* 08-31: Reserved, must be zero */ | 71 | u8 reserved1[3]; /* 08-31: Reserved, must be zero */ |
75 | 72 | ||
76 | u8 reserved2[40]; /* Reserved, must be zero */ | 73 | u8 reserved2[40]; /* Reserved, must be zero */ |
77 | }; | 74 | }; |
78 | 75 | ||
79 | |||
80 | /* | 76 | /* |
81 | * ACPI 1.0 Fixed ACPI Description Table (FADT) | 77 | * ACPI 1.0 Fixed ACPI Description Table (FADT) |
82 | */ | 78 | */ |
83 | struct fadt_descriptor_rev1 | 79 | struct fadt_descriptor_rev1 { |
84 | { | 80 | ACPI_TABLE_HEADER_DEF /* ACPI common table header */ |
85 | ACPI_TABLE_HEADER_DEF /* ACPI common table header */ | 81 | u32 firmware_ctrl; /* Physical address of FACS */ |
86 | u32 firmware_ctrl; /* Physical address of FACS */ | 82 | u32 dsdt; /* Physical address of DSDT */ |
87 | u32 dsdt; /* Physical address of DSDT */ | 83 | u8 model; /* System Interrupt Model */ |
88 | u8 model; /* System Interrupt Model */ | 84 | u8 reserved1; /* Reserved, must be zero */ |
89 | u8 reserved1; /* Reserved, must be zero */ | 85 | u16 sci_int; /* System vector of SCI interrupt */ |
90 | u16 sci_int; /* System vector of SCI interrupt */ | 86 | u32 smi_cmd; /* Port address of SMI command port */ |
91 | u32 smi_cmd; /* Port address of SMI command port */ | 87 | u8 acpi_enable; /* Value to write to smi_cmd to enable ACPI */ |
92 | u8 acpi_enable; /* Value to write to smi_cmd to enable ACPI */ | 88 | u8 acpi_disable; /* Value to write to smi_cmd to disable ACPI */ |
93 | u8 acpi_disable; /* Value to write to smi_cmd to disable ACPI */ | 89 | u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */ |
94 | u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */ | 90 | u8 reserved2; /* Reserved, must be zero */ |
95 | u8 reserved2; /* Reserved, must be zero */ | 91 | u32 pm1a_evt_blk; /* Port address of Power Mgt 1a acpi_event Reg Blk */ |
96 | u32 pm1a_evt_blk; /* Port address of Power Mgt 1a acpi_event Reg Blk */ | 92 | u32 pm1b_evt_blk; /* Port address of Power Mgt 1b acpi_event Reg Blk */ |
97 | u32 pm1b_evt_blk; /* Port address of Power Mgt 1b acpi_event Reg Blk */ | 93 | u32 pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */ |
98 | u32 pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */ | 94 | u32 pm1b_cnt_blk; /* Port address of Power Mgt 1b Control Reg Blk */ |
99 | u32 pm1b_cnt_blk; /* Port address of Power Mgt 1b Control Reg Blk */ | 95 | u32 pm2_cnt_blk; /* Port address of Power Mgt 2 Control Reg Blk */ |
100 | u32 pm2_cnt_blk; /* Port address of Power Mgt 2 Control Reg Blk */ | 96 | u32 pm_tmr_blk; /* Port address of Power Mgt Timer Ctrl Reg Blk */ |
101 | u32 pm_tmr_blk; /* Port address of Power Mgt Timer Ctrl Reg Blk */ | 97 | u32 gpe0_blk; /* Port addr of General Purpose acpi_event 0 Reg Blk */ |
102 | u32 gpe0_blk; /* Port addr of General Purpose acpi_event 0 Reg Blk */ | 98 | u32 gpe1_blk; /* Port addr of General Purpose acpi_event 1 Reg Blk */ |
103 | u32 gpe1_blk; /* Port addr of General Purpose acpi_event 1 Reg Blk */ | 99 | u8 pm1_evt_len; /* Byte length of ports at pm1_x_evt_blk */ |
104 | u8 pm1_evt_len; /* Byte length of ports at pm1_x_evt_blk */ | 100 | u8 pm1_cnt_len; /* Byte length of ports at pm1_x_cnt_blk */ |
105 | u8 pm1_cnt_len; /* Byte length of ports at pm1_x_cnt_blk */ | 101 | u8 pm2_cnt_len; /* Byte Length of ports at pm2_cnt_blk */ |
106 | u8 pm2_cnt_len; /* Byte Length of ports at pm2_cnt_blk */ | 102 | u8 pm_tm_len; /* Byte Length of ports at pm_tm_blk */ |
107 | u8 pm_tm_len; /* Byte Length of ports at pm_tm_blk */ | 103 | u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */ |
108 | u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */ | 104 | u8 gpe1_blk_len; /* Byte Length of ports at gpe1_blk */ |
109 | u8 gpe1_blk_len; /* Byte Length of ports at gpe1_blk */ | 105 | u8 gpe1_base; /* Offset in gpe model where gpe1 events start */ |
110 | u8 gpe1_base; /* Offset in gpe model where gpe1 events start */ | 106 | u8 reserved3; /* Reserved, must be zero */ |
111 | u8 reserved3; /* Reserved, must be zero */ | 107 | u16 plvl2_lat; /* Worst case HW latency to enter/exit C2 state */ |
112 | u16 plvl2_lat; /* Worst case HW latency to enter/exit C2 state */ | 108 | u16 plvl3_lat; /* Worst case HW latency to enter/exit C3 state */ |
113 | u16 plvl3_lat; /* Worst case HW latency to enter/exit C3 state */ | 109 | u16 flush_size; /* Size of area read to flush caches */ |
114 | u16 flush_size; /* Size of area read to flush caches */ | 110 | u16 flush_stride; /* Stride used in flushing caches */ |
115 | u16 flush_stride; /* Stride used in flushing caches */ | 111 | u8 duty_offset; /* Bit location of duty cycle field in p_cnt reg */ |
116 | u8 duty_offset; /* Bit location of duty cycle field in p_cnt reg */ | 112 | u8 duty_width; /* Bit width of duty cycle field in p_cnt reg */ |
117 | u8 duty_width; /* Bit width of duty cycle field in p_cnt reg */ | 113 | u8 day_alrm; /* Index to day-of-month alarm in RTC CMOS RAM */ |
118 | u8 day_alrm; /* Index to day-of-month alarm in RTC CMOS RAM */ | 114 | u8 mon_alrm; /* Index to month-of-year alarm in RTC CMOS RAM */ |
119 | u8 mon_alrm; /* Index to month-of-year alarm in RTC CMOS RAM */ | 115 | u8 century; /* Index to century in RTC CMOS RAM */ |
120 | u8 century; /* Index to century in RTC CMOS RAM */ | 116 | u8 reserved4[3]; /* Reserved, must be zero */ |
121 | u8 reserved4[3]; /* Reserved, must be zero */ | ||
122 | 117 | ||
123 | /* Flags (32 bits) */ | 118 | /* Flags (32 bits) */ |
124 | 119 | ||
125 | u8 wb_invd : 1; /* 00: The wbinvd instruction works properly */ | 120 | u8 wb_invd:1; /* 00: The wbinvd instruction works properly */ |
126 | u8 wb_invd_flush : 1; /* 01: The wbinvd flushes but does not invalidate */ | 121 | u8 wb_invd_flush:1; /* 01: The wbinvd flushes but does not invalidate */ |
127 | u8 proc_c1 : 1; /* 02: All processors support C1 state */ | 122 | u8 proc_c1:1; /* 02: All processors support C1 state */ |
128 | u8 plvl2_up : 1; /* 03: C2 state works on MP system */ | 123 | u8 plvl2_up:1; /* 03: C2 state works on MP system */ |
129 | u8 pwr_button : 1; /* 04: Power button is handled as a generic feature */ | 124 | u8 pwr_button:1; /* 04: Power button is handled as a generic feature */ |
130 | u8 sleep_button : 1; /* 05: Sleep button is handled as a generic feature, or not present */ | 125 | u8 sleep_button:1; /* 05: Sleep button is handled as a generic feature, or not present */ |
131 | u8 fixed_rTC : 1; /* 06: RTC wakeup stat not in fixed register space */ | 126 | u8 fixed_rTC:1; /* 06: RTC wakeup stat not in fixed register space */ |
132 | u8 rtcs4 : 1; /* 07: RTC wakeup stat not possible from S4 */ | 127 | u8 rtcs4:1; /* 07: RTC wakeup stat not possible from S4 */ |
133 | u8 tmr_val_ext : 1; /* 08: tmr_val width is 32 bits (0 = 24 bits) */ | 128 | u8 tmr_val_ext:1; /* 08: tmr_val width is 32 bits (0 = 24 bits) */ |
134 | u8 : 7; /* 09-15: Reserved, must be zero */ | 129 | u8:7; /* 09-15: Reserved, must be zero */ |
135 | u8 reserved5[2]; /* 16-31: Reserved, must be zero */ | 130 | u8 reserved5[2]; /* 16-31: Reserved, must be zero */ |
136 | }; | 131 | }; |
137 | 132 | ||
138 | #pragma pack() | 133 | #pragma pack() |
139 | 134 | ||
140 | #endif /* __ACTBL1_H__ */ | 135 | #endif /* __ACTBL1_H__ */ |
141 | |||
142 | |||
diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h index 84ce5abbd6f6..50305ce2681a 100644 --- a/include/acpi/actbl2.h +++ b/include/acpi/actbl2.h | |||
@@ -64,65 +64,56 @@ | |||
64 | #define FADT2_REVISION_ID 3 | 64 | #define FADT2_REVISION_ID 3 |
65 | #define FADT2_MINUS_REVISION_ID 2 | 65 | #define FADT2_MINUS_REVISION_ID 2 |
66 | 66 | ||
67 | |||
68 | #pragma pack(1) | 67 | #pragma pack(1) |
69 | 68 | ||
70 | /* | 69 | /* |
71 | * ACPI 2.0 Root System Description Table (RSDT) | 70 | * ACPI 2.0 Root System Description Table (RSDT) |
72 | */ | 71 | */ |
73 | struct rsdt_descriptor_rev2 | 72 | struct rsdt_descriptor_rev2 { |
74 | { | 73 | ACPI_TABLE_HEADER_DEF /* ACPI common table header */ |
75 | ACPI_TABLE_HEADER_DEF /* ACPI common table header */ | 74 | u32 table_offset_entry[1]; /* Array of pointers to ACPI tables */ |
76 | u32 table_offset_entry[1]; /* Array of pointers to ACPI tables */ | ||
77 | }; | 75 | }; |
78 | 76 | ||
79 | |||
80 | /* | 77 | /* |
81 | * ACPI 2.0 Extended System Description Table (XSDT) | 78 | * ACPI 2.0 Extended System Description Table (XSDT) |
82 | */ | 79 | */ |
83 | struct xsdt_descriptor_rev2 | 80 | struct xsdt_descriptor_rev2 { |
84 | { | 81 | ACPI_TABLE_HEADER_DEF /* ACPI common table header */ |
85 | ACPI_TABLE_HEADER_DEF /* ACPI common table header */ | 82 | u64 table_offset_entry[1]; /* Array of pointers to ACPI tables */ |
86 | u64 table_offset_entry[1]; /* Array of pointers to ACPI tables */ | ||
87 | }; | 83 | }; |
88 | 84 | ||
89 | |||
90 | /* | 85 | /* |
91 | * ACPI 2.0 Firmware ACPI Control Structure (FACS) | 86 | * ACPI 2.0 Firmware ACPI Control Structure (FACS) |
92 | */ | 87 | */ |
93 | struct facs_descriptor_rev2 | 88 | struct facs_descriptor_rev2 { |
94 | { | 89 | char signature[4]; /* ASCII table signature */ |
95 | char signature[4]; /* ASCII table signature */ | 90 | u32 length; /* Length of structure, in bytes */ |
96 | u32 length; /* Length of structure, in bytes */ | 91 | u32 hardware_signature; /* Hardware configuration signature */ |
97 | u32 hardware_signature; /* Hardware configuration signature */ | 92 | u32 firmware_waking_vector; /* 32-bit physical address of the Firmware Waking Vector. */ |
98 | u32 firmware_waking_vector; /* 32-bit physical address of the Firmware Waking Vector. */ | 93 | u32 global_lock; /* Global Lock used to synchronize access to shared hardware resources */ |
99 | u32 global_lock; /* Global Lock used to synchronize access to shared hardware resources */ | ||
100 | 94 | ||
101 | /* Flags (32 bits) */ | 95 | /* Flags (32 bits) */ |
102 | 96 | ||
103 | u8 S4bios_f : 1; /* 00: S4BIOS support is present */ | 97 | u8 S4bios_f:1; /* 00: S4BIOS support is present */ |
104 | u8 : 7; /* 01-07: Reserved, must be zero */ | 98 | u8:7; /* 01-07: Reserved, must be zero */ |
105 | u8 reserved1[3]; /* 08-31: Reserved, must be zero */ | 99 | u8 reserved1[3]; /* 08-31: Reserved, must be zero */ |
106 | 100 | ||
107 | u64 xfirmware_waking_vector; /* 64-bit physical address of the Firmware Waking Vector. */ | 101 | u64 xfirmware_waking_vector; /* 64-bit physical address of the Firmware Waking Vector. */ |
108 | u8 version; /* Version of this table */ | 102 | u8 version; /* Version of this table */ |
109 | u8 reserved3[31]; /* Reserved, must be zero */ | 103 | u8 reserved3[31]; /* Reserved, must be zero */ |
110 | }; | 104 | }; |
111 | 105 | ||
112 | |||
113 | /* | 106 | /* |
114 | * ACPI 2.0+ Generic Address Structure (GAS) | 107 | * ACPI 2.0+ Generic Address Structure (GAS) |
115 | */ | 108 | */ |
116 | struct acpi_generic_address | 109 | struct acpi_generic_address { |
117 | { | 110 | u8 address_space_id; /* Address space where struct or register exists. */ |
118 | u8 address_space_id; /* Address space where struct or register exists. */ | 111 | u8 register_bit_width; /* Size in bits of given register */ |
119 | u8 register_bit_width; /* Size in bits of given register */ | 112 | u8 register_bit_offset; /* Bit offset within the register */ |
120 | u8 register_bit_offset; /* Bit offset within the register */ | 113 | u8 access_width; /* Minimum Access size (ACPI 3.0) */ |
121 | u8 access_width; /* Minimum Access size (ACPI 3.0) */ | 114 | u64 address; /* 64-bit address of struct or register */ |
122 | u64 address; /* 64-bit address of struct or register */ | ||
123 | }; | 115 | }; |
124 | 116 | ||
125 | |||
126 | #define FADT_REV2_COMMON \ | 117 | #define FADT_REV2_COMMON \ |
127 | u32 V1_firmware_ctrl; /* 32-bit physical address of FACS */ \ | 118 | u32 V1_firmware_ctrl; /* 32-bit physical address of FACS */ \ |
128 | u32 V1_dsdt; /* 32-bit physical address of DSDT */ \ | 119 | u32 V1_dsdt; /* 32-bit physical address of DSDT */ \ |
@@ -164,141 +155,123 @@ struct acpi_generic_address | |||
164 | /* | 155 | /* |
165 | * ACPI 2.0+ Fixed ACPI Description Table (FADT) | 156 | * ACPI 2.0+ Fixed ACPI Description Table (FADT) |
166 | */ | 157 | */ |
167 | struct fadt_descriptor_rev2 | 158 | struct fadt_descriptor_rev2 { |
168 | { | 159 | ACPI_TABLE_HEADER_DEF /* ACPI common table header */ |
169 | ACPI_TABLE_HEADER_DEF /* ACPI common table header */ | 160 | FADT_REV2_COMMON u8 reserved2; /* Reserved, must be zero */ |
170 | FADT_REV2_COMMON | ||
171 | u8 reserved2; /* Reserved, must be zero */ | ||
172 | 161 | ||
173 | /* Flags (32 bits) */ | 162 | /* Flags (32 bits) */ |
174 | 163 | ||
175 | u8 wb_invd : 1; /* 00: The wbinvd instruction works properly */ | 164 | u8 wb_invd:1; /* 00: The wbinvd instruction works properly */ |
176 | u8 wb_invd_flush : 1; /* 01: The wbinvd flushes but does not invalidate */ | 165 | u8 wb_invd_flush:1; /* 01: The wbinvd flushes but does not invalidate */ |
177 | u8 proc_c1 : 1; /* 02: All processors support C1 state */ | 166 | u8 proc_c1:1; /* 02: All processors support C1 state */ |
178 | u8 plvl2_up : 1; /* 03: C2 state works on MP system */ | 167 | u8 plvl2_up:1; /* 03: C2 state works on MP system */ |
179 | u8 pwr_button : 1; /* 04: Power button is handled as a generic feature */ | 168 | u8 pwr_button:1; /* 04: Power button is handled as a generic feature */ |
180 | u8 sleep_button : 1; /* 05: Sleep button is handled as a generic feature, or not present */ | 169 | u8 sleep_button:1; /* 05: Sleep button is handled as a generic feature, or not present */ |
181 | u8 fixed_rTC : 1; /* 06: RTC wakeup stat not in fixed register space */ | 170 | u8 fixed_rTC:1; /* 06: RTC wakeup stat not in fixed register space */ |
182 | u8 rtcs4 : 1; /* 07: RTC wakeup stat not possible from S4 */ | 171 | u8 rtcs4:1; /* 07: RTC wakeup stat not possible from S4 */ |
183 | u8 tmr_val_ext : 1; /* 08: tmr_val is 32 bits 0=24-bits */ | 172 | u8 tmr_val_ext:1; /* 08: tmr_val is 32 bits 0=24-bits */ |
184 | u8 dock_cap : 1; /* 09: Docking supported */ | 173 | u8 dock_cap:1; /* 09: Docking supported */ |
185 | u8 reset_reg_sup : 1; /* 10: System reset via the FADT RESET_REG supported */ | 174 | u8 reset_reg_sup:1; /* 10: System reset via the FADT RESET_REG supported */ |
186 | u8 sealed_case : 1; /* 11: No internal expansion capabilities and case is sealed */ | 175 | u8 sealed_case:1; /* 11: No internal expansion capabilities and case is sealed */ |
187 | u8 headless : 1; /* 12: No local video capabilities or local input devices */ | 176 | u8 headless:1; /* 12: No local video capabilities or local input devices */ |
188 | u8 cpu_sw_sleep : 1; /* 13: Must execute native instruction after writing SLP_TYPx register */ | 177 | u8 cpu_sw_sleep:1; /* 13: Must execute native instruction after writing SLP_TYPx register */ |
189 | 178 | ||
190 | u8 pci_exp_wak : 1; /* 14: System supports PCIEXP_WAKE (STS/EN) bits (ACPI 3.0) */ | 179 | u8 pci_exp_wak:1; /* 14: System supports PCIEXP_WAKE (STS/EN) bits (ACPI 3.0) */ |
191 | u8 use_platform_clock : 1; /* 15: OSPM should use platform-provided timer (ACPI 3.0) */ | 180 | u8 use_platform_clock:1; /* 15: OSPM should use platform-provided timer (ACPI 3.0) */ |
192 | u8 S4rtc_sts_valid : 1; /* 16: Contents of RTC_STS valid after S4 wake (ACPI 3.0) */ | 181 | u8 S4rtc_sts_valid:1; /* 16: Contents of RTC_STS valid after S4 wake (ACPI 3.0) */ |
193 | u8 remote_power_on_capable : 1; /* 17: System is compatible with remote power on (ACPI 3.0) */ | 182 | u8 remote_power_on_capable:1; /* 17: System is compatible with remote power on (ACPI 3.0) */ |
194 | u8 force_apic_cluster_model : 1; /* 18: All local APICs must use cluster model (ACPI 3.0) */ | 183 | u8 force_apic_cluster_model:1; /* 18: All local APICs must use cluster model (ACPI 3.0) */ |
195 | u8 force_apic_physical_destination_mode : 1; /* 19: all local x_aPICs must use physical dest mode (ACPI 3.0) */ | 184 | u8 force_apic_physical_destination_mode:1; /* 19: all local x_aPICs must use physical dest mode (ACPI 3.0) */ |
196 | u8 : 4; /* 20-23: Reserved, must be zero */ | 185 | u8:4; /* 20-23: Reserved, must be zero */ |
197 | u8 reserved3; /* 24-31: Reserved, must be zero */ | 186 | u8 reserved3; /* 24-31: Reserved, must be zero */ |
198 | 187 | ||
199 | struct acpi_generic_address reset_register; /* Reset register address in GAS format */ | 188 | struct acpi_generic_address reset_register; /* Reset register address in GAS format */ |
200 | u8 reset_value; /* Value to write to the reset_register port to reset the system */ | 189 | u8 reset_value; /* Value to write to the reset_register port to reset the system */ |
201 | u8 reserved4[3]; /* These three bytes must be zero */ | 190 | u8 reserved4[3]; /* These three bytes must be zero */ |
202 | u64 xfirmware_ctrl; /* 64-bit physical address of FACS */ | 191 | u64 xfirmware_ctrl; /* 64-bit physical address of FACS */ |
203 | u64 Xdsdt; /* 64-bit physical address of DSDT */ | 192 | u64 Xdsdt; /* 64-bit physical address of DSDT */ |
204 | struct acpi_generic_address xpm1a_evt_blk; /* Extended Power Mgt 1a acpi_event Reg Blk address */ | 193 | struct acpi_generic_address xpm1a_evt_blk; /* Extended Power Mgt 1a acpi_event Reg Blk address */ |
205 | struct acpi_generic_address xpm1b_evt_blk; /* Extended Power Mgt 1b acpi_event Reg Blk address */ | 194 | struct acpi_generic_address xpm1b_evt_blk; /* Extended Power Mgt 1b acpi_event Reg Blk address */ |
206 | struct acpi_generic_address xpm1a_cnt_blk; /* Extended Power Mgt 1a Control Reg Blk address */ | 195 | struct acpi_generic_address xpm1a_cnt_blk; /* Extended Power Mgt 1a Control Reg Blk address */ |
207 | struct acpi_generic_address xpm1b_cnt_blk; /* Extended Power Mgt 1b Control Reg Blk address */ | 196 | struct acpi_generic_address xpm1b_cnt_blk; /* Extended Power Mgt 1b Control Reg Blk address */ |
208 | struct acpi_generic_address xpm2_cnt_blk; /* Extended Power Mgt 2 Control Reg Blk address */ | 197 | struct acpi_generic_address xpm2_cnt_blk; /* Extended Power Mgt 2 Control Reg Blk address */ |
209 | struct acpi_generic_address xpm_tmr_blk; /* Extended Power Mgt Timer Ctrl Reg Blk address */ | 198 | struct acpi_generic_address xpm_tmr_blk; /* Extended Power Mgt Timer Ctrl Reg Blk address */ |
210 | struct acpi_generic_address xgpe0_blk; /* Extended General Purpose acpi_event 0 Reg Blk address */ | 199 | struct acpi_generic_address xgpe0_blk; /* Extended General Purpose acpi_event 0 Reg Blk address */ |
211 | struct acpi_generic_address xgpe1_blk; /* Extended General Purpose acpi_event 1 Reg Blk address */ | 200 | struct acpi_generic_address xgpe1_blk; /* Extended General Purpose acpi_event 1 Reg Blk address */ |
212 | }; | 201 | }; |
213 | 202 | ||
214 | |||
215 | /* "Down-revved" ACPI 2.0 FADT descriptor */ | 203 | /* "Down-revved" ACPI 2.0 FADT descriptor */ |
216 | 204 | ||
217 | struct fadt_descriptor_rev2_minus | 205 | struct fadt_descriptor_rev2_minus { |
218 | { | 206 | ACPI_TABLE_HEADER_DEF /* ACPI common table header */ |
219 | ACPI_TABLE_HEADER_DEF /* ACPI common table header */ | 207 | FADT_REV2_COMMON u8 reserved2; /* Reserved, must be zero */ |
220 | FADT_REV2_COMMON | 208 | u32 flags; |
221 | u8 reserved2; /* Reserved, must be zero */ | 209 | struct acpi_generic_address reset_register; /* Reset register address in GAS format */ |
222 | u32 flags; | 210 | u8 reset_value; /* Value to write to the reset_register port to reset the system. */ |
223 | struct acpi_generic_address reset_register; /* Reset register address in GAS format */ | 211 | u8 reserved7[3]; /* Reserved, must be zero */ |
224 | u8 reset_value; /* Value to write to the reset_register port to reset the system. */ | ||
225 | u8 reserved7[3]; /* Reserved, must be zero */ | ||
226 | }; | 212 | }; |
227 | 213 | ||
228 | |||
229 | /* ECDT - Embedded Controller Boot Resources Table */ | 214 | /* ECDT - Embedded Controller Boot Resources Table */ |
230 | 215 | ||
231 | struct ec_boot_resources | 216 | struct ec_boot_resources { |
232 | { | 217 | ACPI_TABLE_HEADER_DEF struct acpi_generic_address ec_control; /* Address of EC command/status register */ |
233 | ACPI_TABLE_HEADER_DEF | 218 | struct acpi_generic_address ec_data; /* Address of EC data register */ |
234 | struct acpi_generic_address ec_control; /* Address of EC command/status register */ | 219 | u32 uid; /* Unique ID - must be same as the EC _UID method */ |
235 | struct acpi_generic_address ec_data; /* Address of EC data register */ | 220 | u8 gpe_bit; /* The GPE for the EC */ |
236 | u32 uid; /* Unique ID - must be same as the EC _UID method */ | 221 | u8 ec_id[1]; /* Full namepath of the EC in the ACPI namespace */ |
237 | u8 gpe_bit; /* The GPE for the EC */ | ||
238 | u8 ec_id[1]; /* Full namepath of the EC in the ACPI namespace */ | ||
239 | }; | 222 | }; |
240 | 223 | ||
241 | |||
242 | /* SRAT - System Resource Affinity Table */ | 224 | /* SRAT - System Resource Affinity Table */ |
243 | 225 | ||
244 | struct static_resource_alloc | 226 | struct static_resource_alloc { |
245 | { | 227 | u8 type; |
246 | u8 type; | 228 | u8 length; |
247 | u8 length; | 229 | u8 proximity_domain_lo; |
248 | u8 proximity_domain_lo; | 230 | u8 apic_id; |
249 | u8 apic_id; | ||
250 | 231 | ||
251 | /* Flags (32 bits) */ | 232 | /* Flags (32 bits) */ |
252 | 233 | ||
253 | u8 enabled :1; /* 00: Use affinity structure */ | 234 | u8 enabled:1; /* 00: Use affinity structure */ |
254 | u8 :7; /* 01-07: Reserved, must be zero */ | 235 | u8:7; /* 01-07: Reserved, must be zero */ |
255 | u8 reserved3[3]; /* 08-31: Reserved, must be zero */ | 236 | u8 reserved3[3]; /* 08-31: Reserved, must be zero */ |
256 | 237 | ||
257 | u8 local_sapic_eid; | 238 | u8 local_sapic_eid; |
258 | u8 proximity_domain_hi[3]; | 239 | u8 proximity_domain_hi[3]; |
259 | u32 reserved4; /* Reserved, must be zero */ | 240 | u32 reserved4; /* Reserved, must be zero */ |
260 | }; | 241 | }; |
261 | 242 | ||
262 | struct memory_affinity | 243 | struct memory_affinity { |
263 | { | 244 | u8 type; |
264 | u8 type; | 245 | u8 length; |
265 | u8 length; | 246 | u32 proximity_domain; |
266 | u32 proximity_domain; | 247 | u16 reserved3; |
267 | u16 reserved3; | 248 | u64 base_address; |
268 | u64 base_address; | 249 | u64 address_length; |
269 | u64 address_length; | 250 | u32 reserved4; |
270 | u32 reserved4; | ||
271 | 251 | ||
272 | /* Flags (32 bits) */ | 252 | /* Flags (32 bits) */ |
273 | 253 | ||
274 | u8 enabled :1; /* 00: Use affinity structure */ | 254 | u8 enabled:1; /* 00: Use affinity structure */ |
275 | u8 hot_pluggable :1; /* 01: Memory region is hot pluggable */ | 255 | u8 hot_pluggable:1; /* 01: Memory region is hot pluggable */ |
276 | u8 non_volatile :1; /* 02: Memory is non-volatile */ | 256 | u8 non_volatile:1; /* 02: Memory is non-volatile */ |
277 | u8 :5; /* 03-07: Reserved, must be zero */ | 257 | u8:5; /* 03-07: Reserved, must be zero */ |
278 | u8 reserved5[3]; /* 08-31: Reserved, must be zero */ | 258 | u8 reserved5[3]; /* 08-31: Reserved, must be zero */ |
279 | 259 | ||
280 | u64 reserved6; /* Reserved, must be zero */ | 260 | u64 reserved6; /* Reserved, must be zero */ |
281 | }; | 261 | }; |
282 | 262 | ||
283 | struct system_resource_affinity | 263 | struct system_resource_affinity { |
284 | { | 264 | ACPI_TABLE_HEADER_DEF u32 reserved1; /* Must be value '1' */ |
285 | ACPI_TABLE_HEADER_DEF | 265 | u64 reserved2; /* Reserved, must be zero */ |
286 | u32 reserved1; /* Must be value '1' */ | ||
287 | u64 reserved2; /* Reserved, must be zero */ | ||
288 | }; | 266 | }; |
289 | 267 | ||
290 | |||
291 | /* SLIT - System Locality Distance Information Table */ | 268 | /* SLIT - System Locality Distance Information Table */ |
292 | 269 | ||
293 | struct system_locality_info | 270 | struct system_locality_info { |
294 | { | 271 | ACPI_TABLE_HEADER_DEF u64 locality_count; |
295 | ACPI_TABLE_HEADER_DEF | 272 | u8 entry[1][1]; |
296 | u64 locality_count; | ||
297 | u8 entry[1][1]; | ||
298 | }; | 273 | }; |
299 | 274 | ||
300 | |||
301 | #pragma pack() | 275 | #pragma pack() |
302 | 276 | ||
303 | #endif /* __ACTBL2_H__ */ | 277 | #endif /* __ACTBL2_H__ */ |
304 | |||
diff --git a/include/acpi/actbl71.h b/include/acpi/actbl71.h index 7b4fb44261f3..10ac05bb36bc 100644 --- a/include/acpi/actbl71.h +++ b/include/acpi/actbl71.h | |||
@@ -27,7 +27,6 @@ | |||
27 | #ifndef __ACTBL71_H__ | 27 | #ifndef __ACTBL71_H__ |
28 | #define __ACTBL71_H__ | 28 | #define __ACTBL71_H__ |
29 | 29 | ||
30 | |||
31 | /* 0.71 FADT address_space data item bitmasks defines */ | 30 | /* 0.71 FADT address_space data item bitmasks defines */ |
32 | /* If the associated bit is zero then it is in memory space else in io space */ | 31 | /* If the associated bit is zero then it is in memory space else in io space */ |
33 | 32 | ||
@@ -40,105 +39,96 @@ | |||
40 | 39 | ||
41 | /* Only for clarity in declarations */ | 40 | /* Only for clarity in declarations */ |
42 | 41 | ||
43 | typedef u64 IO_ADDRESS; | 42 | typedef u64 IO_ADDRESS; |
44 | |||
45 | 43 | ||
46 | #pragma pack(1) | 44 | #pragma pack(1) |
47 | struct /* Root System Descriptor Pointer */ | 45 | struct { /* Root System Descriptor Pointer */ |
48 | { | 46 | NATIVE_CHAR signature[8]; /* contains "RSD PTR " */ |
49 | NATIVE_CHAR signature [8]; /* contains "RSD PTR " */ | 47 | u8 checksum; /* to make sum of struct == 0 */ |
50 | u8 checksum; /* to make sum of struct == 0 */ | 48 | NATIVE_CHAR oem_id[6]; /* OEM identification */ |
51 | NATIVE_CHAR oem_id [6]; /* OEM identification */ | 49 | u8 reserved; /* Must be 0 for 1.0, 2 for 2.0 */ |
52 | u8 reserved; /* Must be 0 for 1.0, 2 for 2.0 */ | 50 | u64 rsdt_physical_address; /* 64-bit physical address of RSDT */ |
53 | u64 rsdt_physical_address; /* 64-bit physical address of RSDT */ | ||
54 | }; | 51 | }; |
55 | 52 | ||
56 | |||
57 | /*****************************************/ | 53 | /*****************************************/ |
58 | /* IA64 Extensions to ACPI Spec Rev 0.71 */ | 54 | /* IA64 Extensions to ACPI Spec Rev 0.71 */ |
59 | /* for the Root System Description Table */ | 55 | /* for the Root System Description Table */ |
60 | /*****************************************/ | 56 | /*****************************************/ |
61 | struct | 57 | struct { |
62 | { | 58 | struct acpi_table_header header; /* Table header */ |
63 | struct acpi_table_header header; /* Table header */ | 59 | u32 reserved_pad; /* IA64 alignment, must be 0 */ |
64 | u32 reserved_pad; /* IA64 alignment, must be 0 */ | 60 | u64 table_offset_entry[1]; /* Array of pointers to other */ |
65 | u64 table_offset_entry [1]; /* Array of pointers to other */ | 61 | /* tables' headers */ |
66 | /* tables' headers */ | ||
67 | }; | 62 | }; |
68 | 63 | ||
69 | |||
70 | /*******************************************/ | 64 | /*******************************************/ |
71 | /* IA64 Extensions to ACPI Spec Rev 0.71 */ | 65 | /* IA64 Extensions to ACPI Spec Rev 0.71 */ |
72 | /* for the Firmware ACPI Control Structure */ | 66 | /* for the Firmware ACPI Control Structure */ |
73 | /*******************************************/ | 67 | /*******************************************/ |
74 | struct | 68 | struct { |
75 | { | 69 | NATIVE_CHAR signature[4]; /* signature "FACS" */ |
76 | NATIVE_CHAR signature[4]; /* signature "FACS" */ | 70 | u32 length; /* length of structure, in bytes */ |
77 | u32 length; /* length of structure, in bytes */ | 71 | u32 hardware_signature; /* hardware configuration signature */ |
78 | u32 hardware_signature; /* hardware configuration signature */ | 72 | u32 reserved4; /* must be 0 */ |
79 | u32 reserved4; /* must be 0 */ | 73 | u64 firmware_waking_vector; /* ACPI OS waking vector */ |
80 | u64 firmware_waking_vector; /* ACPI OS waking vector */ | 74 | u64 global_lock; /* Global Lock */ |
81 | u64 global_lock; /* Global Lock */ | 75 | u32 S4bios_f:1; /* Indicates if S4BIOS support is present */ |
82 | u32 S4bios_f : 1; /* Indicates if S4BIOS support is present */ | 76 | u32 reserved1:31; /* must be 0 */ |
83 | u32 reserved1 : 31; /* must be 0 */ | 77 | u8 reserved3[28]; /* reserved - must be zero */ |
84 | u8 reserved3 [28]; /* reserved - must be zero */ | ||
85 | }; | 78 | }; |
86 | 79 | ||
87 | |||
88 | /******************************************/ | 80 | /******************************************/ |
89 | /* IA64 Extensions to ACPI Spec Rev 0.71 */ | 81 | /* IA64 Extensions to ACPI Spec Rev 0.71 */ |
90 | /* for the Fixed ACPI Description Table */ | 82 | /* for the Fixed ACPI Description Table */ |
91 | /******************************************/ | 83 | /******************************************/ |
92 | struct | 84 | struct { |
93 | { | 85 | struct acpi_table_header header; /* table header */ |
94 | struct acpi_table_header header; /* table header */ | 86 | u32 reserved_pad; /* IA64 alignment, must be 0 */ |
95 | u32 reserved_pad; /* IA64 alignment, must be 0 */ | 87 | u64 firmware_ctrl; /* 64-bit Physical address of FACS */ |
96 | u64 firmware_ctrl; /* 64-bit Physical address of FACS */ | 88 | u64 dsdt; /* 64-bit Physical address of DSDT */ |
97 | u64 dsdt; /* 64-bit Physical address of DSDT */ | 89 | u8 model; /* System Interrupt Model */ |
98 | u8 model; /* System Interrupt Model */ | 90 | u8 address_space; /* Address Space Bitmask */ |
99 | u8 address_space; /* Address Space Bitmask */ | 91 | u16 sci_int; /* System vector of SCI interrupt */ |
100 | u16 sci_int; /* System vector of SCI interrupt */ | 92 | u8 acpi_enable; /* value to write to smi_cmd to enable ACPI */ |
101 | u8 acpi_enable; /* value to write to smi_cmd to enable ACPI */ | 93 | u8 acpi_disable; /* value to write to smi_cmd to disable ACPI */ |
102 | u8 acpi_disable; /* value to write to smi_cmd to disable ACPI */ | 94 | u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */ |
103 | u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */ | 95 | u8 reserved2; /* reserved - must be zero */ |
104 | u8 reserved2; /* reserved - must be zero */ | 96 | u64 smi_cmd; /* Port address of SMI command port */ |
105 | u64 smi_cmd; /* Port address of SMI command port */ | 97 | u64 pm1a_evt_blk; /* Port address of Power Mgt 1a acpi_event Reg Blk */ |
106 | u64 pm1a_evt_blk; /* Port address of Power Mgt 1a acpi_event Reg Blk */ | 98 | u64 pm1b_evt_blk; /* Port address of Power Mgt 1b acpi_event Reg Blk */ |
107 | u64 pm1b_evt_blk; /* Port address of Power Mgt 1b acpi_event Reg Blk */ | 99 | u64 pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */ |
108 | u64 pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */ | 100 | u64 pm1b_cnt_blk; /* Port address of Power Mgt 1b Control Reg Blk */ |
109 | u64 pm1b_cnt_blk; /* Port address of Power Mgt 1b Control Reg Blk */ | 101 | u64 pm2_cnt_blk; /* Port address of Power Mgt 2 Control Reg Blk */ |
110 | u64 pm2_cnt_blk; /* Port address of Power Mgt 2 Control Reg Blk */ | 102 | u64 pm_tmr_blk; /* Port address of Power Mgt Timer Ctrl Reg Blk */ |
111 | u64 pm_tmr_blk; /* Port address of Power Mgt Timer Ctrl Reg Blk */ | 103 | u64 gpe0_blk; /* Port addr of General Purpose acpi_event 0 Reg Blk */ |
112 | u64 gpe0_blk; /* Port addr of General Purpose acpi_event 0 Reg Blk */ | 104 | u64 gpe1_blk; /* Port addr of General Purpose acpi_event 1 Reg Blk */ |
113 | u64 gpe1_blk; /* Port addr of General Purpose acpi_event 1 Reg Blk */ | 105 | u8 pm1_evt_len; /* Byte length of ports at pm1_x_evt_blk */ |
114 | u8 pm1_evt_len; /* Byte length of ports at pm1_x_evt_blk */ | 106 | u8 pm1_cnt_len; /* Byte length of ports at pm1_x_cnt_blk */ |
115 | u8 pm1_cnt_len; /* Byte length of ports at pm1_x_cnt_blk */ | 107 | u8 pm2_cnt_len; /* Byte Length of ports at pm2_cnt_blk */ |
116 | u8 pm2_cnt_len; /* Byte Length of ports at pm2_cnt_blk */ | 108 | u8 pm_tm_len; /* Byte Length of ports at pm_tm_blk */ |
117 | u8 pm_tm_len; /* Byte Length of ports at pm_tm_blk */ | 109 | u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */ |
118 | u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */ | 110 | u8 gpe1_blk_len; /* Byte Length of ports at gpe1_blk */ |
119 | u8 gpe1_blk_len; /* Byte Length of ports at gpe1_blk */ | 111 | u8 gpe1_base; /* offset in gpe model where gpe1 events start */ |
120 | u8 gpe1_base; /* offset in gpe model where gpe1 events start */ | 112 | u8 reserved3; /* reserved */ |
121 | u8 reserved3; /* reserved */ | 113 | u16 plvl2_lat; /* worst case HW latency to enter/exit C2 state */ |
122 | u16 plvl2_lat; /* worst case HW latency to enter/exit C2 state */ | 114 | u16 plvl3_lat; /* worst case HW latency to enter/exit C3 state */ |
123 | u16 plvl3_lat; /* worst case HW latency to enter/exit C3 state */ | 115 | u8 day_alrm; /* index to day-of-month alarm in RTC CMOS RAM */ |
124 | u8 day_alrm; /* index to day-of-month alarm in RTC CMOS RAM */ | 116 | u8 mon_alrm; /* index to month-of-year alarm in RTC CMOS RAM */ |
125 | u8 mon_alrm; /* index to month-of-year alarm in RTC CMOS RAM */ | 117 | u8 century; /* index to century in RTC CMOS RAM */ |
126 | u8 century; /* index to century in RTC CMOS RAM */ | 118 | u8 reserved4; /* reserved */ |
127 | u8 reserved4; /* reserved */ | 119 | u32 flush_cash:1; /* PAL_FLUSH_CACHE is correctly supported */ |
128 | u32 flush_cash : 1; /* PAL_FLUSH_CACHE is correctly supported */ | 120 | u32 reserved5:1; /* reserved - must be zero */ |
129 | u32 reserved5 : 1; /* reserved - must be zero */ | 121 | u32 proc_c1:1; /* all processors support C1 state */ |
130 | u32 proc_c1 : 1; /* all processors support C1 state */ | 122 | u32 plvl2_up:1; /* C2 state works on MP system */ |
131 | u32 plvl2_up : 1; /* C2 state works on MP system */ | 123 | u32 pwr_button:1; /* Power button is handled as a generic feature */ |
132 | u32 pwr_button : 1; /* Power button is handled as a generic feature */ | 124 | u32 sleep_button:1; /* Sleep button is handled as a generic feature, or not present */ |
133 | u32 sleep_button : 1; /* Sleep button is handled as a generic feature, or not present */ | 125 | u32 fixed_rTC:1; /* RTC wakeup stat not in fixed register space */ |
134 | u32 fixed_rTC : 1; /* RTC wakeup stat not in fixed register space */ | 126 | u32 rtcs4:1; /* RTC wakeup stat not possible from S4 */ |
135 | u32 rtcs4 : 1; /* RTC wakeup stat not possible from S4 */ | 127 | u32 tmr_val_ext:1; /* tmr_val is 32 bits */ |
136 | u32 tmr_val_ext : 1; /* tmr_val is 32 bits */ | 128 | u32 dock_cap:1; /* Supports Docking */ |
137 | u32 dock_cap : 1; /* Supports Docking */ | 129 | u32 reserved6:22; /* reserved - must be zero */ |
138 | u32 reserved6 : 22; /* reserved - must be zero */ | ||
139 | }; | 130 | }; |
140 | 131 | ||
141 | #pragma pack() | 132 | #pragma pack() |
142 | 133 | ||
143 | #endif /* __ACTBL71_H__ */ | 134 | #endif /* __ACTBL71_H__ */ |
144 | |||
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 1895b862ce0d..254f4b06e7ef 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h | |||
@@ -46,35 +46,31 @@ | |||
46 | 46 | ||
47 | /*! [Begin] no source code translation (keep the typedefs) */ | 47 | /*! [Begin] no source code translation (keep the typedefs) */ |
48 | 48 | ||
49 | |||
50 | |||
51 | /* | 49 | /* |
52 | * Data type ranges | 50 | * Data type ranges |
53 | * Note: These macros are designed to be compiler independent as well as | 51 | * Note: These macros are designed to be compiler independent as well as |
54 | * working around problems that some 32-bit compilers have with 64-bit | 52 | * working around problems that some 32-bit compilers have with 64-bit |
55 | * constants. | 53 | * constants. |
56 | */ | 54 | */ |
57 | #define ACPI_UINT8_MAX (UINT8) (~((UINT8) 0)) /* 0xFF */ | 55 | #define ACPI_UINT8_MAX (UINT8) (~((UINT8) 0)) /* 0xFF */ |
58 | #define ACPI_UINT16_MAX (UINT16)(~((UINT16) 0)) /* 0xFFFF */ | 56 | #define ACPI_UINT16_MAX (UINT16)(~((UINT16) 0)) /* 0xFFFF */ |
59 | #define ACPI_UINT32_MAX (UINT32)(~((UINT32) 0)) /* 0xFFFFFFFF */ | 57 | #define ACPI_UINT32_MAX (UINT32)(~((UINT32) 0)) /* 0xFFFFFFFF */ |
60 | #define ACPI_UINT64_MAX (UINT64)(~((UINT64) 0)) /* 0xFFFFFFFFFFFFFFFF */ | 58 | #define ACPI_UINT64_MAX (UINT64)(~((UINT64) 0)) /* 0xFFFFFFFFFFFFFFFF */ |
61 | #define ACPI_ASCII_MAX 0x7F | 59 | #define ACPI_ASCII_MAX 0x7F |
62 | 60 | ||
63 | |||
64 | #ifdef DEFINE_ALTERNATE_TYPES | 61 | #ifdef DEFINE_ALTERNATE_TYPES |
65 | /* | 62 | /* |
66 | * Types used only in translated source, defined here to enable | 63 | * Types used only in translated source, defined here to enable |
67 | * cross-platform compilation only. | 64 | * cross-platform compilation only. |
68 | */ | 65 | */ |
69 | typedef int s32; | 66 | typedef int s32; |
70 | typedef unsigned char u8; | 67 | typedef unsigned char u8; |
71 | typedef unsigned short u16; | 68 | typedef unsigned short u16; |
72 | typedef unsigned int u32; | 69 | typedef unsigned int u32; |
73 | typedef COMPILER_DEPENDENT_UINT64 u64; | 70 | typedef COMPILER_DEPENDENT_UINT64 u64; |
74 | 71 | ||
75 | #endif | 72 | #endif |
76 | 73 | ||
77 | |||
78 | /* | 74 | /* |
79 | * Data types - Fixed across all compilation models (16/32/64) | 75 | * Data types - Fixed across all compilation models (16/32/64) |
80 | * | 76 | * |
@@ -102,30 +98,29 @@ typedef COMPILER_DEPENDENT_UINT64 u64; | |||
102 | /* | 98 | /* |
103 | * 64-bit type definitions | 99 | * 64-bit type definitions |
104 | */ | 100 | */ |
105 | typedef unsigned char UINT8; | 101 | typedef unsigned char UINT8; |
106 | typedef unsigned char BOOLEAN; | 102 | typedef unsigned char BOOLEAN; |
107 | typedef unsigned short UINT16; | 103 | typedef unsigned short UINT16; |
108 | typedef int INT32; | 104 | typedef int INT32; |
109 | typedef unsigned int UINT32; | 105 | typedef unsigned int UINT32; |
110 | typedef COMPILER_DEPENDENT_INT64 INT64; | 106 | typedef COMPILER_DEPENDENT_INT64 INT64; |
111 | typedef COMPILER_DEPENDENT_UINT64 UINT64; | 107 | typedef COMPILER_DEPENDENT_UINT64 UINT64; |
112 | 108 | ||
113 | /*! [End] no source code translation !*/ | 109 | /*! [End] no source code translation !*/ |
114 | 110 | ||
115 | typedef s64 acpi_native_int; | 111 | typedef s64 acpi_native_int; |
116 | typedef u64 acpi_native_uint; | 112 | typedef u64 acpi_native_uint; |
117 | 113 | ||
118 | typedef u64 acpi_table_ptr; | 114 | typedef u64 acpi_table_ptr; |
119 | typedef u64 acpi_io_address; | 115 | typedef u64 acpi_io_address; |
120 | typedef u64 acpi_physical_address; | 116 | typedef u64 acpi_physical_address; |
121 | typedef u64 acpi_size; | 117 | typedef u64 acpi_size; |
122 | 118 | ||
123 | #define ALIGNED_ADDRESS_BOUNDARY 0x00000008 /* No hardware alignment support in IA64 */ | 119 | #define ALIGNED_ADDRESS_BOUNDARY 0x00000008 /* No hardware alignment support in IA64 */ |
124 | #define ACPI_USE_NATIVE_DIVIDE /* Native 64-bit integer support */ | 120 | #define ACPI_USE_NATIVE_DIVIDE /* Native 64-bit integer support */ |
125 | #define ACPI_MAX_PTR ACPI_UINT64_MAX | 121 | #define ACPI_MAX_PTR ACPI_UINT64_MAX |
126 | #define ACPI_SIZE_MAX ACPI_UINT64_MAX | 122 | #define ACPI_SIZE_MAX ACPI_UINT64_MAX |
127 | 123 | ||
128 | |||
129 | #elif ACPI_MACHINE_WIDTH == 16 | 124 | #elif ACPI_MACHINE_WIDTH == 16 |
130 | 125 | ||
131 | /*! [Begin] no source code translation (keep the typedefs) */ | 126 | /*! [Begin] no source code translation (keep the typedefs) */ |
@@ -133,32 +128,31 @@ typedef u64 acpi_size; | |||
133 | /* | 128 | /* |
134 | * 16-bit type definitions | 129 | * 16-bit type definitions |
135 | */ | 130 | */ |
136 | typedef unsigned char UINT8; | 131 | typedef unsigned char UINT8; |
137 | typedef unsigned char BOOLEAN; | 132 | typedef unsigned char BOOLEAN; |
138 | typedef unsigned int UINT16; | 133 | typedef unsigned int UINT16; |
139 | typedef long INT32; | 134 | typedef long INT32; |
140 | typedef int INT16; | 135 | typedef int INT16; |
141 | typedef unsigned long UINT32; | 136 | typedef unsigned long UINT32; |
142 | 137 | ||
143 | struct | 138 | struct { |
144 | { | 139 | UINT32 Lo; |
145 | UINT32 Lo; | 140 | UINT32 Hi; |
146 | UINT32 Hi; | ||
147 | }; | 141 | }; |
148 | 142 | ||
149 | /*! [End] no source code translation !*/ | 143 | /*! [End] no source code translation !*/ |
150 | 144 | ||
151 | typedef u16 acpi_native_uint; | 145 | typedef u16 acpi_native_uint; |
152 | typedef s16 acpi_native_int; | 146 | typedef s16 acpi_native_int; |
153 | 147 | ||
154 | typedef u32 acpi_table_ptr; | 148 | typedef u32 acpi_table_ptr; |
155 | typedef u32 acpi_io_address; | 149 | typedef u32 acpi_io_address; |
156 | typedef char *acpi_physical_address; | 150 | typedef char *acpi_physical_address; |
157 | typedef u16 acpi_size; | 151 | typedef u16 acpi_size; |
158 | 152 | ||
159 | #define ALIGNED_ADDRESS_BOUNDARY 0x00000002 | 153 | #define ALIGNED_ADDRESS_BOUNDARY 0x00000002 |
160 | #define ACPI_MISALIGNED_TRANSFERS | 154 | #define ACPI_MISALIGNED_TRANSFERS |
161 | #define ACPI_USE_NATIVE_DIVIDE /* No 64-bit integers, ok to use native divide */ | 155 | #define ACPI_USE_NATIVE_DIVIDE /* No 64-bit integers, ok to use native divide */ |
162 | #define ACPI_MAX_PTR ACPI_UINT16_MAX | 156 | #define ACPI_MAX_PTR ACPI_UINT16_MAX |
163 | #define ACPI_SIZE_MAX ACPI_UINT16_MAX | 157 | #define ACPI_SIZE_MAX ACPI_UINT16_MAX |
164 | 158 | ||
@@ -168,7 +162,6 @@ typedef u16 acpi_size; | |||
168 | */ | 162 | */ |
169 | #define ACPI_NO_INTEGER64_SUPPORT | 163 | #define ACPI_NO_INTEGER64_SUPPORT |
170 | 164 | ||
171 | |||
172 | #elif ACPI_MACHINE_WIDTH == 32 | 165 | #elif ACPI_MACHINE_WIDTH == 32 |
173 | 166 | ||
174 | /*! [Begin] no source code translation (keep the typedefs) */ | 167 | /*! [Begin] no source code translation (keep the typedefs) */ |
@@ -176,23 +169,23 @@ typedef u16 acpi_size; | |||
176 | /* | 169 | /* |
177 | * 32-bit type definitions (default) | 170 | * 32-bit type definitions (default) |
178 | */ | 171 | */ |
179 | typedef unsigned char UINT8; | 172 | typedef unsigned char UINT8; |
180 | typedef unsigned char BOOLEAN; | 173 | typedef unsigned char BOOLEAN; |
181 | typedef unsigned short UINT16; | 174 | typedef unsigned short UINT16; |
182 | typedef int INT32; | 175 | typedef int INT32; |
183 | typedef unsigned int UINT32; | 176 | typedef unsigned int UINT32; |
184 | typedef COMPILER_DEPENDENT_INT64 INT64; | 177 | typedef COMPILER_DEPENDENT_INT64 INT64; |
185 | typedef COMPILER_DEPENDENT_UINT64 UINT64; | 178 | typedef COMPILER_DEPENDENT_UINT64 UINT64; |
186 | 179 | ||
187 | /*! [End] no source code translation !*/ | 180 | /*! [End] no source code translation !*/ |
188 | 181 | ||
189 | typedef s32 acpi_native_int; | 182 | typedef s32 acpi_native_int; |
190 | typedef u32 acpi_native_uint; | 183 | typedef u32 acpi_native_uint; |
191 | 184 | ||
192 | typedef u64 acpi_table_ptr; | 185 | typedef u64 acpi_table_ptr; |
193 | typedef u32 acpi_io_address; | 186 | typedef u32 acpi_io_address; |
194 | typedef u64 acpi_physical_address; | 187 | typedef u64 acpi_physical_address; |
195 | typedef u32 acpi_size; | 188 | typedef u32 acpi_size; |
196 | 189 | ||
197 | #define ALIGNED_ADDRESS_BOUNDARY 0x00000004 | 190 | #define ALIGNED_ADDRESS_BOUNDARY 0x00000004 |
198 | #define ACPI_MISALIGNED_TRANSFERS | 191 | #define ACPI_MISALIGNED_TRANSFERS |
@@ -203,30 +196,27 @@ typedef u32 acpi_size; | |||
203 | #error unknown ACPI_MACHINE_WIDTH | 196 | #error unknown ACPI_MACHINE_WIDTH |
204 | #endif | 197 | #endif |
205 | 198 | ||
206 | |||
207 | /* | 199 | /* |
208 | * This type is used for bitfields in ACPI tables. The only type that is | 200 | * This type is used for bitfields in ACPI tables. The only type that is |
209 | * even remotely portable is u8. Anything else is not portable, so | 201 | * even remotely portable is u8. Anything else is not portable, so |
210 | * do not add any more bitfield types. | 202 | * do not add any more bitfield types. |
211 | */ | 203 | */ |
212 | typedef u8 UINT8_BIT; | 204 | typedef u8 UINT8_BIT; |
213 | typedef acpi_native_uint ACPI_PTRDIFF; | 205 | typedef acpi_native_uint ACPI_PTRDIFF; |
214 | 206 | ||
215 | /* | 207 | /* |
216 | * Pointer overlays to avoid lots of typecasting for | 208 | * Pointer overlays to avoid lots of typecasting for |
217 | * code that accepts both physical and logical pointers. | 209 | * code that accepts both physical and logical pointers. |
218 | */ | 210 | */ |
219 | union acpi_pointers | 211 | union acpi_pointers { |
220 | { | 212 | acpi_physical_address physical; |
221 | acpi_physical_address physical; | 213 | void *logical; |
222 | void *logical; | 214 | acpi_table_ptr value; |
223 | acpi_table_ptr value; | ||
224 | }; | 215 | }; |
225 | 216 | ||
226 | struct acpi_pointer | 217 | struct acpi_pointer { |
227 | { | 218 | u32 pointer_type; |
228 | u32 pointer_type; | 219 | union acpi_pointers pointer; |
229 | union acpi_pointers pointer; | ||
230 | }; | 220 | }; |
231 | 221 | ||
232 | /* pointer_types for above */ | 222 | /* pointer_types for above */ |
@@ -270,34 +260,29 @@ struct acpi_pointer | |||
270 | #define NULL (void *) 0 | 260 | #define NULL (void *) 0 |
271 | #endif | 261 | #endif |
272 | 262 | ||
273 | |||
274 | /* | 263 | /* |
275 | * Local datatypes | 264 | * Local datatypes |
276 | */ | 265 | */ |
277 | typedef u32 acpi_status; /* All ACPI Exceptions */ | 266 | typedef u32 acpi_status; /* All ACPI Exceptions */ |
278 | typedef u32 acpi_name; /* 4-byte ACPI name */ | 267 | typedef u32 acpi_name; /* 4-byte ACPI name */ |
279 | typedef char * acpi_string; /* Null terminated ASCII string */ | 268 | typedef char *acpi_string; /* Null terminated ASCII string */ |
280 | typedef void * acpi_handle; /* Actually a ptr to an Node */ | 269 | typedef void *acpi_handle; /* Actually a ptr to an Node */ |
281 | 270 | ||
282 | struct uint64_struct | 271 | struct uint64_struct { |
283 | { | 272 | u32 lo; |
284 | u32 lo; | 273 | u32 hi; |
285 | u32 hi; | ||
286 | }; | 274 | }; |
287 | 275 | ||
288 | union uint64_overlay | 276 | union uint64_overlay { |
289 | { | 277 | u64 full; |
290 | u64 full; | 278 | struct uint64_struct part; |
291 | struct uint64_struct part; | ||
292 | }; | 279 | }; |
293 | 280 | ||
294 | struct uint32_struct | 281 | struct uint32_struct { |
295 | { | 282 | u32 lo; |
296 | u32 lo; | 283 | u32 hi; |
297 | u32 hi; | ||
298 | }; | 284 | }; |
299 | 285 | ||
300 | |||
301 | /* | 286 | /* |
302 | * Acpi integer width. In ACPI version 1, integers are | 287 | * Acpi integer width. In ACPI version 1, integers are |
303 | * 32 bits. In ACPI version 2, integers are 64 bits. | 288 | * 32 bits. In ACPI version 2, integers are 64 bits. |
@@ -309,26 +294,24 @@ struct uint32_struct | |||
309 | 294 | ||
310 | /* 32-bit integers only, no 64-bit support */ | 295 | /* 32-bit integers only, no 64-bit support */ |
311 | 296 | ||
312 | typedef u32 acpi_integer; | 297 | typedef u32 acpi_integer; |
313 | #define ACPI_INTEGER_MAX ACPI_UINT32_MAX | 298 | #define ACPI_INTEGER_MAX ACPI_UINT32_MAX |
314 | #define ACPI_INTEGER_BIT_SIZE 32 | 299 | #define ACPI_INTEGER_BIT_SIZE 32 |
315 | #define ACPI_MAX_DECIMAL_DIGITS 10 /* 2^32 = 4,294,967,296 */ | 300 | #define ACPI_MAX_DECIMAL_DIGITS 10 /* 2^32 = 4,294,967,296 */ |
316 | |||
317 | #define ACPI_USE_NATIVE_DIVIDE /* Use compiler native 32-bit divide */ | ||
318 | 301 | ||
302 | #define ACPI_USE_NATIVE_DIVIDE /* Use compiler native 32-bit divide */ | ||
319 | 303 | ||
320 | #else | 304 | #else |
321 | 305 | ||
322 | /* 64-bit integers */ | 306 | /* 64-bit integers */ |
323 | 307 | ||
324 | typedef u64 acpi_integer; | 308 | typedef u64 acpi_integer; |
325 | #define ACPI_INTEGER_MAX ACPI_UINT64_MAX | 309 | #define ACPI_INTEGER_MAX ACPI_UINT64_MAX |
326 | #define ACPI_INTEGER_BIT_SIZE 64 | 310 | #define ACPI_INTEGER_BIT_SIZE 64 |
327 | #define ACPI_MAX_DECIMAL_DIGITS 20 /* 2^64 = 18,446,744,073,709,551,616 */ | 311 | #define ACPI_MAX_DECIMAL_DIGITS 20 /* 2^64 = 18,446,744,073,709,551,616 */ |
328 | |||
329 | 312 | ||
330 | #if ACPI_MACHINE_WIDTH == 64 | 313 | #if ACPI_MACHINE_WIDTH == 64 |
331 | #define ACPI_USE_NATIVE_DIVIDE /* Use compiler native 64-bit divide */ | 314 | #define ACPI_USE_NATIVE_DIVIDE /* Use compiler native 64-bit divide */ |
332 | #endif | 315 | #endif |
333 | #endif | 316 | #endif |
334 | 317 | ||
@@ -342,7 +325,6 @@ typedef u64 acpi_integer; | |||
342 | */ | 325 | */ |
343 | #define ACPI_ROOT_OBJECT (acpi_handle) ACPI_PTR_ADD (char, NULL, ACPI_MAX_PTR) | 326 | #define ACPI_ROOT_OBJECT (acpi_handle) ACPI_PTR_ADD (char, NULL, ACPI_MAX_PTR) |
344 | 327 | ||
345 | |||
346 | /* | 328 | /* |
347 | * Initialization sequence | 329 | * Initialization sequence |
348 | */ | 330 | */ |
@@ -409,7 +391,7 @@ typedef u64 acpi_integer; | |||
409 | /* | 391 | /* |
410 | * Table types. These values are passed to the table related APIs | 392 | * Table types. These values are passed to the table related APIs |
411 | */ | 393 | */ |
412 | typedef u32 acpi_table_type; | 394 | typedef u32 acpi_table_type; |
413 | 395 | ||
414 | #define ACPI_TABLE_RSDP (acpi_table_type) 0 | 396 | #define ACPI_TABLE_RSDP (acpi_table_type) 0 |
415 | #define ACPI_TABLE_DSDT (acpi_table_type) 1 | 397 | #define ACPI_TABLE_DSDT (acpi_table_type) 1 |
@@ -430,22 +412,22 @@ typedef u32 acpi_table_type; | |||
430 | * NOTE: Types must be kept in sync with the global acpi_ns_properties | 412 | * NOTE: Types must be kept in sync with the global acpi_ns_properties |
431 | * and acpi_ns_type_names arrays. | 413 | * and acpi_ns_type_names arrays. |
432 | */ | 414 | */ |
433 | typedef u32 acpi_object_type; | 415 | typedef u32 acpi_object_type; |
434 | 416 | ||
435 | #define ACPI_TYPE_ANY 0x00 | 417 | #define ACPI_TYPE_ANY 0x00 |
436 | #define ACPI_TYPE_INTEGER 0x01 /* Byte/Word/Dword/Zero/One/Ones */ | 418 | #define ACPI_TYPE_INTEGER 0x01 /* Byte/Word/Dword/Zero/One/Ones */ |
437 | #define ACPI_TYPE_STRING 0x02 | 419 | #define ACPI_TYPE_STRING 0x02 |
438 | #define ACPI_TYPE_BUFFER 0x03 | 420 | #define ACPI_TYPE_BUFFER 0x03 |
439 | #define ACPI_TYPE_PACKAGE 0x04 /* byte_const, multiple data_term/Constant/super_name */ | 421 | #define ACPI_TYPE_PACKAGE 0x04 /* byte_const, multiple data_term/Constant/super_name */ |
440 | #define ACPI_TYPE_FIELD_UNIT 0x05 | 422 | #define ACPI_TYPE_FIELD_UNIT 0x05 |
441 | #define ACPI_TYPE_DEVICE 0x06 /* Name, multiple Node */ | 423 | #define ACPI_TYPE_DEVICE 0x06 /* Name, multiple Node */ |
442 | #define ACPI_TYPE_EVENT 0x07 | 424 | #define ACPI_TYPE_EVENT 0x07 |
443 | #define ACPI_TYPE_METHOD 0x08 /* Name, byte_const, multiple Code */ | 425 | #define ACPI_TYPE_METHOD 0x08 /* Name, byte_const, multiple Code */ |
444 | #define ACPI_TYPE_MUTEX 0x09 | 426 | #define ACPI_TYPE_MUTEX 0x09 |
445 | #define ACPI_TYPE_REGION 0x0A | 427 | #define ACPI_TYPE_REGION 0x0A |
446 | #define ACPI_TYPE_POWER 0x0B /* Name,byte_const,word_const,multi Node */ | 428 | #define ACPI_TYPE_POWER 0x0B /* Name,byte_const,word_const,multi Node */ |
447 | #define ACPI_TYPE_PROCESSOR 0x0C /* Name,byte_const,Dword_const,byte_const,multi nm_o */ | 429 | #define ACPI_TYPE_PROCESSOR 0x0C /* Name,byte_const,Dword_const,byte_const,multi nm_o */ |
448 | #define ACPI_TYPE_THERMAL 0x0D /* Name, multiple Node */ | 430 | #define ACPI_TYPE_THERMAL 0x0D /* Name, multiple Node */ |
449 | #define ACPI_TYPE_BUFFER_FIELD 0x0E | 431 | #define ACPI_TYPE_BUFFER_FIELD 0x0E |
450 | #define ACPI_TYPE_DDB_HANDLE 0x0F | 432 | #define ACPI_TYPE_DDB_HANDLE 0x0F |
451 | #define ACPI_TYPE_DEBUG_OBJECT 0x10 | 433 | #define ACPI_TYPE_DEBUG_OBJECT 0x10 |
@@ -462,16 +444,16 @@ typedef u32 acpi_object_type; | |||
462 | #define ACPI_TYPE_LOCAL_REGION_FIELD 0x11 | 444 | #define ACPI_TYPE_LOCAL_REGION_FIELD 0x11 |
463 | #define ACPI_TYPE_LOCAL_BANK_FIELD 0x12 | 445 | #define ACPI_TYPE_LOCAL_BANK_FIELD 0x12 |
464 | #define ACPI_TYPE_LOCAL_INDEX_FIELD 0x13 | 446 | #define ACPI_TYPE_LOCAL_INDEX_FIELD 0x13 |
465 | #define ACPI_TYPE_LOCAL_REFERENCE 0x14 /* Arg#, Local#, Name, Debug, ref_of, Index */ | 447 | #define ACPI_TYPE_LOCAL_REFERENCE 0x14 /* Arg#, Local#, Name, Debug, ref_of, Index */ |
466 | #define ACPI_TYPE_LOCAL_ALIAS 0x15 | 448 | #define ACPI_TYPE_LOCAL_ALIAS 0x15 |
467 | #define ACPI_TYPE_LOCAL_METHOD_ALIAS 0x16 | 449 | #define ACPI_TYPE_LOCAL_METHOD_ALIAS 0x16 |
468 | #define ACPI_TYPE_LOCAL_NOTIFY 0x17 | 450 | #define ACPI_TYPE_LOCAL_NOTIFY 0x17 |
469 | #define ACPI_TYPE_LOCAL_ADDRESS_HANDLER 0x18 | 451 | #define ACPI_TYPE_LOCAL_ADDRESS_HANDLER 0x18 |
470 | #define ACPI_TYPE_LOCAL_RESOURCE 0x19 | 452 | #define ACPI_TYPE_LOCAL_RESOURCE 0x19 |
471 | #define ACPI_TYPE_LOCAL_RESOURCE_FIELD 0x1A | 453 | #define ACPI_TYPE_LOCAL_RESOURCE_FIELD 0x1A |
472 | #define ACPI_TYPE_LOCAL_SCOPE 0x1B /* 1 Name, multiple object_list Nodes */ | 454 | #define ACPI_TYPE_LOCAL_SCOPE 0x1B /* 1 Name, multiple object_list Nodes */ |
473 | 455 | ||
474 | #define ACPI_TYPE_NS_NODE_MAX 0x1B /* Last typecode used within a NS Node */ | 456 | #define ACPI_TYPE_NS_NODE_MAX 0x1B /* Last typecode used within a NS Node */ |
475 | 457 | ||
476 | /* | 458 | /* |
477 | * These are special object types that never appear in | 459 | * These are special object types that never appear in |
@@ -515,7 +497,7 @@ typedef u32 acpi_object_type; | |||
515 | #define ACPI_BTYPE_DATA (ACPI_BTYPE_COMPUTE_DATA | ACPI_BTYPE_PACKAGE) | 497 | #define ACPI_BTYPE_DATA (ACPI_BTYPE_COMPUTE_DATA | ACPI_BTYPE_PACKAGE) |
516 | #define ACPI_BTYPE_DATA_REFERENCE (ACPI_BTYPE_DATA | ACPI_BTYPE_REFERENCE | ACPI_BTYPE_DDB_HANDLE) | 498 | #define ACPI_BTYPE_DATA_REFERENCE (ACPI_BTYPE_DATA | ACPI_BTYPE_REFERENCE | ACPI_BTYPE_DDB_HANDLE) |
517 | #define ACPI_BTYPE_DEVICE_OBJECTS (ACPI_BTYPE_DEVICE | ACPI_BTYPE_THERMAL | ACPI_BTYPE_PROCESSOR) | 499 | #define ACPI_BTYPE_DEVICE_OBJECTS (ACPI_BTYPE_DEVICE | ACPI_BTYPE_THERMAL | ACPI_BTYPE_PROCESSOR) |
518 | #define ACPI_BTYPE_OBJECTS_AND_REFS 0x0001FFFF /* ARG or LOCAL */ | 500 | #define ACPI_BTYPE_OBJECTS_AND_REFS 0x0001FFFF /* ARG or LOCAL */ |
519 | #define ACPI_BTYPE_ALL_OBJECTS 0x0000FFFF | 501 | #define ACPI_BTYPE_ALL_OBJECTS 0x0000FFFF |
520 | 502 | ||
521 | /* | 503 | /* |
@@ -528,7 +510,7 @@ typedef u32 acpi_object_type; | |||
528 | /* | 510 | /* |
529 | * Event Types: Fixed & General Purpose | 511 | * Event Types: Fixed & General Purpose |
530 | */ | 512 | */ |
531 | typedef u32 acpi_event_type; | 513 | typedef u32 acpi_event_type; |
532 | 514 | ||
533 | /* | 515 | /* |
534 | * Fixed events | 516 | * Fixed events |
@@ -556,7 +538,7 @@ typedef u32 acpi_event_type; | |||
556 | * | +----- Set? | 538 | * | +----- Set? |
557 | * +----------- <Reserved> | 539 | * +----------- <Reserved> |
558 | */ | 540 | */ |
559 | typedef u32 acpi_event_status; | 541 | typedef u32 acpi_event_status; |
560 | 542 | ||
561 | #define ACPI_EVENT_FLAG_DISABLED (acpi_event_status) 0x00 | 543 | #define ACPI_EVENT_FLAG_DISABLED (acpi_event_status) 0x00 |
562 | #define ACPI_EVENT_FLAG_ENABLED (acpi_event_status) 0x01 | 544 | #define ACPI_EVENT_FLAG_ENABLED (acpi_event_status) 0x01 |
@@ -573,7 +555,6 @@ typedef u32 acpi_event_status; | |||
573 | #define ACPI_GPE_ENABLE 0 | 555 | #define ACPI_GPE_ENABLE 0 |
574 | #define ACPI_GPE_DISABLE 1 | 556 | #define ACPI_GPE_DISABLE 1 |
575 | 557 | ||
576 | |||
577 | /* | 558 | /* |
578 | * GPE info flags - Per GPE | 559 | * GPE info flags - Per GPE |
579 | * +-+-+-+---+---+-+ | 560 | * +-+-+-+---+---+-+ |
@@ -594,22 +575,22 @@ typedef u32 acpi_event_status; | |||
594 | #define ACPI_GPE_TYPE_MASK (u8) 0x06 | 575 | #define ACPI_GPE_TYPE_MASK (u8) 0x06 |
595 | #define ACPI_GPE_TYPE_WAKE_RUN (u8) 0x06 | 576 | #define ACPI_GPE_TYPE_WAKE_RUN (u8) 0x06 |
596 | #define ACPI_GPE_TYPE_WAKE (u8) 0x02 | 577 | #define ACPI_GPE_TYPE_WAKE (u8) 0x02 |
597 | #define ACPI_GPE_TYPE_RUNTIME (u8) 0x04 /* Default */ | 578 | #define ACPI_GPE_TYPE_RUNTIME (u8) 0x04 /* Default */ |
598 | 579 | ||
599 | #define ACPI_GPE_DISPATCH_MASK (u8) 0x18 | 580 | #define ACPI_GPE_DISPATCH_MASK (u8) 0x18 |
600 | #define ACPI_GPE_DISPATCH_HANDLER (u8) 0x08 | 581 | #define ACPI_GPE_DISPATCH_HANDLER (u8) 0x08 |
601 | #define ACPI_GPE_DISPATCH_METHOD (u8) 0x10 | 582 | #define ACPI_GPE_DISPATCH_METHOD (u8) 0x10 |
602 | #define ACPI_GPE_DISPATCH_NOT_USED (u8) 0x00 /* Default */ | 583 | #define ACPI_GPE_DISPATCH_NOT_USED (u8) 0x00 /* Default */ |
603 | 584 | ||
604 | #define ACPI_GPE_RUN_ENABLE_MASK (u8) 0x20 | 585 | #define ACPI_GPE_RUN_ENABLE_MASK (u8) 0x20 |
605 | #define ACPI_GPE_RUN_ENABLED (u8) 0x20 | 586 | #define ACPI_GPE_RUN_ENABLED (u8) 0x20 |
606 | #define ACPI_GPE_RUN_DISABLED (u8) 0x00 /* Default */ | 587 | #define ACPI_GPE_RUN_DISABLED (u8) 0x00 /* Default */ |
607 | 588 | ||
608 | #define ACPI_GPE_WAKE_ENABLE_MASK (u8) 0x40 | 589 | #define ACPI_GPE_WAKE_ENABLE_MASK (u8) 0x40 |
609 | #define ACPI_GPE_WAKE_ENABLED (u8) 0x40 | 590 | #define ACPI_GPE_WAKE_ENABLED (u8) 0x40 |
610 | #define ACPI_GPE_WAKE_DISABLED (u8) 0x00 /* Default */ | 591 | #define ACPI_GPE_WAKE_DISABLED (u8) 0x00 /* Default */ |
611 | 592 | ||
612 | #define ACPI_GPE_ENABLE_MASK (u8) 0x60 /* Both run/wake */ | 593 | #define ACPI_GPE_ENABLE_MASK (u8) 0x60 /* Both run/wake */ |
613 | 594 | ||
614 | #define ACPI_GPE_SYSTEM_MASK (u8) 0x80 | 595 | #define ACPI_GPE_SYSTEM_MASK (u8) 0x80 |
615 | #define ACPI_GPE_SYSTEM_RUNNING (u8) 0x80 | 596 | #define ACPI_GPE_SYSTEM_RUNNING (u8) 0x80 |
@@ -618,13 +599,12 @@ typedef u32 acpi_event_status; | |||
618 | /* | 599 | /* |
619 | * Flags for GPE and Lock interfaces | 600 | * Flags for GPE and Lock interfaces |
620 | */ | 601 | */ |
621 | #define ACPI_EVENT_WAKE_ENABLE 0x2 /* acpi_gpe_enable */ | 602 | #define ACPI_EVENT_WAKE_ENABLE 0x2 /* acpi_gpe_enable */ |
622 | #define ACPI_EVENT_WAKE_DISABLE 0x2 /* acpi_gpe_disable */ | 603 | #define ACPI_EVENT_WAKE_DISABLE 0x2 /* acpi_gpe_disable */ |
623 | 604 | ||
624 | #define ACPI_NOT_ISR 0x1 | 605 | #define ACPI_NOT_ISR 0x1 |
625 | #define ACPI_ISR 0x0 | 606 | #define ACPI_ISR 0x0 |
626 | 607 | ||
627 | |||
628 | /* Notify types */ | 608 | /* Notify types */ |
629 | 609 | ||
630 | #define ACPI_SYSTEM_NOTIFY 0x1 | 610 | #define ACPI_SYSTEM_NOTIFY 0x1 |
@@ -634,10 +614,9 @@ typedef u32 acpi_event_status; | |||
634 | 614 | ||
635 | #define ACPI_MAX_SYS_NOTIFY 0x7f | 615 | #define ACPI_MAX_SYS_NOTIFY 0x7f |
636 | 616 | ||
637 | |||
638 | /* Address Space (Operation Region) Types */ | 617 | /* Address Space (Operation Region) Types */ |
639 | 618 | ||
640 | typedef u8 acpi_adr_space_type; | 619 | typedef u8 acpi_adr_space_type; |
641 | 620 | ||
642 | #define ACPI_ADR_SPACE_SYSTEM_MEMORY (acpi_adr_space_type) 0 | 621 | #define ACPI_ADR_SPACE_SYSTEM_MEMORY (acpi_adr_space_type) 0 |
643 | #define ACPI_ADR_SPACE_SYSTEM_IO (acpi_adr_space_type) 1 | 622 | #define ACPI_ADR_SPACE_SYSTEM_IO (acpi_adr_space_type) 1 |
@@ -649,7 +628,6 @@ typedef u8 acpi_adr_space_type; | |||
649 | #define ACPI_ADR_SPACE_DATA_TABLE (acpi_adr_space_type) 7 | 628 | #define ACPI_ADR_SPACE_DATA_TABLE (acpi_adr_space_type) 7 |
650 | #define ACPI_ADR_SPACE_FIXED_HARDWARE (acpi_adr_space_type) 127 | 629 | #define ACPI_ADR_SPACE_FIXED_HARDWARE (acpi_adr_space_type) 127 |
651 | 630 | ||
652 | |||
653 | /* | 631 | /* |
654 | * bit_register IDs | 632 | * bit_register IDs |
655 | * These are bitfields defined within the full ACPI registers | 633 | * These are bitfields defined within the full ACPI registers |
@@ -683,74 +661,62 @@ typedef u8 acpi_adr_space_type; | |||
683 | #define ACPI_BITREG_MAX 0x15 | 661 | #define ACPI_BITREG_MAX 0x15 |
684 | #define ACPI_NUM_BITREG ACPI_BITREG_MAX + 1 | 662 | #define ACPI_NUM_BITREG ACPI_BITREG_MAX + 1 |
685 | 663 | ||
686 | |||
687 | /* | 664 | /* |
688 | * External ACPI object definition | 665 | * External ACPI object definition |
689 | */ | 666 | */ |
690 | union acpi_object | 667 | union acpi_object { |
691 | { | 668 | acpi_object_type type; /* See definition of acpi_ns_type for values */ |
692 | acpi_object_type type; /* See definition of acpi_ns_type for values */ | 669 | struct { |
693 | struct | 670 | acpi_object_type type; |
694 | { | 671 | acpi_integer value; /* The actual number */ |
695 | acpi_object_type type; | ||
696 | acpi_integer value; /* The actual number */ | ||
697 | } integer; | 672 | } integer; |
698 | 673 | ||
699 | struct | 674 | struct { |
700 | { | 675 | acpi_object_type type; |
701 | acpi_object_type type; | 676 | u32 length; /* # of bytes in string, excluding trailing null */ |
702 | u32 length; /* # of bytes in string, excluding trailing null */ | 677 | char *pointer; /* points to the string value */ |
703 | char *pointer; /* points to the string value */ | ||
704 | } string; | 678 | } string; |
705 | 679 | ||
706 | struct | 680 | struct { |
707 | { | 681 | acpi_object_type type; |
708 | acpi_object_type type; | 682 | u32 length; /* # of bytes in buffer */ |
709 | u32 length; /* # of bytes in buffer */ | 683 | u8 *pointer; /* points to the buffer */ |
710 | u8 *pointer; /* points to the buffer */ | ||
711 | } buffer; | 684 | } buffer; |
712 | 685 | ||
713 | struct | 686 | struct { |
714 | { | 687 | acpi_object_type type; |
715 | acpi_object_type type; | 688 | u32 fill1; |
716 | u32 fill1; | 689 | acpi_handle handle; /* object reference */ |
717 | acpi_handle handle; /* object reference */ | ||
718 | } reference; | 690 | } reference; |
719 | 691 | ||
720 | struct | 692 | struct { |
721 | { | 693 | acpi_object_type type; |
722 | acpi_object_type type; | 694 | u32 count; /* # of elements in package */ |
723 | u32 count; /* # of elements in package */ | 695 | union acpi_object *elements; /* Pointer to an array of ACPI_OBJECTs */ |
724 | union acpi_object *elements; /* Pointer to an array of ACPI_OBJECTs */ | ||
725 | } package; | 696 | } package; |
726 | 697 | ||
727 | struct | 698 | struct { |
728 | { | 699 | acpi_object_type type; |
729 | acpi_object_type type; | 700 | u32 proc_id; |
730 | u32 proc_id; | 701 | acpi_io_address pblk_address; |
731 | acpi_io_address pblk_address; | 702 | u32 pblk_length; |
732 | u32 pblk_length; | ||
733 | } processor; | 703 | } processor; |
734 | 704 | ||
735 | struct | 705 | struct { |
736 | { | 706 | acpi_object_type type; |
737 | acpi_object_type type; | 707 | u32 system_level; |
738 | u32 system_level; | 708 | u32 resource_order; |
739 | u32 resource_order; | ||
740 | } power_resource; | 709 | } power_resource; |
741 | }; | 710 | }; |
742 | 711 | ||
743 | |||
744 | /* | 712 | /* |
745 | * List of objects, used as a parameter list for control method evaluation | 713 | * List of objects, used as a parameter list for control method evaluation |
746 | */ | 714 | */ |
747 | struct acpi_object_list | 715 | struct acpi_object_list { |
748 | { | 716 | u32 count; |
749 | u32 count; | 717 | union acpi_object *pointer; |
750 | union acpi_object *pointer; | ||
751 | }; | 718 | }; |
752 | 719 | ||
753 | |||
754 | /* | 720 | /* |
755 | * Miscellaneous common Data Structures used by the interfaces | 721 | * Miscellaneous common Data Structures used by the interfaces |
756 | */ | 722 | */ |
@@ -758,13 +724,11 @@ struct acpi_object_list | |||
758 | #define ACPI_ALLOCATE_BUFFER (acpi_size) (-1) | 724 | #define ACPI_ALLOCATE_BUFFER (acpi_size) (-1) |
759 | #define ACPI_ALLOCATE_LOCAL_BUFFER (acpi_size) (-2) | 725 | #define ACPI_ALLOCATE_LOCAL_BUFFER (acpi_size) (-2) |
760 | 726 | ||
761 | struct acpi_buffer | 727 | struct acpi_buffer { |
762 | { | 728 | acpi_size length; /* Length in bytes of the buffer */ |
763 | acpi_size length; /* Length in bytes of the buffer */ | 729 | void *pointer; /* pointer to buffer */ |
764 | void *pointer; /* pointer to buffer */ | ||
765 | }; | 730 | }; |
766 | 731 | ||
767 | |||
768 | /* | 732 | /* |
769 | * name_type for acpi_get_name | 733 | * name_type for acpi_get_name |
770 | */ | 734 | */ |
@@ -772,7 +736,6 @@ struct acpi_buffer | |||
772 | #define ACPI_SINGLE_NAME 1 | 736 | #define ACPI_SINGLE_NAME 1 |
773 | #define ACPI_NAME_TYPE_MAX 1 | 737 | #define ACPI_NAME_TYPE_MAX 1 |
774 | 738 | ||
775 | |||
776 | /* | 739 | /* |
777 | * Structure and flags for acpi_get_system_info | 740 | * Structure and flags for acpi_get_system_info |
778 | */ | 741 | */ |
@@ -781,139 +744,106 @@ struct acpi_buffer | |||
781 | #define ACPI_SYS_MODE_LEGACY 0x0002 | 744 | #define ACPI_SYS_MODE_LEGACY 0x0002 |
782 | #define ACPI_SYS_MODES_MASK 0x0003 | 745 | #define ACPI_SYS_MODES_MASK 0x0003 |
783 | 746 | ||
784 | |||
785 | /* | 747 | /* |
786 | * ACPI Table Info. One per ACPI table _type_ | 748 | * ACPI Table Info. One per ACPI table _type_ |
787 | */ | 749 | */ |
788 | struct acpi_table_info | 750 | struct acpi_table_info { |
789 | { | 751 | u32 count; |
790 | u32 count; | ||
791 | }; | 752 | }; |
792 | 753 | ||
793 | |||
794 | /* | 754 | /* |
795 | * System info returned by acpi_get_system_info() | 755 | * System info returned by acpi_get_system_info() |
796 | */ | 756 | */ |
797 | struct acpi_system_info | 757 | struct acpi_system_info { |
798 | { | 758 | u32 acpi_ca_version; |
799 | u32 acpi_ca_version; | 759 | u32 flags; |
800 | u32 flags; | 760 | u32 timer_resolution; |
801 | u32 timer_resolution; | 761 | u32 reserved1; |
802 | u32 reserved1; | 762 | u32 reserved2; |
803 | u32 reserved2; | 763 | u32 debug_level; |
804 | u32 debug_level; | 764 | u32 debug_layer; |
805 | u32 debug_layer; | 765 | u32 num_table_types; |
806 | u32 num_table_types; | 766 | struct acpi_table_info table_info[NUM_ACPI_TABLE_TYPES]; |
807 | struct acpi_table_info table_info [NUM_ACPI_TABLE_TYPES]; | ||
808 | }; | 767 | }; |
809 | 768 | ||
810 | |||
811 | /* | 769 | /* |
812 | * Types specific to the OS service interfaces | 770 | * Types specific to the OS service interfaces |
813 | */ | 771 | */ |
814 | typedef u32 | 772 | typedef u32(ACPI_SYSTEM_XFACE * acpi_osd_handler) (void *context); |
815 | (ACPI_SYSTEM_XFACE *acpi_osd_handler) ( | ||
816 | void *context); | ||
817 | 773 | ||
818 | typedef void | 774 | typedef void |
819 | (ACPI_SYSTEM_XFACE *acpi_osd_exec_callback) ( | 775 | (ACPI_SYSTEM_XFACE * acpi_osd_exec_callback) (void *context); |
820 | void *context); | ||
821 | 776 | ||
822 | /* | 777 | /* |
823 | * Various handlers and callback procedures | 778 | * Various handlers and callback procedures |
824 | */ | 779 | */ |
825 | typedef | 780 | typedef u32(*acpi_event_handler) (void *context); |
826 | u32 (*acpi_event_handler) ( | ||
827 | void *context); | ||
828 | 781 | ||
829 | typedef | 782 | typedef |
830 | void (*acpi_notify_handler) ( | 783 | void (*acpi_notify_handler) (acpi_handle device, u32 value, void *context); |
831 | acpi_handle device, | ||
832 | u32 value, | ||
833 | void *context); | ||
834 | 784 | ||
835 | typedef | 785 | typedef |
836 | void (*acpi_object_handler) ( | 786 | void (*acpi_object_handler) (acpi_handle object, u32 function, void *data); |
837 | acpi_handle object, | ||
838 | u32 function, | ||
839 | void *data); | ||
840 | 787 | ||
841 | typedef | 788 | typedef acpi_status(*acpi_init_handler) (acpi_handle object, u32 function); |
842 | acpi_status (*acpi_init_handler) ( | ||
843 | acpi_handle object, | ||
844 | u32 function); | ||
845 | 789 | ||
846 | #define ACPI_INIT_DEVICE_INI 1 | 790 | #define ACPI_INIT_DEVICE_INI 1 |
847 | 791 | ||
848 | typedef | 792 | typedef |
849 | acpi_status (*acpi_exception_handler) ( | 793 | acpi_status(*acpi_exception_handler) (acpi_status aml_status, |
850 | acpi_status aml_status, | 794 | acpi_name name, |
851 | acpi_name name, | 795 | u16 opcode, |
852 | u16 opcode, | 796 | u32 aml_offset, void *context); |
853 | u32 aml_offset, | ||
854 | void *context); | ||
855 | |||
856 | 797 | ||
857 | /* Address Spaces (For Operation Regions) */ | 798 | /* Address Spaces (For Operation Regions) */ |
858 | 799 | ||
859 | typedef | 800 | typedef |
860 | acpi_status (*acpi_adr_space_handler) ( | 801 | acpi_status(*acpi_adr_space_handler) (u32 function, |
861 | u32 function, | 802 | acpi_physical_address address, |
862 | acpi_physical_address address, | 803 | u32 bit_width, |
863 | u32 bit_width, | 804 | acpi_integer * value, |
864 | acpi_integer *value, | 805 | void *handler_context, |
865 | void *handler_context, | 806 | void *region_context); |
866 | void *region_context); | ||
867 | 807 | ||
868 | #define ACPI_DEFAULT_HANDLER NULL | 808 | #define ACPI_DEFAULT_HANDLER NULL |
869 | 809 | ||
870 | |||
871 | typedef | 810 | typedef |
872 | acpi_status (*acpi_adr_space_setup) ( | 811 | acpi_status(*acpi_adr_space_setup) (acpi_handle region_handle, |
873 | acpi_handle region_handle, | 812 | u32 function, |
874 | u32 function, | 813 | void *handler_context, |
875 | void *handler_context, | 814 | void **region_context); |
876 | void **region_context); | ||
877 | 815 | ||
878 | #define ACPI_REGION_ACTIVATE 0 | 816 | #define ACPI_REGION_ACTIVATE 0 |
879 | #define ACPI_REGION_DEACTIVATE 1 | 817 | #define ACPI_REGION_DEACTIVATE 1 |
880 | 818 | ||
881 | typedef | 819 | typedef |
882 | acpi_status (*acpi_walk_callback) ( | 820 | acpi_status(*acpi_walk_callback) (acpi_handle obj_handle, |
883 | acpi_handle obj_handle, | 821 | u32 nesting_level, |
884 | u32 nesting_level, | 822 | void *context, void **return_value); |
885 | void *context, | ||
886 | void **return_value); | ||
887 | |||
888 | 823 | ||
889 | /* Interrupt handler return values */ | 824 | /* Interrupt handler return values */ |
890 | 825 | ||
891 | #define ACPI_INTERRUPT_NOT_HANDLED 0x00 | 826 | #define ACPI_INTERRUPT_NOT_HANDLED 0x00 |
892 | #define ACPI_INTERRUPT_HANDLED 0x01 | 827 | #define ACPI_INTERRUPT_HANDLED 0x01 |
893 | 828 | ||
894 | |||
895 | /* Common string version of device HIDs and UIDs */ | 829 | /* Common string version of device HIDs and UIDs */ |
896 | 830 | ||
897 | struct acpi_device_id | 831 | struct acpi_device_id { |
898 | { | 832 | char value[ACPI_DEVICE_ID_LENGTH]; |
899 | char value[ACPI_DEVICE_ID_LENGTH]; | ||
900 | }; | 833 | }; |
901 | 834 | ||
902 | /* Common string version of device CIDs */ | 835 | /* Common string version of device CIDs */ |
903 | 836 | ||
904 | struct acpi_compatible_id | 837 | struct acpi_compatible_id { |
905 | { | 838 | char value[ACPI_MAX_CID_LENGTH]; |
906 | char value[ACPI_MAX_CID_LENGTH]; | ||
907 | }; | 839 | }; |
908 | 840 | ||
909 | struct acpi_compatible_id_list | 841 | struct acpi_compatible_id_list { |
910 | { | 842 | u32 count; |
911 | u32 count; | 843 | u32 size; |
912 | u32 size; | 844 | struct acpi_compatible_id id[1]; |
913 | struct acpi_compatible_id id[1]; | ||
914 | }; | 845 | }; |
915 | 846 | ||
916 | |||
917 | /* Structure and flags for acpi_get_object_info */ | 847 | /* Structure and flags for acpi_get_object_info */ |
918 | 848 | ||
919 | #define ACPI_VALID_STA 0x0001 | 849 | #define ACPI_VALID_STA 0x0001 |
@@ -923,55 +853,45 @@ struct acpi_compatible_id_list | |||
923 | #define ACPI_VALID_CID 0x0010 | 853 | #define ACPI_VALID_CID 0x0010 |
924 | #define ACPI_VALID_SXDS 0x0020 | 854 | #define ACPI_VALID_SXDS 0x0020 |
925 | 855 | ||
926 | |||
927 | #define ACPI_COMMON_OBJ_INFO \ | 856 | #define ACPI_COMMON_OBJ_INFO \ |
928 | acpi_object_type type; /* ACPI object type */ \ | 857 | acpi_object_type type; /* ACPI object type */ \ |
929 | acpi_name name /* ACPI object Name */ | 858 | acpi_name name /* ACPI object Name */ |
930 | |||
931 | 859 | ||
932 | struct acpi_obj_info_header | 860 | struct acpi_obj_info_header { |
933 | { | ||
934 | ACPI_COMMON_OBJ_INFO; | 861 | ACPI_COMMON_OBJ_INFO; |
935 | }; | 862 | }; |
936 | 863 | ||
937 | |||
938 | /* Structure returned from Get Object Info */ | 864 | /* Structure returned from Get Object Info */ |
939 | 865 | ||
940 | struct acpi_device_info | 866 | struct acpi_device_info { |
941 | { | ||
942 | ACPI_COMMON_OBJ_INFO; | 867 | ACPI_COMMON_OBJ_INFO; |
943 | 868 | ||
944 | u32 valid; /* Indicates which fields below are valid */ | 869 | u32 valid; /* Indicates which fields below are valid */ |
945 | u32 current_status; /* _STA value */ | 870 | u32 current_status; /* _STA value */ |
946 | acpi_integer address; /* _ADR value if any */ | 871 | acpi_integer address; /* _ADR value if any */ |
947 | struct acpi_device_id hardware_id; /* _HID value if any */ | 872 | struct acpi_device_id hardware_id; /* _HID value if any */ |
948 | struct acpi_device_id unique_id; /* _UID value if any */ | 873 | struct acpi_device_id unique_id; /* _UID value if any */ |
949 | u8 highest_dstates[4]; /* _sx_d values: 0xFF indicates not valid */ | 874 | u8 highest_dstates[4]; /* _sx_d values: 0xFF indicates not valid */ |
950 | struct acpi_compatible_id_list compatibility_id; /* List of _CIDs if any */ | 875 | struct acpi_compatible_id_list compatibility_id; /* List of _CIDs if any */ |
951 | }; | 876 | }; |
952 | 877 | ||
953 | |||
954 | /* Context structs for address space handlers */ | 878 | /* Context structs for address space handlers */ |
955 | 879 | ||
956 | struct acpi_pci_id | 880 | struct acpi_pci_id { |
957 | { | 881 | u16 segment; |
958 | u16 segment; | 882 | u16 bus; |
959 | u16 bus; | 883 | u16 device; |
960 | u16 device; | 884 | u16 function; |
961 | u16 function; | ||
962 | }; | 885 | }; |
963 | 886 | ||
964 | 887 | struct acpi_mem_space_context { | |
965 | struct acpi_mem_space_context | 888 | u32 length; |
966 | { | 889 | acpi_physical_address address; |
967 | u32 length; | 890 | acpi_physical_address mapped_physical_address; |
968 | acpi_physical_address address; | 891 | u8 *mapped_logical_address; |
969 | acpi_physical_address mapped_physical_address; | 892 | acpi_size mapped_length; |
970 | u8 *mapped_logical_address; | ||
971 | acpi_size mapped_length; | ||
972 | }; | 893 | }; |
973 | 894 | ||
974 | |||
975 | /* | 895 | /* |
976 | * Definitions for Resource Attributes | 896 | * Definitions for Resource Attributes |
977 | */ | 897 | */ |
@@ -1001,8 +921,8 @@ struct acpi_mem_space_context | |||
1001 | /* | 921 | /* |
1002 | * IO Port Descriptor Decode | 922 | * IO Port Descriptor Decode |
1003 | */ | 923 | */ |
1004 | #define ACPI_DECODE_10 (u8) 0x00 /* 10-bit IO address decode */ | 924 | #define ACPI_DECODE_10 (u8) 0x00 /* 10-bit IO address decode */ |
1005 | #define ACPI_DECODE_16 (u8) 0x01 /* 16-bit IO address decode */ | 925 | #define ACPI_DECODE_16 (u8) 0x01 /* 16-bit IO address decode */ |
1006 | 926 | ||
1007 | /* | 927 | /* |
1008 | * IRQ Attributes | 928 | * IRQ Attributes |
@@ -1054,32 +974,28 @@ struct acpi_mem_space_context | |||
1054 | #define ACPI_PRODUCER (u8) 0x00 | 974 | #define ACPI_PRODUCER (u8) 0x00 |
1055 | #define ACPI_CONSUMER (u8) 0x01 | 975 | #define ACPI_CONSUMER (u8) 0x01 |
1056 | 976 | ||
1057 | |||
1058 | /* | 977 | /* |
1059 | * Structures used to describe device resources | 978 | * Structures used to describe device resources |
1060 | */ | 979 | */ |
1061 | struct acpi_resource_irq | 980 | struct acpi_resource_irq { |
1062 | { | 981 | u32 edge_level; |
1063 | u32 edge_level; | 982 | u32 active_high_low; |
1064 | u32 active_high_low; | 983 | u32 shared_exclusive; |
1065 | u32 shared_exclusive; | 984 | u32 number_of_interrupts; |
1066 | u32 number_of_interrupts; | 985 | u32 interrupts[1]; |
1067 | u32 interrupts[1]; | ||
1068 | }; | 986 | }; |
1069 | 987 | ||
1070 | struct acpi_resource_dma | 988 | struct acpi_resource_dma { |
1071 | { | 989 | u32 type; |
1072 | u32 type; | 990 | u32 bus_master; |
1073 | u32 bus_master; | 991 | u32 transfer; |
1074 | u32 transfer; | 992 | u32 number_of_channels; |
1075 | u32 number_of_channels; | 993 | u32 channels[1]; |
1076 | u32 channels[1]; | ||
1077 | }; | 994 | }; |
1078 | 995 | ||
1079 | struct acpi_resource_start_dpf | 996 | struct acpi_resource_start_dpf { |
1080 | { | 997 | u32 compatibility_priority; |
1081 | u32 compatibility_priority; | 998 | u32 performance_robustness; |
1082 | u32 performance_robustness; | ||
1083 | }; | 999 | }; |
1084 | 1000 | ||
1085 | /* | 1001 | /* |
@@ -1087,150 +1003,133 @@ struct acpi_resource_start_dpf | |||
1087 | * needed because it has no fields | 1003 | * needed because it has no fields |
1088 | */ | 1004 | */ |
1089 | 1005 | ||
1090 | struct acpi_resource_io | 1006 | struct acpi_resource_io { |
1091 | { | 1007 | u32 io_decode; |
1092 | u32 io_decode; | 1008 | u32 min_base_address; |
1093 | u32 min_base_address; | 1009 | u32 max_base_address; |
1094 | u32 max_base_address; | 1010 | u32 alignment; |
1095 | u32 alignment; | 1011 | u32 range_length; |
1096 | u32 range_length; | ||
1097 | }; | 1012 | }; |
1098 | 1013 | ||
1099 | struct acpi_resource_fixed_io | 1014 | struct acpi_resource_fixed_io { |
1100 | { | 1015 | u32 base_address; |
1101 | u32 base_address; | 1016 | u32 range_length; |
1102 | u32 range_length; | ||
1103 | }; | 1017 | }; |
1104 | 1018 | ||
1105 | struct acpi_resource_vendor | 1019 | struct acpi_resource_vendor { |
1106 | { | 1020 | u32 length; |
1107 | u32 length; | 1021 | u8 reserved[1]; |
1108 | u8 reserved[1]; | ||
1109 | }; | 1022 | }; |
1110 | 1023 | ||
1111 | struct acpi_resource_end_tag | 1024 | struct acpi_resource_end_tag { |
1112 | { | 1025 | u8 checksum; |
1113 | u8 checksum; | ||
1114 | }; | 1026 | }; |
1115 | 1027 | ||
1116 | struct acpi_resource_mem24 | 1028 | struct acpi_resource_mem24 { |
1117 | { | 1029 | u32 read_write_attribute; |
1118 | u32 read_write_attribute; | 1030 | u32 min_base_address; |
1119 | u32 min_base_address; | 1031 | u32 max_base_address; |
1120 | u32 max_base_address; | 1032 | u32 alignment; |
1121 | u32 alignment; | 1033 | u32 range_length; |
1122 | u32 range_length; | ||
1123 | }; | 1034 | }; |
1124 | 1035 | ||
1125 | struct acpi_resource_mem32 | 1036 | struct acpi_resource_mem32 { |
1126 | { | 1037 | u32 read_write_attribute; |
1127 | u32 read_write_attribute; | 1038 | u32 min_base_address; |
1128 | u32 min_base_address; | 1039 | u32 max_base_address; |
1129 | u32 max_base_address; | 1040 | u32 alignment; |
1130 | u32 alignment; | 1041 | u32 range_length; |
1131 | u32 range_length; | ||
1132 | }; | 1042 | }; |
1133 | 1043 | ||
1134 | struct acpi_resource_fixed_mem32 | 1044 | struct acpi_resource_fixed_mem32 { |
1135 | { | 1045 | u32 read_write_attribute; |
1136 | u32 read_write_attribute; | 1046 | u32 range_base_address; |
1137 | u32 range_base_address; | 1047 | u32 range_length; |
1138 | u32 range_length; | ||
1139 | }; | 1048 | }; |
1140 | 1049 | ||
1141 | struct acpi_memory_attribute | 1050 | struct acpi_memory_attribute { |
1142 | { | 1051 | u16 cache_attribute; |
1143 | u16 cache_attribute; | 1052 | u16 read_write_attribute; |
1144 | u16 read_write_attribute; | ||
1145 | }; | 1053 | }; |
1146 | 1054 | ||
1147 | struct acpi_io_attribute | 1055 | struct acpi_io_attribute { |
1148 | { | 1056 | u16 range_attribute; |
1149 | u16 range_attribute; | 1057 | u16 translation_attribute; |
1150 | u16 translation_attribute; | ||
1151 | }; | 1058 | }; |
1152 | 1059 | ||
1153 | struct acpi_bus_attribute | 1060 | struct acpi_bus_attribute { |
1154 | { | 1061 | u16 reserved1; |
1155 | u16 reserved1; | 1062 | u16 reserved2; |
1156 | u16 reserved2; | ||
1157 | }; | 1063 | }; |
1158 | 1064 | ||
1159 | union acpi_resource_attribute | 1065 | union acpi_resource_attribute { |
1160 | { | 1066 | struct acpi_memory_attribute memory; |
1161 | struct acpi_memory_attribute memory; | 1067 | struct acpi_io_attribute io; |
1162 | struct acpi_io_attribute io; | 1068 | struct acpi_bus_attribute bus; |
1163 | struct acpi_bus_attribute bus; | ||
1164 | }; | 1069 | }; |
1165 | 1070 | ||
1166 | struct acpi_resource_source | 1071 | struct acpi_resource_source { |
1167 | { | 1072 | u32 index; |
1168 | u32 index; | 1073 | u32 string_length; |
1169 | u32 string_length; | 1074 | char *string_ptr; |
1170 | char *string_ptr; | ||
1171 | }; | 1075 | }; |
1172 | 1076 | ||
1173 | struct acpi_resource_address16 | 1077 | struct acpi_resource_address16 { |
1174 | { | 1078 | u32 resource_type; |
1175 | u32 resource_type; | 1079 | u32 producer_consumer; |
1176 | u32 producer_consumer; | 1080 | u32 decode; |
1177 | u32 decode; | 1081 | u32 min_address_fixed; |
1178 | u32 min_address_fixed; | 1082 | u32 max_address_fixed; |
1179 | u32 max_address_fixed; | 1083 | union acpi_resource_attribute attribute; |
1180 | union acpi_resource_attribute attribute; | 1084 | u32 granularity; |
1181 | u32 granularity; | 1085 | u32 min_address_range; |
1182 | u32 min_address_range; | 1086 | u32 max_address_range; |
1183 | u32 max_address_range; | 1087 | u32 address_translation_offset; |
1184 | u32 address_translation_offset; | 1088 | u32 address_length; |
1185 | u32 address_length; | 1089 | struct acpi_resource_source resource_source; |
1186 | struct acpi_resource_source resource_source; | ||
1187 | }; | 1090 | }; |
1188 | 1091 | ||
1189 | struct acpi_resource_address32 | 1092 | struct acpi_resource_address32 { |
1190 | { | 1093 | u32 resource_type; |
1191 | u32 resource_type; | 1094 | u32 producer_consumer; |
1192 | u32 producer_consumer; | 1095 | u32 decode; |
1193 | u32 decode; | 1096 | u32 min_address_fixed; |
1194 | u32 min_address_fixed; | 1097 | u32 max_address_fixed; |
1195 | u32 max_address_fixed; | 1098 | union acpi_resource_attribute attribute; |
1196 | union acpi_resource_attribute attribute; | 1099 | u32 granularity; |
1197 | u32 granularity; | 1100 | u32 min_address_range; |
1198 | u32 min_address_range; | 1101 | u32 max_address_range; |
1199 | u32 max_address_range; | 1102 | u32 address_translation_offset; |
1200 | u32 address_translation_offset; | 1103 | u32 address_length; |
1201 | u32 address_length; | 1104 | struct acpi_resource_source resource_source; |
1202 | struct acpi_resource_source resource_source; | ||
1203 | }; | 1105 | }; |
1204 | 1106 | ||
1205 | struct acpi_resource_address64 | 1107 | struct acpi_resource_address64 { |
1206 | { | 1108 | u32 resource_type; |
1207 | u32 resource_type; | 1109 | u32 producer_consumer; |
1208 | u32 producer_consumer; | 1110 | u32 decode; |
1209 | u32 decode; | 1111 | u32 min_address_fixed; |
1210 | u32 min_address_fixed; | 1112 | u32 max_address_fixed; |
1211 | u32 max_address_fixed; | 1113 | union acpi_resource_attribute attribute; |
1212 | union acpi_resource_attribute attribute; | 1114 | u64 granularity; |
1213 | u64 granularity; | 1115 | u64 min_address_range; |
1214 | u64 min_address_range; | 1116 | u64 max_address_range; |
1215 | u64 max_address_range; | 1117 | u64 address_translation_offset; |
1216 | u64 address_translation_offset; | 1118 | u64 address_length; |
1217 | u64 address_length; | 1119 | u64 type_specific_attributes; |
1218 | u64 type_specific_attributes; | 1120 | struct acpi_resource_source resource_source; |
1219 | struct acpi_resource_source resource_source; | ||
1220 | }; | 1121 | }; |
1221 | 1122 | ||
1222 | struct acpi_resource_ext_irq | 1123 | struct acpi_resource_ext_irq { |
1223 | { | 1124 | u32 producer_consumer; |
1224 | u32 producer_consumer; | 1125 | u32 edge_level; |
1225 | u32 edge_level; | 1126 | u32 active_high_low; |
1226 | u32 active_high_low; | 1127 | u32 shared_exclusive; |
1227 | u32 shared_exclusive; | 1128 | u32 number_of_interrupts; |
1228 | u32 number_of_interrupts; | 1129 | struct acpi_resource_source resource_source; |
1229 | struct acpi_resource_source resource_source; | 1130 | u32 interrupts[1]; |
1230 | u32 interrupts[1]; | ||
1231 | }; | 1131 | }; |
1232 | 1132 | ||
1233 | |||
1234 | /* ACPI_RESOURCE_TYPEs */ | 1133 | /* ACPI_RESOURCE_TYPEs */ |
1235 | 1134 | ||
1236 | #define ACPI_RSTYPE_IRQ 0 | 1135 | #define ACPI_RSTYPE_IRQ 0 |
@@ -1249,35 +1148,33 @@ struct acpi_resource_ext_irq | |||
1249 | #define ACPI_RSTYPE_ADDRESS64 13 | 1148 | #define ACPI_RSTYPE_ADDRESS64 13 |
1250 | #define ACPI_RSTYPE_EXT_IRQ 14 | 1149 | #define ACPI_RSTYPE_EXT_IRQ 14 |
1251 | 1150 | ||
1252 | typedef u32 acpi_resource_type; | 1151 | typedef u32 acpi_resource_type; |
1253 | 1152 | ||
1254 | union acpi_resource_data | 1153 | union acpi_resource_data { |
1255 | { | 1154 | struct acpi_resource_irq irq; |
1256 | struct acpi_resource_irq irq; | 1155 | struct acpi_resource_dma dma; |
1257 | struct acpi_resource_dma dma; | 1156 | struct acpi_resource_start_dpf start_dpf; |
1258 | struct acpi_resource_start_dpf start_dpf; | 1157 | struct acpi_resource_io io; |
1259 | struct acpi_resource_io io; | 1158 | struct acpi_resource_fixed_io fixed_io; |
1260 | struct acpi_resource_fixed_io fixed_io; | 1159 | struct acpi_resource_vendor vendor_specific; |
1261 | struct acpi_resource_vendor vendor_specific; | 1160 | struct acpi_resource_end_tag end_tag; |
1262 | struct acpi_resource_end_tag end_tag; | 1161 | struct acpi_resource_mem24 memory24; |
1263 | struct acpi_resource_mem24 memory24; | 1162 | struct acpi_resource_mem32 memory32; |
1264 | struct acpi_resource_mem32 memory32; | 1163 | struct acpi_resource_fixed_mem32 fixed_memory32; |
1265 | struct acpi_resource_fixed_mem32 fixed_memory32; | 1164 | struct acpi_resource_address16 address16; |
1266 | struct acpi_resource_address16 address16; | 1165 | struct acpi_resource_address32 address32; |
1267 | struct acpi_resource_address32 address32; | 1166 | struct acpi_resource_address64 address64; |
1268 | struct acpi_resource_address64 address64; | 1167 | struct acpi_resource_ext_irq extended_irq; |
1269 | struct acpi_resource_ext_irq extended_irq; | ||
1270 | }; | 1168 | }; |
1271 | 1169 | ||
1272 | struct acpi_resource | 1170 | struct acpi_resource { |
1273 | { | 1171 | acpi_resource_type id; |
1274 | acpi_resource_type id; | 1172 | u32 length; |
1275 | u32 length; | 1173 | union acpi_resource_data data; |
1276 | union acpi_resource_data data; | ||
1277 | }; | 1174 | }; |
1278 | 1175 | ||
1279 | #define ACPI_RESOURCE_LENGTH 12 | 1176 | #define ACPI_RESOURCE_LENGTH 12 |
1280 | #define ACPI_RESOURCE_LENGTH_NO_DATA 8 /* Id + Length fields */ | 1177 | #define ACPI_RESOURCE_LENGTH_NO_DATA 8 /* Id + Length fields */ |
1281 | 1178 | ||
1282 | #define ACPI_SIZEOF_RESOURCE(type) (ACPI_RESOURCE_LENGTH_NO_DATA + sizeof (type)) | 1179 | #define ACPI_SIZEOF_RESOURCE(type) (ACPI_RESOURCE_LENGTH_NO_DATA + sizeof (type)) |
1283 | 1180 | ||
@@ -1293,19 +1190,16 @@ struct acpi_resource | |||
1293 | * END: of definitions for Resource Attributes | 1190 | * END: of definitions for Resource Attributes |
1294 | */ | 1191 | */ |
1295 | 1192 | ||
1296 | 1193 | struct acpi_pci_routing_table { | |
1297 | struct acpi_pci_routing_table | 1194 | u32 length; |
1298 | { | 1195 | u32 pin; |
1299 | u32 length; | 1196 | acpi_integer address; /* here for 64-bit alignment */ |
1300 | u32 pin; | 1197 | u32 source_index; |
1301 | acpi_integer address; /* here for 64-bit alignment */ | 1198 | char source[4]; /* pad to 64 bits so sizeof() works in all cases */ |
1302 | u32 source_index; | ||
1303 | char source[4]; /* pad to 64 bits so sizeof() works in all cases */ | ||
1304 | }; | 1199 | }; |
1305 | 1200 | ||
1306 | /* | 1201 | /* |
1307 | * END: of definitions for PCI Routing tables | 1202 | * END: of definitions for PCI Routing tables |
1308 | */ | 1203 | */ |
1309 | 1204 | ||
1310 | 1205 | #endif /* __ACTYPES_H__ */ | |
1311 | #endif /* __ACTYPES_H__ */ | ||
diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h index 0e7b0a3e3b5e..c1086452696e 100644 --- a/include/acpi/acutils.h +++ b/include/acpi/acutils.h | |||
@@ -44,20 +44,17 @@ | |||
44 | #ifndef _ACUTILS_H | 44 | #ifndef _ACUTILS_H |
45 | #define _ACUTILS_H | 45 | #define _ACUTILS_H |
46 | 46 | ||
47 | |||
48 | typedef | 47 | typedef |
49 | acpi_status (*acpi_pkg_callback) ( | 48 | acpi_status(*acpi_pkg_callback) (u8 object_type, |
50 | u8 object_type, | 49 | union acpi_operand_object * source_object, |
51 | union acpi_operand_object *source_object, | 50 | union acpi_generic_state * state, |
52 | union acpi_generic_state *state, | 51 | void *context); |
53 | void *context); | 52 | |
54 | 53 | struct acpi_pkg_info { | |
55 | struct acpi_pkg_info | 54 | u8 *free_space; |
56 | { | 55 | acpi_size length; |
57 | u8 *free_space; | 56 | u32 object_space; |
58 | acpi_size length; | 57 | u32 num_packages; |
59 | u32 object_space; | ||
60 | u32 num_packages; | ||
61 | }; | 58 | }; |
62 | 59 | ||
63 | #define REF_INCREMENT (u16) 0 | 60 | #define REF_INCREMENT (u16) 0 |
@@ -71,163 +68,89 @@ struct acpi_pkg_info | |||
71 | #define DB_DWORD_DISPLAY 4 | 68 | #define DB_DWORD_DISPLAY 4 |
72 | #define DB_QWORD_DISPLAY 8 | 69 | #define DB_QWORD_DISPLAY 8 |
73 | 70 | ||
74 | |||
75 | /* | 71 | /* |
76 | * utglobal - Global data structures and procedures | 72 | * utglobal - Global data structures and procedures |
77 | */ | 73 | */ |
78 | void | 74 | void acpi_ut_init_globals(void); |
79 | acpi_ut_init_globals ( | ||
80 | void); | ||
81 | 75 | ||
82 | #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) | 76 | #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) |
83 | 77 | ||
84 | char * | 78 | char *acpi_ut_get_mutex_name(u32 mutex_id); |
85 | acpi_ut_get_mutex_name ( | ||
86 | u32 mutex_id); | ||
87 | 79 | ||
88 | #endif | 80 | #endif |
89 | 81 | ||
90 | char * | 82 | char *acpi_ut_get_type_name(acpi_object_type type); |
91 | acpi_ut_get_type_name ( | ||
92 | acpi_object_type type); | ||
93 | |||
94 | char * | ||
95 | acpi_ut_get_node_name ( | ||
96 | void *object); | ||
97 | 83 | ||
98 | char * | 84 | char *acpi_ut_get_node_name(void *object); |
99 | acpi_ut_get_descriptor_name ( | ||
100 | void *object); | ||
101 | 85 | ||
102 | char * | 86 | char *acpi_ut_get_descriptor_name(void *object); |
103 | acpi_ut_get_object_type_name ( | ||
104 | union acpi_operand_object *obj_desc); | ||
105 | 87 | ||
106 | char * | 88 | char *acpi_ut_get_object_type_name(union acpi_operand_object *obj_desc); |
107 | acpi_ut_get_region_name ( | ||
108 | u8 space_id); | ||
109 | 89 | ||
110 | char * | 90 | char *acpi_ut_get_region_name(u8 space_id); |
111 | acpi_ut_get_event_name ( | ||
112 | u32 event_id); | ||
113 | 91 | ||
114 | char | 92 | char *acpi_ut_get_event_name(u32 event_id); |
115 | acpi_ut_hex_to_ascii_char ( | ||
116 | acpi_integer integer, | ||
117 | u32 position); | ||
118 | 93 | ||
119 | u8 | 94 | char acpi_ut_hex_to_ascii_char(acpi_integer integer, u32 position); |
120 | acpi_ut_valid_object_type ( | ||
121 | acpi_object_type type); | ||
122 | 95 | ||
96 | u8 acpi_ut_valid_object_type(acpi_object_type type); | ||
123 | 97 | ||
124 | /* | 98 | /* |
125 | * utinit - miscellaneous initialization and shutdown | 99 | * utinit - miscellaneous initialization and shutdown |
126 | */ | 100 | */ |
127 | acpi_status | 101 | acpi_status acpi_ut_hardware_initialize(void); |
128 | acpi_ut_hardware_initialize ( | ||
129 | void); | ||
130 | |||
131 | void | ||
132 | acpi_ut_subsystem_shutdown ( | ||
133 | void); | ||
134 | 102 | ||
135 | acpi_status | 103 | void acpi_ut_subsystem_shutdown(void); |
136 | acpi_ut_validate_fadt ( | ||
137 | void); | ||
138 | 104 | ||
105 | acpi_status acpi_ut_validate_fadt(void); | ||
139 | 106 | ||
140 | /* | 107 | /* |
141 | * utclib - Local implementations of C library functions | 108 | * utclib - Local implementations of C library functions |
142 | */ | 109 | */ |
143 | #ifndef ACPI_USE_SYSTEM_CLIBRARY | 110 | #ifndef ACPI_USE_SYSTEM_CLIBRARY |
144 | 111 | ||
145 | acpi_size | 112 | acpi_size acpi_ut_strlen(const char *string); |
146 | acpi_ut_strlen ( | 113 | |
147 | const char *string); | 114 | char *acpi_ut_strcpy(char *dst_string, const char *src_string); |
148 | 115 | ||
149 | char * | 116 | char *acpi_ut_strncpy(char *dst_string, |
150 | acpi_ut_strcpy ( | 117 | const char *src_string, acpi_size count); |
151 | char *dst_string, | 118 | |
152 | const char *src_string); | 119 | int acpi_ut_memcmp(const char *buffer1, const char *buffer2, acpi_size count); |
153 | 120 | ||
154 | char * | 121 | int acpi_ut_strncmp(const char *string1, const char *string2, acpi_size count); |
155 | acpi_ut_strncpy ( | 122 | |
156 | char *dst_string, | 123 | int acpi_ut_strcmp(const char *string1, const char *string2); |
157 | const char *src_string, | 124 | |
158 | acpi_size count); | 125 | char *acpi_ut_strcat(char *dst_string, const char *src_string); |
159 | 126 | ||
160 | int | 127 | char *acpi_ut_strncat(char *dst_string, |
161 | acpi_ut_memcmp ( | 128 | const char *src_string, acpi_size count); |
162 | const char *buffer1, | 129 | |
163 | const char *buffer2, | 130 | u32 acpi_ut_strtoul(const char *string, char **terminator, u32 base); |
164 | acpi_size count); | 131 | |
165 | 132 | char *acpi_ut_strstr(char *string1, char *string2); | |
166 | int | 133 | |
167 | acpi_ut_strncmp ( | 134 | void *acpi_ut_memcpy(void *dest, const void *src, acpi_size count); |
168 | const char *string1, | 135 | |
169 | const char *string2, | 136 | void *acpi_ut_memset(void *dest, acpi_native_uint value, acpi_size count); |
170 | acpi_size count); | 137 | |
171 | 138 | int acpi_ut_to_upper(int c); | |
172 | int | 139 | |
173 | acpi_ut_strcmp ( | 140 | int acpi_ut_to_lower(int c); |
174 | const char *string1, | ||
175 | const char *string2); | ||
176 | |||
177 | char * | ||
178 | acpi_ut_strcat ( | ||
179 | char *dst_string, | ||
180 | const char *src_string); | ||
181 | |||
182 | char * | ||
183 | acpi_ut_strncat ( | ||
184 | char *dst_string, | ||
185 | const char *src_string, | ||
186 | acpi_size count); | ||
187 | |||
188 | u32 | ||
189 | acpi_ut_strtoul ( | ||
190 | const char *string, | ||
191 | char **terminator, | ||
192 | u32 base); | ||
193 | |||
194 | char * | ||
195 | acpi_ut_strstr ( | ||
196 | char *string1, | ||
197 | char *string2); | ||
198 | |||
199 | void * | ||
200 | acpi_ut_memcpy ( | ||
201 | void *dest, | ||
202 | const void *src, | ||
203 | acpi_size count); | ||
204 | |||
205 | void * | ||
206 | acpi_ut_memset ( | ||
207 | void *dest, | ||
208 | acpi_native_uint value, | ||
209 | acpi_size count); | ||
210 | |||
211 | int | ||
212 | acpi_ut_to_upper ( | ||
213 | int c); | ||
214 | |||
215 | int | ||
216 | acpi_ut_to_lower ( | ||
217 | int c); | ||
218 | 141 | ||
219 | extern const u8 _acpi_ctype[]; | 142 | extern const u8 _acpi_ctype[]; |
220 | 143 | ||
221 | #define _ACPI_XA 0x00 /* extra alphabetic - not supported */ | 144 | #define _ACPI_XA 0x00 /* extra alphabetic - not supported */ |
222 | #define _ACPI_XS 0x40 /* extra space */ | 145 | #define _ACPI_XS 0x40 /* extra space */ |
223 | #define _ACPI_BB 0x00 /* BEL, BS, etc. - not supported */ | 146 | #define _ACPI_BB 0x00 /* BEL, BS, etc. - not supported */ |
224 | #define _ACPI_CN 0x20 /* CR, FF, HT, NL, VT */ | 147 | #define _ACPI_CN 0x20 /* CR, FF, HT, NL, VT */ |
225 | #define _ACPI_DI 0x04 /* '0'-'9' */ | 148 | #define _ACPI_DI 0x04 /* '0'-'9' */ |
226 | #define _ACPI_LO 0x02 /* 'a'-'z' */ | 149 | #define _ACPI_LO 0x02 /* 'a'-'z' */ |
227 | #define _ACPI_PU 0x10 /* punctuation */ | 150 | #define _ACPI_PU 0x10 /* punctuation */ |
228 | #define _ACPI_SP 0x08 /* space */ | 151 | #define _ACPI_SP 0x08 /* space */ |
229 | #define _ACPI_UP 0x01 /* 'A'-'Z' */ | 152 | #define _ACPI_UP 0x01 /* 'A'-'Z' */ |
230 | #define _ACPI_XD 0x80 /* '0'-'9', 'A'-'F', 'a'-'f' */ | 153 | #define _ACPI_XD 0x80 /* '0'-'9', 'A'-'F', 'a'-'f' */ |
231 | 154 | ||
232 | #define ACPI_IS_DIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_DI)) | 155 | #define ACPI_IS_DIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_DI)) |
233 | #define ACPI_IS_SPACE(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_SP)) | 156 | #define ACPI_IS_SPACE(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_SP)) |
@@ -238,517 +161,323 @@ extern const u8 _acpi_ctype[]; | |||
238 | #define ACPI_IS_ALPHA(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP)) | 161 | #define ACPI_IS_ALPHA(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP)) |
239 | #define ACPI_IS_ASCII(c) ((c) < 0x80) | 162 | #define ACPI_IS_ASCII(c) ((c) < 0x80) |
240 | 163 | ||
241 | #endif /* ACPI_USE_SYSTEM_CLIBRARY */ | 164 | #endif /* ACPI_USE_SYSTEM_CLIBRARY */ |
242 | |||
243 | 165 | ||
244 | /* | 166 | /* |
245 | * utcopy - Object construction and conversion interfaces | 167 | * utcopy - Object construction and conversion interfaces |
246 | */ | 168 | */ |
247 | acpi_status | 169 | acpi_status |
248 | acpi_ut_build_simple_object( | 170 | acpi_ut_build_simple_object(union acpi_operand_object *obj, |
249 | union acpi_operand_object *obj, | 171 | union acpi_object *user_obj, |
250 | union acpi_object *user_obj, | 172 | u8 * data_space, u32 * buffer_space_used); |
251 | u8 *data_space, | ||
252 | u32 *buffer_space_used); | ||
253 | 173 | ||
254 | acpi_status | 174 | acpi_status |
255 | acpi_ut_build_package_object ( | 175 | acpi_ut_build_package_object(union acpi_operand_object *obj, |
256 | union acpi_operand_object *obj, | 176 | u8 * buffer, u32 * space_used); |
257 | u8 *buffer, | ||
258 | u32 *space_used); | ||
259 | 177 | ||
260 | acpi_status | 178 | acpi_status |
261 | acpi_ut_copy_iobject_to_eobject ( | 179 | acpi_ut_copy_iobject_to_eobject(union acpi_operand_object *obj, |
262 | union acpi_operand_object *obj, | 180 | struct acpi_buffer *ret_buffer); |
263 | struct acpi_buffer *ret_buffer); | ||
264 | 181 | ||
265 | acpi_status | 182 | acpi_status |
266 | acpi_ut_copy_eobject_to_iobject ( | 183 | acpi_ut_copy_eobject_to_iobject(union acpi_object *obj, |
267 | union acpi_object *obj, | 184 | union acpi_operand_object **internal_obj); |
268 | union acpi_operand_object **internal_obj); | ||
269 | 185 | ||
270 | acpi_status | 186 | acpi_status |
271 | acpi_ut_copy_isimple_to_isimple ( | 187 | acpi_ut_copy_isimple_to_isimple(union acpi_operand_object *source_obj, |
272 | union acpi_operand_object *source_obj, | 188 | union acpi_operand_object *dest_obj); |
273 | union acpi_operand_object *dest_obj); | ||
274 | 189 | ||
275 | acpi_status | 190 | acpi_status |
276 | acpi_ut_copy_iobject_to_iobject ( | 191 | acpi_ut_copy_iobject_to_iobject(union acpi_operand_object *source_desc, |
277 | union acpi_operand_object *source_desc, | 192 | union acpi_operand_object **dest_desc, |
278 | union acpi_operand_object **dest_desc, | 193 | struct acpi_walk_state *walk_state); |
279 | struct acpi_walk_state *walk_state); | ||
280 | |||
281 | 194 | ||
282 | /* | 195 | /* |
283 | * utcreate - Object creation | 196 | * utcreate - Object creation |
284 | */ | 197 | */ |
285 | acpi_status | 198 | acpi_status |
286 | acpi_ut_update_object_reference ( | 199 | acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action); |
287 | union acpi_operand_object *object, | ||
288 | u16 action); | ||
289 | |||
290 | 200 | ||
291 | /* | 201 | /* |
292 | * utdebug - Debug interfaces | 202 | * utdebug - Debug interfaces |
293 | */ | 203 | */ |
294 | void | 204 | void acpi_ut_init_stack_ptr_trace(void); |
295 | acpi_ut_init_stack_ptr_trace ( | ||
296 | void); | ||
297 | 205 | ||
298 | void | 206 | void acpi_ut_track_stack_ptr(void); |
299 | acpi_ut_track_stack_ptr ( | ||
300 | void); | ||
301 | 207 | ||
302 | void | 208 | void |
303 | acpi_ut_trace ( | 209 | acpi_ut_trace(u32 line_number, |
304 | u32 line_number, | 210 | const char *function_name, char *module_name, u32 component_id); |
305 | const char *function_name, | ||
306 | char *module_name, | ||
307 | u32 component_id); | ||
308 | 211 | ||
309 | void | 212 | void |
310 | acpi_ut_trace_ptr ( | 213 | acpi_ut_trace_ptr(u32 line_number, |
311 | u32 line_number, | 214 | const char *function_name, |
312 | const char *function_name, | 215 | char *module_name, u32 component_id, void *pointer); |
313 | char *module_name, | ||
314 | u32 component_id, | ||
315 | void *pointer); | ||
316 | 216 | ||
317 | void | 217 | void |
318 | acpi_ut_trace_u32 ( | 218 | acpi_ut_trace_u32(u32 line_number, |
319 | u32 line_number, | 219 | const char *function_name, |
320 | const char *function_name, | 220 | char *module_name, u32 component_id, u32 integer); |
321 | char *module_name, | ||
322 | u32 component_id, | ||
323 | u32 integer); | ||
324 | 221 | ||
325 | void | 222 | void |
326 | acpi_ut_trace_str ( | 223 | acpi_ut_trace_str(u32 line_number, |
327 | u32 line_number, | 224 | const char *function_name, |
328 | const char *function_name, | 225 | char *module_name, u32 component_id, char *string); |
329 | char *module_name, | ||
330 | u32 component_id, | ||
331 | char *string); | ||
332 | 226 | ||
333 | void | 227 | void |
334 | acpi_ut_exit ( | 228 | acpi_ut_exit(u32 line_number, |
335 | u32 line_number, | 229 | const char *function_name, char *module_name, u32 component_id); |
336 | const char *function_name, | ||
337 | char *module_name, | ||
338 | u32 component_id); | ||
339 | 230 | ||
340 | void | 231 | void |
341 | acpi_ut_status_exit ( | 232 | acpi_ut_status_exit(u32 line_number, |
342 | u32 line_number, | 233 | const char *function_name, |
343 | const char *function_name, | 234 | char *module_name, u32 component_id, acpi_status status); |
344 | char *module_name, | ||
345 | u32 component_id, | ||
346 | acpi_status status); | ||
347 | 235 | ||
348 | void | 236 | void |
349 | acpi_ut_value_exit ( | 237 | acpi_ut_value_exit(u32 line_number, |
350 | u32 line_number, | 238 | const char *function_name, |
351 | const char *function_name, | 239 | char *module_name, u32 component_id, acpi_integer value); |
352 | char *module_name, | ||
353 | u32 component_id, | ||
354 | acpi_integer value); | ||
355 | 240 | ||
356 | void | 241 | void |
357 | acpi_ut_ptr_exit ( | 242 | acpi_ut_ptr_exit(u32 line_number, |
358 | u32 line_number, | 243 | const char *function_name, |
359 | const char *function_name, | 244 | char *module_name, u32 component_id, u8 * ptr); |
360 | char *module_name, | ||
361 | u32 component_id, | ||
362 | u8 *ptr); | ||
363 | 245 | ||
364 | void | 246 | void acpi_ut_report_info(char *module_name, u32 line_number, u32 component_id); |
365 | acpi_ut_report_info ( | ||
366 | char *module_name, | ||
367 | u32 line_number, | ||
368 | u32 component_id); | ||
369 | 247 | ||
370 | void | 248 | void acpi_ut_report_error(char *module_name, u32 line_number, u32 component_id); |
371 | acpi_ut_report_error ( | ||
372 | char *module_name, | ||
373 | u32 line_number, | ||
374 | u32 component_id); | ||
375 | 249 | ||
376 | void | 250 | void |
377 | acpi_ut_report_warning ( | 251 | acpi_ut_report_warning(char *module_name, u32 line_number, u32 component_id); |
378 | char *module_name, | ||
379 | u32 line_number, | ||
380 | u32 component_id); | ||
381 | 252 | ||
382 | void | 253 | void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id); |
383 | acpi_ut_dump_buffer ( | ||
384 | u8 *buffer, | ||
385 | u32 count, | ||
386 | u32 display, | ||
387 | u32 component_id); | ||
388 | 254 | ||
389 | void ACPI_INTERNAL_VAR_XFACE | 255 | void ACPI_INTERNAL_VAR_XFACE |
390 | acpi_ut_debug_print ( | 256 | acpi_ut_debug_print(u32 requested_debug_level, |
391 | u32 requested_debug_level, | 257 | u32 line_number, |
392 | u32 line_number, | 258 | const char *function_name, |
393 | const char *function_name, | 259 | char *module_name, |
394 | char *module_name, | 260 | u32 component_id, char *format, ...) ACPI_PRINTF_LIKE_FUNC; |
395 | u32 component_id, | ||
396 | char *format, | ||
397 | ...) ACPI_PRINTF_LIKE_FUNC; | ||
398 | 261 | ||
399 | void ACPI_INTERNAL_VAR_XFACE | 262 | void ACPI_INTERNAL_VAR_XFACE |
400 | acpi_ut_debug_print_raw ( | 263 | acpi_ut_debug_print_raw(u32 requested_debug_level, |
401 | u32 requested_debug_level, | 264 | u32 line_number, |
402 | u32 line_number, | 265 | const char *function_name, |
403 | const char *function_name, | 266 | char *module_name, |
404 | char *module_name, | 267 | u32 component_id, |
405 | u32 component_id, | 268 | char *format, ...) ACPI_PRINTF_LIKE_FUNC; |
406 | char *format, | ||
407 | ...) ACPI_PRINTF_LIKE_FUNC; | ||
408 | |||
409 | 269 | ||
410 | /* | 270 | /* |
411 | * utdelete - Object deletion and reference counts | 271 | * utdelete - Object deletion and reference counts |
412 | */ | 272 | */ |
413 | void | 273 | void acpi_ut_add_reference(union acpi_operand_object *object); |
414 | acpi_ut_add_reference ( | ||
415 | union acpi_operand_object *object); | ||
416 | 274 | ||
417 | void | 275 | void acpi_ut_remove_reference(union acpi_operand_object *object); |
418 | acpi_ut_remove_reference ( | ||
419 | union acpi_operand_object *object); | ||
420 | 276 | ||
421 | void | 277 | void acpi_ut_delete_internal_package_object(union acpi_operand_object *object); |
422 | acpi_ut_delete_internal_package_object ( | ||
423 | union acpi_operand_object *object); | ||
424 | |||
425 | void | ||
426 | acpi_ut_delete_internal_simple_object ( | ||
427 | union acpi_operand_object *object); | ||
428 | 278 | ||
429 | void | 279 | void acpi_ut_delete_internal_simple_object(union acpi_operand_object *object); |
430 | acpi_ut_delete_internal_object_list ( | ||
431 | union acpi_operand_object **obj_list); | ||
432 | 280 | ||
281 | void acpi_ut_delete_internal_object_list(union acpi_operand_object **obj_list); | ||
433 | 282 | ||
434 | /* | 283 | /* |
435 | * uteval - object evaluation | 284 | * uteval - object evaluation |
436 | */ | 285 | */ |
437 | acpi_status | 286 | acpi_status acpi_ut_osi_implementation(struct acpi_walk_state *walk_state); |
438 | acpi_ut_osi_implementation ( | ||
439 | struct acpi_walk_state *walk_state); | ||
440 | 287 | ||
441 | acpi_status | 288 | acpi_status |
442 | acpi_ut_evaluate_object ( | 289 | acpi_ut_evaluate_object(struct acpi_namespace_node *prefix_node, |
443 | struct acpi_namespace_node *prefix_node, | 290 | char *path, |
444 | char *path, | 291 | u32 expected_return_btypes, |
445 | u32 expected_return_btypes, | 292 | union acpi_operand_object **return_desc); |
446 | union acpi_operand_object **return_desc); | ||
447 | 293 | ||
448 | acpi_status | 294 | acpi_status |
449 | acpi_ut_evaluate_numeric_object ( | 295 | acpi_ut_evaluate_numeric_object(char *object_name, |
450 | char *object_name, | 296 | struct acpi_namespace_node *device_node, |
451 | struct acpi_namespace_node *device_node, | 297 | acpi_integer * address); |
452 | acpi_integer *address); | ||
453 | 298 | ||
454 | acpi_status | 299 | acpi_status |
455 | acpi_ut_execute_HID ( | 300 | acpi_ut_execute_HID(struct acpi_namespace_node *device_node, |
456 | struct acpi_namespace_node *device_node, | 301 | struct acpi_device_id *hid); |
457 | struct acpi_device_id *hid); | ||
458 | 302 | ||
459 | acpi_status | 303 | acpi_status |
460 | acpi_ut_execute_CID ( | 304 | acpi_ut_execute_CID(struct acpi_namespace_node *device_node, |
461 | struct acpi_namespace_node *device_node, | 305 | struct acpi_compatible_id_list **return_cid_list); |
462 | struct acpi_compatible_id_list **return_cid_list); | ||
463 | 306 | ||
464 | acpi_status | 307 | acpi_status |
465 | acpi_ut_execute_STA ( | 308 | acpi_ut_execute_STA(struct acpi_namespace_node *device_node, |
466 | struct acpi_namespace_node *device_node, | 309 | u32 * status_flags); |
467 | u32 *status_flags); | ||
468 | 310 | ||
469 | acpi_status | 311 | acpi_status |
470 | acpi_ut_execute_UID ( | 312 | acpi_ut_execute_UID(struct acpi_namespace_node *device_node, |
471 | struct acpi_namespace_node *device_node, | 313 | struct acpi_device_id *uid); |
472 | struct acpi_device_id *uid); | ||
473 | 314 | ||
474 | acpi_status | 315 | acpi_status |
475 | acpi_ut_execute_sxds ( | 316 | acpi_ut_execute_sxds(struct acpi_namespace_node *device_node, u8 * highest); |
476 | struct acpi_namespace_node *device_node, | ||
477 | u8 *highest); | ||
478 | |||
479 | 317 | ||
480 | /* | 318 | /* |
481 | * utobject - internal object create/delete/cache routines | 319 | * utobject - internal object create/delete/cache routines |
482 | */ | 320 | */ |
483 | union acpi_operand_object * | 321 | union acpi_operand_object *acpi_ut_create_internal_object_dbg(char *module_name, |
484 | acpi_ut_create_internal_object_dbg ( | 322 | u32 line_number, |
485 | char *module_name, | 323 | u32 component_id, |
486 | u32 line_number, | 324 | acpi_object_type |
487 | u32 component_id, | 325 | type); |
488 | acpi_object_type type); | 326 | |
489 | 327 | void *acpi_ut_allocate_object_desc_dbg(char *module_name, | |
490 | void * | 328 | u32 line_number, u32 component_id); |
491 | acpi_ut_allocate_object_desc_dbg ( | ||
492 | char *module_name, | ||
493 | u32 line_number, | ||
494 | u32 component_id); | ||
495 | 329 | ||
496 | #define acpi_ut_create_internal_object(t) acpi_ut_create_internal_object_dbg (_acpi_module_name,__LINE__,_COMPONENT,t) | 330 | #define acpi_ut_create_internal_object(t) acpi_ut_create_internal_object_dbg (_acpi_module_name,__LINE__,_COMPONENT,t) |
497 | #define acpi_ut_allocate_object_desc() acpi_ut_allocate_object_desc_dbg (_acpi_module_name,__LINE__,_COMPONENT) | 331 | #define acpi_ut_allocate_object_desc() acpi_ut_allocate_object_desc_dbg (_acpi_module_name,__LINE__,_COMPONENT) |
498 | 332 | ||
499 | void | 333 | void acpi_ut_delete_object_desc(union acpi_operand_object *object); |
500 | acpi_ut_delete_object_desc ( | ||
501 | union acpi_operand_object *object); | ||
502 | 334 | ||
503 | u8 | 335 | u8 acpi_ut_valid_internal_object(void *object); |
504 | acpi_ut_valid_internal_object ( | ||
505 | void *object); | ||
506 | 336 | ||
507 | union acpi_operand_object * | 337 | union acpi_operand_object *acpi_ut_create_buffer_object(acpi_size buffer_size); |
508 | acpi_ut_create_buffer_object ( | ||
509 | acpi_size buffer_size); | ||
510 | 338 | ||
511 | union acpi_operand_object * | 339 | union acpi_operand_object *acpi_ut_create_string_object(acpi_size string_size); |
512 | acpi_ut_create_string_object ( | ||
513 | acpi_size string_size); | ||
514 | 340 | ||
515 | acpi_status | 341 | acpi_status |
516 | acpi_ut_get_object_size( | 342 | acpi_ut_get_object_size(union acpi_operand_object *obj, acpi_size * obj_length); |
517 | union acpi_operand_object *obj, | ||
518 | acpi_size *obj_length); | ||
519 | |||
520 | 343 | ||
521 | /* | 344 | /* |
522 | * utstate - Generic state creation/cache routines | 345 | * utstate - Generic state creation/cache routines |
523 | */ | 346 | */ |
524 | void | 347 | void |
525 | acpi_ut_push_generic_state ( | 348 | acpi_ut_push_generic_state(union acpi_generic_state **list_head, |
526 | union acpi_generic_state **list_head, | 349 | union acpi_generic_state *state); |
527 | union acpi_generic_state *state); | ||
528 | |||
529 | union acpi_generic_state * | ||
530 | acpi_ut_pop_generic_state ( | ||
531 | union acpi_generic_state **list_head); | ||
532 | 350 | ||
351 | union acpi_generic_state *acpi_ut_pop_generic_state(union acpi_generic_state | ||
352 | **list_head); | ||
533 | 353 | ||
534 | union acpi_generic_state * | 354 | union acpi_generic_state *acpi_ut_create_generic_state(void); |
535 | acpi_ut_create_generic_state ( | ||
536 | void); | ||
537 | 355 | ||
538 | struct acpi_thread_state * | 356 | struct acpi_thread_state *acpi_ut_create_thread_state(void); |
539 | acpi_ut_create_thread_state ( | ||
540 | void); | ||
541 | 357 | ||
542 | union acpi_generic_state * | 358 | union acpi_generic_state *acpi_ut_create_update_state(union acpi_operand_object |
543 | acpi_ut_create_update_state ( | 359 | *object, u16 action); |
544 | union acpi_operand_object *object, | ||
545 | u16 action); | ||
546 | 360 | ||
547 | union acpi_generic_state * | 361 | union acpi_generic_state *acpi_ut_create_pkg_state(void *internal_object, |
548 | acpi_ut_create_pkg_state ( | 362 | void *external_object, |
549 | void *internal_object, | 363 | u16 index); |
550 | void *external_object, | ||
551 | u16 index); | ||
552 | 364 | ||
553 | acpi_status | 365 | acpi_status |
554 | acpi_ut_create_update_state_and_push ( | 366 | acpi_ut_create_update_state_and_push(union acpi_operand_object *object, |
555 | union acpi_operand_object *object, | 367 | u16 action, |
556 | u16 action, | 368 | union acpi_generic_state **state_list); |
557 | union acpi_generic_state **state_list); | ||
558 | 369 | ||
559 | #ifdef ACPI_FUTURE_USAGE | 370 | #ifdef ACPI_FUTURE_USAGE |
560 | acpi_status | 371 | acpi_status |
561 | acpi_ut_create_pkg_state_and_push ( | 372 | acpi_ut_create_pkg_state_and_push(void *internal_object, |
562 | void *internal_object, | 373 | void *external_object, |
563 | void *external_object, | 374 | u16 index, |
564 | u16 index, | 375 | union acpi_generic_state **state_list); |
565 | union acpi_generic_state **state_list); | 376 | #endif /* ACPI_FUTURE_USAGE */ |
566 | #endif /* ACPI_FUTURE_USAGE */ | ||
567 | 377 | ||
568 | union acpi_generic_state * | 378 | union acpi_generic_state *acpi_ut_create_control_state(void); |
569 | acpi_ut_create_control_state ( | ||
570 | void); | ||
571 | |||
572 | void | ||
573 | acpi_ut_delete_generic_state ( | ||
574 | union acpi_generic_state *state); | ||
575 | 379 | ||
380 | void acpi_ut_delete_generic_state(union acpi_generic_state *state); | ||
576 | 381 | ||
577 | /* | 382 | /* |
578 | * utmath | 383 | * utmath |
579 | */ | 384 | */ |
580 | acpi_status | 385 | acpi_status |
581 | acpi_ut_divide ( | 386 | acpi_ut_divide(acpi_integer in_dividend, |
582 | acpi_integer in_dividend, | 387 | acpi_integer in_divisor, |
583 | acpi_integer in_divisor, | 388 | acpi_integer * out_quotient, acpi_integer * out_remainder); |
584 | acpi_integer *out_quotient, | ||
585 | acpi_integer *out_remainder); | ||
586 | 389 | ||
587 | acpi_status | 390 | acpi_status |
588 | acpi_ut_short_divide ( | 391 | acpi_ut_short_divide(acpi_integer in_dividend, |
589 | acpi_integer in_dividend, | 392 | u32 divisor, |
590 | u32 divisor, | 393 | acpi_integer * out_quotient, u32 * out_remainder); |
591 | acpi_integer *out_quotient, | ||
592 | u32 *out_remainder); | ||
593 | 394 | ||
594 | /* | 395 | /* |
595 | * utmisc | 396 | * utmisc |
596 | */ | 397 | */ |
597 | acpi_status | 398 | acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id); |
598 | acpi_ut_allocate_owner_id ( | ||
599 | acpi_owner_id *owner_id); | ||
600 | 399 | ||
601 | void | 400 | void acpi_ut_release_owner_id(acpi_owner_id * owner_id); |
602 | acpi_ut_release_owner_id ( | ||
603 | acpi_owner_id *owner_id); | ||
604 | 401 | ||
605 | acpi_status | 402 | acpi_status |
606 | acpi_ut_walk_package_tree ( | 403 | acpi_ut_walk_package_tree(union acpi_operand_object *source_object, |
607 | union acpi_operand_object *source_object, | 404 | void *target_object, |
608 | void *target_object, | 405 | acpi_pkg_callback walk_callback, void *context); |
609 | acpi_pkg_callback walk_callback, | ||
610 | void *context); | ||
611 | 406 | ||
612 | void | 407 | void acpi_ut_strupr(char *src_string); |
613 | acpi_ut_strupr ( | ||
614 | char *src_string); | ||
615 | 408 | ||
616 | void | 409 | void acpi_ut_print_string(char *string, u8 max_length); |
617 | acpi_ut_print_string ( | ||
618 | char *string, | ||
619 | u8 max_length); | ||
620 | 410 | ||
621 | u8 | 411 | u8 acpi_ut_valid_acpi_name(u32 name); |
622 | acpi_ut_valid_acpi_name ( | ||
623 | u32 name); | ||
624 | 412 | ||
625 | u8 | 413 | u8 acpi_ut_valid_acpi_character(char character); |
626 | acpi_ut_valid_acpi_character ( | ||
627 | char character); | ||
628 | 414 | ||
629 | acpi_status | 415 | acpi_status |
630 | acpi_ut_strtoul64 ( | 416 | acpi_ut_strtoul64(char *string, u32 base, acpi_integer * ret_integer); |
631 | char *string, | ||
632 | u32 base, | ||
633 | acpi_integer *ret_integer); | ||
634 | 417 | ||
635 | /* Values for Base above (16=Hex, 10=Decimal) */ | 418 | /* Values for Base above (16=Hex, 10=Decimal) */ |
636 | 419 | ||
637 | #define ACPI_ANY_BASE 0 | 420 | #define ACPI_ANY_BASE 0 |
638 | 421 | ||
639 | u8 * | 422 | u8 *acpi_ut_get_resource_end_tag(union acpi_operand_object *obj_desc); |
640 | acpi_ut_get_resource_end_tag ( | ||
641 | union acpi_operand_object *obj_desc); | ||
642 | 423 | ||
643 | u8 | 424 | u8 acpi_ut_generate_checksum(u8 * buffer, u32 length); |
644 | acpi_ut_generate_checksum ( | ||
645 | u8 *buffer, | ||
646 | u32 length); | ||
647 | 425 | ||
648 | u32 | 426 | u32 acpi_ut_dword_byte_swap(u32 value); |
649 | acpi_ut_dword_byte_swap ( | ||
650 | u32 value); | ||
651 | 427 | ||
652 | void | 428 | void acpi_ut_set_integer_width(u8 revision); |
653 | acpi_ut_set_integer_width ( | ||
654 | u8 revision); | ||
655 | 429 | ||
656 | #ifdef ACPI_DEBUG_OUTPUT | 430 | #ifdef ACPI_DEBUG_OUTPUT |
657 | void | 431 | void |
658 | acpi_ut_display_init_pathname ( | 432 | acpi_ut_display_init_pathname(u8 type, |
659 | u8 type, | 433 | struct acpi_namespace_node *obj_handle, |
660 | struct acpi_namespace_node *obj_handle, | 434 | char *path); |
661 | char *path); | ||
662 | 435 | ||
663 | #endif | 436 | #endif |
664 | 437 | ||
665 | |||
666 | /* | 438 | /* |
667 | * utmutex - mutex support | 439 | * utmutex - mutex support |
668 | */ | 440 | */ |
669 | acpi_status | 441 | acpi_status acpi_ut_mutex_initialize(void); |
670 | acpi_ut_mutex_initialize ( | ||
671 | void); | ||
672 | |||
673 | void | ||
674 | acpi_ut_mutex_terminate ( | ||
675 | void); | ||
676 | 442 | ||
677 | acpi_status | 443 | void acpi_ut_mutex_terminate(void); |
678 | acpi_ut_acquire_mutex ( | ||
679 | acpi_mutex_handle mutex_id); | ||
680 | 444 | ||
681 | acpi_status | 445 | acpi_status acpi_ut_acquire_mutex(acpi_mutex_handle mutex_id); |
682 | acpi_ut_release_mutex ( | ||
683 | acpi_mutex_handle mutex_id); | ||
684 | 446 | ||
447 | acpi_status acpi_ut_release_mutex(acpi_mutex_handle mutex_id); | ||
685 | 448 | ||
686 | /* | 449 | /* |
687 | * utalloc - memory allocation and object caching | 450 | * utalloc - memory allocation and object caching |
688 | */ | 451 | */ |
689 | acpi_status | 452 | acpi_status acpi_ut_create_caches(void); |
690 | acpi_ut_create_caches ( | ||
691 | void); | ||
692 | 453 | ||
693 | acpi_status | 454 | acpi_status acpi_ut_delete_caches(void); |
694 | acpi_ut_delete_caches ( | ||
695 | void); | ||
696 | 455 | ||
697 | acpi_status | 456 | acpi_status acpi_ut_validate_buffer(struct acpi_buffer *buffer); |
698 | acpi_ut_validate_buffer ( | ||
699 | struct acpi_buffer *buffer); | ||
700 | 457 | ||
701 | acpi_status | 458 | acpi_status |
702 | acpi_ut_initialize_buffer ( | 459 | acpi_ut_initialize_buffer(struct acpi_buffer *buffer, |
703 | struct acpi_buffer *buffer, | 460 | acpi_size required_length); |
704 | acpi_size required_length); | 461 | |
705 | 462 | void *acpi_ut_allocate(acpi_size size, u32 component, char *module, u32 line); | |
706 | void * | 463 | |
707 | acpi_ut_allocate ( | 464 | void *acpi_ut_callocate(acpi_size size, u32 component, char *module, u32 line); |
708 | acpi_size size, | ||
709 | u32 component, | ||
710 | char *module, | ||
711 | u32 line); | ||
712 | |||
713 | void * | ||
714 | acpi_ut_callocate ( | ||
715 | acpi_size size, | ||
716 | u32 component, | ||
717 | char *module, | ||
718 | u32 line); | ||
719 | 465 | ||
720 | #ifdef ACPI_DBG_TRACK_ALLOCATIONS | 466 | #ifdef ACPI_DBG_TRACK_ALLOCATIONS |
721 | void * | 467 | void *acpi_ut_allocate_and_track(acpi_size size, |
722 | acpi_ut_allocate_and_track ( | 468 | u32 component, char *module, u32 line); |
723 | acpi_size size, | 469 | |
724 | u32 component, | 470 | void *acpi_ut_callocate_and_track(acpi_size size, |
725 | char *module, | 471 | u32 component, char *module, u32 line); |
726 | u32 line); | ||
727 | |||
728 | void * | ||
729 | acpi_ut_callocate_and_track ( | ||
730 | acpi_size size, | ||
731 | u32 component, | ||
732 | char *module, | ||
733 | u32 line); | ||
734 | 472 | ||
735 | void | 473 | void |
736 | acpi_ut_free_and_track ( | 474 | acpi_ut_free_and_track(void *address, u32 component, char *module, u32 line); |
737 | void *address, | ||
738 | u32 component, | ||
739 | char *module, | ||
740 | u32 line); | ||
741 | 475 | ||
742 | #ifdef ACPI_FUTURE_USAGE | 476 | #ifdef ACPI_FUTURE_USAGE |
743 | void | 477 | void acpi_ut_dump_allocation_info(void); |
744 | acpi_ut_dump_allocation_info ( | 478 | #endif /* ACPI_FUTURE_USAGE */ |
745 | void); | ||
746 | #endif /* ACPI_FUTURE_USAGE */ | ||
747 | 479 | ||
748 | void | 480 | void acpi_ut_dump_allocations(u32 component, char *module); |
749 | acpi_ut_dump_allocations ( | ||
750 | u32 component, | ||
751 | char *module); | ||
752 | #endif | 481 | #endif |
753 | 482 | ||
754 | #endif /* _ACUTILS_H */ | 483 | #endif /* _ACUTILS_H */ |
diff --git a/include/acpi/amlcode.h b/include/acpi/amlcode.h index 50a088901196..7fdf5299f501 100644 --- a/include/acpi/amlcode.h +++ b/include/acpi/amlcode.h | |||
@@ -59,11 +59,11 @@ | |||
59 | #define AML_WORD_OP (u16) 0x0b | 59 | #define AML_WORD_OP (u16) 0x0b |
60 | #define AML_DWORD_OP (u16) 0x0c | 60 | #define AML_DWORD_OP (u16) 0x0c |
61 | #define AML_STRING_OP (u16) 0x0d | 61 | #define AML_STRING_OP (u16) 0x0d |
62 | #define AML_QWORD_OP (u16) 0x0e /* ACPI 2.0 */ | 62 | #define AML_QWORD_OP (u16) 0x0e /* ACPI 2.0 */ |
63 | #define AML_SCOPE_OP (u16) 0x10 | 63 | #define AML_SCOPE_OP (u16) 0x10 |
64 | #define AML_BUFFER_OP (u16) 0x11 | 64 | #define AML_BUFFER_OP (u16) 0x11 |
65 | #define AML_PACKAGE_OP (u16) 0x12 | 65 | #define AML_PACKAGE_OP (u16) 0x12 |
66 | #define AML_VAR_PACKAGE_OP (u16) 0x13 /* ACPI 2.0 */ | 66 | #define AML_VAR_PACKAGE_OP (u16) 0x13 /* ACPI 2.0 */ |
67 | #define AML_METHOD_OP (u16) 0x14 | 67 | #define AML_METHOD_OP (u16) 0x14 |
68 | #define AML_DUAL_NAME_PREFIX (u16) 0x2e | 68 | #define AML_DUAL_NAME_PREFIX (u16) 0x2e |
69 | #define AML_MULTI_NAME_PREFIX_OP (u16) 0x2f | 69 | #define AML_MULTI_NAME_PREFIX_OP (u16) 0x2f |
@@ -109,8 +109,8 @@ | |||
109 | #define AML_FIND_SET_LEFT_BIT_OP (u16) 0x81 | 109 | #define AML_FIND_SET_LEFT_BIT_OP (u16) 0x81 |
110 | #define AML_FIND_SET_RIGHT_BIT_OP (u16) 0x82 | 110 | #define AML_FIND_SET_RIGHT_BIT_OP (u16) 0x82 |
111 | #define AML_DEREF_OF_OP (u16) 0x83 | 111 | #define AML_DEREF_OF_OP (u16) 0x83 |
112 | #define AML_CONCAT_RES_OP (u16) 0x84 /* ACPI 2.0 */ | 112 | #define AML_CONCAT_RES_OP (u16) 0x84 /* ACPI 2.0 */ |
113 | #define AML_MOD_OP (u16) 0x85 /* ACPI 2.0 */ | 113 | #define AML_MOD_OP (u16) 0x85 /* ACPI 2.0 */ |
114 | #define AML_NOTIFY_OP (u16) 0x86 | 114 | #define AML_NOTIFY_OP (u16) 0x86 |
115 | #define AML_SIZE_OF_OP (u16) 0x87 | 115 | #define AML_SIZE_OF_OP (u16) 0x87 |
116 | #define AML_INDEX_OP (u16) 0x88 | 116 | #define AML_INDEX_OP (u16) 0x88 |
@@ -120,21 +120,21 @@ | |||
120 | #define AML_CREATE_BYTE_FIELD_OP (u16) 0x8c | 120 | #define AML_CREATE_BYTE_FIELD_OP (u16) 0x8c |
121 | #define AML_CREATE_BIT_FIELD_OP (u16) 0x8d | 121 | #define AML_CREATE_BIT_FIELD_OP (u16) 0x8d |
122 | #define AML_TYPE_OP (u16) 0x8e | 122 | #define AML_TYPE_OP (u16) 0x8e |
123 | #define AML_CREATE_QWORD_FIELD_OP (u16) 0x8f /* ACPI 2.0 */ | 123 | #define AML_CREATE_QWORD_FIELD_OP (u16) 0x8f /* ACPI 2.0 */ |
124 | #define AML_LAND_OP (u16) 0x90 | 124 | #define AML_LAND_OP (u16) 0x90 |
125 | #define AML_LOR_OP (u16) 0x91 | 125 | #define AML_LOR_OP (u16) 0x91 |
126 | #define AML_LNOT_OP (u16) 0x92 | 126 | #define AML_LNOT_OP (u16) 0x92 |
127 | #define AML_LEQUAL_OP (u16) 0x93 | 127 | #define AML_LEQUAL_OP (u16) 0x93 |
128 | #define AML_LGREATER_OP (u16) 0x94 | 128 | #define AML_LGREATER_OP (u16) 0x94 |
129 | #define AML_LLESS_OP (u16) 0x95 | 129 | #define AML_LLESS_OP (u16) 0x95 |
130 | #define AML_TO_BUFFER_OP (u16) 0x96 /* ACPI 2.0 */ | 130 | #define AML_TO_BUFFER_OP (u16) 0x96 /* ACPI 2.0 */ |
131 | #define AML_TO_DECSTRING_OP (u16) 0x97 /* ACPI 2.0 */ | 131 | #define AML_TO_DECSTRING_OP (u16) 0x97 /* ACPI 2.0 */ |
132 | #define AML_TO_HEXSTRING_OP (u16) 0x98 /* ACPI 2.0 */ | 132 | #define AML_TO_HEXSTRING_OP (u16) 0x98 /* ACPI 2.0 */ |
133 | #define AML_TO_INTEGER_OP (u16) 0x99 /* ACPI 2.0 */ | 133 | #define AML_TO_INTEGER_OP (u16) 0x99 /* ACPI 2.0 */ |
134 | #define AML_TO_STRING_OP (u16) 0x9c /* ACPI 2.0 */ | 134 | #define AML_TO_STRING_OP (u16) 0x9c /* ACPI 2.0 */ |
135 | #define AML_COPY_OP (u16) 0x9d /* ACPI 2.0 */ | 135 | #define AML_COPY_OP (u16) 0x9d /* ACPI 2.0 */ |
136 | #define AML_MID_OP (u16) 0x9e /* ACPI 2.0 */ | 136 | #define AML_MID_OP (u16) 0x9e /* ACPI 2.0 */ |
137 | #define AML_CONTINUE_OP (u16) 0x9f /* ACPI 2.0 */ | 137 | #define AML_CONTINUE_OP (u16) 0x9f /* ACPI 2.0 */ |
138 | #define AML_IF_OP (u16) 0xa0 | 138 | #define AML_IF_OP (u16) 0xa0 |
139 | #define AML_ELSE_OP (u16) 0xa1 | 139 | #define AML_ELSE_OP (u16) 0xa1 |
140 | #define AML_WHILE_OP (u16) 0xa2 | 140 | #define AML_WHILE_OP (u16) 0xa2 |
@@ -146,7 +146,7 @@ | |||
146 | 146 | ||
147 | /* prefixed opcodes */ | 147 | /* prefixed opcodes */ |
148 | 148 | ||
149 | #define AML_EXTENDED_OPCODE (u16) 0x5b00 /* prefix for 2-byte opcodes */ | 149 | #define AML_EXTENDED_OPCODE (u16) 0x5b00 /* prefix for 2-byte opcodes */ |
150 | 150 | ||
151 | #define AML_MUTEX_OP (u16) 0x5b01 | 151 | #define AML_MUTEX_OP (u16) 0x5b01 |
152 | #define AML_EVENT_OP (u16) 0x5b02 | 152 | #define AML_EVENT_OP (u16) 0x5b02 |
@@ -154,7 +154,7 @@ | |||
154 | #define AML_SHIFT_LEFT_BIT_OP (u16) 0x5b11 | 154 | #define AML_SHIFT_LEFT_BIT_OP (u16) 0x5b11 |
155 | #define AML_COND_REF_OF_OP (u16) 0x5b12 | 155 | #define AML_COND_REF_OF_OP (u16) 0x5b12 |
156 | #define AML_CREATE_FIELD_OP (u16) 0x5b13 | 156 | #define AML_CREATE_FIELD_OP (u16) 0x5b13 |
157 | #define AML_LOAD_TABLE_OP (u16) 0x5b1f /* ACPI 2.0 */ | 157 | #define AML_LOAD_TABLE_OP (u16) 0x5b1f /* ACPI 2.0 */ |
158 | #define AML_LOAD_OP (u16) 0x5b20 | 158 | #define AML_LOAD_OP (u16) 0x5b20 |
159 | #define AML_STALL_OP (u16) 0x5b21 | 159 | #define AML_STALL_OP (u16) 0x5b21 |
160 | #define AML_SLEEP_OP (u16) 0x5b22 | 160 | #define AML_SLEEP_OP (u16) 0x5b22 |
@@ -169,7 +169,7 @@ | |||
169 | #define AML_REVISION_OP (u16) 0x5b30 | 169 | #define AML_REVISION_OP (u16) 0x5b30 |
170 | #define AML_DEBUG_OP (u16) 0x5b31 | 170 | #define AML_DEBUG_OP (u16) 0x5b31 |
171 | #define AML_FATAL_OP (u16) 0x5b32 | 171 | #define AML_FATAL_OP (u16) 0x5b32 |
172 | #define AML_TIMER_OP (u16) 0x5b33 /* ACPI 3.0 */ | 172 | #define AML_TIMER_OP (u16) 0x5b33 /* ACPI 3.0 */ |
173 | #define AML_REGION_OP (u16) 0x5b80 | 173 | #define AML_REGION_OP (u16) 0x5b80 |
174 | #define AML_FIELD_OP (u16) 0x5b81 | 174 | #define AML_FIELD_OP (u16) 0x5b81 |
175 | #define AML_DEVICE_OP (u16) 0x5b82 | 175 | #define AML_DEVICE_OP (u16) 0x5b82 |
@@ -178,8 +178,7 @@ | |||
178 | #define AML_THERMAL_ZONE_OP (u16) 0x5b85 | 178 | #define AML_THERMAL_ZONE_OP (u16) 0x5b85 |
179 | #define AML_INDEX_FIELD_OP (u16) 0x5b86 | 179 | #define AML_INDEX_FIELD_OP (u16) 0x5b86 |
180 | #define AML_BANK_FIELD_OP (u16) 0x5b87 | 180 | #define AML_BANK_FIELD_OP (u16) 0x5b87 |
181 | #define AML_DATA_REGION_OP (u16) 0x5b88 /* ACPI 2.0 */ | 181 | #define AML_DATA_REGION_OP (u16) 0x5b88 /* ACPI 2.0 */ |
182 | |||
183 | 182 | ||
184 | /* Bogus opcodes (they are actually two separate opcodes) */ | 183 | /* Bogus opcodes (they are actually two separate opcodes) */ |
185 | 184 | ||
@@ -187,7 +186,6 @@ | |||
187 | #define AML_LLESSEQUAL_OP (u16) 0x9294 | 186 | #define AML_LLESSEQUAL_OP (u16) 0x9294 |
188 | #define AML_LNOTEQUAL_OP (u16) 0x9293 | 187 | #define AML_LNOTEQUAL_OP (u16) 0x9293 |
189 | 188 | ||
190 | |||
191 | /* | 189 | /* |
192 | * Internal opcodes | 190 | * Internal opcodes |
193 | * Use only "Unknown" AML opcodes, don't attempt to use | 191 | * Use only "Unknown" AML opcodes, don't attempt to use |
@@ -203,7 +201,6 @@ | |||
203 | #define AML_INT_RETURN_VALUE_OP (u16) 0x0036 | 201 | #define AML_INT_RETURN_VALUE_OP (u16) 0x0036 |
204 | #define AML_INT_EVAL_SUBTREE_OP (u16) 0x0037 | 202 | #define AML_INT_EVAL_SUBTREE_OP (u16) 0x0037 |
205 | 203 | ||
206 | |||
207 | #define ARG_NONE 0x0 | 204 | #define ARG_NONE 0x0 |
208 | 205 | ||
209 | /* | 206 | /* |
@@ -245,7 +242,7 @@ | |||
245 | 242 | ||
246 | /* Single, simple types */ | 243 | /* Single, simple types */ |
247 | 244 | ||
248 | #define ARGI_ANYTYPE 0x01 /* Don't care */ | 245 | #define ARGI_ANYTYPE 0x01 /* Don't care */ |
249 | #define ARGI_PACKAGE 0x02 | 246 | #define ARGI_PACKAGE 0x02 |
250 | #define ARGI_EVENT 0x03 | 247 | #define ARGI_EVENT 0x03 |
251 | #define ARGI_MUTEX 0x04 | 248 | #define ARGI_MUTEX 0x04 |
@@ -256,8 +253,8 @@ | |||
256 | #define ARGI_INTEGER 0x06 | 253 | #define ARGI_INTEGER 0x06 |
257 | #define ARGI_STRING 0x07 | 254 | #define ARGI_STRING 0x07 |
258 | #define ARGI_BUFFER 0x08 | 255 | #define ARGI_BUFFER 0x08 |
259 | #define ARGI_BUFFER_OR_STRING 0x09 /* Used by MID op only */ | 256 | #define ARGI_BUFFER_OR_STRING 0x09 /* Used by MID op only */ |
260 | #define ARGI_COMPUTEDATA 0x0A /* Buffer, String, or Integer */ | 257 | #define ARGI_COMPUTEDATA 0x0A /* Buffer, String, or Integer */ |
261 | 258 | ||
262 | /* Reference objects */ | 259 | /* Reference objects */ |
263 | 260 | ||
@@ -265,30 +262,28 @@ | |||
265 | #define ARGI_OBJECT_REF 0x0C | 262 | #define ARGI_OBJECT_REF 0x0C |
266 | #define ARGI_DEVICE_REF 0x0D | 263 | #define ARGI_DEVICE_REF 0x0D |
267 | #define ARGI_REFERENCE 0x0E | 264 | #define ARGI_REFERENCE 0x0E |
268 | #define ARGI_TARGETREF 0x0F /* Target, subject to implicit conversion */ | 265 | #define ARGI_TARGETREF 0x0F /* Target, subject to implicit conversion */ |
269 | #define ARGI_FIXED_TARGET 0x10 /* Target, no implicit conversion */ | 266 | #define ARGI_FIXED_TARGET 0x10 /* Target, no implicit conversion */ |
270 | #define ARGI_SIMPLE_TARGET 0x11 /* Name, Local, Arg -- no implicit conversion */ | 267 | #define ARGI_SIMPLE_TARGET 0x11 /* Name, Local, Arg -- no implicit conversion */ |
271 | 268 | ||
272 | /* Multiple/complex types */ | 269 | /* Multiple/complex types */ |
273 | 270 | ||
274 | #define ARGI_DATAOBJECT 0x12 /* Buffer, String, package or reference to a Node - Used only by size_of operator*/ | 271 | #define ARGI_DATAOBJECT 0x12 /* Buffer, String, package or reference to a Node - Used only by size_of operator */ |
275 | #define ARGI_COMPLEXOBJ 0x13 /* Buffer, String, or package (Used by INDEX op only) */ | 272 | #define ARGI_COMPLEXOBJ 0x13 /* Buffer, String, or package (Used by INDEX op only) */ |
276 | #define ARGI_REF_OR_STRING 0x14 /* Reference or String (Used by DEREFOF op only) */ | 273 | #define ARGI_REF_OR_STRING 0x14 /* Reference or String (Used by DEREFOF op only) */ |
277 | #define ARGI_REGION_OR_FIELD 0x15 /* Used by LOAD op only */ | 274 | #define ARGI_REGION_OR_FIELD 0x15 /* Used by LOAD op only */ |
278 | #define ARGI_DATAREFOBJ 0x16 | 275 | #define ARGI_DATAREFOBJ 0x16 |
279 | 276 | ||
280 | /* Note: types above can expand to 0x1F maximum */ | 277 | /* Note: types above can expand to 0x1F maximum */ |
281 | 278 | ||
282 | #define ARGI_INVALID_OPCODE 0xFFFFFFFF | 279 | #define ARGI_INVALID_OPCODE 0xFFFFFFFF |
283 | 280 | ||
284 | |||
285 | /* | 281 | /* |
286 | * hash offsets | 282 | * hash offsets |
287 | */ | 283 | */ |
288 | #define AML_EXTOP_HASH_OFFSET 22 | 284 | #define AML_EXTOP_HASH_OFFSET 22 |
289 | #define AML_LNOT_HASH_OFFSET 19 | 285 | #define AML_LNOT_HASH_OFFSET 19 |
290 | 286 | ||
291 | |||
292 | /* | 287 | /* |
293 | * opcode groups and types | 288 | * opcode groups and types |
294 | */ | 289 | */ |
@@ -296,7 +291,6 @@ | |||
296 | #define OPGRP_FIELD 0x02 | 291 | #define OPGRP_FIELD 0x02 |
297 | #define OPGRP_BYTELIST 0x04 | 292 | #define OPGRP_BYTELIST 0x04 |
298 | 293 | ||
299 | |||
300 | /* | 294 | /* |
301 | * Opcode information | 295 | * Opcode information |
302 | */ | 296 | */ |
@@ -322,31 +316,30 @@ | |||
322 | /* Convenient flag groupings */ | 316 | /* Convenient flag groupings */ |
323 | 317 | ||
324 | #define AML_FLAGS_EXEC_0A_0T_1R AML_HAS_RETVAL | 318 | #define AML_FLAGS_EXEC_0A_0T_1R AML_HAS_RETVAL |
325 | #define AML_FLAGS_EXEC_1A_0T_0R AML_HAS_ARGS /* Monadic1 */ | 319 | #define AML_FLAGS_EXEC_1A_0T_0R AML_HAS_ARGS /* Monadic1 */ |
326 | #define AML_FLAGS_EXEC_1A_0T_1R AML_HAS_ARGS | AML_HAS_RETVAL /* Monadic2 */ | 320 | #define AML_FLAGS_EXEC_1A_0T_1R AML_HAS_ARGS | AML_HAS_RETVAL /* Monadic2 */ |
327 | #define AML_FLAGS_EXEC_1A_1T_0R AML_HAS_ARGS | AML_HAS_TARGET | 321 | #define AML_FLAGS_EXEC_1A_1T_0R AML_HAS_ARGS | AML_HAS_TARGET |
328 | #define AML_FLAGS_EXEC_1A_1T_1R AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL /* monadic2_r */ | 322 | #define AML_FLAGS_EXEC_1A_1T_1R AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL /* monadic2_r */ |
329 | #define AML_FLAGS_EXEC_2A_0T_0R AML_HAS_ARGS /* Dyadic1 */ | 323 | #define AML_FLAGS_EXEC_2A_0T_0R AML_HAS_ARGS /* Dyadic1 */ |
330 | #define AML_FLAGS_EXEC_2A_0T_1R AML_HAS_ARGS | AML_HAS_RETVAL /* Dyadic2 */ | 324 | #define AML_FLAGS_EXEC_2A_0T_1R AML_HAS_ARGS | AML_HAS_RETVAL /* Dyadic2 */ |
331 | #define AML_FLAGS_EXEC_2A_1T_1R AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL /* dyadic2_r */ | 325 | #define AML_FLAGS_EXEC_2A_1T_1R AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL /* dyadic2_r */ |
332 | #define AML_FLAGS_EXEC_2A_2T_1R AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL | 326 | #define AML_FLAGS_EXEC_2A_2T_1R AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL |
333 | #define AML_FLAGS_EXEC_3A_0T_0R AML_HAS_ARGS | 327 | #define AML_FLAGS_EXEC_3A_0T_0R AML_HAS_ARGS |
334 | #define AML_FLAGS_EXEC_3A_1T_1R AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL | 328 | #define AML_FLAGS_EXEC_3A_1T_1R AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL |
335 | #define AML_FLAGS_EXEC_6A_0T_1R AML_HAS_ARGS | AML_HAS_RETVAL | 329 | #define AML_FLAGS_EXEC_6A_0T_1R AML_HAS_ARGS | AML_HAS_RETVAL |
336 | 330 | ||
337 | |||
338 | /* | 331 | /* |
339 | * The opcode Type is used in a dispatch table, do not change | 332 | * The opcode Type is used in a dispatch table, do not change |
340 | * without updating the table. | 333 | * without updating the table. |
341 | */ | 334 | */ |
342 | #define AML_TYPE_EXEC_0A_0T_1R 0x00 | 335 | #define AML_TYPE_EXEC_0A_0T_1R 0x00 |
343 | #define AML_TYPE_EXEC_1A_0T_0R 0x01 /* Monadic1 */ | 336 | #define AML_TYPE_EXEC_1A_0T_0R 0x01 /* Monadic1 */ |
344 | #define AML_TYPE_EXEC_1A_0T_1R 0x02 /* Monadic2 */ | 337 | #define AML_TYPE_EXEC_1A_0T_1R 0x02 /* Monadic2 */ |
345 | #define AML_TYPE_EXEC_1A_1T_0R 0x03 | 338 | #define AML_TYPE_EXEC_1A_1T_0R 0x03 |
346 | #define AML_TYPE_EXEC_1A_1T_1R 0x04 /* monadic2_r */ | 339 | #define AML_TYPE_EXEC_1A_1T_1R 0x04 /* monadic2_r */ |
347 | #define AML_TYPE_EXEC_2A_0T_0R 0x05 /* Dyadic1 */ | 340 | #define AML_TYPE_EXEC_2A_0T_0R 0x05 /* Dyadic1 */ |
348 | #define AML_TYPE_EXEC_2A_0T_1R 0x06 /* Dyadic2 */ | 341 | #define AML_TYPE_EXEC_2A_0T_1R 0x06 /* Dyadic2 */ |
349 | #define AML_TYPE_EXEC_2A_1T_1R 0x07 /* dyadic2_r */ | 342 | #define AML_TYPE_EXEC_2A_1T_1R 0x07 /* dyadic2_r */ |
350 | #define AML_TYPE_EXEC_2A_2T_1R 0x08 | 343 | #define AML_TYPE_EXEC_2A_2T_1R 0x08 |
351 | #define AML_TYPE_EXEC_3A_0T_0R 0x09 | 344 | #define AML_TYPE_EXEC_3A_0T_0R 0x09 |
352 | #define AML_TYPE_EXEC_3A_1T_1R 0x0A | 345 | #define AML_TYPE_EXEC_3A_1T_1R 0x0A |
@@ -399,40 +392,33 @@ | |||
399 | #define AML_CLASS_METHOD_CALL 0x09 | 392 | #define AML_CLASS_METHOD_CALL 0x09 |
400 | #define AML_CLASS_UNKNOWN 0x0A | 393 | #define AML_CLASS_UNKNOWN 0x0A |
401 | 394 | ||
402 | |||
403 | /* Predefined Operation Region space_iDs */ | 395 | /* Predefined Operation Region space_iDs */ |
404 | 396 | ||
405 | typedef enum | 397 | typedef enum { |
406 | { | 398 | REGION_MEMORY = 0, |
407 | REGION_MEMORY = 0, | ||
408 | REGION_IO, | 399 | REGION_IO, |
409 | REGION_PCI_CONFIG, | 400 | REGION_PCI_CONFIG, |
410 | REGION_EC, | 401 | REGION_EC, |
411 | REGION_SMBUS, | 402 | REGION_SMBUS, |
412 | REGION_CMOS, | 403 | REGION_CMOS, |
413 | REGION_PCI_BAR, | 404 | REGION_PCI_BAR, |
414 | REGION_DATA_TABLE, /* Internal use only */ | 405 | REGION_DATA_TABLE, /* Internal use only */ |
415 | REGION_FIXED_HW = 0x7F | 406 | REGION_FIXED_HW = 0x7F |
416 | |||
417 | } AML_REGION_TYPES; | 407 | } AML_REGION_TYPES; |
418 | 408 | ||
419 | |||
420 | /* Comparison operation codes for match_op operator */ | 409 | /* Comparison operation codes for match_op operator */ |
421 | 410 | ||
422 | typedef enum | 411 | typedef enum { |
423 | { | 412 | MATCH_MTR = 0, |
424 | MATCH_MTR = 0, | 413 | MATCH_MEQ = 1, |
425 | MATCH_MEQ = 1, | 414 | MATCH_MLE = 2, |
426 | MATCH_MLE = 2, | 415 | MATCH_MLT = 3, |
427 | MATCH_MLT = 3, | 416 | MATCH_MGE = 4, |
428 | MATCH_MGE = 4, | 417 | MATCH_MGT = 5 |
429 | MATCH_MGT = 5 | ||
430 | |||
431 | } AML_MATCH_OPERATOR; | 418 | } AML_MATCH_OPERATOR; |
432 | 419 | ||
433 | #define MAX_MATCH_OPERATOR 5 | 420 | #define MAX_MATCH_OPERATOR 5 |
434 | 421 | ||
435 | |||
436 | /* | 422 | /* |
437 | * field_flags | 423 | * field_flags |
438 | * | 424 | * |
@@ -450,60 +436,47 @@ typedef enum | |||
450 | #define AML_FIELD_LOCK_RULE_MASK 0x10 | 436 | #define AML_FIELD_LOCK_RULE_MASK 0x10 |
451 | #define AML_FIELD_UPDATE_RULE_MASK 0x60 | 437 | #define AML_FIELD_UPDATE_RULE_MASK 0x60 |
452 | 438 | ||
453 | |||
454 | /* 1) Field Access Types */ | 439 | /* 1) Field Access Types */ |
455 | 440 | ||
456 | typedef enum | 441 | typedef enum { |
457 | { | 442 | AML_FIELD_ACCESS_ANY = 0x00, |
458 | AML_FIELD_ACCESS_ANY = 0x00, | 443 | AML_FIELD_ACCESS_BYTE = 0x01, |
459 | AML_FIELD_ACCESS_BYTE = 0x01, | 444 | AML_FIELD_ACCESS_WORD = 0x02, |
460 | AML_FIELD_ACCESS_WORD = 0x02, | 445 | AML_FIELD_ACCESS_DWORD = 0x03, |
461 | AML_FIELD_ACCESS_DWORD = 0x03, | 446 | AML_FIELD_ACCESS_QWORD = 0x04, /* ACPI 2.0 */ |
462 | AML_FIELD_ACCESS_QWORD = 0x04, /* ACPI 2.0 */ | 447 | AML_FIELD_ACCESS_BUFFER = 0x05 /* ACPI 2.0 */ |
463 | AML_FIELD_ACCESS_BUFFER = 0x05 /* ACPI 2.0 */ | ||
464 | |||
465 | } AML_ACCESS_TYPE; | 448 | } AML_ACCESS_TYPE; |
466 | 449 | ||
467 | |||
468 | /* 2) Field Lock Rules */ | 450 | /* 2) Field Lock Rules */ |
469 | 451 | ||
470 | typedef enum | 452 | typedef enum { |
471 | { | 453 | AML_FIELD_LOCK_NEVER = 0x00, |
472 | AML_FIELD_LOCK_NEVER = 0x00, | 454 | AML_FIELD_LOCK_ALWAYS = 0x10 |
473 | AML_FIELD_LOCK_ALWAYS = 0x10 | ||
474 | |||
475 | } AML_LOCK_RULE; | 455 | } AML_LOCK_RULE; |
476 | 456 | ||
477 | |||
478 | /* 3) Field Update Rules */ | 457 | /* 3) Field Update Rules */ |
479 | 458 | ||
480 | typedef enum | 459 | typedef enum { |
481 | { | 460 | AML_FIELD_UPDATE_PRESERVE = 0x00, |
482 | AML_FIELD_UPDATE_PRESERVE = 0x00, | 461 | AML_FIELD_UPDATE_WRITE_AS_ONES = 0x20, |
483 | AML_FIELD_UPDATE_WRITE_AS_ONES = 0x20, | ||
484 | AML_FIELD_UPDATE_WRITE_AS_ZEROS = 0x40 | 462 | AML_FIELD_UPDATE_WRITE_AS_ZEROS = 0x40 |
485 | |||
486 | } AML_UPDATE_RULE; | 463 | } AML_UPDATE_RULE; |
487 | 464 | ||
488 | |||
489 | /* | 465 | /* |
490 | * Field Access Attributes. | 466 | * Field Access Attributes. |
491 | * This byte is extracted from the AML via the | 467 | * This byte is extracted from the AML via the |
492 | * access_as keyword | 468 | * access_as keyword |
493 | */ | 469 | */ |
494 | typedef enum | 470 | typedef enum { |
495 | { | 471 | AML_FIELD_ATTRIB_SMB_QUICK = 0x02, |
496 | AML_FIELD_ATTRIB_SMB_QUICK = 0x02, | 472 | AML_FIELD_ATTRIB_SMB_SEND_RCV = 0x04, |
497 | AML_FIELD_ATTRIB_SMB_SEND_RCV = 0x04, | 473 | AML_FIELD_ATTRIB_SMB_BYTE = 0x06, |
498 | AML_FIELD_ATTRIB_SMB_BYTE = 0x06, | 474 | AML_FIELD_ATTRIB_SMB_WORD = 0x08, |
499 | AML_FIELD_ATTRIB_SMB_WORD = 0x08, | 475 | AML_FIELD_ATTRIB_SMB_BLOCK = 0x0A, |
500 | AML_FIELD_ATTRIB_SMB_BLOCK = 0x0A, | 476 | AML_FIELD_ATTRIB_SMB_WORD_CALL = 0x0C, |
501 | AML_FIELD_ATTRIB_SMB_WORD_CALL = 0x0C, | ||
502 | AML_FIELD_ATTRIB_SMB_BLOCK_CALL = 0x0D | 477 | AML_FIELD_ATTRIB_SMB_BLOCK_CALL = 0x0D |
503 | |||
504 | } AML_ACCESS_ATTRIBUTE; | 478 | } AML_ACCESS_ATTRIBUTE; |
505 | 479 | ||
506 | |||
507 | /* Bit fields in method_flags byte */ | 480 | /* Bit fields in method_flags byte */ |
508 | 481 | ||
509 | #define AML_METHOD_ARG_COUNT 0x07 | 482 | #define AML_METHOD_ARG_COUNT 0x07 |
@@ -516,5 +489,4 @@ typedef enum | |||
516 | #define AML_METHOD_RESERVED1 0x02 | 489 | #define AML_METHOD_RESERVED1 0x02 |
517 | #define AML_METHOD_RESERVED2 0x04 | 490 | #define AML_METHOD_RESERVED2 0x04 |
518 | 491 | ||
519 | 492 | #endif /* __AMLCODE_H__ */ | |
520 | #endif /* __AMLCODE_H__ */ | ||
diff --git a/include/acpi/amlresrc.h b/include/acpi/amlresrc.h index b20ec303df07..051786e4b210 100644 --- a/include/acpi/amlresrc.h +++ b/include/acpi/amlresrc.h | |||
@@ -42,29 +42,27 @@ | |||
42 | * POSSIBILITY OF SUCH DAMAGES. | 42 | * POSSIBILITY OF SUCH DAMAGES. |
43 | */ | 43 | */ |
44 | 44 | ||
45 | |||
46 | #ifndef __AMLRESRC_H | 45 | #ifndef __AMLRESRC_H |
47 | #define __AMLRESRC_H | 46 | #define __AMLRESRC_H |
48 | 47 | ||
49 | |||
50 | #define ASL_RESNAME_ADDRESS "_ADR" | 48 | #define ASL_RESNAME_ADDRESS "_ADR" |
51 | #define ASL_RESNAME_ALIGNMENT "_ALN" | 49 | #define ASL_RESNAME_ALIGNMENT "_ALN" |
52 | #define ASL_RESNAME_ADDRESSSPACE "_ASI" | 50 | #define ASL_RESNAME_ADDRESSSPACE "_ASI" |
53 | #define ASL_RESNAME_ACCESSSIZE "_ASZ" | 51 | #define ASL_RESNAME_ACCESSSIZE "_ASZ" |
54 | #define ASL_RESNAME_TYPESPECIFICATTRIBUTES "_ATT" | 52 | #define ASL_RESNAME_TYPESPECIFICATTRIBUTES "_ATT" |
55 | #define ASL_RESNAME_BASEADDRESS "_BAS" | 53 | #define ASL_RESNAME_BASEADDRESS "_BAS" |
56 | #define ASL_RESNAME_BUSMASTER "_BM_" /* Master(1), Slave(0) */ | 54 | #define ASL_RESNAME_BUSMASTER "_BM_" /* Master(1), Slave(0) */ |
57 | #define ASL_RESNAME_DECODE "_DEC" | 55 | #define ASL_RESNAME_DECODE "_DEC" |
58 | #define ASL_RESNAME_DMA "_DMA" | 56 | #define ASL_RESNAME_DMA "_DMA" |
59 | #define ASL_RESNAME_DMATYPE "_TYP" /* Compatible(0), A(1), B(2), F(3) */ | 57 | #define ASL_RESNAME_DMATYPE "_TYP" /* Compatible(0), A(1), B(2), F(3) */ |
60 | #define ASL_RESNAME_GRANULARITY "_GRA" | 58 | #define ASL_RESNAME_GRANULARITY "_GRA" |
61 | #define ASL_RESNAME_INTERRUPT "_INT" | 59 | #define ASL_RESNAME_INTERRUPT "_INT" |
62 | #define ASL_RESNAME_INTERRUPTLEVEL "_LL_" /* active_lo(1), active_hi(0) */ | 60 | #define ASL_RESNAME_INTERRUPTLEVEL "_LL_" /* active_lo(1), active_hi(0) */ |
63 | #define ASL_RESNAME_INTERRUPTSHARE "_SHR" /* Shareable(1), no_share(0) */ | 61 | #define ASL_RESNAME_INTERRUPTSHARE "_SHR" /* Shareable(1), no_share(0) */ |
64 | #define ASL_RESNAME_INTERRUPTTYPE "_HE_" /* Edge(1), Level(0) */ | 62 | #define ASL_RESNAME_INTERRUPTTYPE "_HE_" /* Edge(1), Level(0) */ |
65 | #define ASL_RESNAME_LENGTH "_LEN" | 63 | #define ASL_RESNAME_LENGTH "_LEN" |
66 | #define ASL_RESNAME_MEMATTRIBUTES "_MTP" /* Memory(0), Reserved(1), ACPI(2), NVS(3) */ | 64 | #define ASL_RESNAME_MEMATTRIBUTES "_MTP" /* Memory(0), Reserved(1), ACPI(2), NVS(3) */ |
67 | #define ASL_RESNAME_MEMTYPE "_MEM" /* non_cache(0), Cacheable(1) Cache+combine(2), Cache+prefetch(3) */ | 65 | #define ASL_RESNAME_MEMTYPE "_MEM" /* non_cache(0), Cacheable(1) Cache+combine(2), Cache+prefetch(3) */ |
68 | #define ASL_RESNAME_MAXADDR "_MAX" | 66 | #define ASL_RESNAME_MAXADDR "_MAX" |
69 | #define ASL_RESNAME_MINADDR "_MIN" | 67 | #define ASL_RESNAME_MINADDR "_MIN" |
70 | #define ASL_RESNAME_MAXTYPE "_MAF" | 68 | #define ASL_RESNAME_MAXTYPE "_MAF" |
@@ -72,12 +70,11 @@ | |||
72 | #define ASL_RESNAME_REGISTERBITOFFSET "_RBO" | 70 | #define ASL_RESNAME_REGISTERBITOFFSET "_RBO" |
73 | #define ASL_RESNAME_REGISTERBITWIDTH "_RBW" | 71 | #define ASL_RESNAME_REGISTERBITWIDTH "_RBW" |
74 | #define ASL_RESNAME_RANGETYPE "_RNG" | 72 | #define ASL_RESNAME_RANGETYPE "_RNG" |
75 | #define ASL_RESNAME_READWRITETYPE "_RW_" /* read_only(0), Writeable (1) */ | 73 | #define ASL_RESNAME_READWRITETYPE "_RW_" /* read_only(0), Writeable (1) */ |
76 | #define ASL_RESNAME_TRANSLATION "_TRA" | 74 | #define ASL_RESNAME_TRANSLATION "_TRA" |
77 | #define ASL_RESNAME_TRANSTYPE "_TRS" /* Sparse(1), Dense(0) */ | 75 | #define ASL_RESNAME_TRANSTYPE "_TRS" /* Sparse(1), Dense(0) */ |
78 | #define ASL_RESNAME_TYPE "_TTP" /* Translation(1), Static (0) */ | 76 | #define ASL_RESNAME_TYPE "_TTP" /* Translation(1), Static (0) */ |
79 | #define ASL_RESNAME_XFERTYPE "_SIz" /* 8(0), 8_and16(1), 16(2) */ | 77 | #define ASL_RESNAME_XFERTYPE "_SIz" /* 8(0), 8_and16(1), 16(2) */ |
80 | |||
81 | 78 | ||
82 | /* Default sizes for "small" resource descriptors */ | 79 | /* Default sizes for "small" resource descriptors */ |
83 | 80 | ||
@@ -89,15 +86,12 @@ | |||
89 | #define ASL_RDESC_FIXED_IO_SIZE 0x03 | 86 | #define ASL_RDESC_FIXED_IO_SIZE 0x03 |
90 | #define ASL_RDESC_END_TAG_SIZE 0x01 | 87 | #define ASL_RDESC_END_TAG_SIZE 0x01 |
91 | 88 | ||
92 | 89 | struct asl_resource_node { | |
93 | struct asl_resource_node | 90 | u32 buffer_length; |
94 | { | 91 | void *buffer; |
95 | u32 buffer_length; | 92 | struct asl_resource_node *next; |
96 | void *buffer; | ||
97 | struct asl_resource_node *next; | ||
98 | }; | 93 | }; |
99 | 94 | ||
100 | |||
101 | /* | 95 | /* |
102 | * Resource descriptors defined in the ACPI specification. | 96 | * Resource descriptors defined in the ACPI specification. |
103 | * | 97 | * |
@@ -106,214 +100,175 @@ struct asl_resource_node | |||
106 | */ | 100 | */ |
107 | #pragma pack(1) | 101 | #pragma pack(1) |
108 | 102 | ||
109 | struct asl_irq_format_desc | 103 | struct asl_irq_format_desc { |
110 | { | 104 | u8 descriptor_type; |
111 | u8 descriptor_type; | 105 | u16 irq_mask; |
112 | u16 irq_mask; | 106 | u8 flags; |
113 | u8 flags; | ||
114 | }; | 107 | }; |
115 | 108 | ||
116 | 109 | struct asl_irq_noflags_desc { | |
117 | struct asl_irq_noflags_desc | 110 | u8 descriptor_type; |
118 | { | 111 | u16 irq_mask; |
119 | u8 descriptor_type; | ||
120 | u16 irq_mask; | ||
121 | }; | 112 | }; |
122 | 113 | ||
123 | 114 | struct asl_dma_format_desc { | |
124 | struct asl_dma_format_desc | 115 | u8 descriptor_type; |
125 | { | 116 | u8 dma_channel_mask; |
126 | u8 descriptor_type; | 117 | u8 flags; |
127 | u8 dma_channel_mask; | ||
128 | u8 flags; | ||
129 | }; | 118 | }; |
130 | 119 | ||
131 | 120 | struct asl_start_dependent_desc { | |
132 | struct asl_start_dependent_desc | 121 | u8 descriptor_type; |
133 | { | 122 | u8 flags; |
134 | u8 descriptor_type; | ||
135 | u8 flags; | ||
136 | }; | 123 | }; |
137 | 124 | ||
138 | 125 | struct asl_start_dependent_noprio_desc { | |
139 | struct asl_start_dependent_noprio_desc | 126 | u8 descriptor_type; |
140 | { | ||
141 | u8 descriptor_type; | ||
142 | }; | 127 | }; |
143 | 128 | ||
144 | 129 | struct asl_end_dependent_desc { | |
145 | struct asl_end_dependent_desc | 130 | u8 descriptor_type; |
146 | { | ||
147 | u8 descriptor_type; | ||
148 | }; | 131 | }; |
149 | 132 | ||
150 | 133 | struct asl_io_port_desc { | |
151 | struct asl_io_port_desc | 134 | u8 descriptor_type; |
152 | { | 135 | u8 information; |
153 | u8 descriptor_type; | 136 | u16 address_min; |
154 | u8 information; | 137 | u16 address_max; |
155 | u16 address_min; | 138 | u8 alignment; |
156 | u16 address_max; | 139 | u8 length; |
157 | u8 alignment; | ||
158 | u8 length; | ||
159 | }; | 140 | }; |
160 | 141 | ||
161 | 142 | struct asl_fixed_io_port_desc { | |
162 | struct asl_fixed_io_port_desc | 143 | u8 descriptor_type; |
163 | { | 144 | u16 base_address; |
164 | u8 descriptor_type; | 145 | u8 length; |
165 | u16 base_address; | ||
166 | u8 length; | ||
167 | }; | 146 | }; |
168 | 147 | ||
169 | 148 | struct asl_small_vendor_desc { | |
170 | struct asl_small_vendor_desc | 149 | u8 descriptor_type; |
171 | { | 150 | u8 vendor_defined[7]; |
172 | u8 descriptor_type; | ||
173 | u8 vendor_defined[7]; | ||
174 | }; | 151 | }; |
175 | 152 | ||
176 | 153 | struct asl_end_tag_desc { | |
177 | struct asl_end_tag_desc | 154 | u8 descriptor_type; |
178 | { | 155 | u8 checksum; |
179 | u8 descriptor_type; | ||
180 | u8 checksum; | ||
181 | }; | 156 | }; |
182 | 157 | ||
183 | |||
184 | /* LARGE descriptors */ | 158 | /* LARGE descriptors */ |
185 | 159 | ||
186 | struct asl_memory_24_desc | 160 | struct asl_memory_24_desc { |
187 | { | 161 | u8 descriptor_type; |
188 | u8 descriptor_type; | 162 | u16 length; |
189 | u16 length; | 163 | u8 information; |
190 | u8 information; | 164 | u16 address_min; |
191 | u16 address_min; | 165 | u16 address_max; |
192 | u16 address_max; | 166 | u16 alignment; |
193 | u16 alignment; | 167 | u16 range_length; |
194 | u16 range_length; | ||
195 | }; | 168 | }; |
196 | 169 | ||
197 | 170 | struct asl_large_vendor_desc { | |
198 | struct asl_large_vendor_desc | 171 | u8 descriptor_type; |
199 | { | 172 | u16 length; |
200 | u8 descriptor_type; | 173 | u8 vendor_defined[1]; |
201 | u16 length; | ||
202 | u8 vendor_defined[1]; | ||
203 | }; | 174 | }; |
204 | 175 | ||
205 | 176 | struct asl_memory_32_desc { | |
206 | struct asl_memory_32_desc | 177 | u8 descriptor_type; |
207 | { | 178 | u16 length; |
208 | u8 descriptor_type; | 179 | u8 information; |
209 | u16 length; | 180 | u32 address_min; |
210 | u8 information; | 181 | u32 address_max; |
211 | u32 address_min; | 182 | u32 alignment; |
212 | u32 address_max; | 183 | u32 range_length; |
213 | u32 alignment; | ||
214 | u32 range_length; | ||
215 | }; | 184 | }; |
216 | 185 | ||
217 | 186 | struct asl_fixed_memory_32_desc { | |
218 | struct asl_fixed_memory_32_desc | 187 | u8 descriptor_type; |
219 | { | 188 | u16 length; |
220 | u8 descriptor_type; | 189 | u8 information; |
221 | u16 length; | 190 | u32 base_address; |
222 | u8 information; | 191 | u32 range_length; |
223 | u32 base_address; | ||
224 | u32 range_length; | ||
225 | }; | 192 | }; |
226 | 193 | ||
227 | 194 | struct asl_extended_address_desc { | |
228 | struct asl_extended_address_desc | 195 | u8 descriptor_type; |
229 | { | 196 | u16 length; |
230 | u8 descriptor_type; | 197 | u8 resource_type; |
231 | u16 length; | 198 | u8 flags; |
232 | u8 resource_type; | 199 | u8 specific_flags; |
233 | u8 flags; | 200 | u8 revision_iD; |
234 | u8 specific_flags; | 201 | u8 reserved; |
235 | u8 revision_iD; | 202 | u64 granularity; |
236 | u8 reserved; | 203 | u64 address_min; |
237 | u64 granularity; | 204 | u64 address_max; |
238 | u64 address_min; | 205 | u64 translation_offset; |
239 | u64 address_max; | 206 | u64 address_length; |
240 | u64 translation_offset; | 207 | u64 type_specific_attributes; |
241 | u64 address_length; | 208 | u8 optional_fields[2]; /* Used for length calculation only */ |
242 | u64 type_specific_attributes; | ||
243 | u8 optional_fields[2]; /* Used for length calculation only */ | ||
244 | }; | 209 | }; |
245 | 210 | ||
246 | #define ASL_EXTENDED_ADDRESS_DESC_REVISION 1 /* ACPI 3.0 */ | 211 | #define ASL_EXTENDED_ADDRESS_DESC_REVISION 1 /* ACPI 3.0 */ |
247 | 212 | ||
248 | 213 | struct asl_qword_address_desc { | |
249 | struct asl_qword_address_desc | 214 | u8 descriptor_type; |
250 | { | 215 | u16 length; |
251 | u8 descriptor_type; | 216 | u8 resource_type; |
252 | u16 length; | 217 | u8 flags; |
253 | u8 resource_type; | 218 | u8 specific_flags; |
254 | u8 flags; | 219 | u64 granularity; |
255 | u8 specific_flags; | 220 | u64 address_min; |
256 | u64 granularity; | 221 | u64 address_max; |
257 | u64 address_min; | 222 | u64 translation_offset; |
258 | u64 address_max; | 223 | u64 address_length; |
259 | u64 translation_offset; | 224 | u8 optional_fields[2]; |
260 | u64 address_length; | ||
261 | u8 optional_fields[2]; | ||
262 | }; | 225 | }; |
263 | 226 | ||
264 | 227 | struct asl_dword_address_desc { | |
265 | struct asl_dword_address_desc | 228 | u8 descriptor_type; |
266 | { | 229 | u16 length; |
267 | u8 descriptor_type; | 230 | u8 resource_type; |
268 | u16 length; | 231 | u8 flags; |
269 | u8 resource_type; | 232 | u8 specific_flags; |
270 | u8 flags; | 233 | u32 granularity; |
271 | u8 specific_flags; | 234 | u32 address_min; |
272 | u32 granularity; | 235 | u32 address_max; |
273 | u32 address_min; | 236 | u32 translation_offset; |
274 | u32 address_max; | 237 | u32 address_length; |
275 | u32 translation_offset; | 238 | u8 optional_fields[2]; |
276 | u32 address_length; | ||
277 | u8 optional_fields[2]; | ||
278 | }; | 239 | }; |
279 | 240 | ||
280 | 241 | struct asl_word_address_desc { | |
281 | struct asl_word_address_desc | 242 | u8 descriptor_type; |
282 | { | 243 | u16 length; |
283 | u8 descriptor_type; | 244 | u8 resource_type; |
284 | u16 length; | 245 | u8 flags; |
285 | u8 resource_type; | 246 | u8 specific_flags; |
286 | u8 flags; | 247 | u16 granularity; |
287 | u8 specific_flags; | 248 | u16 address_min; |
288 | u16 granularity; | 249 | u16 address_max; |
289 | u16 address_min; | 250 | u16 translation_offset; |
290 | u16 address_max; | 251 | u16 address_length; |
291 | u16 translation_offset; | 252 | u8 optional_fields[2]; |
292 | u16 address_length; | ||
293 | u8 optional_fields[2]; | ||
294 | }; | 253 | }; |
295 | 254 | ||
296 | 255 | struct asl_extended_xrupt_desc { | |
297 | struct asl_extended_xrupt_desc | 256 | u8 descriptor_type; |
298 | { | 257 | u16 length; |
299 | u8 descriptor_type; | 258 | u8 flags; |
300 | u16 length; | 259 | u8 table_length; |
301 | u8 flags; | 260 | u32 interrupt_number[1]; |
302 | u8 table_length; | ||
303 | u32 interrupt_number[1]; | ||
304 | /* res_source_index, res_source optional fields follow */ | 261 | /* res_source_index, res_source optional fields follow */ |
305 | }; | 262 | }; |
306 | 263 | ||
307 | 264 | struct asl_general_register_desc { | |
308 | struct asl_general_register_desc | 265 | u8 descriptor_type; |
309 | { | 266 | u16 length; |
310 | u8 descriptor_type; | 267 | u8 address_space_id; |
311 | u16 length; | 268 | u8 bit_width; |
312 | u8 address_space_id; | 269 | u8 bit_offset; |
313 | u8 bit_width; | 270 | u8 access_size; /* ACPI 3.0, was Reserved */ |
314 | u8 bit_offset; | 271 | u64 address; |
315 | u8 access_size; /* ACPI 3.0, was Reserved */ | ||
316 | u64 address; | ||
317 | }; | 272 | }; |
318 | 273 | ||
319 | /* restore default alignment */ | 274 | /* restore default alignment */ |
@@ -322,32 +277,29 @@ struct asl_general_register_desc | |||
322 | 277 | ||
323 | /* Union of all resource descriptors, so we can allocate the worst case */ | 278 | /* Union of all resource descriptors, so we can allocate the worst case */ |
324 | 279 | ||
325 | union asl_resource_desc | 280 | union asl_resource_desc { |
326 | { | 281 | struct asl_irq_format_desc irq; |
327 | struct asl_irq_format_desc irq; | 282 | struct asl_dma_format_desc dma; |
328 | struct asl_dma_format_desc dma; | 283 | struct asl_start_dependent_desc std; |
329 | struct asl_start_dependent_desc std; | 284 | struct asl_end_dependent_desc end; |
330 | struct asl_end_dependent_desc end; | 285 | struct asl_io_port_desc iop; |
331 | struct asl_io_port_desc iop; | 286 | struct asl_fixed_io_port_desc fio; |
332 | struct asl_fixed_io_port_desc fio; | 287 | struct asl_small_vendor_desc smv; |
333 | struct asl_small_vendor_desc smv; | 288 | struct asl_end_tag_desc et; |
334 | struct asl_end_tag_desc et; | 289 | |
335 | 290 | struct asl_memory_24_desc M24; | |
336 | struct asl_memory_24_desc M24; | 291 | struct asl_large_vendor_desc lgv; |
337 | struct asl_large_vendor_desc lgv; | 292 | struct asl_memory_32_desc M32; |
338 | struct asl_memory_32_desc M32; | 293 | struct asl_fixed_memory_32_desc F32; |
339 | struct asl_fixed_memory_32_desc F32; | 294 | struct asl_qword_address_desc qas; |
340 | struct asl_qword_address_desc qas; | 295 | struct asl_dword_address_desc das; |
341 | struct asl_dword_address_desc das; | 296 | struct asl_word_address_desc was; |
342 | struct asl_word_address_desc was; | 297 | struct asl_extended_address_desc eas; |
343 | struct asl_extended_address_desc eas; | 298 | struct asl_extended_xrupt_desc exx; |
344 | struct asl_extended_xrupt_desc exx; | 299 | struct asl_general_register_desc grg; |
345 | struct asl_general_register_desc grg; | 300 | u32 u32_item; |
346 | u32 u32_item; | 301 | u16 u16_item; |
347 | u16 u16_item; | 302 | u8 U8item; |
348 | u8 U8item; | ||
349 | }; | 303 | }; |
350 | 304 | ||
351 | |||
352 | #endif | 305 | #endif |
353 | |||
diff --git a/include/acpi/container.h b/include/acpi/container.h index d716df04d9dc..a703f14e049e 100644 --- a/include/acpi/container.h +++ b/include/acpi/container.h | |||
@@ -9,5 +9,4 @@ struct acpi_container { | |||
9 | int state; | 9 | int state; |
10 | }; | 10 | }; |
11 | 11 | ||
12 | #endif /* __ACPI_CONTAINER_H */ | 12 | #endif /* __ACPI_CONTAINER_H */ |
13 | |||
diff --git a/include/acpi/pdc_intel.h b/include/acpi/pdc_intel.h index fd6730e4e567..91f4a12a99a1 100644 --- a/include/acpi/pdc_intel.h +++ b/include/acpi/pdc_intel.h | |||
@@ -14,7 +14,6 @@ | |||
14 | #define ACPI_PDC_SMP_T_SWCOORD (0x0080) | 14 | #define ACPI_PDC_SMP_T_SWCOORD (0x0080) |
15 | #define ACPI_PDC_C_C1_FFH (0x0100) | 15 | #define ACPI_PDC_C_C1_FFH (0x0100) |
16 | 16 | ||
17 | |||
18 | #define ACPI_PDC_EST_CAPABILITY_SMP (ACPI_PDC_SMP_C1PT | \ | 17 | #define ACPI_PDC_EST_CAPABILITY_SMP (ACPI_PDC_SMP_C1PT | \ |
19 | ACPI_PDC_C_C1_HALT) | 18 | ACPI_PDC_C_C1_HALT) |
20 | 19 | ||
@@ -25,5 +24,4 @@ | |||
25 | ACPI_PDC_SMP_C1PT | \ | 24 | ACPI_PDC_SMP_C1PT | \ |
26 | ACPI_PDC_C_C1_HALT) | 25 | ACPI_PDC_C_C1_HALT) |
27 | 26 | ||
28 | #endif /* __PDC_INTEL_H__ */ | 27 | #endif /* __PDC_INTEL_H__ */ |
29 | |||
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h index bae1fbed097a..16609c1ab2eb 100644 --- a/include/acpi/platform/acenv.h +++ b/include/acpi/platform/acenv.h | |||
@@ -44,7 +44,6 @@ | |||
44 | #ifndef __ACENV_H__ | 44 | #ifndef __ACENV_H__ |
45 | #define __ACENV_H__ | 45 | #define __ACENV_H__ |
46 | 46 | ||
47 | |||
48 | /* | 47 | /* |
49 | * Configuration for ACPI tools and utilities | 48 | * Configuration for ACPI tools and utilities |
50 | */ | 49 | */ |
@@ -134,7 +133,7 @@ | |||
134 | #elif defined(WIN64) | 133 | #elif defined(WIN64) |
135 | #include "acwin64.h" | 134 | #include "acwin64.h" |
136 | 135 | ||
137 | #elif defined(MSDOS) /* Must appear after WIN32 and WIN64 check */ | 136 | #elif defined(MSDOS) /* Must appear after WIN32 and WIN64 check */ |
138 | #include "acdos16.h" | 137 | #include "acdos16.h" |
139 | 138 | ||
140 | #elif defined(__FreeBSD__) | 139 | #elif defined(__FreeBSD__) |
@@ -180,7 +179,6 @@ | |||
180 | 179 | ||
181 | /*! [End] no source code translation !*/ | 180 | /*! [End] no source code translation !*/ |
182 | 181 | ||
183 | |||
184 | /* | 182 | /* |
185 | * Debugger threading model | 183 | * Debugger threading model |
186 | * Use single threaded if the entire subsystem is contained in an application | 184 | * Use single threaded if the entire subsystem is contained in an application |
@@ -199,8 +197,7 @@ | |||
199 | #else | 197 | #else |
200 | #define DEBUGGER_THREADING DEBUGGER_MULTI_THREADED | 198 | #define DEBUGGER_THREADING DEBUGGER_MULTI_THREADED |
201 | #endif | 199 | #endif |
202 | #endif /* !DEBUGGER_THREADING */ | 200 | #endif /* !DEBUGGER_THREADING */ |
203 | |||
204 | 201 | ||
205 | /****************************************************************************** | 202 | /****************************************************************************** |
206 | * | 203 | * |
@@ -222,7 +219,7 @@ | |||
222 | #include <string.h> | 219 | #include <string.h> |
223 | #include <ctype.h> | 220 | #include <ctype.h> |
224 | 221 | ||
225 | #endif /* ACPI_USE_STANDARD_HEADERS */ | 222 | #endif /* ACPI_USE_STANDARD_HEADERS */ |
226 | 223 | ||
227 | /* | 224 | /* |
228 | * We will be linking to the standard Clib functions | 225 | * We will be linking to the standard Clib functions |
@@ -260,18 +257,18 @@ | |||
260 | *****************************************************************************/ | 257 | *****************************************************************************/ |
261 | 258 | ||
262 | /* | 259 | /* |
263 | * Use local definitions of C library macros and functions | 260 | * Use local definitions of C library macros and functions |
264 | * NOTE: The function implementations may not be as efficient | 261 | * NOTE: The function implementations may not be as efficient |
265 | * as an inline or assembly code implementation provided by a | 262 | * as an inline or assembly code implementation provided by a |
266 | * native C library. | 263 | * native C library. |
267 | */ | 264 | */ |
268 | 265 | ||
269 | #ifndef va_arg | 266 | #ifndef va_arg |
270 | 267 | ||
271 | #ifndef _VALIST | 268 | #ifndef _VALIST |
272 | #define _VALIST | 269 | #define _VALIST |
273 | typedef char *va_list; | 270 | typedef char *va_list; |
274 | #endif /* _VALIST */ | 271 | #endif /* _VALIST */ |
275 | 272 | ||
276 | /* | 273 | /* |
277 | * Storage alignment properties | 274 | * Storage alignment properties |
@@ -287,8 +284,7 @@ typedef char *va_list; | |||
287 | #define va_end(ap) (void) 0 | 284 | #define va_end(ap) (void) 0 |
288 | #define va_start(ap, A) (void) ((ap) = (((char *) &(A)) + (_bnd (A,_AUPBND)))) | 285 | #define va_start(ap, A) (void) ((ap) = (((char *) &(A)) + (_bnd (A,_AUPBND)))) |
289 | 286 | ||
290 | #endif /* va_arg */ | 287 | #endif /* va_arg */ |
291 | |||
292 | 288 | ||
293 | #define ACPI_STRSTR(s1,s2) acpi_ut_strstr ((s1), (s2)) | 289 | #define ACPI_STRSTR(s1,s2) acpi_ut_strstr ((s1), (s2)) |
294 | #define ACPI_STRCHR(s1,c) acpi_ut_strchr ((s1), (c)) | 290 | #define ACPI_STRCHR(s1,c) acpi_ut_strchr ((s1), (c)) |
@@ -306,8 +302,7 @@ typedef char *va_list; | |||
306 | #define ACPI_TOUPPER acpi_ut_to_upper | 302 | #define ACPI_TOUPPER acpi_ut_to_upper |
307 | #define ACPI_TOLOWER acpi_ut_to_lower | 303 | #define ACPI_TOLOWER acpi_ut_to_lower |
308 | 304 | ||
309 | #endif /* ACPI_USE_SYSTEM_CLIBRARY */ | 305 | #endif /* ACPI_USE_SYSTEM_CLIBRARY */ |
310 | |||
311 | 306 | ||
312 | /****************************************************************************** | 307 | /****************************************************************************** |
313 | * | 308 | * |
@@ -348,8 +343,7 @@ typedef char *va_list; | |||
348 | #define ACPI_ACQUIRE_GLOBAL_LOCK(Glptr, acq) | 343 | #define ACPI_ACQUIRE_GLOBAL_LOCK(Glptr, acq) |
349 | #define ACPI_RELEASE_GLOBAL_LOCK(Glptr, acq) | 344 | #define ACPI_RELEASE_GLOBAL_LOCK(Glptr, acq) |
350 | 345 | ||
351 | #endif /* ACPI_ASM_MACROS */ | 346 | #endif /* ACPI_ASM_MACROS */ |
352 | |||
353 | 347 | ||
354 | #ifdef ACPI_APPLICATION | 348 | #ifdef ACPI_APPLICATION |
355 | 349 | ||
@@ -359,11 +353,10 @@ typedef char *va_list; | |||
359 | #define BREAKPOINT3 | 353 | #define BREAKPOINT3 |
360 | #endif | 354 | #endif |
361 | 355 | ||
362 | |||
363 | /****************************************************************************** | 356 | /****************************************************************************** |
364 | * | 357 | * |
365 | * Compiler-specific information is contained in the compiler-specific | 358 | * Compiler-specific information is contained in the compiler-specific |
366 | * headers. | 359 | * headers. |
367 | * | 360 | * |
368 | *****************************************************************************/ | 361 | *****************************************************************************/ |
369 | #endif /* __ACENV_H__ */ | 362 | #endif /* __ACENV_H__ */ |
diff --git a/include/acpi/platform/acgcc.h b/include/acpi/platform/acgcc.h index 39264127574c..4c0e0ba09ba0 100644 --- a/include/acpi/platform/acgcc.h +++ b/include/acpi/platform/acgcc.h | |||
@@ -60,4 +60,4 @@ | |||
60 | */ | 60 | */ |
61 | #define ACPI_UNUSED_VAR __attribute__ ((unused)) | 61 | #define ACPI_UNUSED_VAR __attribute__ ((unused)) |
62 | 62 | ||
63 | #endif /* __ACGCC_H__ */ | 63 | #endif /* __ACGCC_H__ */ |
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index 4fbc0fd52a27..c93e6562f0e1 100644 --- a/include/acpi/platform/aclinux.h +++ b/include/acpi/platform/aclinux.h | |||
@@ -71,9 +71,7 @@ | |||
71 | #define acpi_cache_t kmem_cache_t | 71 | #define acpi_cache_t kmem_cache_t |
72 | #endif | 72 | #endif |
73 | 73 | ||
74 | 74 | #else /* !__KERNEL__ */ | |
75 | |||
76 | #else /* !__KERNEL__ */ | ||
77 | 75 | ||
78 | #include <stdarg.h> | 76 | #include <stdarg.h> |
79 | #include <string.h> | 77 | #include <string.h> |
@@ -94,10 +92,10 @@ | |||
94 | 92 | ||
95 | #define __cdecl | 93 | #define __cdecl |
96 | #define ACPI_FLUSH_CPU_CACHE() | 94 | #define ACPI_FLUSH_CPU_CACHE() |
97 | #endif /* __KERNEL__ */ | 95 | #endif /* __KERNEL__ */ |
98 | 96 | ||
99 | /* Linux uses GCC */ | 97 | /* Linux uses GCC */ |
100 | 98 | ||
101 | #include "acgcc.h" | 99 | #include "acgcc.h" |
102 | 100 | ||
103 | #endif /* __ACLINUX_H__ */ | 101 | #endif /* __ACLINUX_H__ */ |
diff --git a/include/acpi/processor.h b/include/acpi/processor.h index 50cfea4ff6ca..7a00d5089de9 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h | |||
@@ -23,45 +23,44 @@ | |||
23 | struct acpi_processor_cx; | 23 | struct acpi_processor_cx; |
24 | 24 | ||
25 | struct acpi_power_register { | 25 | struct acpi_power_register { |
26 | u8 descriptor; | 26 | u8 descriptor; |
27 | u16 length; | 27 | u16 length; |
28 | u8 space_id; | 28 | u8 space_id; |
29 | u8 bit_width; | 29 | u8 bit_width; |
30 | u8 bit_offset; | 30 | u8 bit_offset; |
31 | u8 reserved; | 31 | u8 reserved; |
32 | u64 address; | 32 | u64 address; |
33 | } __attribute__ ((packed)); | 33 | } __attribute__ ((packed)); |
34 | 34 | ||
35 | |||
36 | struct acpi_processor_cx_policy { | 35 | struct acpi_processor_cx_policy { |
37 | u32 count; | 36 | u32 count; |
38 | struct acpi_processor_cx *state; | 37 | struct acpi_processor_cx *state; |
39 | struct { | 38 | struct { |
40 | u32 time; | 39 | u32 time; |
41 | u32 ticks; | 40 | u32 ticks; |
42 | u32 count; | 41 | u32 count; |
43 | u32 bm; | 42 | u32 bm; |
44 | } threshold; | 43 | } threshold; |
45 | }; | 44 | }; |
46 | 45 | ||
47 | struct acpi_processor_cx { | 46 | struct acpi_processor_cx { |
48 | u8 valid; | 47 | u8 valid; |
49 | u8 type; | 48 | u8 type; |
50 | u32 address; | 49 | u32 address; |
51 | u32 latency; | 50 | u32 latency; |
52 | u32 latency_ticks; | 51 | u32 latency_ticks; |
53 | u32 power; | 52 | u32 power; |
54 | u32 usage; | 53 | u32 usage; |
55 | struct acpi_processor_cx_policy promotion; | 54 | struct acpi_processor_cx_policy promotion; |
56 | struct acpi_processor_cx_policy demotion; | 55 | struct acpi_processor_cx_policy demotion; |
57 | }; | 56 | }; |
58 | 57 | ||
59 | struct acpi_processor_power { | 58 | struct acpi_processor_power { |
60 | struct acpi_processor_cx *state; | 59 | struct acpi_processor_cx *state; |
61 | unsigned long bm_check_timestamp; | 60 | unsigned long bm_check_timestamp; |
62 | u32 default_state; | 61 | u32 default_state; |
63 | u32 bm_activity; | 62 | u32 bm_activity; |
64 | int count; | 63 | int count; |
65 | struct acpi_processor_cx states[ACPI_PROCESSOR_MAX_POWER]; | 64 | struct acpi_processor_cx states[ACPI_PROCESSOR_MAX_POWER]; |
66 | 65 | ||
67 | /* the _PDC objects passed by the driver, if any */ | 66 | /* the _PDC objects passed by the driver, if any */ |
@@ -71,85 +70,82 @@ struct acpi_processor_power { | |||
71 | /* Performance Management */ | 70 | /* Performance Management */ |
72 | 71 | ||
73 | struct acpi_pct_register { | 72 | struct acpi_pct_register { |
74 | u8 descriptor; | 73 | u8 descriptor; |
75 | u16 length; | 74 | u16 length; |
76 | u8 space_id; | 75 | u8 space_id; |
77 | u8 bit_width; | 76 | u8 bit_width; |
78 | u8 bit_offset; | 77 | u8 bit_offset; |
79 | u8 reserved; | 78 | u8 reserved; |
80 | u64 address; | 79 | u64 address; |
81 | } __attribute__ ((packed)); | 80 | } __attribute__ ((packed)); |
82 | 81 | ||
83 | struct acpi_processor_px { | 82 | struct acpi_processor_px { |
84 | acpi_integer core_frequency; /* megahertz */ | 83 | acpi_integer core_frequency; /* megahertz */ |
85 | acpi_integer power; /* milliWatts */ | 84 | acpi_integer power; /* milliWatts */ |
86 | acpi_integer transition_latency; /* microseconds */ | 85 | acpi_integer transition_latency; /* microseconds */ |
87 | acpi_integer bus_master_latency; /* microseconds */ | 86 | acpi_integer bus_master_latency; /* microseconds */ |
88 | acpi_integer control; /* control value */ | 87 | acpi_integer control; /* control value */ |
89 | acpi_integer status; /* success indicator */ | 88 | acpi_integer status; /* success indicator */ |
90 | }; | 89 | }; |
91 | 90 | ||
92 | struct acpi_processor_performance { | 91 | struct acpi_processor_performance { |
93 | unsigned int state; | 92 | unsigned int state; |
94 | unsigned int platform_limit; | 93 | unsigned int platform_limit; |
95 | struct acpi_pct_register control_register; | 94 | struct acpi_pct_register control_register; |
96 | struct acpi_pct_register status_register; | 95 | struct acpi_pct_register status_register; |
97 | unsigned int state_count; | 96 | unsigned int state_count; |
98 | struct acpi_processor_px *states; | 97 | struct acpi_processor_px *states; |
99 | 98 | ||
100 | /* the _PDC objects passed by the driver, if any */ | 99 | /* the _PDC objects passed by the driver, if any */ |
101 | struct acpi_object_list *pdc; | 100 | struct acpi_object_list *pdc; |
102 | }; | 101 | }; |
103 | 102 | ||
104 | |||
105 | |||
106 | /* Throttling Control */ | 103 | /* Throttling Control */ |
107 | 104 | ||
108 | struct acpi_processor_tx { | 105 | struct acpi_processor_tx { |
109 | u16 power; | 106 | u16 power; |
110 | u16 performance; | 107 | u16 performance; |
111 | }; | 108 | }; |
112 | 109 | ||
113 | struct acpi_processor_throttling { | 110 | struct acpi_processor_throttling { |
114 | int state; | 111 | int state; |
115 | u32 address; | 112 | u32 address; |
116 | u8 duty_offset; | 113 | u8 duty_offset; |
117 | u8 duty_width; | 114 | u8 duty_width; |
118 | int state_count; | 115 | int state_count; |
119 | struct acpi_processor_tx states[ACPI_PROCESSOR_MAX_THROTTLING]; | 116 | struct acpi_processor_tx states[ACPI_PROCESSOR_MAX_THROTTLING]; |
120 | }; | 117 | }; |
121 | 118 | ||
122 | /* Limit Interface */ | 119 | /* Limit Interface */ |
123 | 120 | ||
124 | struct acpi_processor_lx { | 121 | struct acpi_processor_lx { |
125 | int px; /* performace state */ | 122 | int px; /* performace state */ |
126 | int tx; /* throttle level */ | 123 | int tx; /* throttle level */ |
127 | }; | 124 | }; |
128 | 125 | ||
129 | struct acpi_processor_limit { | 126 | struct acpi_processor_limit { |
130 | struct acpi_processor_lx state; /* current limit */ | 127 | struct acpi_processor_lx state; /* current limit */ |
131 | struct acpi_processor_lx thermal; /* thermal limit */ | 128 | struct acpi_processor_lx thermal; /* thermal limit */ |
132 | struct acpi_processor_lx user; /* user limit */ | 129 | struct acpi_processor_lx user; /* user limit */ |
133 | }; | 130 | }; |
134 | 131 | ||
135 | |||
136 | struct acpi_processor_flags { | 132 | struct acpi_processor_flags { |
137 | u8 power:1; | 133 | u8 power:1; |
138 | u8 performance:1; | 134 | u8 performance:1; |
139 | u8 throttling:1; | 135 | u8 throttling:1; |
140 | u8 limit:1; | 136 | u8 limit:1; |
141 | u8 bm_control:1; | 137 | u8 bm_control:1; |
142 | u8 bm_check:1; | 138 | u8 bm_check:1; |
143 | u8 has_cst:1; | 139 | u8 has_cst:1; |
144 | u8 power_setup_done:1; | 140 | u8 power_setup_done:1; |
145 | }; | 141 | }; |
146 | 142 | ||
147 | struct acpi_processor { | 143 | struct acpi_processor { |
148 | acpi_handle handle; | 144 | acpi_handle handle; |
149 | u32 acpi_id; | 145 | u32 acpi_id; |
150 | u32 id; | 146 | u32 id; |
151 | u32 pblk; | 147 | u32 pblk; |
152 | int performance_platform_limit; | 148 | int performance_platform_limit; |
153 | struct acpi_processor_flags flags; | 149 | struct acpi_processor_flags flags; |
154 | struct acpi_processor_power power; | 150 | struct acpi_processor_power power; |
155 | struct acpi_processor_performance *performance; | 151 | struct acpi_processor_performance *performance; |
@@ -158,50 +154,49 @@ struct acpi_processor { | |||
158 | }; | 154 | }; |
159 | 155 | ||
160 | struct acpi_processor_errata { | 156 | struct acpi_processor_errata { |
161 | u8 smp; | 157 | u8 smp; |
162 | struct { | 158 | struct { |
163 | u8 throttle:1; | 159 | u8 throttle:1; |
164 | u8 fdma:1; | 160 | u8 fdma:1; |
165 | u8 reserved:6; | 161 | u8 reserved:6; |
166 | u32 bmisx; | 162 | u32 bmisx; |
167 | } piix4; | 163 | } piix4; |
168 | }; | 164 | }; |
169 | 165 | ||
170 | extern int acpi_processor_register_performance ( | 166 | extern int acpi_processor_register_performance(struct acpi_processor_performance |
171 | struct acpi_processor_performance * performance, | 167 | *performance, unsigned int cpu); |
172 | unsigned int cpu); | 168 | extern void acpi_processor_unregister_performance(struct |
173 | extern void acpi_processor_unregister_performance ( | 169 | acpi_processor_performance |
174 | struct acpi_processor_performance * performance, | 170 | *performance, |
175 | unsigned int cpu); | 171 | unsigned int cpu); |
176 | 172 | ||
177 | /* note: this locks both the calling module and the processor module | 173 | /* note: this locks both the calling module and the processor module |
178 | if a _PPC object exists, rmmod is disallowed then */ | 174 | if a _PPC object exists, rmmod is disallowed then */ |
179 | int acpi_processor_notify_smm(struct module *calling_module); | 175 | int acpi_processor_notify_smm(struct module *calling_module); |
180 | 176 | ||
181 | |||
182 | |||
183 | /* for communication between multiple parts of the processor kernel module */ | 177 | /* for communication between multiple parts of the processor kernel module */ |
184 | extern struct acpi_processor *processors[NR_CPUS]; | 178 | extern struct acpi_processor *processors[NR_CPUS]; |
185 | extern struct acpi_processor_errata errata; | 179 | extern struct acpi_processor_errata errata; |
186 | 180 | ||
187 | int acpi_processor_set_pdc(struct acpi_processor *pr, | 181 | int acpi_processor_set_pdc(struct acpi_processor *pr, |
188 | struct acpi_object_list *pdc_in); | 182 | struct acpi_object_list *pdc_in); |
189 | 183 | ||
190 | #ifdef ARCH_HAS_POWER_PDC_INIT | 184 | #ifdef ARCH_HAS_POWER_PDC_INIT |
191 | void acpi_processor_power_init_pdc(struct acpi_processor_power *pow, | 185 | void acpi_processor_power_init_pdc(struct acpi_processor_power *pow, |
192 | unsigned int cpu); | 186 | unsigned int cpu); |
193 | void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags, | 187 | void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags, |
194 | unsigned int cpu); | 188 | unsigned int cpu); |
195 | #else | 189 | #else |
196 | static inline void acpi_processor_power_init_pdc( | 190 | static inline void acpi_processor_power_init_pdc(struct acpi_processor_power |
197 | struct acpi_processor_power *pow, unsigned int cpu) | 191 | *pow, unsigned int cpu) |
198 | { | 192 | { |
199 | pow->pdc = NULL; | 193 | pow->pdc = NULL; |
200 | return; | 194 | return; |
201 | } | 195 | } |
202 | 196 | ||
203 | static inline void acpi_processor_power_init_bm_check( | 197 | static inline void acpi_processor_power_init_bm_check(struct |
204 | struct acpi_processor_flags *flags, unsigned int cpu) | 198 | acpi_processor_flags |
199 | *flags, unsigned int cpu) | ||
205 | { | 200 | { |
206 | flags->bm_check = 1; | 201 | flags->bm_check = 1; |
207 | return; | 202 | return; |
@@ -215,51 +210,62 @@ void acpi_processor_ppc_init(void); | |||
215 | void acpi_processor_ppc_exit(void); | 210 | void acpi_processor_ppc_exit(void); |
216 | int acpi_processor_ppc_has_changed(struct acpi_processor *pr); | 211 | int acpi_processor_ppc_has_changed(struct acpi_processor *pr); |
217 | #else | 212 | #else |
218 | static inline void acpi_processor_ppc_init(void) { return; } | 213 | static inline void acpi_processor_ppc_init(void) |
219 | static inline void acpi_processor_ppc_exit(void) { return; } | 214 | { |
220 | static inline int acpi_processor_ppc_has_changed(struct acpi_processor *pr) { | 215 | return; |
216 | } | ||
217 | static inline void acpi_processor_ppc_exit(void) | ||
218 | { | ||
219 | return; | ||
220 | } | ||
221 | static inline int acpi_processor_ppc_has_changed(struct acpi_processor *pr) | ||
222 | { | ||
221 | static unsigned int printout = 1; | 223 | static unsigned int printout = 1; |
222 | if (printout) { | 224 | if (printout) { |
223 | printk(KERN_WARNING "Warning: Processor Platform Limit event detected, but not handled.\n"); | 225 | printk(KERN_WARNING |
224 | printk(KERN_WARNING "Consider compiling CPUfreq support into your kernel.\n"); | 226 | "Warning: Processor Platform Limit event detected, but not handled.\n"); |
227 | printk(KERN_WARNING | ||
228 | "Consider compiling CPUfreq support into your kernel.\n"); | ||
225 | printout = 0; | 229 | printout = 0; |
226 | } | 230 | } |
227 | return 0; | 231 | return 0; |
228 | } | 232 | } |
229 | #endif /* CONFIG_CPU_FREQ */ | 233 | #endif /* CONFIG_CPU_FREQ */ |
230 | 234 | ||
231 | /* in processor_throttling.c */ | 235 | /* in processor_throttling.c */ |
232 | int acpi_processor_get_throttling_info (struct acpi_processor *pr); | 236 | int acpi_processor_get_throttling_info(struct acpi_processor *pr); |
233 | int acpi_processor_set_throttling (struct acpi_processor *pr, int state); | 237 | int acpi_processor_set_throttling(struct acpi_processor *pr, int state); |
234 | ssize_t acpi_processor_write_throttling ( | 238 | ssize_t acpi_processor_write_throttling(struct file *file, |
235 | struct file *file, | 239 | const char __user * buffer, |
236 | const char __user *buffer, | 240 | size_t count, loff_t * data); |
237 | size_t count, | ||
238 | loff_t *data); | ||
239 | extern struct file_operations acpi_processor_throttling_fops; | 241 | extern struct file_operations acpi_processor_throttling_fops; |
240 | 242 | ||
241 | /* in processor_idle.c */ | 243 | /* in processor_idle.c */ |
242 | int acpi_processor_power_init(struct acpi_processor *pr, struct acpi_device *device); | 244 | int acpi_processor_power_init(struct acpi_processor *pr, |
243 | int acpi_processor_cst_has_changed (struct acpi_processor *pr); | 245 | struct acpi_device *device); |
244 | int acpi_processor_power_exit(struct acpi_processor *pr, struct acpi_device *device); | 246 | int acpi_processor_cst_has_changed(struct acpi_processor *pr); |
245 | 247 | int acpi_processor_power_exit(struct acpi_processor *pr, | |
248 | struct acpi_device *device); | ||
246 | 249 | ||
247 | /* in processor_thermal.c */ | 250 | /* in processor_thermal.c */ |
248 | int acpi_processor_get_limit_info (struct acpi_processor *pr); | 251 | int acpi_processor_get_limit_info(struct acpi_processor *pr); |
249 | ssize_t acpi_processor_write_limit ( | 252 | ssize_t acpi_processor_write_limit(struct file *file, |
250 | struct file *file, | 253 | const char __user * buffer, |
251 | const char __user *buffer, | 254 | size_t count, loff_t * data); |
252 | size_t count, | ||
253 | loff_t *data); | ||
254 | extern struct file_operations acpi_processor_limit_fops; | 255 | extern struct file_operations acpi_processor_limit_fops; |
255 | 256 | ||
256 | #ifdef CONFIG_CPU_FREQ | 257 | #ifdef CONFIG_CPU_FREQ |
257 | void acpi_thermal_cpufreq_init(void); | 258 | void acpi_thermal_cpufreq_init(void); |
258 | void acpi_thermal_cpufreq_exit(void); | 259 | void acpi_thermal_cpufreq_exit(void); |
259 | #else | 260 | #else |
260 | static inline void acpi_thermal_cpufreq_init(void) { return; } | 261 | static inline void acpi_thermal_cpufreq_init(void) |
261 | static inline void acpi_thermal_cpufreq_exit(void) { return; } | 262 | { |
263 | return; | ||
264 | } | ||
265 | static inline void acpi_thermal_cpufreq_exit(void) | ||
266 | { | ||
267 | return; | ||
268 | } | ||
262 | #endif | 269 | #endif |
263 | 270 | ||
264 | |||
265 | #endif | 271 | #endif |