aboutsummaryrefslogtreecommitdiffstats
path: root/include/acpi
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2005-08-04 18:09:09 -0400
committerLen Brown <len.brown@intel.com>2005-08-04 18:09:09 -0400
commit5d2a22079c825669d91a3a200332f1053b4b61b0 (patch)
tree2e6e88bbcc3e17535fdf3103540b246b3658e20b /include/acpi
parent1c5ad84516ae7ea4ec868436a910a6bd8d20215a (diff)
parentbd6dbdf3c7b9784fbf5d8500e427a954e27a976a (diff)
/home/lenb/src/to-akpm branch 'acpi-2.6.12'
Diffstat (limited to 'include/acpi')
-rw-r--r--include/acpi/acconfig.h9
-rw-r--r--include/acpi/acdebug.h6
-rw-r--r--include/acpi/acdisasm.h3
-rw-r--r--include/acpi/acdispat.h10
-rw-r--r--include/acpi/acevents.h5
-rw-r--r--include/acpi/acexcep.h6
-rw-r--r--include/acpi/acglobal.h29
-rw-r--r--include/acpi/achware.h6
-rw-r--r--include/acpi/aclocal.h84
-rw-r--r--include/acpi/acmacros.h102
-rw-r--r--include/acpi/acnames.h5
-rw-r--r--include/acpi/acnamesp.h6
-rw-r--r--include/acpi/acobject.h2
-rw-r--r--include/acpi/acopcode.h2
-rw-r--r--include/acpi/acoutput.h2
-rw-r--r--include/acpi/acparser.h33
-rw-r--r--include/acpi/acpiosxf.h35
-rw-r--r--include/acpi/acpixf.h2
-rw-r--r--include/acpi/acstruct.h15
-rw-r--r--include/acpi/actables.h10
-rw-r--r--include/acpi/actbl.h58
-rw-r--r--include/acpi/actbl1.h52
-rw-r--r--include/acpi/actbl2.h109
-rw-r--r--include/acpi/actypes.h15
-rw-r--r--include/acpi/acutils.h121
-rw-r--r--include/acpi/amlcode.h4
-rw-r--r--include/acpi/platform/acenv.h37
-rw-r--r--include/acpi/platform/acgcc.h8
-rw-r--r--include/acpi/platform/aclinux.h11
29 files changed, 470 insertions, 317 deletions
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index 2f6ab189fc6f..d62af7293923 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -64,7 +64,7 @@
64 64
65/* Version string */ 65/* Version string */
66 66
67#define ACPI_CA_VERSION 0x20050408 67#define ACPI_CA_VERSION 0x20050729
68 68
69/* 69/*
70 * OS name, used for the _OS object. The _OS object is essentially obsolete, 70 * OS name, used for the _OS object. The _OS object is essentially obsolete,
@@ -78,11 +78,10 @@
78 78
79/* Maximum objects in the various object caches */ 79/* Maximum objects in the various object caches */
80 80
81#define ACPI_MAX_STATE_CACHE_DEPTH 64 /* State objects */ 81#define ACPI_MAX_STATE_CACHE_DEPTH 96 /* State objects */
82#define ACPI_MAX_PARSE_CACHE_DEPTH 96 /* Parse tree objects */ 82#define ACPI_MAX_PARSE_CACHE_DEPTH 96 /* Parse tree objects */
83#define ACPI_MAX_EXTPARSE_CACHE_DEPTH 64 /* Parse tree objects */ 83#define ACPI_MAX_EXTPARSE_CACHE_DEPTH 96 /* Parse tree objects */
84#define ACPI_MAX_OBJECT_CACHE_DEPTH 64 /* Interpreter operand objects */ 84#define ACPI_MAX_OBJECT_CACHE_DEPTH 96 /* Interpreter operand objects */
85#define ACPI_MAX_WALK_CACHE_DEPTH 4 /* Objects for parse tree walks */
86 85
87/* 86/*
88 * Should the subystem abort the loading of an ACPI table if the 87 * Should the subystem abort the loading of an ACPI table if the
diff --git a/include/acpi/acdebug.h b/include/acpi/acdebug.h
index 8ba372b0f245..f8fa2227583d 100644
--- a/include/acpi/acdebug.h
+++ b/include/acpi/acdebug.h
@@ -114,6 +114,10 @@ acpi_db_set_method_call_breakpoint (
114 union acpi_parse_object *op); 114 union acpi_parse_object *op);
115 115
116void 116void
117acpi_db_get_bus_info (
118 void);
119
120void
117acpi_db_disassemble_aml ( 121acpi_db_disassemble_aml (
118 char *statements, 122 char *statements,
119 union acpi_parse_object *op); 123 union acpi_parse_object *op);
@@ -327,7 +331,7 @@ acpi_db_set_output_destination (
327 u32 where); 331 u32 where);
328 332
329void 333void
330acpi_db_dump_object ( 334acpi_db_dump_external_object (
331 union acpi_object *obj_desc, 335 union acpi_object *obj_desc,
332 u32 level); 336 u32 level);
333 337
diff --git a/include/acpi/acdisasm.h b/include/acpi/acdisasm.h
index dbfa877121ba..26325430db80 100644
--- a/include/acpi/acdisasm.h
+++ b/include/acpi/acdisasm.h
@@ -90,6 +90,7 @@ struct acpi_op_walk_info
90{ 90{
91 u32 level; 91 u32 level;
92 u32 bit_offset; 92 u32 bit_offset;
93 struct acpi_walk_state *walk_state;
93}; 94};
94 95
95typedef 96typedef
@@ -210,7 +211,7 @@ acpi_dm_byte_list (
210 union acpi_parse_object *op); 211 union acpi_parse_object *op);
211 212
212void 213void
213acpi_is_eisa_id ( 214acpi_dm_is_eisa_id (
214 union acpi_parse_object *op); 215 union acpi_parse_object *op);
215 216
216void 217void
diff --git a/include/acpi/acdispat.h b/include/acpi/acdispat.h
index 8f5f2f71b1de..90b7d30bd255 100644
--- a/include/acpi/acdispat.h
+++ b/include/acpi/acdispat.h
@@ -236,7 +236,7 @@ acpi_ds_method_data_init (
236 */ 236 */
237acpi_status 237acpi_status
238acpi_ds_parse_method ( 238acpi_ds_parse_method (
239 acpi_handle obj_handle); 239 struct acpi_namespace_node *node);
240 240
241acpi_status 241acpi_status
242acpi_ds_call_control_method ( 242acpi_ds_call_control_method (
@@ -391,7 +391,7 @@ acpi_ds_init_aml_walk (
391 u8 *aml_start, 391 u8 *aml_start,
392 u32 aml_length, 392 u32 aml_length,
393 struct acpi_parameter_info *info, 393 struct acpi_parameter_info *info,
394 u32 pass_number); 394 u8 pass_number);
395 395
396acpi_status 396acpi_status
397acpi_ds_obj_stack_pop_and_delete ( 397acpi_ds_obj_stack_pop_and_delete (
@@ -450,10 +450,4 @@ acpi_ds_result_pop_from_bottom (
450 union acpi_operand_object **object, 450 union acpi_operand_object **object,
451 struct acpi_walk_state *walk_state); 451 struct acpi_walk_state *walk_state);
452 452
453#ifdef ACPI_ENABLE_OBJECT_CACHE
454void
455acpi_ds_delete_walk_state_cache (
456 void);
457#endif
458
459#endif /* _ACDISPAT_H_ */ 453#endif /* _ACDISPAT_H_ */
diff --git a/include/acpi/acevents.h b/include/acpi/acevents.h
index 61a27c8c5079..33ae2ca997b7 100644
--- a/include/acpi/acevents.h
+++ b/include/acpi/acevents.h
@@ -122,8 +122,7 @@ acpi_ev_valid_gpe_event (
122 122
123acpi_status 123acpi_status
124acpi_ev_walk_gpe_list ( 124acpi_ev_walk_gpe_list (
125 ACPI_GPE_CALLBACK gpe_walk_callback, 125 ACPI_GPE_CALLBACK gpe_walk_callback);
126 u32 flags);
127 126
128acpi_status 127acpi_status
129acpi_ev_delete_gpe_handlers ( 128acpi_ev_delete_gpe_handlers (
@@ -136,7 +135,7 @@ acpi_ev_create_gpe_block (
136 struct acpi_generic_address *gpe_block_address, 135 struct acpi_generic_address *gpe_block_address,
137 u32 register_count, 136 u32 register_count,
138 u8 gpe_block_base_number, 137 u8 gpe_block_base_number,
139 u32 interrupt_level, 138 u32 interrupt_number,
140 struct acpi_gpe_block_info **return_gpe_block); 139 struct acpi_gpe_block_info **return_gpe_block);
141 140
142acpi_status 141acpi_status
diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h
index 60d737b2d70f..0a6f492f3c8e 100644
--- a/include/acpi/acexcep.h
+++ b/include/acpi/acexcep.h
@@ -95,8 +95,9 @@
95#define AE_ABORT_METHOD (acpi_status) (0x001C | AE_CODE_ENVIRONMENTAL) 95#define AE_ABORT_METHOD (acpi_status) (0x001C | AE_CODE_ENVIRONMENTAL)
96#define AE_SAME_HANDLER (acpi_status) (0x001D | AE_CODE_ENVIRONMENTAL) 96#define AE_SAME_HANDLER (acpi_status) (0x001D | AE_CODE_ENVIRONMENTAL)
97#define AE_WAKE_ONLY_GPE (acpi_status) (0x001E | AE_CODE_ENVIRONMENTAL) 97#define AE_WAKE_ONLY_GPE (acpi_status) (0x001E | AE_CODE_ENVIRONMENTAL)
98#define AE_OWNER_ID_LIMIT (acpi_status) (0x001F | AE_CODE_ENVIRONMENTAL)
98 99
99#define AE_CODE_ENV_MAX 0x001E 100#define AE_CODE_ENV_MAX 0x001F
100 101
101 102
102/* 103/*
@@ -226,7 +227,8 @@ char const *acpi_gbl_exception_names_env[] =
226 "AE_LOGICAL_ADDRESS", 227 "AE_LOGICAL_ADDRESS",
227 "AE_ABORT_METHOD", 228 "AE_ABORT_METHOD",
228 "AE_SAME_HANDLER", 229 "AE_SAME_HANDLER",
229 "AE_WAKE_ONLY_GPE" 230 "AE_WAKE_ONLY_GPE",
231 "AE_OWNER_ID_LIMIT"
230}; 232};
231 233
232char const *acpi_gbl_exception_names_pgm[] = 234char const *acpi_gbl_exception_names_pgm[] =
diff --git a/include/acpi/acglobal.h b/include/acpi/acglobal.h
index 4946696088c3..e3cf16eadbed 100644
--- a/include/acpi/acglobal.h
+++ b/include/acpi/acglobal.h
@@ -151,6 +151,13 @@ ACPI_EXTERN struct acpi_common_facs acpi_gbl_common_fACS;
151 */ 151 */
152 152
153 153
154/* The root table can be either an RSDT or an XSDT */
155
156ACPI_EXTERN u8 acpi_gbl_root_table_type;
157#define ACPI_TABLE_TYPE_RSDT 'R'
158#define ACPI_TABLE_TYPE_XSDT 'X'
159
160
154/* 161/*
155 * Handle both ACPI 1.0 and ACPI 2.0 Integer widths: 162 * Handle both ACPI 1.0 and ACPI 2.0 Integer widths:
156 * If we are executing a method that exists in a 32-bit ACPI table, 163 * If we are executing a method that exists in a 32-bit ACPI table,
@@ -180,8 +187,23 @@ ACPI_EXTERN struct acpi_mutex_info acpi_gbl_mutex_info[NUM_MUTEX];
180 * 187 *
181 ****************************************************************************/ 188 ****************************************************************************/
182 189
190#ifdef ACPI_DBG_TRACK_ALLOCATIONS
191
192/* Lists for tracking memory allocations */
193
194ACPI_EXTERN struct acpi_memory_list *acpi_gbl_global_list;
195ACPI_EXTERN struct acpi_memory_list *acpi_gbl_ns_node_list;
196#endif
197
198/* Object caches */
199
200ACPI_EXTERN acpi_cache_t *acpi_gbl_state_cache;
201ACPI_EXTERN acpi_cache_t *acpi_gbl_ps_node_cache;
202ACPI_EXTERN acpi_cache_t *acpi_gbl_ps_node_ext_cache;
203ACPI_EXTERN acpi_cache_t *acpi_gbl_operand_cache;
204
205/* Global handlers */
183 206
184ACPI_EXTERN struct acpi_memory_list acpi_gbl_memory_lists[ACPI_NUM_MEM_LISTS];
185ACPI_EXTERN struct acpi_object_notify_handler acpi_gbl_device_notify; 207ACPI_EXTERN struct acpi_object_notify_handler acpi_gbl_device_notify;
186ACPI_EXTERN struct acpi_object_notify_handler acpi_gbl_system_notify; 208ACPI_EXTERN struct acpi_object_notify_handler acpi_gbl_system_notify;
187ACPI_EXTERN acpi_exception_handler acpi_gbl_exception_handler; 209ACPI_EXTERN acpi_exception_handler acpi_gbl_exception_handler;
@@ -189,14 +211,15 @@ ACPI_EXTERN acpi_init_handler acpi_gbl_init_handler;
189ACPI_EXTERN struct acpi_walk_state *acpi_gbl_breakpoint_walk; 211ACPI_EXTERN struct acpi_walk_state *acpi_gbl_breakpoint_walk;
190ACPI_EXTERN acpi_handle acpi_gbl_global_lock_semaphore; 212ACPI_EXTERN acpi_handle acpi_gbl_global_lock_semaphore;
191 213
214/* Misc */
215
192ACPI_EXTERN u32 acpi_gbl_global_lock_thread_count; 216ACPI_EXTERN u32 acpi_gbl_global_lock_thread_count;
193ACPI_EXTERN u32 acpi_gbl_original_mode; 217ACPI_EXTERN u32 acpi_gbl_original_mode;
194ACPI_EXTERN u32 acpi_gbl_rsdp_original_location; 218ACPI_EXTERN u32 acpi_gbl_rsdp_original_location;
195ACPI_EXTERN u32 acpi_gbl_ns_lookup_count; 219ACPI_EXTERN u32 acpi_gbl_ns_lookup_count;
196ACPI_EXTERN u32 acpi_gbl_ps_find_count; 220ACPI_EXTERN u32 acpi_gbl_ps_find_count;
221ACPI_EXTERN u32 acpi_gbl_owner_id_mask;
197ACPI_EXTERN u16 acpi_gbl_pm1_enable_register_save; 222ACPI_EXTERN u16 acpi_gbl_pm1_enable_register_save;
198ACPI_EXTERN u16 acpi_gbl_next_table_owner_id;
199ACPI_EXTERN u16 acpi_gbl_next_method_owner_id;
200ACPI_EXTERN u16 acpi_gbl_global_lock_handle; 223ACPI_EXTERN u16 acpi_gbl_global_lock_handle;
201ACPI_EXTERN u8 acpi_gbl_debugger_configuration; 224ACPI_EXTERN u8 acpi_gbl_debugger_configuration;
202ACPI_EXTERN u8 acpi_gbl_global_lock_acquired; 225ACPI_EXTERN u8 acpi_gbl_global_lock_acquired;
diff --git a/include/acpi/achware.h b/include/acpi/achware.h
index 9d63641b8e7d..cf5de4625a71 100644
--- a/include/acpi/achware.h
+++ b/include/acpi/achware.h
@@ -143,15 +143,15 @@ acpi_hw_get_gpe_status (
143 143
144acpi_status 144acpi_status
145acpi_hw_disable_all_gpes ( 145acpi_hw_disable_all_gpes (
146 u32 flags); 146 void);
147 147
148acpi_status 148acpi_status
149acpi_hw_enable_all_runtime_gpes ( 149acpi_hw_enable_all_runtime_gpes (
150 u32 flags); 150 void);
151 151
152acpi_status 152acpi_status
153acpi_hw_enable_all_wakeup_gpes ( 153acpi_hw_enable_all_wakeup_gpes (
154 u32 flags); 154 void);
155 155
156acpi_status 156acpi_status
157acpi_hw_enable_runtime_gpe_block ( 157acpi_hw_enable_runtime_gpe_block (
diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h
index 030e641115cb..4d2635698e10 100644
--- a/include/acpi/aclocal.h
+++ b/include/acpi/aclocal.h
@@ -56,6 +56,13 @@ typedef u32 acpi_mutex_handle;
56#define AML_NUM_OPCODES 0x7F 56#define AML_NUM_OPCODES 0x7F
57 57
58 58
59/* Forward declarations */
60
61struct acpi_walk_state ;
62struct acpi_obj_mutex;
63union acpi_parse_object ;
64
65
59/***************************************************************************** 66/*****************************************************************************
60 * 67 *
61 * Mutex typedefs and structs 68 * Mutex typedefs and structs
@@ -116,19 +123,24 @@ static char *acpi_gbl_mutex_names[] =
116#endif 123#endif
117 124
118 125
126/* Owner IDs are used to track namespace nodes for selective deletion */
127
128typedef u8 acpi_owner_id;
129#define ACPI_OWNER_ID_MAX 0xFF
130
131/* This Thread ID means that the mutex is not in use (unlocked) */
132
133#define ACPI_MUTEX_NOT_ACQUIRED (u32) -1
134
119/* Table for the global mutexes */ 135/* Table for the global mutexes */
120 136
121struct acpi_mutex_info 137struct acpi_mutex_info
122{ 138{
123 acpi_mutex mutex; 139 acpi_mutex mutex;
124 u32 use_count; 140 u32 use_count;
125 u32 owner_id; 141 u32 thread_id;
126}; 142};
127 143
128/* This owner ID means that the mutex is not in use (unlocked) */
129
130#define ACPI_MUTEX_NOT_ACQUIRED (u32) (-1)
131
132 144
133/* Lock flag parameter for various interfaces */ 145/* Lock flag parameter for various interfaces */
134 146
@@ -136,13 +148,6 @@ struct acpi_mutex_info
136#define ACPI_MTX_LOCK 1 148#define ACPI_MTX_LOCK 1
137 149
138 150
139typedef u16 acpi_owner_id;
140#define ACPI_OWNER_TYPE_TABLE 0x0
141#define ACPI_OWNER_TYPE_METHOD 0x1
142#define ACPI_FIRST_METHOD_ID 0x0001
143#define ACPI_FIRST_TABLE_ID 0xF000
144
145
146/* Field access granularities */ 151/* Field access granularities */
147 152
148#define ACPI_FIELD_BYTE_GRANULARITY 1 153#define ACPI_FIELD_BYTE_GRANULARITY 1
@@ -185,13 +190,20 @@ struct acpi_namespace_node
185{ 190{
186 u8 descriptor; /* Used to differentiate object descriptor types */ 191 u8 descriptor; /* Used to differentiate object descriptor types */
187 u8 type; /* Type associated with this name */ 192 u8 type; /* Type associated with this name */
188 u16 owner_id; 193 u16 reference_count; /* Current count of references and children */
189 union acpi_name_union name; /* ACPI Name, always 4 chars per ACPI spec */ 194 union acpi_name_union name; /* ACPI Name, always 4 chars per ACPI spec */
190 union acpi_operand_object *object; /* Pointer to attached ACPI object (optional) */ 195 union acpi_operand_object *object; /* Pointer to attached ACPI object (optional) */
191 struct acpi_namespace_node *child; /* First child */ 196 struct acpi_namespace_node *child; /* First child */
192 struct acpi_namespace_node *peer; /* Next peer*/ 197 struct acpi_namespace_node *peer; /* Next peer*/
193 u16 reference_count; /* Current count of references and children */ 198 u8 owner_id; /* Who created this node */
194 u8 flags; 199 u8 flags;
200
201 /* Fields used by the ASL compiler only */
202
203#ifdef ACPI_ASL_COMPILER
204 u32 value;
205 union acpi_parse_object *op;
206#endif
195}; 207};
196 208
197 209
@@ -222,7 +234,7 @@ struct acpi_table_desc
222 u64 physical_address; 234 u64 physical_address;
223 u32 aml_length; 235 u32 aml_length;
224 acpi_size length; 236 acpi_size length;
225 acpi_owner_id table_id; 237 acpi_owner_id owner_id;
226 u8 type; 238 u8 type;
227 u8 allocation; 239 u8 allocation;
228 u8 loaded_into_namespace; 240 u8 loaded_into_namespace;
@@ -365,7 +377,7 @@ struct acpi_gpe_xrupt_info
365 struct acpi_gpe_xrupt_info *previous; 377 struct acpi_gpe_xrupt_info *previous;
366 struct acpi_gpe_xrupt_info *next; 378 struct acpi_gpe_xrupt_info *next;
367 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 */
368 u32 interrupt_level; /* System interrupt level */ 380 u32 interrupt_number; /* System interrupt number */
369}; 381};
370 382
371 383
@@ -420,13 +432,6 @@ struct acpi_field_info
420#define ACPI_CONTROL_PREDICATE_TRUE 0xC4 432#define ACPI_CONTROL_PREDICATE_TRUE 0xC4
421 433
422 434
423/* Forward declarations */
424
425struct acpi_walk_state ;
426struct acpi_obj_mutex;
427union acpi_parse_object ;
428
429
430#define ACPI_STATE_COMMON /* Two 32-bit fields and a pointer */\ 435#define ACPI_STATE_COMMON /* Two 32-bit fields and a pointer */\
431 u8 data_type; /* To differentiate various internal objs */\ 436 u8 data_type; /* To differentiate various internal objs */\
432 u8 flags; \ 437 u8 flags; \
@@ -737,6 +742,7 @@ struct acpi_parse_state
737 ****************************************************************************/ 742 ****************************************************************************/
738 743
739#define PCI_ROOT_HID_STRING "PNP0A03" 744#define PCI_ROOT_HID_STRING "PNP0A03"
745#define PCI_EXPRESS_ROOT_HID_STRING "PNP0A08"
740 746
741struct acpi_bit_register_info 747struct acpi_bit_register_info
742{ 748{
@@ -915,14 +921,6 @@ struct acpi_integrity_info
915 * 921 *
916 ****************************************************************************/ 922 ****************************************************************************/
917 923
918struct acpi_debug_print_info
919{
920 u32 component_id;
921 char *proc_name;
922 char *module_name;
923};
924
925
926/* Entry for a memory allocation (debug only) */ 924/* Entry for a memory allocation (debug only) */
927 925
928#define ACPI_MEM_MALLOC 0 926#define ACPI_MEM_MALLOC 0
@@ -952,24 +950,18 @@ struct acpi_debug_mem_block
952 950
953#define ACPI_MEM_LIST_GLOBAL 0 951#define ACPI_MEM_LIST_GLOBAL 0
954#define ACPI_MEM_LIST_NSNODE 1 952#define ACPI_MEM_LIST_NSNODE 1
955 953#define ACPI_MEM_LIST_MAX 1
956#define ACPI_MEM_LIST_FIRST_CACHE_LIST 2 954#define ACPI_NUM_MEM_LISTS 2
957#define ACPI_MEM_LIST_STATE 2
958#define ACPI_MEM_LIST_PSNODE 3
959#define ACPI_MEM_LIST_PSNODE_EXT 4
960#define ACPI_MEM_LIST_OPERAND 5
961#define ACPI_MEM_LIST_WALK 6
962#define ACPI_MEM_LIST_MAX 6
963#define ACPI_NUM_MEM_LISTS 7
964 955
965 956
966struct acpi_memory_list 957struct acpi_memory_list
967{ 958{
959 char *list_name;
968 void *list_head; 960 void *list_head;
969 u16 link_offset;
970 u16 max_cache_depth;
971 u16 cache_depth;
972 u16 object_size; 961 u16 object_size;
962 u16 max_depth;
963 u16 current_depth;
964 u16 link_offset;
973 965
974#ifdef ACPI_DBG_TRACK_ALLOCATIONS 966#ifdef ACPI_DBG_TRACK_ALLOCATIONS
975 967
@@ -978,11 +970,9 @@ struct acpi_memory_list
978 u32 total_allocated; 970 u32 total_allocated;
979 u32 total_freed; 971 u32 total_freed;
980 u32 current_total_size; 972 u32 current_total_size;
981 u32 cache_requests; 973 u32 requests;
982 u32 cache_hits; 974 u32 hits;
983 char *list_name;
984#endif 975#endif
985}; 976};
986 977
987
988#endif /* __ACLOCAL_H__ */ 978#endif /* __ACLOCAL_H__ */
diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h
index 09be937d2c39..fcdef0a4b01b 100644
--- a/include/acpi/acmacros.h
+++ b/include/acpi/acmacros.h
@@ -437,21 +437,22 @@
437#define ACPI_PARAM_LIST(pl) pl 437#define ACPI_PARAM_LIST(pl) pl
438 438
439/* 439/*
440 * Error reporting. These versions add callers module and line#. Since 440 * Error reporting. These versions add callers module and line#.
441 * _THIS_MODULE gets compiled out when ACPI_DEBUG_OUTPUT isn't defined, only 441 *
442 * use it in debug mode. 442 * Since _acpi_module_name gets compiled out when ACPI_DEBUG_OUTPUT
443 * isn't defined, only use it in debug mode.
443 */ 444 */
444#ifdef ACPI_DEBUG_OUTPUT 445#ifdef ACPI_DEBUG_OUTPUT
445 446
446#define ACPI_REPORT_INFO(fp) {acpi_ut_report_info(_THIS_MODULE,__LINE__,_COMPONENT); \ 447#define ACPI_REPORT_INFO(fp) {acpi_ut_report_info(_acpi_module_name,__LINE__,_COMPONENT); \
447 acpi_os_printf ACPI_PARAM_LIST(fp);} 448 acpi_os_printf ACPI_PARAM_LIST(fp);}
448#define ACPI_REPORT_ERROR(fp) {acpi_ut_report_error(_THIS_MODULE,__LINE__,_COMPONENT); \ 449#define ACPI_REPORT_ERROR(fp) {acpi_ut_report_error(_acpi_module_name,__LINE__,_COMPONENT); \
449 acpi_os_printf ACPI_PARAM_LIST(fp);} 450 acpi_os_printf ACPI_PARAM_LIST(fp);}
450#define ACPI_REPORT_WARNING(fp) {acpi_ut_report_warning(_THIS_MODULE,__LINE__,_COMPONENT); \ 451#define ACPI_REPORT_WARNING(fp) {acpi_ut_report_warning(_acpi_module_name,__LINE__,_COMPONENT); \
451 acpi_os_printf ACPI_PARAM_LIST(fp);} 452 acpi_os_printf ACPI_PARAM_LIST(fp);}
452#define ACPI_REPORT_NSERROR(s,e) acpi_ns_report_error(_THIS_MODULE,__LINE__,_COMPONENT, s, e); 453#define ACPI_REPORT_NSERROR(s,e) acpi_ns_report_error(_acpi_module_name,__LINE__,_COMPONENT, s, e);
453 454
454#define ACPI_REPORT_METHOD_ERROR(s,n,p,e) acpi_ns_report_method_error(_THIS_MODULE,__LINE__,_COMPONENT, s, n, p, e); 455#define ACPI_REPORT_METHOD_ERROR(s,n,p,e) acpi_ns_report_method_error(_acpi_module_name,__LINE__,_COMPONENT, s, n, p, e);
455 456
456#else 457#else
457 458
@@ -480,36 +481,58 @@
480 * Debug macros that are conditionally compiled 481 * Debug macros that are conditionally compiled
481 */ 482 */
482#ifdef ACPI_DEBUG_OUTPUT 483#ifdef ACPI_DEBUG_OUTPUT
484#define ACPI_MODULE_NAME(name) static char ACPI_UNUSED_VAR *_acpi_module_name = name;
483 485
484#define ACPI_MODULE_NAME(name) static char ACPI_UNUSED_VAR *_THIS_MODULE = name; 486/*
487 * Common parameters used for debug output functions:
488 * line number, function name, module(file) name, component ID
489 */
490#define ACPI_DEBUG_PARAMETERS __LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT
485 491
486/* 492/*
487 * Function entry tracing. 493 * Function entry tracing
488 * The first parameter should be the procedure name as a quoted string. This is declared
489 * as a local string ("_proc_name) so that it can be also used by the function exit macros below.
490 */ 494 */
491#define ACPI_FUNCTION_NAME(a) struct acpi_debug_print_info _debug_info; \ 495
492 _debug_info.component_id = _COMPONENT; \ 496/*
493 _debug_info.proc_name = a; \ 497 * If ACPI_GET_FUNCTION_NAME was not defined in the compiler-dependent header,
494 _debug_info.module_name = _THIS_MODULE; 498 * define it now. This is the case where there the compiler does not support
495 499 * a __FUNCTION__ macro or equivalent. We save the function name on the
496#define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a) \ 500 * local stack.
497 acpi_ut_trace(__LINE__,&_debug_info) 501 */
498#define ACPI_FUNCTION_TRACE_PTR(a,b) ACPI_FUNCTION_NAME(a) \ 502#ifndef ACPI_GET_FUNCTION_NAME
499 acpi_ut_trace_ptr(__LINE__,&_debug_info,(void *)b) 503#define ACPI_GET_FUNCTION_NAME _acpi_function_name
500#define ACPI_FUNCTION_TRACE_U32(a,b) ACPI_FUNCTION_NAME(a) \ 504/*
501 acpi_ut_trace_u32(__LINE__,&_debug_info,(u32)b) 505 * The Name parameter should be the procedure name as a quoted string.
502#define ACPI_FUNCTION_TRACE_STR(a,b) ACPI_FUNCTION_NAME(a) \ 506 * This is declared as a local string ("my_function_name") so that it can
503 acpi_ut_trace_str(__LINE__,&_debug_info,(char *)b) 507 * be also used by the function exit macros below.
504 508 * Note: (const char) is used to be compatible with the debug interfaces
505#define ACPI_FUNCTION_ENTRY() acpi_ut_track_stack_ptr() 509 * and macros such as __FUNCTION__.
510 */
511#define ACPI_FUNCTION_NAME(name) const char *_acpi_function_name = name;
512
513#else
514/* Compiler supports __FUNCTION__ (or equivalent) -- Ignore this macro */
515
516#define ACPI_FUNCTION_NAME(name)
517#endif
518
519#define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a) \
520 acpi_ut_trace(ACPI_DEBUG_PARAMETERS)
521#define ACPI_FUNCTION_TRACE_PTR(a,b) ACPI_FUNCTION_NAME(a) \
522 acpi_ut_trace_ptr(ACPI_DEBUG_PARAMETERS,(void *)b)
523#define ACPI_FUNCTION_TRACE_U32(a,b) ACPI_FUNCTION_NAME(a) \
524 acpi_ut_trace_u32(ACPI_DEBUG_PARAMETERS,(u32)b)
525#define ACPI_FUNCTION_TRACE_STR(a,b) ACPI_FUNCTION_NAME(a) \
526 acpi_ut_trace_str(ACPI_DEBUG_PARAMETERS,(char *)b)
527
528#define ACPI_FUNCTION_ENTRY() acpi_ut_track_stack_ptr()
506 529
507/* 530/*
508 * Function exit tracing. 531 * Function exit tracing.
509 * WARNING: These macros include a return statement. This is usually considered 532 * WARNING: These macros include a return statement. This is usually considered
510 * bad form, but having a separate exit macro is very ugly and difficult to maintain. 533 * bad form, but having a separate exit macro is very ugly and difficult to maintain.
511 * One of the FUNCTION_TRACE macros above must be used in conjunction with these macros 534 * One of the FUNCTION_TRACE macros above must be used in conjunction with these macros
512 * so that "_proc_name" is defined. 535 * so that "_acpi_function_name" is defined.
513 */ 536 */
514#ifdef ACPI_USE_DO_WHILE_0 537#ifdef ACPI_USE_DO_WHILE_0
515#define ACPI_DO_WHILE0(a) do a while(0) 538#define ACPI_DO_WHILE0(a) do a while(0)
@@ -517,10 +540,10 @@
517#define ACPI_DO_WHILE0(a) a 540#define ACPI_DO_WHILE0(a) a
518#endif 541#endif
519 542
520#define return_VOID ACPI_DO_WHILE0 ({acpi_ut_exit(__LINE__,&_debug_info);return;}) 543#define return_VOID ACPI_DO_WHILE0 ({acpi_ut_exit(ACPI_DEBUG_PARAMETERS);return;})
521#define return_ACPI_STATUS(s) ACPI_DO_WHILE0 ({acpi_ut_status_exit(__LINE__,&_debug_info,(s));return((s));}) 544#define return_ACPI_STATUS(s) ACPI_DO_WHILE0 ({acpi_ut_status_exit(ACPI_DEBUG_PARAMETERS,(s));return((s));})
522#define return_VALUE(s) ACPI_DO_WHILE0 ({acpi_ut_value_exit(__LINE__,&_debug_info,(acpi_integer)(s));return((s));}) 545#define return_VALUE(s) ACPI_DO_WHILE0 ({acpi_ut_value_exit(ACPI_DEBUG_PARAMETERS,(acpi_integer)(s));return((s));})
523#define return_PTR(s) ACPI_DO_WHILE0 ({acpi_ut_ptr_exit(__LINE__,&_debug_info,(u8 *)(s));return((s));}) 546#define return_PTR(s) ACPI_DO_WHILE0 ({acpi_ut_ptr_exit(ACPI_DEBUG_PARAMETERS,(u8 *)(s));return((s));})
524 547
525/* Conditional execution */ 548/* Conditional execution */
526 549
@@ -535,7 +558,7 @@
535/* Stack and buffer dumping */ 558/* Stack and buffer dumping */
536 559
537#define ACPI_DUMP_STACK_ENTRY(a) acpi_ex_dump_operand((a),0) 560#define ACPI_DUMP_STACK_ENTRY(a) acpi_ex_dump_operand((a),0)
538#define ACPI_DUMP_OPERANDS(a,b,c,d,e) acpi_ex_dump_operands(a,b,c,d,e,_THIS_MODULE,__LINE__) 561#define ACPI_DUMP_OPERANDS(a,b,c,d,e) acpi_ex_dump_operands(a,b,c,d,e,_acpi_module_name,__LINE__)
539 562
540 563
541#define ACPI_DUMP_ENTRY(a,b) acpi_ns_dump_entry (a,b) 564#define ACPI_DUMP_ENTRY(a,b) acpi_ns_dump_entry (a,b)
@@ -572,7 +595,7 @@
572 * leaving no executable debug code! 595 * leaving no executable debug code!
573 */ 596 */
574#define ACPI_MODULE_NAME(name) 597#define ACPI_MODULE_NAME(name)
575#define _THIS_MODULE "" 598#define _acpi_module_name ""
576 599
577#define ACPI_DEBUG_EXEC(a) 600#define ACPI_DEBUG_EXEC(a)
578#define ACPI_NORMAL_EXEC(a) a; 601#define ACPI_NORMAL_EXEC(a) a;
@@ -648,19 +671,18 @@
648 671
649/* Memory allocation */ 672/* Memory allocation */
650 673
651#define ACPI_MEM_ALLOCATE(a) acpi_ut_allocate((acpi_size)(a),_COMPONENT,_THIS_MODULE,__LINE__) 674#define ACPI_MEM_ALLOCATE(a) acpi_ut_allocate((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__)
652#define ACPI_MEM_CALLOCATE(a) acpi_ut_callocate((acpi_size)(a), _COMPONENT,_THIS_MODULE,__LINE__) 675#define ACPI_MEM_CALLOCATE(a) acpi_ut_callocate((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__)
653#define ACPI_MEM_FREE(a) acpi_os_free(a) 676#define ACPI_MEM_FREE(a) acpi_os_free(a)
654#define ACPI_MEM_TRACKING(a) 677#define ACPI_MEM_TRACKING(a)
655 678
656
657#else 679#else
658 680
659/* Memory allocation */ 681/* Memory allocation */
660 682
661#define ACPI_MEM_ALLOCATE(a) acpi_ut_allocate_and_track((acpi_size)(a),_COMPONENT,_THIS_MODULE,__LINE__) 683#define ACPI_MEM_ALLOCATE(a) acpi_ut_allocate_and_track((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__)
662#define ACPI_MEM_CALLOCATE(a) acpi_ut_callocate_and_track((acpi_size)(a), _COMPONENT,_THIS_MODULE,__LINE__) 684#define ACPI_MEM_CALLOCATE(a) acpi_ut_callocate_and_track((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__)
663#define ACPI_MEM_FREE(a) acpi_ut_free_and_track(a,_COMPONENT,_THIS_MODULE,__LINE__) 685#define ACPI_MEM_FREE(a) acpi_ut_free_and_track(a,_COMPONENT,_acpi_module_name,__LINE__)
664#define ACPI_MEM_TRACKING(a) a 686#define ACPI_MEM_TRACKING(a) a
665 687
666#endif /* ACPI_DBG_TRACK_ALLOCATIONS */ 688#endif /* ACPI_DBG_TRACK_ALLOCATIONS */
diff --git a/include/acpi/acnames.h b/include/acpi/acnames.h
index deb7cb06f5f0..280e9ed76674 100644
--- a/include/acpi/acnames.h
+++ b/include/acpi/acnames.h
@@ -78,6 +78,11 @@
78#define ACPI_NS_ROOT_PATH "\\" 78#define ACPI_NS_ROOT_PATH "\\"
79#define ACPI_NS_SYSTEM_BUS "_SB_" 79#define ACPI_NS_SYSTEM_BUS "_SB_"
80 80
81/*! [Begin] no source code translation (not handled by acpisrc) */
82#define ACPI_FUNCTION_PREFIX1 'ipcA'
83#define ACPI_FUNCTION_PREFIX2 'ipca'
84/*! [End] no source code translation !*/
85
81 86
82#endif /* __ACNAMES_H__ */ 87#endif /* __ACNAMES_H__ */
83 88
diff --git a/include/acpi/acnamesp.h b/include/acpi/acnamesp.h
index d1b3ce80056f..0c9ba707925b 100644
--- a/include/acpi/acnamesp.h
+++ b/include/acpi/acnamesp.h
@@ -124,7 +124,7 @@ acpi_ns_parse_table (
124 124
125acpi_status 125acpi_status
126acpi_ns_one_complete_parse ( 126acpi_ns_one_complete_parse (
127 u32 pass_number, 127 u8 pass_number,
128 struct acpi_table_desc *table_desc); 128 struct acpi_table_desc *table_desc);
129 129
130 130
@@ -163,7 +163,7 @@ acpi_ns_delete_namespace_subtree (
163 163
164void 164void
165acpi_ns_delete_namespace_by_owner ( 165acpi_ns_delete_namespace_by_owner (
166 u16 table_id); 166 acpi_owner_id owner_id);
167 167
168void 168void
169acpi_ns_detach_object ( 169acpi_ns_detach_object (
@@ -219,7 +219,7 @@ acpi_ns_dump_objects (
219 acpi_object_type type, 219 acpi_object_type type,
220 u8 display_type, 220 u8 display_type,
221 u32 max_depth, 221 u32 max_depth,
222 u32 ownder_id, 222 acpi_owner_id owner_id,
223 acpi_handle start_handle); 223 acpi_handle start_handle);
224#endif /* ACPI_FUTURE_USAGE */ 224#endif /* ACPI_FUTURE_USAGE */
225 225
diff --git a/include/acpi/acobject.h b/include/acpi/acobject.h
index e079b94e4fce..34f9d1f1f79b 100644
--- a/include/acpi/acobject.h
+++ b/include/acpi/acobject.h
@@ -199,7 +199,7 @@ struct acpi_object_method
199 ACPI_INTERNAL_METHOD implementation; 199 ACPI_INTERNAL_METHOD implementation;
200 u8 concurrency; 200 u8 concurrency;
201 u8 thread_count; 201 u8 thread_count;
202 acpi_owner_id owning_id; 202 acpi_owner_id owner_id;
203}; 203};
204 204
205 205
diff --git a/include/acpi/acopcode.h b/include/acpi/acopcode.h
index 118ecba4cf05..093f697e8c54 100644
--- a/include/acpi/acopcode.h
+++ b/include/acpi/acopcode.h
@@ -246,7 +246,7 @@
246#define ARGI_FIELD_OP ARGI_INVALID_OPCODE 246#define ARGI_FIELD_OP ARGI_INVALID_OPCODE
247#define ARGI_FIND_SET_LEFT_BIT_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF) 247#define ARGI_FIND_SET_LEFT_BIT_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF)
248#define ARGI_FIND_SET_RIGHT_BIT_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF) 248#define ARGI_FIND_SET_RIGHT_BIT_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF)
249#define ARGI_FROM_BCD_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF) 249#define ARGI_FROM_BCD_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_FIXED_TARGET)
250#define ARGI_IF_OP ARGI_INVALID_OPCODE 250#define ARGI_IF_OP ARGI_INVALID_OPCODE
251#define ARGI_INCREMENT_OP ARGI_LIST1 (ARGI_INTEGER_REF) 251#define ARGI_INCREMENT_OP ARGI_LIST1 (ARGI_INTEGER_REF)
252#define ARGI_INDEX_FIELD_OP ARGI_INVALID_OPCODE 252#define ARGI_INDEX_FIELD_OP ARGI_INVALID_OPCODE
diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h
index 2fbe180fee6b..d7e828cb84b3 100644
--- a/include/acpi/acoutput.h
+++ b/include/acpi/acoutput.h
@@ -136,7 +136,7 @@
136/* 136/*
137 * Debug level macros that are used in the DEBUG_PRINT macros 137 * Debug level macros that are used in the DEBUG_PRINT macros
138 */ 138 */
139#define ACPI_DEBUG_LEVEL(dl) (u32) dl,__LINE__,&_debug_info 139#define ACPI_DEBUG_LEVEL(dl) (u32) dl,ACPI_DEBUG_PARAMETERS
140 140
141/* Exception level -- used in the global "debug_level" */ 141/* Exception level -- used in the global "debug_level" */
142 142
diff --git a/include/acpi/acparser.h b/include/acpi/acparser.h
index 698276571818..f692ad56cd82 100644
--- a/include/acpi/acparser.h
+++ b/include/acpi/acparser.h
@@ -63,6 +63,7 @@
63#define ACPI_PARSE_MODE_MASK 0x0030 63#define ACPI_PARSE_MODE_MASK 0x0030
64 64
65#define ACPI_PARSE_DEFERRED_OP 0x0100 65#define ACPI_PARSE_DEFERRED_OP 0x0100
66#define ACPI_PARSE_DISASSEMBLE 0x0200
66 67
67 68
68/****************************************************************************** 69/******************************************************************************
@@ -76,12 +77,7 @@
76 * psxface - Parser external interfaces 77 * psxface - Parser external interfaces
77 */ 78 */
78acpi_status 79acpi_status
79acpi_psx_load_table ( 80acpi_ps_execute_method (
80 u8 *pcode_addr,
81 u32 pcode_length);
82
83acpi_status
84acpi_psx_execute (
85 struct acpi_parameter_info *info); 81 struct acpi_parameter_info *info);
86 82
87 83
@@ -158,6 +154,25 @@ u16
158acpi_ps_peek_opcode ( 154acpi_ps_peek_opcode (
159 struct acpi_parse_state *state); 155 struct acpi_parse_state *state);
160 156
157acpi_status
158acpi_ps_complete_this_op (
159 struct acpi_walk_state *walk_state,
160 union acpi_parse_object *op);
161
162acpi_status
163acpi_ps_next_parse_state (
164 struct acpi_walk_state *walk_state,
165 union acpi_parse_object *op,
166 acpi_status callback_status);
167
168
169/*
170 * psloop - main parse loop
171 */
172acpi_status
173acpi_ps_parse_loop (
174 struct acpi_walk_state *walk_state);
175
161 176
162/* 177/*
163 * psscope - Scope stack management routines 178 * psscope - Scope stack management routines
@@ -291,12 +306,6 @@ acpi_ps_set_name(
291 union acpi_parse_object *op, 306 union acpi_parse_object *op,
292 u32 name); 307 u32 name);
293 308
294#ifdef ACPI_ENABLE_OBJECT_CACHE
295void
296acpi_ps_delete_parse_cache (
297 void);
298#endif
299
300 309
301/* 310/*
302 * psdump - display parser tree 311 * psdump - display parser tree
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index ea489f235216..819a53f83cfa 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -139,15 +139,14 @@ void
139acpi_os_delete_lock ( 139acpi_os_delete_lock (
140 acpi_handle handle); 140 acpi_handle handle);
141 141
142void 142unsigned long
143acpi_os_acquire_lock ( 143acpi_os_acquire_lock (
144 acpi_handle handle, 144 acpi_handle handle);
145 u32 flags);
146 145
147void 146void
148acpi_os_release_lock ( 147acpi_os_release_lock (
149 acpi_handle handle, 148 acpi_handle handle,
150 u32 flags); 149 unsigned long flags);
151 150
152 151
153/* 152/*
@@ -180,6 +179,34 @@ acpi_os_get_physical_address (
180#endif 179#endif
181 180
182 181
182
183/*
184 * Memory/Object Cache
185 */
186acpi_status
187acpi_os_create_cache (
188 char *cache_name,
189 u16 object_size,
190 u16 max_depth,
191 acpi_cache_t **return_cache);
192
193acpi_status
194acpi_os_delete_cache (
195 acpi_cache_t *cache);
196
197acpi_status
198acpi_os_purge_cache (
199 acpi_cache_t *cache);
200
201void *
202acpi_os_acquire_object (
203 acpi_cache_t *cache);
204
205acpi_status
206acpi_os_release_object (
207 acpi_cache_t *cache,
208 void *object);
209
183/* 210/*
184 * Interrupt handlers 211 * Interrupt handlers
185 */ 212 */
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index f8f619f8e4f8..9ca212d73fb5 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -387,7 +387,7 @@ acpi_install_gpe_block (
387 acpi_handle gpe_device, 387 acpi_handle gpe_device,
388 struct acpi_generic_address *gpe_block_address, 388 struct acpi_generic_address *gpe_block_address,
389 u32 register_count, 389 u32 register_count,
390 u32 interrupt_level); 390 u32 interrupt_number);
391 391
392acpi_status 392acpi_status
393acpi_remove_gpe_block ( 393acpi_remove_gpe_block (
diff --git a/include/acpi/acstruct.h b/include/acpi/acstruct.h
index e6b9e36a2eda..27b22bb3d229 100644
--- a/include/acpi/acstruct.h
+++ b/include/acpi/acstruct.h
@@ -71,14 +71,13 @@ struct acpi_walk_state
71 u8 walk_type; 71 u8 walk_type;
72 acpi_owner_id owner_id; /* Owner of objects created during the walk */ 72 acpi_owner_id owner_id; /* Owner of objects created during the walk */
73 u8 last_predicate; /* Result of last predicate */ 73 u8 last_predicate; /* Result of last predicate */
74 u8 reserved; /* For alignment */
75 u8 current_result; /* */ 74 u8 current_result; /* */
76 u8 next_op_info; /* Info about next_op */ 75 u8 next_op_info; /* Info about next_op */
77 u8 num_operands; /* Stack pointer for Operands[] array */ 76 u8 num_operands; /* Stack pointer for Operands[] array */
78 u8 return_used; 77 u8 return_used;
79 u16 opcode; /* Current AML opcode */ 78 u16 opcode; /* Current AML opcode */
80 u8 scope_depth; 79 u8 scope_depth;
81 u8 reserved1; 80 u8 pass_number; /* Parse pass during table load */
82 u32 arg_count; /* push for fixed or var args */ 81 u32 arg_count; /* push for fixed or var args */
83 u32 aml_offset; 82 u32 aml_offset;
84 u32 arg_types; 83 u32 arg_types;
@@ -154,14 +153,18 @@ struct acpi_device_walk_info
154struct acpi_walk_info 153struct acpi_walk_info
155{ 154{
156 u32 debug_level; 155 u32 debug_level;
157 u32 owner_id; 156 u32 count;
157 acpi_owner_id owner_id;
158 u8 display_type; 158 u8 display_type;
159}; 159};
160 160
161/* Display Types */ 161/* Display Types */
162 162
163#define ACPI_DISPLAY_SUMMARY 0 163#define ACPI_DISPLAY_SUMMARY (u8) 0
164#define ACPI_DISPLAY_OBJECTS 1 164#define ACPI_DISPLAY_OBJECTS (u8) 1
165#define ACPI_DISPLAY_MASK (u8) 1
166
167#define ACPI_DISPLAY_SHORT (u8) 2
165 168
166struct acpi_get_devices_info 169struct acpi_get_devices_info
167{ 170{
@@ -207,8 +210,10 @@ union acpi_aml_operands
207struct acpi_parameter_info 210struct acpi_parameter_info
208{ 211{
209 struct acpi_namespace_node *node; 212 struct acpi_namespace_node *node;
213 union acpi_operand_object *obj_desc;
210 union acpi_operand_object **parameters; 214 union acpi_operand_object **parameters;
211 union acpi_operand_object *return_object; 215 union acpi_operand_object *return_object;
216 u8 pass_number;
212 u8 parameter_type; 217 u8 parameter_type;
213 u8 return_object_type; 218 u8 return_object_type;
214}; 219};
diff --git a/include/acpi/actables.h b/include/acpi/actables.h
index 39df92e21a0d..e6ceb1819643 100644
--- a/include/acpi/actables.h
+++ b/include/acpi/actables.h
@@ -169,16 +169,24 @@ acpi_status
169acpi_tb_get_table_rsdt ( 169acpi_tb_get_table_rsdt (
170 void); 170 void);
171 171
172acpi_status
173acpi_tb_validate_rsdp (
174 struct rsdp_descriptor *rsdp);
175
172 176
173/* 177/*
174 * tbutils - common table utilities 178 * tbutils - common table utilities
175 */ 179 */
176acpi_status 180acpi_status
181acpi_tb_is_table_installed (
182 struct acpi_table_desc *new_table_desc);
183
184acpi_status
177acpi_tb_verify_table_checksum ( 185acpi_tb_verify_table_checksum (
178 struct acpi_table_header *table_header); 186 struct acpi_table_header *table_header);
179 187
180u8 188u8
181acpi_tb_checksum ( 189acpi_tb_generate_checksum (
182 void *buffer, 190 void *buffer,
183 u32 length); 191 u32 length);
184 192
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h
index b5cdcca444c8..c1e9110c3661 100644
--- a/include/acpi/actbl.h
+++ b/include/acpi/actbl.h
@@ -86,15 +86,15 @@
86 */ 86 */
87struct rsdp_descriptor /* Root System Descriptor Pointer */ 87struct rsdp_descriptor /* Root System Descriptor Pointer */
88{ 88{
89 char signature [8]; /* ACPI signature, contains "RSD PTR " */ 89 char signature[8]; /* ACPI signature, contains "RSD PTR " */
90 u8 checksum; /* To make sum of struct == 0 */ 90 u8 checksum; /* ACPI 1.0 checksum */
91 char oem_id [6]; /* OEM identification */ 91 char oem_id[6]; /* OEM identification */
92 u8 revision; /* Must be 0 for 1.0, 2 for 2.0 */ 92 u8 revision; /* Must be (0) for ACPI 1.0 or (2) for ACPI 2.0+ */
93 u32 rsdt_physical_address; /* 32-bit physical address of RSDT */ 93 u32 rsdt_physical_address; /* 32-bit physical address of the RSDT */
94 u32 length; /* XSDT Length in bytes including hdr */ 94 u32 length; /* XSDT Length in bytes, including header */
95 u64 xsdt_physical_address; /* 64-bit physical address of XSDT */ 95 u64 xsdt_physical_address; /* 64-bit physical address of the XSDT */
96 u8 extended_checksum; /* Checksum of entire table */ 96 u8 extended_checksum; /* Checksum of entire table (ACPI 2.0) */
97 char reserved [3]; /* Reserved field must be 0 */ 97 char reserved[3]; /* Reserved, must be zero */
98}; 98};
99 99
100 100
@@ -107,15 +107,15 @@ struct acpi_common_facs /* Common FACS for internal use */
107 107
108 108
109#define ACPI_TABLE_HEADER_DEF /* ACPI common table header */ \ 109#define ACPI_TABLE_HEADER_DEF /* ACPI common table header */ \
110 char signature [4]; /* ACPI signature (4 ASCII characters) */\ 110 char signature[4]; /* ASCII table signature */\
111 u32 length; /* Length of table, in bytes, including header */\ 111 u32 length; /* Length of table in bytes, including this header */\
112 u8 revision; /* ACPI Specification minor version # */\ 112 u8 revision; /* ACPI Specification minor version # */\
113 u8 checksum; /* To make sum of entire table == 0 */\ 113 u8 checksum; /* To make sum of entire table == 0 */\
114 char oem_id [6]; /* OEM identification */\ 114 char oem_id[6]; /* ASCII OEM identification */\
115 char oem_table_id [8]; /* OEM table identification */\ 115 char oem_table_id[8]; /* ASCII OEM table identification */\
116 u32 oem_revision; /* OEM revision number */\ 116 u32 oem_revision; /* OEM revision number */\
117 char asl_compiler_id [4]; /* ASL compiler vendor ID */\ 117 char asl_compiler_id [4]; /* ASCII ASL compiler vendor ID */\
118 u32 asl_compiler_revision; /* ASL compiler revision number */ 118 u32 asl_compiler_revision; /* ASL compiler version */
119 119
120 120
121struct acpi_table_header /* ACPI common table header */ 121struct acpi_table_header /* ACPI common table header */
@@ -139,8 +139,12 @@ struct multiple_apic_table
139{ 139{
140 ACPI_TABLE_HEADER_DEF /* ACPI common table header */ 140 ACPI_TABLE_HEADER_DEF /* ACPI common table header */
141 u32 local_apic_address; /* Physical address of local APIC */ 141 u32 local_apic_address; /* Physical address of local APIC */
142 u32 PCATcompat : 1; /* A one indicates system also has dual 8259s */ 142
143 u32 reserved1 : 31; 143 /* Flags (32 bits) */
144
145 u8 PCATcompat : 1; /* 00: System also has dual 8259s */
146 u8 : 7; /* 01-07: Reserved, must be zero */
147 u8 reserved1[3]; /* 08-31: Reserved, must be zero */
144}; 148};
145 149
146/* Values for Type in APIC_HEADER_DEF */ 150/* Values for Type in APIC_HEADER_DEF */
@@ -180,16 +184,18 @@ struct apic_header
180#define TRIGGER_RESERVED 2 184#define TRIGGER_RESERVED 2
181#define TRIGGER_LEVEL 3 185#define TRIGGER_LEVEL 3
182 186
183/* Common flag definitions */ 187/* Common flag definitions (16 bits each) */
184 188
185#define MPS_INTI_FLAGS \ 189#define MPS_INTI_FLAGS \
186 u16 polarity : 2; /* Polarity of APIC I/O input signals */\ 190 u8 polarity : 2; /* 00-01: Polarity of APIC I/O input signals */\
187 u16 trigger_mode : 2; /* Trigger mode of APIC input signals */\ 191 u8 trigger_mode : 2; /* 02-03: Trigger mode of APIC input signals */\
188 u16 reserved1 : 12; /* Reserved, must be zero */ 192 u8 : 4; /* 04-07: Reserved, must be zero */\
193 u8 reserved1; /* 08-15: Reserved, must be zero */
189 194
190#define LOCAL_APIC_FLAGS \ 195#define LOCAL_APIC_FLAGS \
191 u32 processor_enabled: 1; /* Processor is usable if set */\ 196 u8 processor_enabled: 1; /* 00: Processor is usable if set */\
192 u32 reserved2 : 31; /* Reserved, must be zero */ 197 u8 : 7; /* 01-07: Reserved, must be zero */\
198 u8 reserved2; /* 08-15: Reserved, must be zero */
193 199
194/* Sub-structures for MADT */ 200/* Sub-structures for MADT */
195 201
@@ -238,7 +244,7 @@ struct madt_local_apic_nmi
238struct madt_address_override 244struct madt_address_override
239{ 245{
240 APIC_HEADER_DEF 246 APIC_HEADER_DEF
241 u16 reserved; /* Reserved - must be zero */ 247 u16 reserved; /* Reserved, must be zero */
242 u64 address; /* APIC physical address */ 248 u64 address; /* APIC physical address */
243}; 249};
244 250
@@ -246,7 +252,7 @@ struct madt_io_sapic
246{ 252{
247 APIC_HEADER_DEF 253 APIC_HEADER_DEF
248 u8 io_sapic_id; /* I/O SAPIC ID */ 254 u8 io_sapic_id; /* I/O SAPIC ID */
249 u8 reserved; /* Reserved - must be zero */ 255 u8 reserved; /* Reserved, must be zero */
250 u32 interrupt_base; /* Glocal interrupt for SAPIC start */ 256 u32 interrupt_base; /* Glocal interrupt for SAPIC start */
251 u64 address; /* SAPIC physical address */ 257 u64 address; /* SAPIC physical address */
252}; 258};
@@ -257,7 +263,7 @@ struct madt_local_sapic
257 u8 processor_id; /* ACPI processor id */ 263 u8 processor_id; /* ACPI processor id */
258 u8 local_sapic_id; /* SAPIC ID */ 264 u8 local_sapic_id; /* SAPIC ID */
259 u8 local_sapic_eid; /* SAPIC EID */ 265 u8 local_sapic_eid; /* SAPIC EID */
260 u8 reserved [3]; /* Reserved - must be zero */ 266 u8 reserved[3]; /* Reserved, must be zero */
261 LOCAL_APIC_FLAGS 267 LOCAL_APIC_FLAGS
262 u32 processor_uID; /* Numeric UID - ACPI 3.0 */ 268 u32 processor_uID; /* Numeric UID - ACPI 3.0 */
263 char processor_uIDstring[1]; /* String UID - ACPI 3.0 */ 269 char processor_uIDstring[1]; /* String UID - ACPI 3.0 */
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h
index 33de5f4d2ccc..93c175a4f446 100644
--- a/include/acpi/actbl1.h
+++ b/include/acpi/actbl1.h
@@ -52,8 +52,7 @@
52struct rsdt_descriptor_rev1 52struct rsdt_descriptor_rev1
53{ 53{
54 ACPI_TABLE_HEADER_DEF /* ACPI common table header */ 54 ACPI_TABLE_HEADER_DEF /* ACPI common table header */
55 u32 table_offset_entry [1]; /* Array of pointers to other */ 55 u32 table_offset_entry[1]; /* Array of pointers to ACPI tables */
56 /* ACPI tables */
57}; 56};
58 57
59 58
@@ -62,14 +61,19 @@ struct rsdt_descriptor_rev1
62 */ 61 */
63struct facs_descriptor_rev1 62struct facs_descriptor_rev1
64{ 63{
65 char signature[4]; /* ACPI Signature */ 64 char signature[4]; /* ASCII table signature */
66 u32 length; /* Length of structure, in bytes */ 65 u32 length; /* Length of structure in bytes */
67 u32 hardware_signature; /* Hardware configuration signature */ 66 u32 hardware_signature; /* Hardware configuration signature */
68 u32 firmware_waking_vector; /* ACPI OS waking vector */ 67 u32 firmware_waking_vector; /* ACPI OS waking vector */
69 u32 global_lock; /* Global Lock */ 68 u32 global_lock; /* Global Lock */
70 u32 S4bios_f : 1; /* Indicates if S4BIOS support is present */ 69
71 u32 reserved1 : 31; /* Must be 0 */ 70 /* Flags (32 bits) */
72 u8 resverved3 [40]; /* Reserved - must be zero */ 71
72 u8 S4bios_f : 1; /* 00: S4BIOS support is present */
73 u8 : 7; /* 01-07: Reserved, must be zero */
74 u8 reserved1[3]; /* 08-31: Reserved, must be zero */
75
76 u8 reserved2[40]; /* Reserved, must be zero */
73}; 77};
74 78
75 79
@@ -82,13 +86,13 @@ struct fadt_descriptor_rev1
82 u32 firmware_ctrl; /* Physical address of FACS */ 86 u32 firmware_ctrl; /* Physical address of FACS */
83 u32 dsdt; /* Physical address of DSDT */ 87 u32 dsdt; /* Physical address of DSDT */
84 u8 model; /* System Interrupt Model */ 88 u8 model; /* System Interrupt Model */
85 u8 reserved1; /* Reserved */ 89 u8 reserved1; /* Reserved, must be zero */
86 u16 sci_int; /* System vector of SCI interrupt */ 90 u16 sci_int; /* System vector of SCI interrupt */
87 u32 smi_cmd; /* Port address of SMI command port */ 91 u32 smi_cmd; /* Port address of SMI command port */
88 u8 acpi_enable; /* Value to write to smi_cmd to enable ACPI */ 92 u8 acpi_enable; /* Value to write to smi_cmd to enable ACPI */
89 u8 acpi_disable; /* Value to write to smi_cmd to disable ACPI */ 93 u8 acpi_disable; /* Value to write to smi_cmd to disable ACPI */
90 u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */ 94 u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */
91 u8 reserved2; /* Reserved - must be zero */ 95 u8 reserved2; /* Reserved, must be zero */
92 u32 pm1a_evt_blk; /* Port address of Power Mgt 1a acpi_event Reg Blk */ 96 u32 pm1a_evt_blk; /* Port address of Power Mgt 1a acpi_event Reg Blk */
93 u32 pm1b_evt_blk; /* Port address of Power Mgt 1b acpi_event Reg Blk */ 97 u32 pm1b_evt_blk; /* Port address of Power Mgt 1b acpi_event Reg Blk */
94 u32 pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */ 98 u32 pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */
@@ -104,7 +108,7 @@ struct fadt_descriptor_rev1
104 u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */ 108 u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */
105 u8 gpe1_blk_len; /* Byte Length of ports at gpe1_blk */ 109 u8 gpe1_blk_len; /* Byte Length of ports at gpe1_blk */
106 u8 gpe1_base; /* Offset in gpe model where gpe1 events start */ 110 u8 gpe1_base; /* Offset in gpe model where gpe1 events start */
107 u8 reserved3; /* Reserved */ 111 u8 reserved3; /* Reserved, must be zero */
108 u16 plvl2_lat; /* Worst case HW latency to enter/exit C2 state */ 112 u16 plvl2_lat; /* Worst case HW latency to enter/exit C2 state */
109 u16 plvl3_lat; /* Worst case HW latency to enter/exit C3 state */ 113 u16 plvl3_lat; /* Worst case HW latency to enter/exit C3 state */
110 u16 flush_size; /* Size of area read to flush caches */ 114 u16 flush_size; /* Size of area read to flush caches */
@@ -114,19 +118,21 @@ struct fadt_descriptor_rev1
114 u8 day_alrm; /* Index to day-of-month alarm in RTC CMOS RAM */ 118 u8 day_alrm; /* Index to day-of-month alarm in RTC CMOS RAM */
115 u8 mon_alrm; /* Index to month-of-year alarm in RTC CMOS RAM */ 119 u8 mon_alrm; /* Index to month-of-year alarm in RTC CMOS RAM */
116 u8 century; /* Index to century in RTC CMOS RAM */ 120 u8 century; /* Index to century in RTC CMOS RAM */
117 u8 reserved4; /* Reserved */ 121 u8 reserved4[3]; /* Reserved, must be zero */
118 u8 reserved4a; /* Reserved */ 122
119 u8 reserved4b; /* Reserved */ 123 /* Flags (32 bits) */
120 u32 wb_invd : 1; /* The wbinvd instruction works properly */ 124
121 u32 wb_invd_flush : 1; /* The wbinvd flushes but does not invalidate */ 125 u8 wb_invd : 1; /* 00: The wbinvd instruction works properly */
122 u32 proc_c1 : 1; /* All processors support C1 state */ 126 u8 wb_invd_flush : 1; /* 01: The wbinvd flushes but does not invalidate */
123 u32 plvl2_up : 1; /* C2 state works on MP system */ 127 u8 proc_c1 : 1; /* 02: All processors support C1 state */
124 u32 pwr_button : 1; /* Power button is handled as a generic feature */ 128 u8 plvl2_up : 1; /* 03: C2 state works on MP system */
125 u32 sleep_button : 1; /* Sleep button is handled as a generic feature, or not present */ 129 u8 pwr_button : 1; /* 04: Power button is handled as a generic feature */
126 u32 fixed_rTC : 1; /* RTC wakeup stat not in fixed register space */ 130 u8 sleep_button : 1; /* 05: Sleep button is handled as a generic feature, or not present */
127 u32 rtcs4 : 1; /* RTC wakeup stat not possible from S4 */ 131 u8 fixed_rTC : 1; /* 06: RTC wakeup stat not in fixed register space */
128 u32 tmr_val_ext : 1; /* The tmr_val width is 32 bits (0 = 24 bits) */ 132 u8 rtcs4 : 1; /* 07: RTC wakeup stat not possible from S4 */
129 u32 reserved5 : 23; /* Reserved - must be zero */ 133 u8 tmr_val_ext : 1; /* 08: tmr_val width is 32 bits (0 = 24 bits) */
134 u8 : 7; /* 09-15: Reserved, must be zero */
135 u8 reserved5[2]; /* 16-31: Reserved, must be zero */
130}; 136};
131 137
132#pragma pack() 138#pragma pack()
diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h
index e1729c967e05..84ce5abbd6f6 100644
--- a/include/acpi/actbl2.h
+++ b/include/acpi/actbl2.h
@@ -73,8 +73,7 @@
73struct rsdt_descriptor_rev2 73struct rsdt_descriptor_rev2
74{ 74{
75 ACPI_TABLE_HEADER_DEF /* ACPI common table header */ 75 ACPI_TABLE_HEADER_DEF /* ACPI common table header */
76 u32 table_offset_entry [1]; /* Array of pointers to */ 76 u32 table_offset_entry[1]; /* Array of pointers to ACPI tables */
77 /* ACPI table headers */
78}; 77};
79 78
80 79
@@ -84,8 +83,7 @@ struct rsdt_descriptor_rev2
84struct xsdt_descriptor_rev2 83struct xsdt_descriptor_rev2
85{ 84{
86 ACPI_TABLE_HEADER_DEF /* ACPI common table header */ 85 ACPI_TABLE_HEADER_DEF /* ACPI common table header */
87 u64 table_offset_entry [1]; /* Array of pointers to */ 86 u64 table_offset_entry[1]; /* Array of pointers to ACPI tables */
88 /* ACPI table headers */
89}; 87};
90 88
91 89
@@ -94,16 +92,21 @@ struct xsdt_descriptor_rev2
94 */ 92 */
95struct facs_descriptor_rev2 93struct facs_descriptor_rev2
96{ 94{
97 char signature[4]; /* ACPI signature */ 95 char signature[4]; /* ASCII table signature */
98 u32 length; /* Length of structure, in bytes */ 96 u32 length; /* Length of structure, in bytes */
99 u32 hardware_signature; /* Hardware configuration signature */ 97 u32 hardware_signature; /* Hardware configuration signature */
100 u32 firmware_waking_vector; /* 32bit physical address of the Firmware Waking Vector. */ 98 u32 firmware_waking_vector; /* 32-bit physical address of the Firmware Waking Vector. */
101 u32 global_lock; /* Global Lock used to synchronize access to shared hardware resources */ 99 u32 global_lock; /* Global Lock used to synchronize access to shared hardware resources */
102 u32 S4bios_f : 1; /* S4Bios_f - Indicates if S4BIOS support is present */ 100
103 u32 reserved1 : 31; /* Must be 0 */ 101 /* Flags (32 bits) */
104 u64 xfirmware_waking_vector; /* 64bit physical address of the Firmware Waking Vector. */ 102
103 u8 S4bios_f : 1; /* 00: S4BIOS support is present */
104 u8 : 7; /* 01-07: Reserved, must be zero */
105 u8 reserved1[3]; /* 08-31: Reserved, must be zero */
106
107 u64 xfirmware_waking_vector; /* 64-bit physical address of the Firmware Waking Vector. */
105 u8 version; /* Version of this table */ 108 u8 version; /* Version of this table */
106 u8 reserved3 [31]; /* Reserved - must be zero */ 109 u8 reserved3[31]; /* Reserved, must be zero */
107}; 110};
108 111
109 112
@@ -165,35 +168,37 @@ struct fadt_descriptor_rev2
165{ 168{
166 ACPI_TABLE_HEADER_DEF /* ACPI common table header */ 169 ACPI_TABLE_HEADER_DEF /* ACPI common table header */
167 FADT_REV2_COMMON 170 FADT_REV2_COMMON
168 u8 reserved2; /* Reserved */ 171 u8 reserved2; /* Reserved, must be zero */
169 u32 wb_invd : 1; /* The wbinvd instruction works properly */ 172
170 u32 wb_invd_flush : 1; /* The wbinvd flushes but does not invalidate */ 173 /* Flags (32 bits) */
171 u32 proc_c1 : 1; /* All processors support C1 state */ 174
172 u32 plvl2_up : 1; /* C2 state works on MP system */ 175 u8 wb_invd : 1; /* 00: The wbinvd instruction works properly */
173 u32 pwr_button : 1; /* Power button is handled as a generic feature */ 176 u8 wb_invd_flush : 1; /* 01: The wbinvd flushes but does not invalidate */
174 u32 sleep_button : 1; /* Sleep button is handled as a generic feature, or not present */ 177 u8 proc_c1 : 1; /* 02: All processors support C1 state */
175 u32 fixed_rTC : 1; /* RTC wakeup stat not in fixed register space */ 178 u8 plvl2_up : 1; /* 03: C2 state works on MP system */
176 u32 rtcs4 : 1; /* RTC wakeup stat not possible from S4 */ 179 u8 pwr_button : 1; /* 04: Power button is handled as a generic feature */
177 u32 tmr_val_ext : 1; /* Indicates tmr_val is 32 bits 0=24-bits */ 180 u8 sleep_button : 1; /* 05: Sleep button is handled as a generic feature, or not present */
178 u32 dock_cap : 1; /* Supports Docking */ 181 u8 fixed_rTC : 1; /* 06: RTC wakeup stat not in fixed register space */
179 u32 reset_reg_sup : 1; /* Indicates system supports system reset via the FADT RESET_REG */ 182 u8 rtcs4 : 1; /* 07: RTC wakeup stat not possible from S4 */
180 u32 sealed_case : 1; /* Indicates system has no internal expansion capabilities and case is sealed */ 183 u8 tmr_val_ext : 1; /* 08: tmr_val is 32 bits 0=24-bits */
181 u32 headless : 1; /* Indicates system does not have local video capabilities or local input devices */ 184 u8 dock_cap : 1; /* 09: Docking supported */
182 u32 cpu_sw_sleep : 1; /* Indicates to OSPM that a processor native instruction */ 185 u8 reset_reg_sup : 1; /* 10: System reset via the FADT RESET_REG supported */
183 /* must be executed after writing the SLP_TYPx register */ 186 u8 sealed_case : 1; /* 11: No internal expansion capabilities and case is sealed */
184 /* ACPI 3.0 flag bits */ 187 u8 headless : 1; /* 12: No local video capabilities or local input devices */
185 188 u8 cpu_sw_sleep : 1; /* 13: Must execute native instruction after writing SLP_TYPx register */
186 u32 pci_exp_wak : 1; /* System supports PCIEXP_WAKE (STS/EN) bits */ 189
187 u32 use_platform_clock : 1; /* OSPM should use platform-provided timer */ 190 u8 pci_exp_wak : 1; /* 14: System supports PCIEXP_WAKE (STS/EN) bits (ACPI 3.0) */
188 u32 S4rtc_sts_valid : 1; /* Contents of RTC_STS valid after S4 wake */ 191 u8 use_platform_clock : 1; /* 15: OSPM should use platform-provided timer (ACPI 3.0) */
189 u32 remote_power_on_capable : 1; /* System is compatible with remote power on */ 192 u8 S4rtc_sts_valid : 1; /* 16: Contents of RTC_STS valid after S4 wake (ACPI 3.0) */
190 u32 force_apic_cluster_model : 1; /* All local APICs must use cluster model */ 193 u8 remote_power_on_capable : 1; /* 17: System is compatible with remote power on (ACPI 3.0) */
191 u32 force_apic_physical_destination_mode : 1; /* all local x_aPICs must use physical dest mode */ 194 u8 force_apic_cluster_model : 1; /* 18: All local APICs must use cluster model (ACPI 3.0) */
192 u32 reserved6 : 12;/* Reserved - must be zero */ 195 u8 force_apic_physical_destination_mode : 1; /* 19: all local x_aPICs must use physical dest mode (ACPI 3.0) */
196 u8 : 4; /* 20-23: Reserved, must be zero */
197 u8 reserved3; /* 24-31: Reserved, must be zero */
193 198
194 struct acpi_generic_address reset_register; /* Reset register address in GAS format */ 199 struct acpi_generic_address reset_register; /* Reset register address in GAS format */
195 u8 reset_value; /* Value to write to the reset_register port to reset the system */ 200 u8 reset_value; /* Value to write to the reset_register port to reset the system */
196 u8 reserved7[3]; /* These three bytes must be zero */ 201 u8 reserved4[3]; /* These three bytes must be zero */
197 u64 xfirmware_ctrl; /* 64-bit physical address of FACS */ 202 u64 xfirmware_ctrl; /* 64-bit physical address of FACS */
198 u64 Xdsdt; /* 64-bit physical address of DSDT */ 203 u64 Xdsdt; /* 64-bit physical address of DSDT */
199 struct acpi_generic_address xpm1a_evt_blk; /* Extended Power Mgt 1a acpi_event Reg Blk address */ 204 struct acpi_generic_address xpm1a_evt_blk; /* Extended Power Mgt 1a acpi_event Reg Blk address */
@@ -213,11 +218,11 @@ struct fadt_descriptor_rev2_minus
213{ 218{
214 ACPI_TABLE_HEADER_DEF /* ACPI common table header */ 219 ACPI_TABLE_HEADER_DEF /* ACPI common table header */
215 FADT_REV2_COMMON 220 FADT_REV2_COMMON
216 u8 reserved2; /* Reserved */ 221 u8 reserved2; /* Reserved, must be zero */
217 u32 flags; 222 u32 flags;
218 struct acpi_generic_address reset_register; /* Reset register address in GAS format */ 223 struct acpi_generic_address reset_register; /* Reset register address in GAS format */
219 u8 reset_value; /* Value to write to the reset_register port to reset the system. */ 224 u8 reset_value; /* Value to write to the reset_register port to reset the system. */
220 u8 reserved7[3]; /* These three bytes must be zero */ 225 u8 reserved7[3]; /* Reserved, must be zero */
221}; 226};
222 227
223 228
@@ -242,11 +247,16 @@ struct static_resource_alloc
242 u8 length; 247 u8 length;
243 u8 proximity_domain_lo; 248 u8 proximity_domain_lo;
244 u8 apic_id; 249 u8 apic_id;
245 u32 enabled :1; 250
246 u32 reserved3 :31; 251 /* Flags (32 bits) */
252
253 u8 enabled :1; /* 00: Use affinity structure */
254 u8 :7; /* 01-07: Reserved, must be zero */
255 u8 reserved3[3]; /* 08-31: Reserved, must be zero */
256
247 u8 local_sapic_eid; 257 u8 local_sapic_eid;
248 u8 proximity_domain_hi[3]; 258 u8 proximity_domain_hi[3];
249 u32 reserved4; 259 u32 reserved4; /* Reserved, must be zero */
250}; 260};
251 261
252struct memory_affinity 262struct memory_affinity
@@ -258,18 +268,23 @@ struct memory_affinity
258 u64 base_address; 268 u64 base_address;
259 u64 address_length; 269 u64 address_length;
260 u32 reserved4; 270 u32 reserved4;
261 u32 enabled :1; 271
262 u32 hot_pluggable :1; 272 /* Flags (32 bits) */
263 u32 non_volatile :1; 273
264 u32 reserved5 :29; 274 u8 enabled :1; /* 00: Use affinity structure */
265 u64 reserved6; 275 u8 hot_pluggable :1; /* 01: Memory region is hot pluggable */
276 u8 non_volatile :1; /* 02: Memory is non-volatile */
277 u8 :5; /* 03-07: Reserved, must be zero */
278 u8 reserved5[3]; /* 08-31: Reserved, must be zero */
279
280 u64 reserved6; /* Reserved, must be zero */
266}; 281};
267 282
268struct system_resource_affinity 283struct system_resource_affinity
269{ 284{
270 ACPI_TABLE_HEADER_DEF 285 ACPI_TABLE_HEADER_DEF
271 u32 reserved1; /* Must be value '1' */ 286 u32 reserved1; /* Must be value '1' */
272 u64 reserved2; 287 u64 reserved2; /* Reserved, must be zero */
273}; 288};
274 289
275 290
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 3a451dc48ac8..1895b862ce0d 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -205,10 +205,11 @@ typedef u32 acpi_size;
205 205
206 206
207/* 207/*
208 * Miscellaneous common types 208 * This type is used for bitfields in ACPI tables. The only type that is
209 * even remotely portable is u8. Anything else is not portable, so
210 * do not add any more bitfield types.
209 */ 211 */
210typedef u16 UINT16_BIT; 212typedef u8 UINT8_BIT;
211typedef u32 UINT32_BIT;
212typedef acpi_native_uint ACPI_PTRDIFF; 213typedef acpi_native_uint ACPI_PTRDIFF;
213 214
214/* 215/*
@@ -243,6 +244,14 @@ struct acpi_pointer
243#define ACPI_LOGMODE_PHYSPTR ACPI_LOGICAL_ADDRESSING | ACPI_PHYSICAL_POINTER 244#define ACPI_LOGMODE_PHYSPTR ACPI_LOGICAL_ADDRESSING | ACPI_PHYSICAL_POINTER
244#define ACPI_LOGMODE_LOGPTR ACPI_LOGICAL_ADDRESSING | ACPI_LOGICAL_POINTER 245#define ACPI_LOGMODE_LOGPTR ACPI_LOGICAL_ADDRESSING | ACPI_LOGICAL_POINTER
245 246
247/*
248 * If acpi_cache_t was not defined in the OS-dependent header,
249 * define it now. This is typically the case where the local cache
250 * manager implementation is to be used (ACPI_USE_LOCAL_CACHE)
251 */
252#ifndef acpi_cache_t
253#define acpi_cache_t struct acpi_memory_list
254#endif
246 255
247/* 256/*
248 * Useful defines 257 * Useful defines
diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h
index 192d0bea3884..0e7b0a3e3b5e 100644
--- a/include/acpi/acutils.h
+++ b/include/acpi/acutils.h
@@ -120,10 +120,6 @@ u8
120acpi_ut_valid_object_type ( 120acpi_ut_valid_object_type (
121 acpi_object_type type); 121 acpi_object_type type);
122 122
123acpi_owner_id
124acpi_ut_allocate_owner_id (
125 u32 id_type);
126
127 123
128/* 124/*
129 * utinit - miscellaneous initialization and shutdown 125 * utinit - miscellaneous initialization and shutdown
@@ -306,47 +302,63 @@ acpi_ut_track_stack_ptr (
306void 302void
307acpi_ut_trace ( 303acpi_ut_trace (
308 u32 line_number, 304 u32 line_number,
309 struct acpi_debug_print_info *dbg_info); 305 const char *function_name,
306 char *module_name,
307 u32 component_id);
310 308
311void 309void
312acpi_ut_trace_ptr ( 310acpi_ut_trace_ptr (
313 u32 line_number, 311 u32 line_number,
314 struct acpi_debug_print_info *dbg_info, 312 const char *function_name,
313 char *module_name,
314 u32 component_id,
315 void *pointer); 315 void *pointer);
316 316
317void 317void
318acpi_ut_trace_u32 ( 318acpi_ut_trace_u32 (
319 u32 line_number, 319 u32 line_number,
320 struct acpi_debug_print_info *dbg_info, 320 const char *function_name,
321 char *module_name,
322 u32 component_id,
321 u32 integer); 323 u32 integer);
322 324
323void 325void
324acpi_ut_trace_str ( 326acpi_ut_trace_str (
325 u32 line_number, 327 u32 line_number,
326 struct acpi_debug_print_info *dbg_info, 328 const char *function_name,
329 char *module_name,
330 u32 component_id,
327 char *string); 331 char *string);
328 332
329void 333void
330acpi_ut_exit ( 334acpi_ut_exit (
331 u32 line_number, 335 u32 line_number,
332 struct acpi_debug_print_info *dbg_info); 336 const char *function_name,
337 char *module_name,
338 u32 component_id);
333 339
334void 340void
335acpi_ut_status_exit ( 341acpi_ut_status_exit (
336 u32 line_number, 342 u32 line_number,
337 struct acpi_debug_print_info *dbg_info, 343 const char *function_name,
344 char *module_name,
345 u32 component_id,
338 acpi_status status); 346 acpi_status status);
339 347
340void 348void
341acpi_ut_value_exit ( 349acpi_ut_value_exit (
342 u32 line_number, 350 u32 line_number,
343 struct acpi_debug_print_info *dbg_info, 351 const char *function_name,
352 char *module_name,
353 u32 component_id,
344 acpi_integer value); 354 acpi_integer value);
345 355
346void 356void
347acpi_ut_ptr_exit ( 357acpi_ut_ptr_exit (
348 u32 line_number, 358 u32 line_number,
349 struct acpi_debug_print_info *dbg_info, 359 const char *function_name,
360 char *module_name,
361 u32 component_id,
350 u8 *ptr); 362 u8 *ptr);
351 363
352void 364void
@@ -378,7 +390,9 @@ void ACPI_INTERNAL_VAR_XFACE
378acpi_ut_debug_print ( 390acpi_ut_debug_print (
379 u32 requested_debug_level, 391 u32 requested_debug_level,
380 u32 line_number, 392 u32 line_number,
381 struct acpi_debug_print_info *dbg_info, 393 const char *function_name,
394 char *module_name,
395 u32 component_id,
382 char *format, 396 char *format,
383 ...) ACPI_PRINTF_LIKE_FUNC; 397 ...) ACPI_PRINTF_LIKE_FUNC;
384 398
@@ -386,7 +400,9 @@ void ACPI_INTERNAL_VAR_XFACE
386acpi_ut_debug_print_raw ( 400acpi_ut_debug_print_raw (
387 u32 requested_debug_level, 401 u32 requested_debug_level,
388 u32 line_number, 402 u32 line_number,
389 struct acpi_debug_print_info *dbg_info, 403 const char *function_name,
404 char *module_name,
405 u32 component_id,
390 char *format, 406 char *format,
391 ...) ACPI_PRINTF_LIKE_FUNC; 407 ...) ACPI_PRINTF_LIKE_FUNC;
392 408
@@ -477,8 +493,8 @@ acpi_ut_allocate_object_desc_dbg (
477 u32 line_number, 493 u32 line_number,
478 u32 component_id); 494 u32 component_id);
479 495
480#define acpi_ut_create_internal_object(t) acpi_ut_create_internal_object_dbg (_THIS_MODULE,__LINE__,_COMPONENT,t) 496#define acpi_ut_create_internal_object(t) acpi_ut_create_internal_object_dbg (_acpi_module_name,__LINE__,_COMPONENT,t)
481#define acpi_ut_allocate_object_desc() acpi_ut_allocate_object_desc_dbg (_THIS_MODULE,__LINE__,_COMPONENT) 497#define acpi_ut_allocate_object_desc() acpi_ut_allocate_object_desc_dbg (_acpi_module_name,__LINE__,_COMPONENT)
482 498
483void 499void
484acpi_ut_delete_object_desc ( 500acpi_ut_delete_object_desc (
@@ -557,16 +573,6 @@ void
557acpi_ut_delete_generic_state ( 573acpi_ut_delete_generic_state (
558 union acpi_generic_state *state); 574 union acpi_generic_state *state);
559 575
560#ifdef ACPI_ENABLE_OBJECT_CACHE
561void
562acpi_ut_delete_generic_state_cache (
563 void);
564
565void
566acpi_ut_delete_object_cache (
567 void);
568#endif
569
570 576
571/* 577/*
572 * utmath 578 * utmath
@@ -589,13 +595,21 @@ acpi_ut_short_divide (
589 * utmisc 595 * utmisc
590 */ 596 */
591acpi_status 597acpi_status
598acpi_ut_allocate_owner_id (
599 acpi_owner_id *owner_id);
600
601void
602acpi_ut_release_owner_id (
603 acpi_owner_id *owner_id);
604
605acpi_status
592acpi_ut_walk_package_tree ( 606acpi_ut_walk_package_tree (
593 union acpi_operand_object *source_object, 607 union acpi_operand_object *source_object,
594 void *target_object, 608 void *target_object,
595 acpi_pkg_callback walk_callback, 609 acpi_pkg_callback walk_callback,
596 void *context); 610 void *context);
597 611
598char * 612void
599acpi_ut_strupr ( 613acpi_ut_strupr (
600 char *src_string); 614 char *src_string);
601 615
@@ -622,22 +636,6 @@ acpi_ut_strtoul64 (
622 636
623#define ACPI_ANY_BASE 0 637#define ACPI_ANY_BASE 0
624 638
625acpi_status
626acpi_ut_mutex_initialize (
627 void);
628
629void
630acpi_ut_mutex_terminate (
631 void);
632
633acpi_status
634acpi_ut_acquire_mutex (
635 acpi_mutex_handle mutex_id);
636
637acpi_status
638acpi_ut_release_mutex (
639 acpi_mutex_handle mutex_id);
640
641u8 * 639u8 *
642acpi_ut_get_resource_end_tag ( 640acpi_ut_get_resource_end_tag (
643 union acpi_operand_object *obj_desc); 641 union acpi_operand_object *obj_desc);
@@ -666,22 +664,35 @@ acpi_ut_display_init_pathname (
666 664
667 665
668/* 666/*
669 * utalloc - memory allocation and object caching 667 * utmutex - mutex support
670 */ 668 */
671void * 669acpi_status
672acpi_ut_acquire_from_cache ( 670acpi_ut_mutex_initialize (
673 u32 list_id); 671 void);
674 672
675void 673void
676acpi_ut_release_to_cache ( 674acpi_ut_mutex_terminate (
677 u32 list_id, 675 void);
678 void *object);
679 676
680#ifdef ACPI_ENABLE_OBJECT_CACHE 677acpi_status
681void 678acpi_ut_acquire_mutex (
682acpi_ut_delete_generic_cache ( 679 acpi_mutex_handle mutex_id);
683 u32 list_id); 680
684#endif 681acpi_status
682acpi_ut_release_mutex (
683 acpi_mutex_handle mutex_id);
684
685
686/*
687 * utalloc - memory allocation and object caching
688 */
689acpi_status
690acpi_ut_create_caches (
691 void);
692
693acpi_status
694acpi_ut_delete_caches (
695 void);
685 696
686acpi_status 697acpi_status
687acpi_ut_validate_buffer ( 698acpi_ut_validate_buffer (
diff --git a/include/acpi/amlcode.h b/include/acpi/amlcode.h
index 55e97ed29190..50a088901196 100644
--- a/include/acpi/amlcode.h
+++ b/include/acpi/amlcode.h
@@ -69,7 +69,7 @@
69#define AML_MULTI_NAME_PREFIX_OP (u16) 0x2f 69#define AML_MULTI_NAME_PREFIX_OP (u16) 0x2f
70#define AML_NAME_CHAR_SUBSEQ (u16) 0x30 70#define AML_NAME_CHAR_SUBSEQ (u16) 0x30
71#define AML_NAME_CHAR_FIRST (u16) 0x41 71#define AML_NAME_CHAR_FIRST (u16) 0x41
72#define AML_OP_PREFIX (u16) 0x5b 72#define AML_EXTENDED_OP_PREFIX (u16) 0x5b
73#define AML_ROOT_PREFIX (u16) 0x5c 73#define AML_ROOT_PREFIX (u16) 0x5c
74#define AML_PARENT_PREFIX (u16) 0x5e 74#define AML_PARENT_PREFIX (u16) 0x5e
75#define AML_LOCAL_OP (u16) 0x60 75#define AML_LOCAL_OP (u16) 0x60
@@ -146,7 +146,7 @@
146 146
147/* prefixed opcodes */ 147/* prefixed opcodes */
148 148
149#define AML_EXTOP (u16) 0x005b /* prefix for 2-byte opcodes */ 149#define AML_EXTENDED_OPCODE (u16) 0x5b00 /* prefix for 2-byte opcodes */
150 150
151#define AML_MUTEX_OP (u16) 0x5b01 151#define AML_MUTEX_OP (u16) 0x5b01
152#define AML_EVENT_OP (u16) 0x5b02 152#define AML_EVENT_OP (u16) 0x5b02
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h
index adf969efa510..bae1fbed097a 100644
--- a/include/acpi/platform/acenv.h
+++ b/include/acpi/platform/acenv.h
@@ -49,35 +49,38 @@
49 * Configuration for ACPI tools and utilities 49 * Configuration for ACPI tools and utilities
50 */ 50 */
51 51
52#ifdef _ACPI_DUMP_APP 52#ifdef ACPI_LIBRARY
53#define ACPI_USE_LOCAL_CACHE
54#endif
55
56#ifdef ACPI_DUMP_APP
53#ifndef MSDOS 57#ifndef MSDOS
54#define ACPI_DEBUG_OUTPUT 58#define ACPI_DEBUG_OUTPUT
55#endif 59#endif
56#define ACPI_APPLICATION 60#define ACPI_APPLICATION
57#define ACPI_DISASSEMBLER 61#define ACPI_DISASSEMBLER
58#define ACPI_NO_METHOD_EXECUTION 62#define ACPI_NO_METHOD_EXECUTION
59#define ACPI_USE_SYSTEM_CLIBRARY
60#define ACPI_ENABLE_OBJECT_CACHE
61#endif 63#endif
62 64
63#ifdef _ACPI_EXEC_APP 65#ifdef ACPI_EXEC_APP
64#undef DEBUGGER_THREADING 66#undef DEBUGGER_THREADING
65#define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED 67#define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED
66#define ACPI_DEBUG_OUTPUT 68#define ACPI_DEBUG_OUTPUT
67#define ACPI_APPLICATION 69#define ACPI_APPLICATION
68#define ACPI_DEBUGGER 70#define ACPI_DEBUGGER
69#define ACPI_DISASSEMBLER 71#define ACPI_DISASSEMBLER
70#define ACPI_USE_SYSTEM_CLIBRARY
71#define ACPI_ENABLE_OBJECT_CACHE
72#endif 72#endif
73 73
74#ifdef _ACPI_ASL_COMPILER 74#ifdef ACPI_ASL_COMPILER
75#define ACPI_DEBUG_OUTPUT 75#define ACPI_DEBUG_OUTPUT
76#define ACPI_APPLICATION 76#define ACPI_APPLICATION
77#define ACPI_DISASSEMBLER 77#define ACPI_DISASSEMBLER
78#define ACPI_CONSTANT_EVAL_ONLY 78#define ACPI_CONSTANT_EVAL_ONLY
79#endif
80
81#ifdef ACPI_APPLICATION
79#define ACPI_USE_SYSTEM_CLIBRARY 82#define ACPI_USE_SYSTEM_CLIBRARY
80#define ACPI_ENABLE_OBJECT_CACHE 83#define ACPI_USE_LOCAL_CACHE
81#endif 84#endif
82 85
83/* 86/*
@@ -238,15 +241,15 @@
238#define ACPI_MEMCPY(d,s,n) (void) memcpy((d), (s), (acpi_size)(n)) 241#define ACPI_MEMCPY(d,s,n) (void) memcpy((d), (s), (acpi_size)(n))
239#define ACPI_MEMSET(d,s,n) (void) memset((d), (s), (acpi_size)(n)) 242#define ACPI_MEMSET(d,s,n) (void) memset((d), (s), (acpi_size)(n))
240 243
241#define ACPI_TOUPPER toupper 244#define ACPI_TOUPPER(i) toupper((int) (i))
242#define ACPI_TOLOWER tolower 245#define ACPI_TOLOWER(i) tolower((int) (i))
243#define ACPI_IS_XDIGIT isxdigit 246#define ACPI_IS_XDIGIT(i) isxdigit((int) (i))
244#define ACPI_IS_DIGIT isdigit 247#define ACPI_IS_DIGIT(i) isdigit((int) (i))
245#define ACPI_IS_SPACE isspace 248#define ACPI_IS_SPACE(i) isspace((int) (i))
246#define ACPI_IS_UPPER isupper 249#define ACPI_IS_UPPER(i) isupper((int) (i))
247#define ACPI_IS_PRINT isprint 250#define ACPI_IS_PRINT(i) isprint((int) (i))
248#define ACPI_IS_ALPHA isalpha 251#define ACPI_IS_ALPHA(i) isalpha((int) (i))
249#define ACPI_IS_ASCII isascii 252#define ACPI_IS_ASCII(i) isascii((int) (i))
250 253
251#else 254#else
252 255
diff --git a/include/acpi/platform/acgcc.h b/include/acpi/platform/acgcc.h
index 91fda36b042b..39264127574c 100644
--- a/include/acpi/platform/acgcc.h
+++ b/include/acpi/platform/acgcc.h
@@ -44,13 +44,17 @@
44#ifndef __ACGCC_H__ 44#ifndef __ACGCC_H__
45#define __ACGCC_H__ 45#define __ACGCC_H__
46 46
47/* Function name is used for debug output. Non-ANSI, compiler-dependent */
48
49#define ACPI_GET_FUNCTION_NAME __FUNCTION__
50
47/* This macro is used to tag functions as "printf-like" because 51/* This macro is used to tag functions as "printf-like" because
48 * some compilers (like GCC) can catch printf format string problems. 52 * some compilers (like GCC) can catch printf format string problems.
49 */ 53 */
50#define ACPI_PRINTF_LIKE_FUNC __attribute__ ((__format__ (__printf__, 4, 5))) 54#define ACPI_PRINTF_LIKE_FUNC __attribute__ ((__format__ (__printf__, 6, 7)))
51 55
52/* Some compilers complain about unused variables. Sometimes we don't want to 56/* Some compilers complain about unused variables. Sometimes we don't want to
53 * use all the variables (most specifically for _THIS_MODULE). This allow us 57 * use all the variables (for example, _acpi_module_name). This allows us
54 * to to tell the compiler warning in a per-variable manner that a variable 58 * to to tell the compiler warning in a per-variable manner that a variable
55 * is unused. 59 * is unused.
56 */ 60 */
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index a3de0db85694..4fbc0fd52a27 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -62,6 +62,17 @@
62 62
63#define ACPI_MACHINE_WIDTH BITS_PER_LONG 63#define ACPI_MACHINE_WIDTH BITS_PER_LONG
64 64
65/* Type(s) for the OSL */
66
67#ifdef ACPI_USE_LOCAL_CACHE
68#define acpi_cache_t struct acpi_memory_list
69#else
70#include <linux/slab.h>
71#define acpi_cache_t kmem_cache_t
72#endif
73
74
75
65#else /* !__KERNEL__ */ 76#else /* !__KERNEL__ */
66 77
67#include <stdarg.h> 78#include <stdarg.h>