aboutsummaryrefslogtreecommitdiffstats
path: root/include/acpi/aclocal.h
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2005-08-05 00:44:28 -0400
committerLen Brown <len.brown@intel.com>2005-08-05 00:45:14 -0400
commit4be44fcd3bf648b782f4460fd06dfae6c42ded4b (patch)
tree5b5b7d296ea58786f53b95e5eac9565ff66890b0 /include/acpi/aclocal.h
parentc65ade4dc8b486e8c8b9b0a6399789a5428e2039 (diff)
[ACPI] Lindent all ACPI files
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'include/acpi/aclocal.h')
-rw-r--r--include/acpi/aclocal.h678
1 files changed, 281 insertions, 397 deletions
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 */ 49typedef void *acpi_mutex;
49 50typedef u32 acpi_mutex_handle;
50typedef void * acpi_mutex;
51typedef 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
61struct acpi_walk_state ; 58struct acpi_walk_state;
62struct acpi_obj_mutex; 59struct acpi_obj_mutex;
63union acpi_parse_object ; 60union 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
105static char *acpi_gbl_mutex_names[] = 99static 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
128typedef u8 acpi_owner_id; 120typedef 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
137struct acpi_mutex_info 129struct 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
167typedef enum 155typedef 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 */
183union acpi_name_union 168union acpi_name_union {
184{ 169 u32 integer;
185 u32 integer; 170 char ascii[4];
186 char ascii[4]; 171};
187}; 172
188 173struct acpi_namespace_node {
189struct 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 */
227struct acpi_table_desc 208struct 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
243struct acpi_table_list 223struct 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 228struct acpi_find_context {
250struct 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 234struct acpi_ns_search_data {
258struct 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 */
267struct acpi_predefined_names 241struct 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
283struct acpi_namestring_info 254struct 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
297struct acpi_create_field_info 266struct 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
320struct acpi_handler_info 287struct 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
327union acpi_gpe_dispatch_info 293union 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 */
337struct acpi_gpe_event_info 302struct 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
347struct acpi_gpe_register_info 311struct 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 */
360struct acpi_gpe_block_info 323struct 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
375struct acpi_gpe_xrupt_info 337struct 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 344struct acpi_gpe_walk_info {
384struct 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 349typedef acpi_status(*ACPI_GPE_CALLBACK) (struct acpi_gpe_xrupt_info *
391typedef 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
398struct acpi_fixed_event_handler 356struct 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
404struct acpi_fixed_event_info 361struct 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
414struct acpi_field_info 370struct 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
443struct acpi_common_state 396struct acpi_common_state {
444{ 397ACPI_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 */
452struct acpi_update_state 402struct 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 */
462struct acpi_pkg_state 409struct 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 */
478struct acpi_control_state 422struct 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 */
491struct acpi_scope_state 432struct 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 436struct acpi_pscope_state {
498struct 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 */
513struct acpi_thread_state 448struct 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 */
527struct acpi_result_values 459struct 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
536typedef 466typedef
537acpi_status (*acpi_parse_downwards) ( 467acpi_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
541typedef
542acpi_status (*acpi_parse_upwards) (
543 struct acpi_walk_state *walk_state);
544 469
470typedef 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 */
550struct acpi_notify_info 476struct 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
560union acpi_generic_state 483union 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
580typedef 501typedef acpi_status(*ACPI_EXECUTE_OP) (struct acpi_walk_state * walk_state);
581acpi_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 */
594struct acpi_opcode_info 512struct 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
607union acpi_parse_value 524union 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 */
644struct acpi_parse_obj_common 560struct acpi_parse_obj_common {
645{ 561ACPI_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 */
654struct acpi_parse_obj_named 567struct 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
666struct acpi_parse_obj_asl 576struct 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}; 603union acpi_parse_object {
694 604 struct acpi_parse_obj_common common;
695union 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 */
707struct acpi_parse_state 613struct 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
747struct acpi_bit_register_info 650struct 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
896struct acpi_db_method_info 791struct 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
906struct acpi_integrity_info 800struct 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
939struct acpi_debug_mem_header 830struct acpi_debug_mem_header {
940{ 831ACPI_COMMON_DEBUG_MEM_HEADER};
941 ACPI_COMMON_DEBUG_MEM_HEADER
942};
943 832
944struct acpi_debug_mem_block 833struct 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 842struct acpi_memory_list {
957struct 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__ */