aboutsummaryrefslogtreecommitdiffstats
path: root/include/acpi/aclocal.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/acpi/aclocal.h')
-rw-r--r--include/acpi/aclocal.h208
1 files changed, 106 insertions, 102 deletions
diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h
index 94fbf96ed3df..5956431784d5 100644
--- a/include/acpi/aclocal.h
+++ b/include/acpi/aclocal.h
@@ -44,7 +44,10 @@
44#ifndef __ACLOCAL_H__ 44#ifndef __ACLOCAL_H__
45#define __ACLOCAL_H__ 45#define __ACLOCAL_H__
46 46
47/* acpisrc:struct_defs -- for acpisrc conversion */
48
47#define ACPI_WAIT_FOREVER 0xFFFF /* u16, as per ACPI spec */ 49#define ACPI_WAIT_FOREVER 0xFFFF /* u16, as per ACPI spec */
50#define ACPI_INFINITE_CONCURRENCY 0xFF
48 51
49typedef void *acpi_mutex; 52typedef void *acpi_mutex;
50typedef u32 acpi_mutex_handle; 53typedef u32 acpi_mutex_handle;
@@ -144,6 +147,8 @@ struct acpi_mutex_info {
144#define ACPI_FIELD_DWORD_GRANULARITY 4 147#define ACPI_FIELD_DWORD_GRANULARITY 4
145#define ACPI_FIELD_QWORD_GRANULARITY 8 148#define ACPI_FIELD_QWORD_GRANULARITY 8
146 149
150#define ACPI_ENTRY_NOT_FOUND NULL
151
147/***************************************************************************** 152/*****************************************************************************
148 * 153 *
149 * Namespace typedefs and structs 154 * Namespace typedefs and structs
@@ -158,49 +163,45 @@ typedef enum {
158 ACPI_IMODE_EXECUTE = 0x0E 163 ACPI_IMODE_EXECUTE = 0x0E
159} acpi_interpreter_mode; 164} acpi_interpreter_mode;
160 165
161/*
162 * The Node describes a named object that appears in the AML
163 * An acpi_node is used to store Nodes.
164 *
165 * data_type is used to differentiate between internal descriptors, and MUST
166 * be the first byte in this structure.
167 */
168union acpi_name_union { 166union acpi_name_union {
169 u32 integer; 167 u32 integer;
170 char ascii[4]; 168 char ascii[4];
171}; 169};
172 170
171/*
172 * The Namespace Node describes a named object that appears in the AML.
173 * descriptor_type is used to differentiate between internal descriptors.
174 *
175 * The node is optimized for both 32-bit and 64-bit platforms:
176 * 20 bytes for the 32-bit case, 32 bytes for the 64-bit case.
177 */
173struct acpi_namespace_node { 178struct acpi_namespace_node {
174 u8 descriptor; /* Used to differentiate object descriptor types */ 179 union acpi_operand_object *object; /* Interpreter object */
175 u8 type; /* Type associated with this name */ 180 u8 descriptor_type; /* Differentiate object descriptor types */
176 u16 reference_count; /* Current count of references and children */ 181 u8 flags; /* Miscellaneous flags */
182 acpi_owner_id owner_id; /* Node creator */
183 u8 type; /* ACPI Type associated with this name */
177 union acpi_name_union name; /* ACPI Name, always 4 chars per ACPI spec */ 184 union acpi_name_union name; /* ACPI Name, always 4 chars per ACPI spec */
178 union acpi_operand_object *object; /* Pointer to attached ACPI object (optional) */
179 struct acpi_namespace_node *child; /* First child */ 185 struct acpi_namespace_node *child; /* First child */
180 struct acpi_namespace_node *peer; /* Next peer */ 186 struct acpi_namespace_node *peer; /* Peer. Parent if ANOBJ_END_OF_PEER_LIST set */
181 u8 owner_id; /* Who created this node */
182 u8 flags;
183 187
184 /* Fields used by the ASL compiler and disassembler only */ 188 /* Fields used by the ASL compiler and disassembler only: */
185 189
186#ifdef ACPI_LARGE_NAMESPACE_NODE 190#ifdef ACPI_LARGE_NAMESPACE_NODE
187 u32 value;
188 union acpi_parse_object *op; 191 union acpi_parse_object *op;
192 u32 value;
189#endif 193#endif
190}; 194};
191 195
192#define ACPI_ENTRY_NOT_FOUND NULL 196/* Namespace Node flags */
193
194/* Node flags */
195 197
196#define ANOBJ_RESERVED 0x01 198#define ANOBJ_END_OF_PEER_LIST 0x01 /* End-of-list, Peer field points to parent */
197#define ANOBJ_END_OF_PEER_LIST 0x02 199#define ANOBJ_DATA_WIDTH_32 0x02 /* Parent table uses 32-bit math */
198#define ANOBJ_DATA_WIDTH_32 0x04 /* Parent table is 64-bits */ 200#define ANOBJ_METHOD_ARG 0x04 /* Node is a method argument */
199#define ANOBJ_METHOD_ARG 0x08 201#define ANOBJ_METHOD_LOCAL 0x08 /* Node is a method local */
200#define ANOBJ_METHOD_LOCAL 0x10 202#define ANOBJ_METHOD_NO_RETVal 0x10 /* i_aSL only: Method has no return value */
201#define ANOBJ_METHOD_NO_RETVAL 0x20 203#define ANOBJ_METHOD_SOME_NO_RETVal 0x20 /* i_aSL only: Method has at least one return value */
202#define ANOBJ_METHOD_SOME_NO_RETVAL 0x40 204#define ANOBJ_IS_BIT_OFFSet 0x40 /* i_aSL only: Reference is a bit offset */
203#define ANOBJ_IS_BIT_OFFSET 0x80
204 205
205/* 206/*
206 * ACPI Table Descriptor. One per ACPI table 207 * ACPI Table Descriptor. One per ACPI table
@@ -212,8 +213,8 @@ struct acpi_table_desc {
212 struct acpi_table_header *pointer; 213 struct acpi_table_header *pointer;
213 u8 *aml_start; 214 u8 *aml_start;
214 u64 physical_address; 215 u64 physical_address;
215 u32 aml_length;
216 acpi_size length; 216 acpi_size length;
217 u32 aml_length;
217 acpi_owner_id owner_id; 218 acpi_owner_id owner_id;
218 u8 type; 219 u8 type;
219 u8 allocation; 220 u8 allocation;
@@ -276,6 +277,9 @@ struct acpi_create_field_info {
276 u8 field_type; 277 u8 field_type;
277}; 278};
278 279
280typedef
281acpi_status(*ACPI_INTERNAL_METHOD) (struct acpi_walk_state * walk_state);
282
279/* 283/*
280 * Bitmapped ACPI types. Used internally only 284 * Bitmapped ACPI types. Used internally only
281 */ 285 */
@@ -377,7 +381,7 @@ struct acpi_gpe_walk_info {
377 struct acpi_gpe_block_info *gpe_block; 381 struct acpi_gpe_block_info *gpe_block;
378}; 382};
379 383
380typedef acpi_status(*ACPI_GPE_CALLBACK) (struct acpi_gpe_xrupt_info * 384typedef acpi_status(*acpi_gpe_callback) (struct acpi_gpe_xrupt_info *
381 gpe_xrupt_info, 385 gpe_xrupt_info,
382 struct acpi_gpe_block_info * 386 struct acpi_gpe_block_info *
383 gpe_block); 387 gpe_block);
@@ -416,13 +420,14 @@ struct acpi_field_info {
416#define ACPI_CONTROL_PREDICATE_FALSE 0xC3 420#define ACPI_CONTROL_PREDICATE_FALSE 0xC3
417#define ACPI_CONTROL_PREDICATE_TRUE 0xC4 421#define ACPI_CONTROL_PREDICATE_TRUE 0xC4
418 422
419#define ACPI_STATE_COMMON /* Two 32-bit fields and a pointer */\ 423#define ACPI_STATE_COMMON \
420 u8 data_type; /* To differentiate various internal objs */\ 424 void *next; \
421 u8 flags; \ 425 u8 descriptor_type; /* To differentiate various internal objs */\
422 u16 value; \ 426 u8 flags; \
423 u16 state; \ 427 u16 value; \
424 u16 reserved; \ 428 u16 state;
425 void *next; 429
430 /* There are 2 bytes available here until the next natural alignment boundary */
426 431
427struct acpi_common_state { 432struct acpi_common_state {
428ACPI_STATE_COMMON}; 433ACPI_STATE_COMMON};
@@ -438,12 +443,12 @@ struct acpi_update_state {
438 * Pkg state - used to traverse nested package structures 443 * Pkg state - used to traverse nested package structures
439 */ 444 */
440struct acpi_pkg_state { 445struct acpi_pkg_state {
441 ACPI_STATE_COMMON union acpi_operand_object *source_object; 446 ACPI_STATE_COMMON u16 index;
447 union acpi_operand_object *source_object;
442 union acpi_operand_object *dest_object; 448 union acpi_operand_object *dest_object;
443 struct acpi_walk_state *walk_state; 449 struct acpi_walk_state *walk_state;
444 void *this_target_obj; 450 void *this_target_obj;
445 u32 num_packages; 451 u32 num_packages;
446 u16 index;
447}; 452};
448 453
449/* 454/*
@@ -451,10 +456,10 @@ struct acpi_pkg_state {
451 * Allows nesting of these constructs 456 * Allows nesting of these constructs
452 */ 457 */
453struct acpi_control_state { 458struct acpi_control_state {
454 ACPI_STATE_COMMON union acpi_parse_object *predicate_op; 459 ACPI_STATE_COMMON u16 opcode;
460 union acpi_parse_object *predicate_op;
455 u8 *aml_predicate_start; /* Start of if/while predicate */ 461 u8 *aml_predicate_start; /* Start of if/while predicate */
456 u8 *package_end; /* End of if/while block */ 462 u8 *package_end; /* End of if/while block */
457 u16 opcode;
458}; 463};
459 464
460/* 465/*
@@ -465,11 +470,11 @@ struct acpi_scope_state {
465}; 470};
466 471
467struct acpi_pscope_state { 472struct acpi_pscope_state {
468 ACPI_STATE_COMMON union acpi_parse_object *op; /* Current op being parsed */ 473 ACPI_STATE_COMMON u8 arg_count; /* Number of fixed arguments */
474 union acpi_parse_object *op; /* Current op being parsed */
469 u8 *arg_end; /* Current argument end */ 475 u8 *arg_end; /* Current argument end */
470 u8 *pkg_end; /* Current package end */ 476 u8 *pkg_end; /* Current package end */
471 u32 arg_list; /* Next argument to parse */ 477 u32 arg_list; /* Next argument to parse */
472 u32 arg_count; /* Number of fixed arguments */
473}; 478};
474 479
475/* 480/*
@@ -477,10 +482,10 @@ struct acpi_pscope_state {
477 * states are created when there are nested control methods executing. 482 * states are created when there are nested control methods executing.
478 */ 483 */
479struct acpi_thread_state { 484struct acpi_thread_state {
480 ACPI_STATE_COMMON struct acpi_walk_state *walk_state_list; /* Head of list of walk_states for this thread */ 485 ACPI_STATE_COMMON u8 current_sync_level; /* Mutex Sync (nested acquire) level */
486 struct acpi_walk_state *walk_state_list; /* Head of list of walk_states for this thread */
481 union acpi_operand_object *acquired_mutex_list; /* List of all currently acquired mutexes */ 487 union acpi_operand_object *acquired_mutex_list; /* List of all currently acquired mutexes */
482 acpi_thread_id thread_id; /* Running thread ID */ 488 acpi_thread_id thread_id; /* Running thread ID */
483 u8 current_sync_level; /* Mutex Sync (nested acquire) level */
484}; 489};
485 490
486/* 491/*
@@ -488,10 +493,9 @@ struct acpi_thread_state {
488 * AML arguments 493 * AML arguments
489 */ 494 */
490struct acpi_result_values { 495struct acpi_result_values {
491 ACPI_STATE_COMMON 496 ACPI_STATE_COMMON u8 num_results;
492 union acpi_operand_object *obj_desc[ACPI_OBJ_NUM_OPERANDS];
493 u8 num_results;
494 u8 last_insert; 497 u8 last_insert;
498 union acpi_operand_object *obj_desc[ACPI_OBJ_NUM_OPERANDS];
495}; 499};
496 500
497typedef 501typedef
@@ -546,7 +550,7 @@ struct acpi_opcode_info {
546#endif 550#endif
547 u32 parse_args; /* Grammar/Parse time arguments */ 551 u32 parse_args; /* Grammar/Parse time arguments */
548 u32 runtime_args; /* Interpret time arguments */ 552 u32 runtime_args; /* Interpret time arguments */
549 u32 flags; /* Misc flags */ 553 u16 flags; /* Misc flags */
550 u8 object_type; /* Corresponding internal object type */ 554 u8 object_type; /* Corresponding internal object type */
551 u8 class; /* Opcode class */ 555 u8 class; /* Opcode class */
552 u8 type; /* Opcode type */ 556 u8 type; /* Opcode type */
@@ -563,29 +567,28 @@ union acpi_parse_value {
563}; 567};
564 568
565#define ACPI_PARSE_COMMON \ 569#define ACPI_PARSE_COMMON \
566 u8 data_type; /* To differentiate various internal objs */\ 570 union acpi_parse_object *parent; /* Parent op */\
567 u8 flags; /* Type of Op */\ 571 u8 descriptor_type; /* To differentiate various internal objs */\
568 u16 aml_opcode; /* AML opcode */\ 572 u8 flags; /* Type of Op */\
569 u32 aml_offset; /* Offset of declaration in AML */\ 573 u16 aml_opcode; /* AML opcode */\
570 union acpi_parse_object *parent; /* Parent op */\ 574 u32 aml_offset; /* Offset of declaration in AML */\
571 union acpi_parse_object *next; /* Next op */\ 575 union acpi_parse_object *next; /* Next op */\
576 struct acpi_namespace_node *node; /* For use by interpreter */\
577 union acpi_parse_value value; /* Value or args associated with the opcode */\
572 ACPI_DISASM_ONLY_MEMBERS (\ 578 ACPI_DISASM_ONLY_MEMBERS (\
573 u8 disasm_flags; /* Used during AML disassembly */\ 579 u8 disasm_flags; /* Used during AML disassembly */\
574 u8 disasm_opcode; /* Subtype used for disassembly */\ 580 u8 disasm_opcode; /* Subtype used for disassembly */\
575 char aml_op_name[16]) /* Op name (debug only) */\ 581 char aml_op_name[16]) /* Op name (debug only) */
576 /* NON-DEBUG members below: */\ 582
577 struct acpi_namespace_node *node; /* For use by interpreter */\ 583#define ACPI_DASM_BUFFER 0x00
578 union acpi_parse_value value; /* Value or args associated with the opcode */ 584#define ACPI_DASM_RESOURCE 0x01
579 585#define ACPI_DASM_STRING 0x02
580#define ACPI_DASM_BUFFER 0x00 586#define ACPI_DASM_UNICODE 0x03
581#define ACPI_DASM_RESOURCE 0x01 587#define ACPI_DASM_EISAID 0x04
582#define ACPI_DASM_STRING 0x02 588#define ACPI_DASM_MATCHOP 0x05
583#define ACPI_DASM_UNICODE 0x03
584#define ACPI_DASM_EISAID 0x04
585#define ACPI_DASM_MATCHOP 0x05
586 589
587/* 590/*
588 * generic operation (for example: If, While, Store) 591 * Generic operation (for example: If, While, Store)
589 */ 592 */
590struct acpi_parse_obj_common { 593struct acpi_parse_obj_common {
591ACPI_PARSE_COMMON}; 594ACPI_PARSE_COMMON};
@@ -601,7 +604,7 @@ struct acpi_parse_obj_named {
601 u32 name; /* 4-byte name or zero if no name */ 604 u32 name; /* 4-byte name or zero if no name */
602}; 605};
603 606
604/* The parse node is the fundamental element of the parse tree */ 607/* this version is used by the i_aSL compiler only */
605 608
606#define ACPI_MAX_PARSEOP_NAME 20 609#define ACPI_MAX_PARSEOP_NAME 20
607 610
@@ -643,7 +646,6 @@ union acpi_parse_object {
643 * method. 646 * method.
644 */ 647 */
645struct acpi_parse_state { 648struct acpi_parse_state {
646 u32 aml_size;
647 u8 *aml_start; /* First AML byte */ 649 u8 *aml_start; /* First AML byte */
648 u8 *aml; /* Next AML byte */ 650 u8 *aml; /* Next AML byte */
649 u8 *aml_end; /* (last + 1) AML byte */ 651 u8 *aml_end; /* (last + 1) AML byte */
@@ -653,22 +655,23 @@ struct acpi_parse_state {
653 struct acpi_namespace_node *start_node; 655 struct acpi_namespace_node *start_node;
654 union acpi_generic_state *scope; /* Current scope */ 656 union acpi_generic_state *scope; /* Current scope */
655 union acpi_parse_object *start_scope; 657 union acpi_parse_object *start_scope;
658 u32 aml_size;
656}; 659};
657 660
658/* Parse object flags */ 661/* Parse object flags */
659 662
660#define ACPI_PARSEOP_GENERIC 0x01 663#define ACPI_PARSEOP_GENERIC 0x01
661#define ACPI_PARSEOP_NAMED 0x02 664#define ACPI_PARSEOP_NAMED 0x02
662#define ACPI_PARSEOP_DEFERRED 0x04 665#define ACPI_PARSEOP_DEFERRED 0x04
663#define ACPI_PARSEOP_BYTELIST 0x08 666#define ACPI_PARSEOP_BYTELIST 0x08
664#define ACPI_PARSEOP_IN_CACHE 0x80 667#define ACPI_PARSEOP_IN_CACHE 0x80
665 668
666/* Parse object disasm_flags */ 669/* Parse object disasm_flags */
667 670
668#define ACPI_PARSEOP_IGNORE 0x01 671#define ACPI_PARSEOP_IGNORE 0x01
669#define ACPI_PARSEOP_PARAMLIST 0x02 672#define ACPI_PARSEOP_PARAMLIST 0x02
670#define ACPI_PARSEOP_EMPTY_TERMLIST 0x04 673#define ACPI_PARSEOP_EMPTY_TERMLIST 0x04
671#define ACPI_PARSEOP_SPECIAL 0x10 674#define ACPI_PARSEOP_SPECIAL 0x10
672 675
673/***************************************************************************** 676/*****************************************************************************
674 * 677 *
@@ -676,8 +679,8 @@ struct acpi_parse_state {
676 * 679 *
677 ****************************************************************************/ 680 ****************************************************************************/
678 681
679#define PCI_ROOT_HID_STRING "PNP0A03" 682#define PCI_ROOT_HID_STRING "PNP0A03"
680#define PCI_EXPRESS_ROOT_HID_STRING "PNP0A08" 683#define PCI_EXPRESS_ROOT_HID_STRING "PNP0A08"
681 684
682struct acpi_bit_register_info { 685struct acpi_bit_register_info {
683 u8 parent_register; 686 u8 parent_register;
@@ -710,13 +713,14 @@ struct acpi_bit_register_info {
710#define ACPI_BITMASK_PCIEXP_WAKE_STATUS 0x4000 /* ACPI 3.0 */ 713#define ACPI_BITMASK_PCIEXP_WAKE_STATUS 0x4000 /* ACPI 3.0 */
711#define ACPI_BITMASK_WAKE_STATUS 0x8000 714#define ACPI_BITMASK_WAKE_STATUS 0x8000
712 715
713#define ACPI_BITMASK_ALL_FIXED_STATUS (ACPI_BITMASK_TIMER_STATUS | \ 716#define ACPI_BITMASK_ALL_FIXED_STATUS (\
714 ACPI_BITMASK_BUS_MASTER_STATUS | \ 717 ACPI_BITMASK_TIMER_STATUS | \
715 ACPI_BITMASK_GLOBAL_LOCK_STATUS | \ 718 ACPI_BITMASK_BUS_MASTER_STATUS | \
716 ACPI_BITMASK_POWER_BUTTON_STATUS | \ 719 ACPI_BITMASK_GLOBAL_LOCK_STATUS | \
717 ACPI_BITMASK_SLEEP_BUTTON_STATUS | \ 720 ACPI_BITMASK_POWER_BUTTON_STATUS | \
718 ACPI_BITMASK_RT_CLOCK_STATUS | \ 721 ACPI_BITMASK_SLEEP_BUTTON_STATUS | \
719 ACPI_BITMASK_WAKE_STATUS) 722 ACPI_BITMASK_RT_CLOCK_STATUS | \
723 ACPI_BITMASK_WAKE_STATUS)
720 724
721#define ACPI_BITMASK_TIMER_ENABLE 0x0001 725#define ACPI_BITMASK_TIMER_ENABLE 0x0001
722#define ACPI_BITMASK_GLOBAL_LOCK_ENABLE 0x0020 726#define ACPI_BITMASK_GLOBAL_LOCK_ENABLE 0x0020
@@ -820,7 +824,7 @@ struct acpi_bit_register_info {
820 * 824 *
821 ****************************************************************************/ 825 ****************************************************************************/
822 826
823#define ACPI_ASCII_ZERO 0x30 827#define ACPI_ASCII_ZERO 0x30
824 828
825/***************************************************************************** 829/*****************************************************************************
826 * 830 *
@@ -842,9 +846,9 @@ struct acpi_integrity_info {
842 u32 objects; 846 u32 objects;
843}; 847};
844 848
845#define ACPI_DB_REDIRECTABLE_OUTPUT 0x01 849#define ACPI_DB_REDIRECTABLE_OUTPUT 0x01
846#define ACPI_DB_CONSOLE_OUTPUT 0x02 850#define ACPI_DB_CONSOLE_OUTPUT 0x02
847#define ACPI_DB_DUPLICATE_OUTPUT 0x03 851#define ACPI_DB_DUPLICATE_OUTPUT 0x03
848 852
849/***************************************************************************** 853/*****************************************************************************
850 * 854 *
@@ -854,18 +858,18 @@ struct acpi_integrity_info {
854 858
855/* Entry for a memory allocation (debug only) */ 859/* Entry for a memory allocation (debug only) */
856 860
857#define ACPI_MEM_MALLOC 0 861#define ACPI_MEM_MALLOC 0
858#define ACPI_MEM_CALLOC 1 862#define ACPI_MEM_CALLOC 1
859#define ACPI_MAX_MODULE_NAME 16 863#define ACPI_MAX_MODULE_NAME 16
860 864
861#define ACPI_COMMON_DEBUG_MEM_HEADER \ 865#define ACPI_COMMON_DEBUG_MEM_HEADER \
862 struct acpi_debug_mem_block *previous; \ 866 struct acpi_debug_mem_block *previous; \
863 struct acpi_debug_mem_block *next; \ 867 struct acpi_debug_mem_block *next; \
864 u32 size; \ 868 u32 size; \
865 u32 component; \ 869 u32 component; \
866 u32 line; \ 870 u32 line; \
867 char module[ACPI_MAX_MODULE_NAME]; \ 871 char module[ACPI_MAX_MODULE_NAME]; \
868 u8 alloc_type; 872 u8 alloc_type;
869 873
870struct acpi_debug_mem_header { 874struct acpi_debug_mem_header {
871ACPI_COMMON_DEBUG_MEM_HEADER}; 875ACPI_COMMON_DEBUG_MEM_HEADER};