aboutsummaryrefslogtreecommitdiffstats
path: root/include/acpi
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2006-03-17 16:44:00 -0500
committerLen Brown <len.brown@intel.com>2006-06-14 01:22:20 -0400
commit61686124f47d7c4b78610346c5f8f9d8a6d46bb5 (patch)
tree6fd91b2c1749907e58ef136107e53d634d7978c4 /include/acpi
parent144c87b4e03759214c362d267e01c2905f1ab095 (diff)
[ACPI] ACPICA 20060317
Implemented the use of a cache object for all internal namespace nodes. Since there are about 1000 static nodes in a typical system, this will decrease memory use for cache implementations that minimize per-allocation overhead (such as a slab allocator.) Removed the reference count mechanism for internal namespace nodes, since it was deemed unnecessary. This reduces the size of each namespace node by about 5%-10% on all platforms. Nodes are now 20 bytes for the 32-bit case, and 32 bytes for the 64-bit case. Optimized several internal data structures to reduce object size on 64-bit platforms by packing data within the 64-bit alignment. This includes the frequently used ACPI_OPERAND_OBJECT, of which there can be ~1000 static instances corresponding to the namespace objects. Added two new strings for the predefined _OSI method: "Windows 2001.1 SP1" and "Windows 2006". Split the allocation tracking mechanism out to a separate file, from utalloc.c to uttrack.c. This mechanism appears to be only useful for application-level code. Kernels may wish to not include uttrack.c in distributions. Removed all remnants of the obsolete ACPI_REPORT_* macros and the associated code. (These macros have been replaced by the ACPI_ERROR and ACPI_WARNING macros.) Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'include/acpi')
-rw-r--r--include/acpi/acconfig.h5
-rw-r--r--include/acpi/acevents.h2
-rw-r--r--include/acpi/acglobal.h1
-rw-r--r--include/acpi/aclocal.h208
-rw-r--r--include/acpi/acmacros.h20
-rw-r--r--include/acpi/acobject.h181
-rw-r--r--include/acpi/acoutput.h2
-rw-r--r--include/acpi/acparser.h7
-rw-r--r--include/acpi/acpixf.h4
-rw-r--r--include/acpi/acresrc.h5
-rw-r--r--include/acpi/acstruct.h39
-rw-r--r--include/acpi/actypes.h36
-rw-r--r--include/acpi/acutils.h49
-rw-r--r--include/acpi/amlresrc.h31
-rw-r--r--include/acpi/platform/acenv.h12
15 files changed, 313 insertions, 289 deletions
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index ebe793fc137f..f3acfd9249fc 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -63,7 +63,7 @@
63 63
64/* Current ACPICA subsystem version in YYYYMMDD format */ 64/* Current ACPICA subsystem version in YYYYMMDD format */
65 65
66#define ACPI_CA_VERSION 0x20060310 66#define ACPI_CA_VERSION 0x20060317
67 67
68/* 68/*
69 * OS name, used for the _OS object. The _OS object is essentially obsolete, 69 * OS name, used for the _OS object. The _OS object is essentially obsolete,
@@ -81,6 +81,7 @@
81#define ACPI_MAX_PARSE_CACHE_DEPTH 96 /* Parse tree objects */ 81#define ACPI_MAX_PARSE_CACHE_DEPTH 96 /* Parse tree objects */
82#define ACPI_MAX_EXTPARSE_CACHE_DEPTH 96 /* Parse tree objects */ 82#define ACPI_MAX_EXTPARSE_CACHE_DEPTH 96 /* Parse tree objects */
83#define ACPI_MAX_OBJECT_CACHE_DEPTH 96 /* Interpreter operand objects */ 83#define ACPI_MAX_OBJECT_CACHE_DEPTH 96 /* Interpreter operand objects */
84#define ACPI_MAX_NAMESPACE_CACHE_DEPTH 96 /* Namespace objects */
84 85
85/* 86/*
86 * Should the subsystem abort the loading of an ACPI table if the 87 * Should the subsystem abort the loading of an ACPI table if the
@@ -189,7 +190,7 @@
189 190
190/* Number of strings associated with the _OSI reserved method */ 191/* Number of strings associated with the _OSI reserved method */
191 192
192#define ACPI_NUM_OSI_STRINGS 10 193#define ACPI_NUM_OSI_STRINGS 12
193 194
194/****************************************************************************** 195/******************************************************************************
195 * 196 *
diff --git a/include/acpi/acevents.h b/include/acpi/acevents.h
index f2717be4fe0d..272bd0480ec7 100644
--- a/include/acpi/acevents.h
+++ b/include/acpi/acevents.h
@@ -93,7 +93,7 @@ struct acpi_gpe_event_info *acpi_ev_get_gpe_event_info(acpi_handle gpe_device,
93 */ 93 */
94u8 acpi_ev_valid_gpe_event(struct acpi_gpe_event_info *gpe_event_info); 94u8 acpi_ev_valid_gpe_event(struct acpi_gpe_event_info *gpe_event_info);
95 95
96acpi_status acpi_ev_walk_gpe_list(ACPI_GPE_CALLBACK gpe_walk_callback); 96acpi_status acpi_ev_walk_gpe_list(acpi_gpe_callback gpe_walk_callback);
97 97
98acpi_status 98acpi_status
99acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info, 99acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
diff --git a/include/acpi/acglobal.h b/include/acpi/acglobal.h
index 734cc77bf2c7..f9eb5925511f 100644
--- a/include/acpi/acglobal.h
+++ b/include/acpi/acglobal.h
@@ -203,6 +203,7 @@ ACPI_EXTERN struct acpi_memory_list *acpi_gbl_ns_node_list;
203 203
204/* Object caches */ 204/* Object caches */
205 205
206ACPI_EXTERN acpi_cache_t *acpi_gbl_namespace_cache;
206ACPI_EXTERN acpi_cache_t *acpi_gbl_state_cache; 207ACPI_EXTERN acpi_cache_t *acpi_gbl_state_cache;
207ACPI_EXTERN acpi_cache_t *acpi_gbl_ps_node_cache; 208ACPI_EXTERN acpi_cache_t *acpi_gbl_ps_node_cache;
208ACPI_EXTERN acpi_cache_t *acpi_gbl_ps_node_ext_cache; 209ACPI_EXTERN acpi_cache_t *acpi_gbl_ps_node_ext_cache;
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};
diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h
index c8aa73fc6dd3..c495670aa11a 100644
--- a/include/acpi/acmacros.h
+++ b/include/acpi/acmacros.h
@@ -400,8 +400,8 @@
400 * 400 *
401 * The "Descriptor" field is the first field in both structures. 401 * The "Descriptor" field is the first field in both structures.
402 */ 402 */
403#define ACPI_GET_DESCRIPTOR_TYPE(d) (((union acpi_descriptor *)(void *)(d))->descriptor_id) 403#define ACPI_GET_DESCRIPTOR_TYPE(d) (((union acpi_descriptor *)(void *)(d))->common.descriptor_type)
404#define ACPI_SET_DESCRIPTOR_TYPE(d,t) (((union acpi_descriptor *)(void *)(d))->descriptor_id = t) 404#define ACPI_SET_DESCRIPTOR_TYPE(d,t) (((union acpi_descriptor *)(void *)(d))->common.descriptor_type = t)
405 405
406/* Macro to test the object type */ 406/* Macro to test the object type */
407 407
@@ -490,7 +490,6 @@
490#define ACPI_ERROR(plist) 490#define ACPI_ERROR(plist)
491#define ACPI_ERROR_NAMESPACE(s,e) 491#define ACPI_ERROR_NAMESPACE(s,e)
492#define ACPI_ERROR_METHOD(s,n,p,e) 492#define ACPI_ERROR_METHOD(s,n,p,e)
493
494#endif 493#endif
495 494
496/* 495/*
@@ -532,13 +531,13 @@
532#endif 531#endif
533 532
534#define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a) \ 533#define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a) \
535 acpi_ut_trace(ACPI_DEBUG_PARAMETERS) 534 acpi_ut_trace(ACPI_DEBUG_PARAMETERS)
536#define ACPI_FUNCTION_TRACE_PTR(a,b) ACPI_FUNCTION_NAME(a) \ 535#define ACPI_FUNCTION_TRACE_PTR(a,b) ACPI_FUNCTION_NAME(a) \
537 acpi_ut_trace_ptr(ACPI_DEBUG_PARAMETERS,(void *)b) 536 acpi_ut_trace_ptr(ACPI_DEBUG_PARAMETERS,(void *)b)
538#define ACPI_FUNCTION_TRACE_U32(a,b) ACPI_FUNCTION_NAME(a) \ 537#define ACPI_FUNCTION_TRACE_U32(a,b) ACPI_FUNCTION_NAME(a) \
539 acpi_ut_trace_u32(ACPI_DEBUG_PARAMETERS,(u32)b) 538 acpi_ut_trace_u32(ACPI_DEBUG_PARAMETERS,(u32)b)
540#define ACPI_FUNCTION_TRACE_STR(a,b) ACPI_FUNCTION_NAME(a) \ 539#define ACPI_FUNCTION_TRACE_STR(a,b) ACPI_FUNCTION_NAME(a) \
541 acpi_ut_trace_str(ACPI_DEBUG_PARAMETERS,(char *)b) 540 acpi_ut_trace_str(ACPI_DEBUG_PARAMETERS,(char *)b)
542 541
543#define ACPI_FUNCTION_ENTRY() acpi_ut_track_stack_ptr() 542#define ACPI_FUNCTION_ENTRY() acpi_ut_track_stack_ptr()
544 543
@@ -658,6 +657,7 @@
658#define ACPI_DUMP_STACK_ENTRY(a) 657#define ACPI_DUMP_STACK_ENTRY(a)
659#define ACPI_DUMP_OPERANDS(a,b,c,d,e) 658#define ACPI_DUMP_OPERANDS(a,b,c,d,e)
660#define ACPI_DUMP_ENTRY(a,b) 659#define ACPI_DUMP_ENTRY(a,b)
660#define ACPI_DUMP_TABLES(a,b)
661#define ACPI_DUMP_PATHNAME(a,b,c,d) 661#define ACPI_DUMP_PATHNAME(a,b,c,d)
662#define ACPI_DUMP_RESOURCE_LIST(a) 662#define ACPI_DUMP_RESOURCE_LIST(a)
663#define ACPI_DUMP_BUFFER(a,b) 663#define ACPI_DUMP_BUFFER(a,b)
@@ -714,7 +714,7 @@
714/* Memory allocation */ 714/* Memory allocation */
715 715
716#define ACPI_ALLOCATE(a) acpi_ut_allocate((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__) 716#define ACPI_ALLOCATE(a) acpi_ut_allocate((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__)
717#define ACPI_ALLOCATE_ZEROED(a) acpi_ut_callocate((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__) 717#define ACPI_ALLOCATE_ZEROED(a) acpi_ut_allocate_zeroed((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__)
718#define ACPI_FREE(a) acpi_os_free(a) 718#define ACPI_FREE(a) acpi_os_free(a)
719#define ACPI_MEM_TRACKING(a) 719#define ACPI_MEM_TRACKING(a)
720 720
@@ -723,9 +723,9 @@
723/* Memory allocation */ 723/* Memory allocation */
724 724
725#define ACPI_ALLOCATE(a) acpi_ut_allocate_and_track((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__) 725#define ACPI_ALLOCATE(a) acpi_ut_allocate_and_track((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__)
726#define ACPI_ALLOCATE_ZEROED(a) acpi_ut_callocate_and_track((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__) 726#define ACPI_ALLOCATE_ZEROED(a) acpi_ut_allocate_zeroed_and_track((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__)
727#define ACPI_FREE(a) acpi_ut_free_and_track(a,_COMPONENT,_acpi_module_name,__LINE__) 727#define ACPI_FREE(a) acpi_ut_free_and_track(a,_COMPONENT,_acpi_module_name,__LINE__)
728#define ACPI_MEM_TRACKING(a) a 728#define ACPI_MEM_TRACKING(a) a
729 729
730#endif /* ACPI_DBG_TRACK_ALLOCATIONS */ 730#endif /* ACPI_DBG_TRACK_ALLOCATIONS */
731 731
diff --git a/include/acpi/acobject.h b/include/acpi/acobject.h
index d130cfed8d55..28241aa15de9 100644
--- a/include/acpi/acobject.h
+++ b/include/acpi/acobject.h
@@ -1,7 +1,7 @@
1 1
2/****************************************************************************** 2/******************************************************************************
3 * 3 *
4 * Name: acobject.h - Definition of union acpi_operand_object (Internal object only) 4 * Name: acobject.h - Definition of union acpi_operand_object (Internal object only)
5 * 5 *
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
@@ -45,10 +45,12 @@
45#ifndef _ACOBJECT_H 45#ifndef _ACOBJECT_H
46#define _ACOBJECT_H 46#define _ACOBJECT_H
47 47
48/* acpisrc:struct_defs -- for acpisrc conversion */
49
48/* 50/*
49 * The union acpi_operand_object is used to pass AML operands from the dispatcher 51 * The union acpi_operand_object is used to pass AML operands from the dispatcher
50 * to the interpreter, and to keep track of the various handlers such as 52 * to the interpreter, and to keep track of the various handlers such as
51 * address space handlers and notify handlers. The object is a constant 53 * address space handlers and notify handlers. The object is a constant
52 * size in order to allow it to be cached and reused. 54 * size in order to allow it to be cached and reused.
53 */ 55 */
54 56
@@ -61,17 +63,21 @@
61/* 63/*
62 * Common area for all objects. 64 * Common area for all objects.
63 * 65 *
64 * data_type is used to differentiate between internal descriptors, and MUST 66 * descriptor_type is used to differentiate between internal descriptors, and
65 * be the first byte in this structure. 67 * must be in the same place across all descriptors
66 */ 68 */
67#define ACPI_OBJECT_COMMON_HEADER /* SIZE/ALIGNMENT: 32 bits, one ptr plus trailing 8-bit flag */\ 69#define ACPI_OBJECT_COMMON_HEADER \
68 u8 descriptor; /* To differentiate various internal objs */\ 70 union acpi_operand_object *next_object; /* Objects linked to parent NS node */\
69 u8 type; /* acpi_object_type */\ 71 u8 descriptor_type; /* To differentiate various internal objs */\
70 u16 reference_count; /* For object deletion management */\ 72 u8 type; /* acpi_object_type */\
71 union acpi_operand_object *next_object; /* Objects linked to parent NS node */\ 73 u16 reference_count; /* For object deletion management */\
72 u8 flags; 74 u8 flags;
73 75 /*
74/* Values for flag byte above */ 76 * Note: There are 3 bytes available here before the
77 * next natural alignment boundary (for both 32/64 cases)
78 */
79
80/* Values for Flag byte above */
75 81
76#define AOPOBJ_AML_CONSTANT 0x01 82#define AOPOBJ_AML_CONSTANT 0x01
77#define AOPOBJ_STATIC_POINTER 0x02 83#define AOPOBJ_STATIC_POINTER 0x02
@@ -80,36 +86,6 @@
80#define AOPOBJ_SETUP_COMPLETE 0x10 86#define AOPOBJ_SETUP_COMPLETE 0x10
81#define AOPOBJ_SINGLE_DATUM 0x20 87#define AOPOBJ_SINGLE_DATUM 0x20
82 88
83/*
84 * Common bitfield for the field objects
85 * "Field Datum" -- a datum from the actual field object
86 * "Buffer Datum" -- a datum from a user buffer, read from or to be written to the field
87 */
88#define ACPI_COMMON_FIELD_INFO /* SIZE/ALIGNMENT: 24 bits + three 32-bit values */\
89 u8 field_flags; /* Access, update, and lock bits */\
90 u8 attribute; /* From access_as keyword */\
91 u8 access_byte_width; /* Read/Write size in bytes */\
92 u32 bit_length; /* Length of field in bits */\
93 u32 base_byte_offset; /* Byte offset within containing object */\
94 u8 start_field_bit_offset;/* Bit offset within first field datum (0-63) */\
95 u8 access_bit_width; /* Read/Write size in bits (8-64) */\
96 u32 value; /* Value to store into the Bank or Index register */\
97 struct acpi_namespace_node *node; /* Link back to parent node */
98
99/*
100 * Fields common to both Strings and Buffers
101 */
102#define ACPI_COMMON_BUFFER_INFO \
103 u32 length;
104
105/*
106 * Common fields for objects that support ASL notifications
107 */
108#define ACPI_COMMON_NOTIFY_INFO \
109 union acpi_operand_object *system_notify; /* Handler for system notifies */\
110 union acpi_operand_object *device_notify; /* Handler for driver notifies */\
111 union acpi_operand_object *handler; /* Handler for Address space */
112
113/****************************************************************************** 89/******************************************************************************
114 * 90 *
115 * Basic data types 91 * Basic data types
@@ -125,25 +101,31 @@ struct acpi_object_integer {
125 101
126/* 102/*
127 * Note: The String and Buffer object must be identical through the Pointer 103 * Note: The String and Buffer object must be identical through the Pointer
128 * element. There is code that depends on this. 104 * and length elements. There is code that depends on this.
105 *
106 * Fields common to both Strings and Buffers
129 */ 107 */
108#define ACPI_COMMON_BUFFER_INFO(_type) \
109 _type *pointer; \
110 u32 length;
111
130struct acpi_object_string { /* Null terminated, ASCII characters only */ 112struct acpi_object_string { /* Null terminated, ASCII characters only */
131 ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_BUFFER_INFO char *pointer; /* String in AML stream or allocated string */ 113 ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_BUFFER_INFO(char) /* String in AML stream or allocated string */
132}; 114};
133 115
134struct acpi_object_buffer { 116struct acpi_object_buffer {
135 ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_BUFFER_INFO u8 * pointer; /* Buffer in AML stream or allocated buffer */ 117 ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_BUFFER_INFO(u8) /* Buffer in AML stream or allocated buffer */
136 struct acpi_namespace_node *node; /* Link back to parent node */
137 u8 *aml_start;
138 u32 aml_length; 118 u32 aml_length;
119 u8 *aml_start;
120 struct acpi_namespace_node *node; /* Link back to parent node */
139}; 121};
140 122
141struct acpi_object_package { 123struct acpi_object_package {
142 ACPI_OBJECT_COMMON_HEADER u32 count; /* # of elements in package */ 124 ACPI_OBJECT_COMMON_HEADER struct acpi_namespace_node *node; /* Link back to parent node */
143 u32 aml_length;
144 u8 *aml_start;
145 struct acpi_namespace_node *node; /* Link back to parent node */
146 union acpi_operand_object **elements; /* Array of pointers to acpi_objects */ 125 union acpi_operand_object **elements; /* Array of pointers to acpi_objects */
126 u8 *aml_start;
127 u32 aml_length;
128 u32 count; /* # of elements in package */
147}; 129};
148 130
149/****************************************************************************** 131/******************************************************************************
@@ -156,23 +138,6 @@ struct acpi_object_event {
156 ACPI_OBJECT_COMMON_HEADER void *semaphore; 138 ACPI_OBJECT_COMMON_HEADER void *semaphore;
157}; 139};
158 140
159#define ACPI_INFINITE_CONCURRENCY 0xFF
160
161typedef
162acpi_status(*ACPI_INTERNAL_METHOD) (struct acpi_walk_state * walk_state);
163
164struct acpi_object_method {
165 ACPI_OBJECT_COMMON_HEADER u8 method_flags;
166 u8 param_count;
167 u32 aml_length;
168 void *semaphore;
169 u8 *aml_start;
170 ACPI_INTERNAL_METHOD implementation;
171 u8 concurrency;
172 u8 thread_count;
173 acpi_owner_id owner_id;
174};
175
176struct acpi_object_mutex { 141struct acpi_object_mutex {
177 ACPI_OBJECT_COMMON_HEADER u8 sync_level; /* 0-15, specified in Mutex() call */ 142 ACPI_OBJECT_COMMON_HEADER u8 sync_level; /* 0-15, specified in Mutex() call */
178 u16 acquisition_depth; /* Allow multiple Acquires, same thread */ 143 u16 acquisition_depth; /* Allow multiple Acquires, same thread */
@@ -186,11 +151,23 @@ struct acpi_object_mutex {
186 151
187struct acpi_object_region { 152struct acpi_object_region {
188 ACPI_OBJECT_COMMON_HEADER u8 space_id; 153 ACPI_OBJECT_COMMON_HEADER u8 space_id;
189 union acpi_operand_object *handler; /* Handler for region access */
190 struct acpi_namespace_node *node; /* Containing namespace node */ 154 struct acpi_namespace_node *node; /* Containing namespace node */
155 union acpi_operand_object *handler; /* Handler for region access */
191 union acpi_operand_object *next; 156 union acpi_operand_object *next;
192 u32 length;
193 acpi_physical_address address; 157 acpi_physical_address address;
158 u32 length;
159};
160
161struct acpi_object_method {
162 ACPI_OBJECT_COMMON_HEADER u8 method_flags;
163 u8 param_count;
164 u8 concurrency;
165 void *semaphore;
166 u8 *aml_start;
167 ACPI_INTERNAL_METHOD implementation;
168 u32 aml_length;
169 u8 thread_count;
170 acpi_owner_id owner_id;
194}; 171};
195 172
196/****************************************************************************** 173/******************************************************************************
@@ -199,6 +176,14 @@ struct acpi_object_region {
199 * 176 *
200 *****************************************************************************/ 177 *****************************************************************************/
201 178
179/*
180 * Common fields for objects that support ASL notifications
181 */
182#define ACPI_COMMON_NOTIFY_INFO \
183 union acpi_operand_object *system_notify; /* Handler for system notifies */\
184 union acpi_operand_object *device_notify; /* Handler for driver notifies */\
185 union acpi_operand_object *handler; /* Handler for Address space */
186
202struct acpi_object_notify_common { /* COMMON NOTIFY for POWER, PROCESSOR, DEVICE, and THERMAL */ 187struct acpi_object_notify_common { /* COMMON NOTIFY for POWER, PROCESSOR, DEVICE, and THERMAL */
203ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_NOTIFY_INFO}; 188ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_NOTIFY_INFO};
204 189
@@ -213,9 +198,9 @@ struct acpi_object_power_resource {
213}; 198};
214 199
215struct acpi_object_processor { 200struct acpi_object_processor {
216 ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_NOTIFY_INFO u32 proc_id; 201 ACPI_OBJECT_COMMON_HEADER u8 proc_id;
217 u32 length; 202 u8 length;
218 acpi_io_address address; 203 ACPI_COMMON_NOTIFY_INFO acpi_io_address address;
219}; 204};
220 205
221struct acpi_object_thermal_zone { 206struct acpi_object_thermal_zone {
@@ -227,9 +212,24 @@ ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_NOTIFY_INFO};
227 * 212 *
228 *****************************************************************************/ 213 *****************************************************************************/
229 214
215/*
216 * Common bitfield for the field objects
217 * "Field Datum" -- a datum from the actual field object
218 * "Buffer Datum" -- a datum from a user buffer, read from or to be written to the field
219 */
220#define ACPI_COMMON_FIELD_INFO \
221 u8 field_flags; /* Access, update, and lock bits */\
222 u8 attribute; /* From access_as keyword */\
223 u8 access_byte_width; /* Read/Write size in bytes */\
224 struct acpi_namespace_node *node; /* Link back to parent node */\
225 u32 bit_length; /* Length of field in bits */\
226 u32 base_byte_offset; /* Byte offset within containing object */\
227 u32 value; /* Value to store into the Bank or Index register */\
228 u8 start_field_bit_offset;/* Bit offset within first field datum (0-63) */\
229 u8 access_bit_width; /* Read/Write size in bits (8-64) */
230
230struct acpi_object_field_common { /* COMMON FIELD (for BUFFER, REGION, BANK, and INDEX fields) */ 231struct acpi_object_field_common { /* COMMON FIELD (for BUFFER, REGION, BANK, and INDEX fields) */
231 ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO union acpi_operand_object *region_obj; /* Containing Operation Region object */ 232 ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO union acpi_operand_object *region_obj; /* Parent Operation Region object (REGION/BANK fields only) */
232 /* (REGION/BANK fields only) */
233}; 233};
234 234
235struct acpi_object_region_field { 235struct acpi_object_region_field {
@@ -269,13 +269,9 @@ struct acpi_object_notify_handler {
269 void *context; 269 void *context;
270}; 270};
271 271
272/* Flags for address handler */
273
274#define ACPI_ADDR_HANDLER_DEFAULT_INSTALLED 0x1
275
276struct acpi_object_addr_handler { 272struct acpi_object_addr_handler {
277 ACPI_OBJECT_COMMON_HEADER u8 space_id; 273 ACPI_OBJECT_COMMON_HEADER u8 space_id;
278 u16 hflags; 274 u8 handler_flags;
279 acpi_adr_space_handler handler; 275 acpi_adr_space_handler handler;
280 struct acpi_namespace_node *node; /* Parent device */ 276 struct acpi_namespace_node *node; /* Parent device */
281 void *context; 277 void *context;
@@ -284,6 +280,10 @@ struct acpi_object_addr_handler {
284 union acpi_operand_object *next; 280 union acpi_operand_object *next;
285}; 281};
286 282
283/* Flags for address handler (handler_flags) */
284
285#define ACPI_ADDR_HANDLER_DEFAULT_INSTALLED 0x01
286
287/****************************************************************************** 287/******************************************************************************
288 * 288 *
289 * Special internal objects 289 * Special internal objects
@@ -297,10 +297,10 @@ struct acpi_object_addr_handler {
297struct acpi_object_reference { 297struct acpi_object_reference {
298 ACPI_OBJECT_COMMON_HEADER u8 target_type; /* Used for index_op */ 298 ACPI_OBJECT_COMMON_HEADER u8 target_type; /* Used for index_op */
299 u16 opcode; 299 u16 opcode;
300 u32 offset; /* Used for arg_op, local_op, and index_op */ 300 void *object; /* name_op=>HANDLE to obj, index_op=>union acpi_operand_object */
301 void *object; /* name_op=>HANDLE to obj, index_op=>union acpi_operand_object */
302 struct acpi_namespace_node *node; 301 struct acpi_namespace_node *node;
303 union acpi_operand_object **where; 302 union acpi_operand_object **where;
303 u32 offset; /* Used for arg_op, local_op, and index_op */
304}; 304};
305 305
306/* 306/*
@@ -311,12 +311,10 @@ struct acpi_object_reference {
311 * Currently: Region and field_unit types 311 * Currently: Region and field_unit types
312 */ 312 */
313struct acpi_object_extra { 313struct acpi_object_extra {
314 ACPI_OBJECT_COMMON_HEADER u8 byte_fill1; 314 ACPI_OBJECT_COMMON_HEADER struct acpi_namespace_node *method_REG; /* _REG method for this region (if any) */
315 u16 word_fill1;
316 u32 aml_length;
317 u8 *aml_start;
318 struct acpi_namespace_node *method_REG; /* _REG method for this region (if any) */
319 void *region_context; /* Region-specific data */ 315 void *region_context; /* Region-specific data */
316 u8 *aml_start;
317 u32 aml_length;
320}; 318};
321 319
322/* Additional data that can be attached to namespace nodes */ 320/* Additional data that can be attached to namespace nodes */
@@ -391,8 +389,13 @@ union acpi_operand_object {
391#define ACPI_DESC_TYPE_NAMED 0x0F 389#define ACPI_DESC_TYPE_NAMED 0x0F
392#define ACPI_DESC_TYPE_MAX 0x0F 390#define ACPI_DESC_TYPE_MAX 0x0F
393 391
392struct acpi_common_descriptor {
393 void *common_pointer;
394 u8 descriptor_type; /* To differentiate various internal objs */
395};
396
394union acpi_descriptor { 397union acpi_descriptor {
395 u8 descriptor_id; /* To differentiate various internal objs */ 398 struct acpi_common_descriptor common;
396 union acpi_operand_object object; 399 union acpi_operand_object object;
397 struct acpi_namespace_node node; 400 struct acpi_namespace_node node;
398 union acpi_parse_object op; 401 union acpi_parse_object op;
diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h
index 7785d481dc3e..621fe23bb4fb 100644
--- a/include/acpi/acoutput.h
+++ b/include/acpi/acoutput.h
@@ -144,7 +144,7 @@
144 144
145/* 145/*
146 * These two levels are essentially obsolete, all instances in the 146 * These two levels are essentially obsolete, all instances in the
147 * ACPICA core code have been replaced by REPORT_ERROR and REPORT_WARNING 147 * ACPICA core code have been replaced by ACPI_ERROR and ACPI_WARNING
148 * (Kept here because some drivers may still use them) 148 * (Kept here because some drivers may still use them)
149 */ 149 */
150#define ACPI_DB_ERROR ACPI_DEBUG_LEVEL (ACPI_LV_ERROR) 150#define ACPI_DB_ERROR ACPI_DEBUG_LEVEL (ACPI_LV_ERROR)
diff --git a/include/acpi/acparser.h b/include/acpi/acparser.h
index 5a1ff484af33..53ac4ce8753a 100644
--- a/include/acpi/acparser.h
+++ b/include/acpi/acparser.h
@@ -48,7 +48,7 @@
48 48
49/* variable # arguments */ 49/* variable # arguments */
50 50
51#define ACPI_VAR_ARGS ACPI_UINT32_MAX 51#define ACPI_VAR_ARGS ACPI_UINT8_MAX
52 52
53#define ACPI_PARSE_DELETE_TREE 0x0001 53#define ACPI_PARSE_DELETE_TREE 0x0001
54#define ACPI_PARSE_NO_TREE_DELETE 0x0000 54#define ACPI_PARSE_NO_TREE_DELETE 0x0000
@@ -146,13 +146,12 @@ u8 acpi_ps_has_completed_scope(struct acpi_parse_state *parser_state);
146 146
147void 147void
148acpi_ps_pop_scope(struct acpi_parse_state *parser_state, 148acpi_ps_pop_scope(struct acpi_parse_state *parser_state,
149 union acpi_parse_object **op, 149 union acpi_parse_object **op, u32 * arg_list, u8 * arg_count);
150 u32 * arg_list, u32 * arg_count);
151 150
152acpi_status 151acpi_status
153acpi_ps_push_scope(struct acpi_parse_state *parser_state, 152acpi_ps_push_scope(struct acpi_parse_state *parser_state,
154 union acpi_parse_object *op, 153 union acpi_parse_object *op,
155 u32 remaining_args, u32 arg_count); 154 u32 remaining_args, u8 arg_count);
156 155
157void acpi_ps_cleanup_scope(struct acpi_parse_state *state); 156void acpi_ps_cleanup_scope(struct acpi_parse_state *state);
158 157
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 66cf2ecef57a..049e9aa1b867 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -268,7 +268,7 @@ acpi_status acpi_remove_gpe_block(acpi_handle gpe_device);
268 * Resource interfaces 268 * Resource interfaces
269 */ 269 */
270typedef 270typedef
271acpi_status(*ACPI_WALK_RESOURCE_CALLBACK) (struct acpi_resource * resource, 271acpi_status(*acpi_walk_resource_callback) (struct acpi_resource * resource,
272 void *context); 272 void *context);
273 273
274acpi_status 274acpi_status
@@ -290,7 +290,7 @@ acpi_get_possible_resources(acpi_handle device_handle,
290acpi_status 290acpi_status
291acpi_walk_resources(acpi_handle device_handle, 291acpi_walk_resources(acpi_handle device_handle,
292 char *name, 292 char *name,
293 ACPI_WALK_RESOURCE_CALLBACK user_function, void *context); 293 acpi_walk_resource_callback user_function, void *context);
294 294
295acpi_status 295acpi_status
296acpi_set_current_resources(acpi_handle device_handle, 296acpi_set_current_resources(acpi_handle device_handle,
diff --git a/include/acpi/acresrc.h b/include/acpi/acresrc.h
index fa02e8083381..bdd6584bbcf1 100644
--- a/include/acpi/acresrc.h
+++ b/include/acpi/acresrc.h
@@ -198,8 +198,9 @@ acpi_rs_get_pci_routing_table_length(union acpi_operand_object *package_object,
198 acpi_size * buffer_size_needed); 198 acpi_size * buffer_size_needed);
199 199
200acpi_status 200acpi_status
201acpi_rs_convert_aml_to_resources(u8 * aml_buffer, 201acpi_rs_convert_aml_to_resources(u8 * aml,
202 u32 aml_buffer_length, u8 * output_buffer); 202 u32 length,
203 u32 offset, u8 resource_index, void **context);
203 204
204acpi_status 205acpi_status
205acpi_rs_convert_resources_to_aml(struct acpi_resource *resource, 206acpi_rs_convert_resources_to_aml(struct acpi_resource *resource,
diff --git a/include/acpi/acstruct.h b/include/acpi/acstruct.h
index d8c1c2cdac0c..04e8966a377d 100644
--- a/include/acpi/acstruct.h
+++ b/include/acpi/acstruct.h
@@ -44,6 +44,8 @@
44#ifndef __ACSTRUCT_H__ 44#ifndef __ACSTRUCT_H__
45#define __ACSTRUCT_H__ 45#define __ACSTRUCT_H__
46 46
47/* acpisrc:struct_defs -- for acpisrc conversion */
48
47/***************************************************************************** 49/*****************************************************************************
48 * 50 *
49 * Tree walking typedefs and structs 51 * Tree walking typedefs and structs
@@ -64,54 +66,55 @@
64#define ACPI_WALK_CONST_OPTIONAL 4 66#define ACPI_WALK_CONST_OPTIONAL 4
65 67
66struct acpi_walk_state { 68struct acpi_walk_state {
67 u8 data_type; /* To differentiate various internal objs MUST BE FIRST! */ 69 struct acpi_walk_state *next; /* Next walk_state in list */
70 u8 descriptor_type; /* To differentiate various internal objs */
68 u8 walk_type; 71 u8 walk_type;
69 acpi_owner_id owner_id; /* Owner of objects created during the walk */ 72 u16 opcode; /* Current AML opcode */
70 u8 last_predicate; /* Result of last predicate */
71 u8 current_result; /* */
72 u8 next_op_info; /* Info about next_op */ 73 u8 next_op_info; /* Info about next_op */
73 u8 num_operands; /* Stack pointer for Operands[] array */ 74 u8 num_operands; /* Stack pointer for Operands[] array */
75 acpi_owner_id owner_id; /* Owner of objects created during the walk */
76 u8 last_predicate; /* Result of last predicate */
77 u8 current_result;
74 u8 return_used; 78 u8 return_used;
75 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 */
79 u32 aml_offset; 81 u32 aml_offset;
80 u32 arg_types; 82 u32 arg_types;
81 u32 method_breakpoint; /* For single stepping */ 83 u32 method_breakpoint; /* For single stepping */
82 u32 user_breakpoint; /* User AML breakpoint */ 84 u32 user_breakpoint; /* User AML breakpoint */
83 u32 parse_flags; 85 u32 parse_flags;
86
87 struct acpi_parse_state parser_state; /* Current state of parser */
84 u32 prev_arg_types; 88 u32 prev_arg_types;
89 u8 arg_count; /* push for fixed or var args */
85 90
86 u8 *aml_last_while;
87 struct acpi_namespace_node arguments[ACPI_METHOD_NUM_ARGS]; /* Control method arguments */ 91 struct acpi_namespace_node arguments[ACPI_METHOD_NUM_ARGS]; /* Control method arguments */
92 struct acpi_namespace_node local_variables[ACPI_METHOD_NUM_LOCALS]; /* Control method locals */
93 union acpi_operand_object *operands[ACPI_OBJ_NUM_OPERANDS + 1]; /* Operands passed to the interpreter (+1 for NULL terminator) */
94 union acpi_operand_object **params;
95
96 u8 *aml_last_while;
88 union acpi_operand_object **caller_return_desc; 97 union acpi_operand_object **caller_return_desc;
89 union acpi_generic_state *control_state; /* List of control states (nested IFs) */ 98 union acpi_generic_state *control_state; /* List of control states (nested IFs) */
90 struct acpi_namespace_node *deferred_node; /* Used when executing deferred opcodes */ 99 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 */ 100 struct acpi_gpe_event_info *gpe_event_info; /* Info for GPE (_Lxx/_Exx methods only */
92 union acpi_operand_object *implicit_return_obj; 101 union acpi_operand_object *implicit_return_obj;
93 struct acpi_namespace_node local_variables[ACPI_METHOD_NUM_LOCALS]; /* Control method locals */
94 struct acpi_namespace_node *method_call_node; /* Called method Node */ 102 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 */ 103 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 */ 104 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. */ 105 struct acpi_namespace_node *method_node; /* Method node if running a method. */
98 union acpi_parse_object *op; /* Current parser op */ 106 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) */
100 const struct acpi_opcode_info *op_info; /* Info on current opcode */ 107 const struct acpi_opcode_info *op_info; /* Info on current opcode */
101 union acpi_parse_object *origin; /* Start of walk [Obsolete] */ 108 union acpi_parse_object *origin; /* Start of walk [Obsolete] */
102 union acpi_operand_object **params;
103 struct acpi_parse_state parser_state; /* Current state of parser */
104 union acpi_operand_object *result_obj; 109 union acpi_operand_object *result_obj;
105 union acpi_generic_state *results; /* Stack of accumulated results */ 110 union acpi_generic_state *results; /* Stack of accumulated results */
106 union acpi_operand_object *return_desc; /* Return object, if any */ 111 union acpi_operand_object *return_desc; /* Return object, if any */
107 union acpi_generic_state *scope_info; /* Stack of nested scopes */ 112 union acpi_generic_state *scope_info; /* Stack of nested scopes */
108
109 union acpi_parse_object *prev_op; /* Last op that was processed */ 113 union acpi_parse_object *prev_op; /* Last op that was processed */
110 union acpi_parse_object *next_op; /* next op to be processed */ 114 union acpi_parse_object *next_op; /* next op to be processed */
115 struct acpi_thread_state *thread;
111 acpi_parse_downwards descending_callback; 116 acpi_parse_downwards descending_callback;
112 acpi_parse_upwards ascending_callback; 117 acpi_parse_upwards ascending_callback;
113 struct acpi_thread_state *thread;
114 struct acpi_walk_state *next; /* Next walk_state in list */
115}; 118};
116 119
117/* Info used by acpi_ps_init_objects */ 120/* Info used by acpi_ps_init_objects */
@@ -151,11 +154,11 @@ struct acpi_walk_info {
151 154
152/* Display Types */ 155/* Display Types */
153 156
154#define ACPI_DISPLAY_SUMMARY (u8) 0 157#define ACPI_DISPLAY_SUMMARY (u8) 0
155#define ACPI_DISPLAY_OBJECTS (u8) 1 158#define ACPI_DISPLAY_OBJECTS (u8) 1
156#define ACPI_DISPLAY_MASK (u8) 1 159#define ACPI_DISPLAY_MASK (u8) 1
157 160
158#define ACPI_DISPLAY_SHORT (u8) 2 161#define ACPI_DISPLAY_SHORT (u8) 2
159 162
160struct acpi_get_devices_info { 163struct acpi_get_devices_info {
161 acpi_walk_callback user_function; 164 acpi_walk_callback user_function;
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 520f315dd53a..091dd2567172 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -44,6 +44,8 @@
44#ifndef __ACTYPES_H__ 44#ifndef __ACTYPES_H__
45#define __ACTYPES_H__ 45#define __ACTYPES_H__
46 46
47/* acpisrc:struct_defs -- for acpisrc conversion */
48
47/* 49/*
48 * ACPI_MACHINE_WIDTH must be specified in an OS- or compiler-dependent header 50 * ACPI_MACHINE_WIDTH must be specified in an OS- or compiler-dependent header
49 * and must be either 16, 32, or 64 51 * and must be either 16, 32, or 64
@@ -250,7 +252,7 @@ typedef acpi_native_uint acpi_size;
250/* Use C99 uintptr_t for pointer casting if available, "void *" otherwise */ 252/* Use C99 uintptr_t for pointer casting if available, "void *" otherwise */
251 253
252#ifndef acpi_uintptr_t 254#ifndef acpi_uintptr_t
253#define acpi_uintptr_t void * 255#define acpi_uintptr_t void *
254#endif 256#endif
255 257
256/* 258/*
@@ -259,7 +261,7 @@ typedef acpi_native_uint acpi_size;
259 * manager implementation is to be used (ACPI_USE_LOCAL_CACHE) 261 * manager implementation is to be used (ACPI_USE_LOCAL_CACHE)
260 */ 262 */
261#ifndef acpi_cache_t 263#ifndef acpi_cache_t
262#define acpi_cache_t struct acpi_memory_list 264#define acpi_cache_t struct acpi_memory_list
263#endif 265#endif
264 266
265/* 267/*
@@ -267,7 +269,7 @@ typedef acpi_native_uint acpi_size;
267 * lock and unlock OSL interfaces. 269 * lock and unlock OSL interfaces.
268 */ 270 */
269#ifndef acpi_cpu_flags 271#ifndef acpi_cpu_flags
270#define acpi_cpu_flags acpi_native_uint 272#define acpi_cpu_flags acpi_native_uint
271#endif 273#endif
272 274
273/* 275/*
@@ -300,7 +302,7 @@ typedef acpi_native_uint acpi_size;
300 * thread_id is returned by acpi_os_get_thread_id. 302 * thread_id is returned by acpi_os_get_thread_id.
301 */ 303 */
302#ifndef acpi_thread_id 304#ifndef acpi_thread_id
303#define acpi_thread_id acpi_native_uint 305#define acpi_thread_id acpi_native_uint
304#endif 306#endif
305 307
306/******************************************************************************* 308/*******************************************************************************
@@ -869,7 +871,7 @@ acpi_status(*acpi_adr_space_handler) (u32 function,
869 void *handler_context, 871 void *handler_context,
870 void *region_context); 872 void *region_context);
871 873
872#define ACPI_DEFAULT_HANDLER NULL 874#define ACPI_DEFAULT_HANDLER NULL
873 875
874typedef 876typedef
875acpi_status(*acpi_adr_space_setup) (acpi_handle region_handle, 877acpi_status(*acpi_adr_space_setup) (acpi_handle region_handle,
@@ -926,8 +928,8 @@ struct acpi_compatible_id_list {
926#define ACPI_STA_BATTERY_PRESENT 0x10 928#define ACPI_STA_BATTERY_PRESENT 0x10
927 929
928#define ACPI_COMMON_OBJ_INFO \ 930#define ACPI_COMMON_OBJ_INFO \
929 acpi_object_type type; /* ACPI object type */ \ 931 acpi_object_type type; /* ACPI object type */ \
930 acpi_name name /* ACPI object Name */ 932 acpi_name name /* ACPI object Name */
931 933
932struct acpi_obj_info_header { 934struct acpi_obj_info_header {
933 ACPI_COMMON_OBJ_INFO; 935 ACPI_COMMON_OBJ_INFO;
@@ -1182,12 +1184,12 @@ struct acpi_resource_source {
1182/* Fields common to all address descriptors, 16/32/64 bit */ 1184/* Fields common to all address descriptors, 16/32/64 bit */
1183 1185
1184#define ACPI_RESOURCE_ADDRESS_COMMON \ 1186#define ACPI_RESOURCE_ADDRESS_COMMON \
1185 u8 resource_type; \ 1187 u8 resource_type; \
1186 u8 producer_consumer; \ 1188 u8 producer_consumer; \
1187 u8 decode; \ 1189 u8 decode; \
1188 u8 min_address_fixed; \ 1190 u8 min_address_fixed; \
1189 u8 max_address_fixed; \ 1191 u8 max_address_fixed; \
1190 union acpi_resource_attribute info; 1192 union acpi_resource_attribute info;
1191 1193
1192struct acpi_resource_address { 1194struct acpi_resource_address {
1193ACPI_RESOURCE_ADDRESS_COMMON}; 1195ACPI_RESOURCE_ADDRESS_COMMON};
@@ -1308,10 +1310,6 @@ struct acpi_resource {
1308 1310
1309#define ACPI_NEXT_RESOURCE(res) (struct acpi_resource *)((u8 *) res + res->length) 1311#define ACPI_NEXT_RESOURCE(res) (struct acpi_resource *)((u8 *) res + res->length)
1310 1312
1311/*
1312 * END: of definitions for Resource Attributes
1313 */
1314
1315struct acpi_pci_routing_table { 1313struct acpi_pci_routing_table {
1316 u32 length; 1314 u32 length;
1317 u32 pin; 1315 u32 pin;
@@ -1320,8 +1318,4 @@ struct acpi_pci_routing_table {
1320 char source[4]; /* pad to 64 bits so sizeof() works in all cases */ 1318 char source[4]; /* pad to 64 bits so sizeof() works in all cases */
1321}; 1319};
1322 1320
1323/*
1324 * END: of definitions for PCI Routing tables
1325 */
1326
1327#endif /* __ACTYPES_H__ */ 1321#endif /* __ACTYPES_H__ */
diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h
index 71ff78c75441..5e69a80c7850 100644
--- a/include/acpi/acutils.h
+++ b/include/acpi/acutils.h
@@ -78,6 +78,12 @@ extern const char *acpi_gbl_TYPdecode[4];
78#define ACPI_SMALL_VARIABLE_LENGTH 3 78#define ACPI_SMALL_VARIABLE_LENGTH 3
79 79
80typedef 80typedef
81acpi_status(*acpi_walk_aml_callback) (u8 * aml,
82 u32 length,
83 u32 offset,
84 u8 resource_index, void *context);
85
86typedef
81acpi_status(*acpi_pkg_callback) (u8 object_type, 87acpi_status(*acpi_pkg_callback) (u8 object_type,
82 union acpi_operand_object * source_object, 88 union acpi_operand_object * source_object,
83 union acpi_generic_state * state, 89 union acpi_generic_state * state,
@@ -469,6 +475,25 @@ acpi_ut_strtoul64(char *string, u32 base, acpi_integer * ret_integer);
469 475
470#define ACPI_ANY_BASE 0 476#define ACPI_ANY_BASE 0
471 477
478u32 acpi_ut_dword_byte_swap(u32 value);
479
480void acpi_ut_set_integer_width(u8 revision);
481
482#ifdef ACPI_DEBUG_OUTPUT
483void
484acpi_ut_display_init_pathname(u8 type,
485 struct acpi_namespace_node *obj_handle,
486 char *path);
487#endif
488
489/*
490 * utresrc
491 */
492acpi_status
493acpi_ut_walk_aml_resources(u8 * aml,
494 acpi_size aml_length,
495 acpi_walk_aml_callback user_function, void *context);
496
472acpi_status acpi_ut_validate_resource(void *aml, u8 * return_index); 497acpi_status acpi_ut_validate_resource(void *aml, u8 * return_index);
473 498
474u32 acpi_ut_get_descriptor_length(void *aml); 499u32 acpi_ut_get_descriptor_length(void *aml);
@@ -483,18 +508,6 @@ acpi_status
483acpi_ut_get_resource_end_tag(union acpi_operand_object *obj_desc, 508acpi_ut_get_resource_end_tag(union acpi_operand_object *obj_desc,
484 u8 ** end_tag); 509 u8 ** end_tag);
485 510
486u32 acpi_ut_dword_byte_swap(u32 value);
487
488void acpi_ut_set_integer_width(u8 revision);
489
490#ifdef ACPI_DEBUG_OUTPUT
491void
492acpi_ut_display_init_pathname(u8 type,
493 struct acpi_namespace_node *obj_handle,
494 char *path);
495
496#endif
497
498/* 511/*
499 * utmutex - mutex support 512 * utmutex - mutex support
500 */ 513 */
@@ -521,14 +534,15 @@ acpi_ut_initialize_buffer(struct acpi_buffer *buffer,
521 534
522void *acpi_ut_allocate(acpi_size size, u32 component, char *module, u32 line); 535void *acpi_ut_allocate(acpi_size size, u32 component, char *module, u32 line);
523 536
524void *acpi_ut_callocate(acpi_size size, u32 component, char *module, u32 line); 537void *acpi_ut_allocate_zeroed(acpi_size size,
538 u32 component, char *module, u32 line);
525 539
526#ifdef ACPI_DBG_TRACK_ALLOCATIONS 540#ifdef ACPI_DBG_TRACK_ALLOCATIONS
527void *acpi_ut_allocate_and_track(acpi_size size, 541void *acpi_ut_allocate_and_track(acpi_size size,
528 u32 component, char *module, u32 line); 542 u32 component, char *module, u32 line);
529 543
530void *acpi_ut_callocate_and_track(acpi_size size, 544void *acpi_ut_allocate_zeroed_and_track(acpi_size size,
531 u32 component, char *module, u32 line); 545 u32 component, char *module, u32 line);
532 546
533void 547void
534acpi_ut_free_and_track(void *address, u32 component, char *module, u32 line); 548acpi_ut_free_and_track(void *address, u32 component, char *module, u32 line);
@@ -538,6 +552,11 @@ void acpi_ut_dump_allocation_info(void);
538#endif /* ACPI_FUTURE_USAGE */ 552#endif /* ACPI_FUTURE_USAGE */
539 553
540void acpi_ut_dump_allocations(u32 component, char *module); 554void acpi_ut_dump_allocations(u32 component, char *module);
555
556acpi_status
557acpi_ut_create_list(char *list_name,
558 u16 object_size, struct acpi_memory_list **return_cache);
559
541#endif 560#endif
542 561
543#endif /* _ACUTILS_H */ 562#endif /* _ACUTILS_H */
diff --git a/include/acpi/amlresrc.h b/include/acpi/amlresrc.h
index e5b42eb38190..64736860bdd5 100644
--- a/include/acpi/amlresrc.h
+++ b/include/acpi/amlresrc.h
@@ -42,9 +42,17 @@
42 * POSSIBILITY OF SUCH DAMAGES. 42 * POSSIBILITY OF SUCH DAMAGES.
43 */ 43 */
44 44
45/* acpisrc:struct_defs -- for acpisrc conversion */
46
45#ifndef __AMLRESRC_H 47#ifndef __AMLRESRC_H
46#define __AMLRESRC_H 48#define __AMLRESRC_H
47 49
50/*! [Begin] no source code translation */
51
52/*
53 * Resource descriptor tags, as defined in the ACPI specification.
54 * Used to symbolically reference fields within a descriptor.
55 */
48#define ACPI_RESTAG_ADDRESS "_ADR" 56#define ACPI_RESTAG_ADDRESS "_ADR"
49#define ACPI_RESTAG_ALIGNMENT "_ALN" 57#define ACPI_RESTAG_ALIGNMENT "_ALN"
50#define ACPI_RESTAG_ADDRESSSPACE "_ASI" 58#define ACPI_RESTAG_ADDRESSSPACE "_ASI"
@@ -57,12 +65,12 @@
57#define ACPI_RESTAG_DMATYPE "_TYP" /* Compatible(0), A(1), B(2), F(3) */ 65#define ACPI_RESTAG_DMATYPE "_TYP" /* Compatible(0), A(1), B(2), F(3) */
58#define ACPI_RESTAG_GRANULARITY "_GRA" 66#define ACPI_RESTAG_GRANULARITY "_GRA"
59#define ACPI_RESTAG_INTERRUPT "_INT" 67#define ACPI_RESTAG_INTERRUPT "_INT"
60#define ACPI_RESTAG_INTERRUPTLEVEL "_LL_" /* active_lo(1), active_hi(0) */ 68#define ACPI_RESTAG_INTERRUPTLEVEL "_LL_" /* ActiveLo(1), ActiveHi(0) */
61#define ACPI_RESTAG_INTERRUPTSHARE "_SHR" /* Shareable(1), no_share(0) */ 69#define ACPI_RESTAG_INTERRUPTSHARE "_SHR" /* Shareable(1), NoShare(0) */
62#define ACPI_RESTAG_INTERRUPTTYPE "_HE_" /* Edge(1), Level(0) */ 70#define ACPI_RESTAG_INTERRUPTTYPE "_HE_" /* Edge(1), Level(0) */
63#define ACPI_RESTAG_LENGTH "_LEN" 71#define ACPI_RESTAG_LENGTH "_LEN"
64#define ACPI_RESTAG_MEMATTRIBUTES "_MTP" /* Memory(0), Reserved(1), ACPI(2), NVS(3) */ 72#define ACPI_RESTAG_MEMATTRIBUTES "_MTP" /* Memory(0), Reserved(1), ACPI(2), NVS(3) */
65#define ACPI_RESTAG_MEMTYPE "_MEM" /* non_cache(0), Cacheable(1) Cache+combine(2), Cache+prefetch(3) */ 73#define ACPI_RESTAG_MEMTYPE "_MEM" /* NonCache(0), Cacheable(1) Cache+combine(2), Cache+prefetch(3) */
66#define ACPI_RESTAG_MAXADDR "_MAX" 74#define ACPI_RESTAG_MAXADDR "_MAX"
67#define ACPI_RESTAG_MINADDR "_MIN" 75#define ACPI_RESTAG_MINADDR "_MIN"
68#define ACPI_RESTAG_MAXTYPE "_MAF" 76#define ACPI_RESTAG_MAXTYPE "_MAF"
@@ -70,11 +78,12 @@
70#define ACPI_RESTAG_REGISTERBITOFFSET "_RBO" 78#define ACPI_RESTAG_REGISTERBITOFFSET "_RBO"
71#define ACPI_RESTAG_REGISTERBITWIDTH "_RBW" 79#define ACPI_RESTAG_REGISTERBITWIDTH "_RBW"
72#define ACPI_RESTAG_RANGETYPE "_RNG" 80#define ACPI_RESTAG_RANGETYPE "_RNG"
73#define ACPI_RESTAG_READWRITETYPE "_RW_" /* read_only(0), Writeable (1) */ 81#define ACPI_RESTAG_READWRITETYPE "_RW_" /* ReadOnly(0), Writeable (1) */
74#define ACPI_RESTAG_TRANSLATION "_TRA" 82#define ACPI_RESTAG_TRANSLATION "_TRA"
75#define ACPI_RESTAG_TRANSTYPE "_TRS" /* Sparse(1), Dense(0) */ 83#define ACPI_RESTAG_TRANSTYPE "_TRS" /* Sparse(1), Dense(0) */
76#define ACPI_RESTAG_TYPE "_TTP" /* Translation(1), Static (0) */ 84#define ACPI_RESTAG_TYPE "_TTP" /* Translation(1), Static (0) */
77#define ACPI_RESTAG_XFERTYPE "_SIz" /* 8(0), 8_and16(1), 16(2) */ 85#define ACPI_RESTAG_XFERTYPE "_SIZ" /* 8(0), 8And16(1), 16(2) */
86/*! [End] no source code translation !*/
78 87
79/* Default sizes for "small" resource descriptors */ 88/* Default sizes for "small" resource descriptors */
80 89
@@ -109,7 +118,7 @@ struct asl_resource_node {
109 * SMALL descriptors 118 * SMALL descriptors
110 */ 119 */
111#define AML_RESOURCE_SMALL_HEADER_COMMON \ 120#define AML_RESOURCE_SMALL_HEADER_COMMON \
112 u8 descriptor_type; 121 u8 descriptor_type;
113 122
114struct aml_resource_small_header { 123struct aml_resource_small_header {
115AML_RESOURCE_SMALL_HEADER_COMMON}; 124AML_RESOURCE_SMALL_HEADER_COMMON};
@@ -162,8 +171,8 @@ struct aml_resource_end_tag {
162 * LARGE descriptors 171 * LARGE descriptors
163 */ 172 */
164#define AML_RESOURCE_LARGE_HEADER_COMMON \ 173#define AML_RESOURCE_LARGE_HEADER_COMMON \
165 u8 descriptor_type;\ 174 u8 descriptor_type;\
166 u16 resource_length; 175 u16 resource_length;
167 176
168struct aml_resource_large_header { 177struct aml_resource_large_header {
169AML_RESOURCE_LARGE_HEADER_COMMON}; 178AML_RESOURCE_LARGE_HEADER_COMMON};
@@ -194,9 +203,9 @@ struct aml_resource_fixed_memory32 {
194}; 203};
195 204
196#define AML_RESOURCE_ADDRESS_COMMON \ 205#define AML_RESOURCE_ADDRESS_COMMON \
197 u8 resource_type; \ 206 u8 resource_type; \
198 u8 flags; \ 207 u8 flags; \
199 u8 specific_flags; 208 u8 specific_flags;
200 209
201struct aml_resource_address { 210struct aml_resource_address {
202AML_RESOURCE_LARGE_HEADER_COMMON AML_RESOURCE_ADDRESS_COMMON}; 211AML_RESOURCE_LARGE_HEADER_COMMON AML_RESOURCE_ADDRESS_COMMON};
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h
index d5a7f566c018..2270bdd5e530 100644
--- a/include/acpi/platform/acenv.h
+++ b/include/acpi/platform/acenv.h
@@ -70,6 +70,7 @@
70#define ACPI_DEBUGGER 70#define ACPI_DEBUGGER
71#define ACPI_DISASSEMBLER 71#define ACPI_DISASSEMBLER
72#define ACPI_MUTEX_DEBUG 72#define ACPI_MUTEX_DEBUG
73#define ACPI_DBG_TRACK_ALLOCATIONS
73#endif 74#endif
74 75
75#ifdef ACPI_ASL_COMPILER 76#ifdef ACPI_ASL_COMPILER
@@ -165,17 +166,6 @@
165 166
166#endif 167#endif
167 168
168/*
169 * Memory allocation tracking. Used only if
170 * 1) This is the debug version
171 * 2) This is NOT a 16-bit version of the code (not enough real-mode memory)
172 */
173#ifdef ACPI_DEBUG_OUTPUT
174#if ACPI_MACHINE_WIDTH != 16
175#define ACPI_DBG_TRACK_ALLOCATIONS
176#endif
177#endif
178
179/*! [End] no source code translation !*/ 169/*! [End] no source code translation !*/
180 170
181/* 171/*