diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-10-27 20:14:59 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-10-27 20:14:59 -0400 |
commit | 9183ea62f71484dd2e91e313b766adeb15789f90 (patch) | |
tree | ee81ef91ec6280f55a90f79a099097cd7be2f3b6 | |
parent | 31c466c1af229b08bec56c6564b50311d9d660ca (diff) | |
parent | 3774929d2ac6213a78068a33660d3402f2334d60 (diff) |
Merge branch 'acpica'
* acpica:
MAINTAINERS / ACPICA: Add ACPICA information to MAINTAINERS
ACPICA: Update version to 20130823.
ACPICA: SCI Handlers: Update handler interface, eliminate unnecessary argument.
ACPICA: Cleanup exception codes.
ACPICA: Tables: Cleanup RSDP signature codes.
ACPICA: Tables: Cleanup table checksum verification code.
ACPICA: Debugger: Add new command to display full namespace pathnames.
ACPICA: Operation region support: Never free the handler "context" pointer.
ACPICA: Add support for host-installed SCI handlers.
ACPICA: Validate start object for acpi_walk_namespace.
ACPICA: Debugger: Prevent possible command line buffer overflow, kernel behavior is not affected.
ACPICA: Linux-specific header: enable "aarch64" 64-bit build.
ACPICA: Debug output: small formatting update, no functional change.
ACPICA: acpi_read: On error, do not modify the return value target location.
ACPICA: Improve error message for "too many parent prefixes" condition.
-rw-r--r-- | MAINTAINERS | 14 | ||||
-rw-r--r-- | drivers/acpi/acpica/acdebug.h | 5 | ||||
-rw-r--r-- | drivers/acpi/acpica/acevents.h | 6 | ||||
-rw-r--r-- | drivers/acpi/acpica/acglobal.h | 18 | ||||
-rw-r--r-- | drivers/acpi/acpica/aclocal.h | 8 | ||||
-rw-r--r-- | drivers/acpi/acpica/acnamesp.h | 6 | ||||
-rw-r--r-- | drivers/acpi/acpica/evgpeutil.c | 2 | ||||
-rw-r--r-- | drivers/acpi/acpica/evmisc.c | 14 | ||||
-rw-r--r-- | drivers/acpi/acpica/evregion.c | 23 | ||||
-rw-r--r-- | drivers/acpi/acpica/evsci.c | 78 | ||||
-rw-r--r-- | drivers/acpi/acpica/evxface.c | 139 | ||||
-rw-r--r-- | drivers/acpi/acpica/hwxface.c | 26 | ||||
-rw-r--r-- | drivers/acpi/acpica/nsaccess.c | 5 | ||||
-rw-r--r-- | drivers/acpi/acpica/nsdump.c | 134 | ||||
-rw-r--r-- | drivers/acpi/acpica/nsxfeval.c | 8 | ||||
-rw-r--r-- | drivers/acpi/acpica/tbinstal.c | 12 | ||||
-rw-r--r-- | drivers/acpi/acpica/tbprint.c | 12 | ||||
-rw-r--r-- | drivers/acpi/acpica/tbxfroot.c | 3 | ||||
-rw-r--r-- | drivers/acpi/acpica/utdebug.c | 2 | ||||
-rw-r--r-- | drivers/acpi/acpica/utglobal.c | 3 | ||||
-rw-r--r-- | include/acpi/acexcep.h | 8 | ||||
-rw-r--r-- | include/acpi/acpixf.h | 15 | ||||
-rw-r--r-- | include/acpi/actypes.h | 8 | ||||
-rw-r--r-- | include/acpi/platform/aclinux.h | 2 |
24 files changed, 479 insertions, 72 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index 3438384d270c..45cdfa3e1067 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -253,6 +253,20 @@ F: drivers/pci/*acpi* | |||
253 | F: drivers/pci/*/*acpi* | 253 | F: drivers/pci/*/*acpi* |
254 | F: drivers/pci/*/*/*acpi* | 254 | F: drivers/pci/*/*/*acpi* |
255 | 255 | ||
256 | ACPI COMPONENT ARCHITECTURE (ACPICA) | ||
257 | M: Robert Moore <robert.moore@intel.com> | ||
258 | M: Lv Zheng <lv.zheng@intel.com> | ||
259 | M: Rafael J. Wysocki <rafael.j.wysocki@intel.com> | ||
260 | L: linux-acpi@vger.kernel.org | ||
261 | L: devel@acpica.org | ||
262 | W: https://acpica.org/ | ||
263 | W: https://github.com/acpica/acpica/ | ||
264 | Q: https://patchwork.kernel.org/project/linux-acpi/list/ | ||
265 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm | ||
266 | S: Supported | ||
267 | F: drivers/acpi/acpica/ | ||
268 | F: include/acpi/ | ||
269 | |||
256 | ACPI FAN DRIVER | 270 | ACPI FAN DRIVER |
257 | M: Zhang Rui <rui.zhang@intel.com> | 271 | M: Zhang Rui <rui.zhang@intel.com> |
258 | L: linux-acpi@vger.kernel.org | 272 | L: linux-acpi@vger.kernel.org |
diff --git a/drivers/acpi/acpica/acdebug.h b/drivers/acpi/acpica/acdebug.h index 9feba08c29fe..27c36a5251b5 100644 --- a/drivers/acpi/acpica/acdebug.h +++ b/drivers/acpi/acpica/acdebug.h | |||
@@ -113,11 +113,12 @@ void acpi_db_display_handlers(void); | |||
113 | ACPI_HW_DEPENDENT_RETURN_VOID(void | 113 | ACPI_HW_DEPENDENT_RETURN_VOID(void |
114 | acpi_db_generate_gpe(char *gpe_arg, | 114 | acpi_db_generate_gpe(char *gpe_arg, |
115 | char *block_arg)) | 115 | char *block_arg)) |
116 | ACPI_HW_DEPENDENT_RETURN_VOID(void acpi_db_generate_sci(void)) | ||
116 | 117 | ||
117 | /* | 118 | /* |
118 | * dbconvert - miscellaneous conversion routines | 119 | * dbconvert - miscellaneous conversion routines |
119 | */ | 120 | */ |
120 | acpi_status acpi_db_hex_char_to_value(int hex_char, u8 *return_value); | 121 | acpi_status acpi_db_hex_char_to_value(int hex_char, u8 *return_value); |
121 | 122 | ||
122 | acpi_status acpi_db_convert_to_package(char *string, union acpi_object *object); | 123 | acpi_status acpi_db_convert_to_package(char *string, union acpi_object *object); |
123 | 124 | ||
@@ -154,6 +155,8 @@ void acpi_db_set_scope(char *name); | |||
154 | 155 | ||
155 | void acpi_db_dump_namespace(char *start_arg, char *depth_arg); | 156 | void acpi_db_dump_namespace(char *start_arg, char *depth_arg); |
156 | 157 | ||
158 | void acpi_db_dump_namespace_paths(void); | ||
159 | |||
157 | void acpi_db_dump_namespace_by_owner(char *owner_arg, char *depth_arg); | 160 | void acpi_db_dump_namespace_by_owner(char *owner_arg, char *depth_arg); |
158 | 161 | ||
159 | acpi_status acpi_db_find_name_in_namespace(char *name_arg); | 162 | acpi_status acpi_db_find_name_in_namespace(char *name_arg); |
diff --git a/drivers/acpi/acpica/acevents.h b/drivers/acpi/acpica/acevents.h index ab0e97710381..3ae5fd02ae64 100644 --- a/drivers/acpi/acpica/acevents.h +++ b/drivers/acpi/acpica/acevents.h | |||
@@ -242,11 +242,11 @@ acpi_ev_initialize_region(union acpi_operand_object *region_obj, | |||
242 | */ | 242 | */ |
243 | u32 ACPI_SYSTEM_XFACE acpi_ev_gpe_xrupt_handler(void *context); | 243 | u32 ACPI_SYSTEM_XFACE acpi_ev_gpe_xrupt_handler(void *context); |
244 | 244 | ||
245 | u32 acpi_ev_install_sci_handler(void); | 245 | u32 acpi_ev_sci_dispatch(void); |
246 | 246 | ||
247 | acpi_status acpi_ev_remove_sci_handler(void); | 247 | u32 acpi_ev_install_sci_handler(void); |
248 | 248 | ||
249 | u32 acpi_ev_initialize_SCI(u32 program_SCI); | 249 | acpi_status acpi_ev_remove_all_sci_handlers(void); |
250 | 250 | ||
251 | ACPI_HW_DEPENDENT_RETURN_VOID(void acpi_ev_terminate(void)) | 251 | ACPI_HW_DEPENDENT_RETURN_VOID(void acpi_ev_terminate(void)) |
252 | #endif /* __ACEVENTS_H__ */ | 252 | #endif /* __ACEVENTS_H__ */ |
diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h index 90e846f985fa..0fba431f4fcb 100644 --- a/drivers/acpi/acpica/acglobal.h +++ b/drivers/acpi/acpica/acglobal.h | |||
@@ -269,6 +269,7 @@ ACPI_EXTERN acpi_table_handler acpi_gbl_table_handler; | |||
269 | ACPI_EXTERN void *acpi_gbl_table_handler_context; | 269 | ACPI_EXTERN void *acpi_gbl_table_handler_context; |
270 | ACPI_EXTERN struct acpi_walk_state *acpi_gbl_breakpoint_walk; | 270 | ACPI_EXTERN struct acpi_walk_state *acpi_gbl_breakpoint_walk; |
271 | ACPI_EXTERN acpi_interface_handler acpi_gbl_interface_handler; | 271 | ACPI_EXTERN acpi_interface_handler acpi_gbl_interface_handler; |
272 | ACPI_EXTERN struct acpi_sci_handler_info *acpi_gbl_sci_handler_list; | ||
272 | 273 | ||
273 | /* Owner ID support */ | 274 | /* Owner ID support */ |
274 | 275 | ||
@@ -445,13 +446,6 @@ ACPI_EXTERN u8 acpi_gbl_db_opt_tables; | |||
445 | ACPI_EXTERN u8 acpi_gbl_db_opt_stats; | 446 | ACPI_EXTERN u8 acpi_gbl_db_opt_stats; |
446 | ACPI_EXTERN u8 acpi_gbl_db_opt_ini_methods; | 447 | ACPI_EXTERN u8 acpi_gbl_db_opt_ini_methods; |
447 | ACPI_EXTERN u8 acpi_gbl_db_opt_no_region_support; | 448 | ACPI_EXTERN u8 acpi_gbl_db_opt_no_region_support; |
448 | |||
449 | ACPI_EXTERN char *acpi_gbl_db_args[ACPI_DEBUGGER_MAX_ARGS]; | ||
450 | ACPI_EXTERN acpi_object_type acpi_gbl_db_arg_types[ACPI_DEBUGGER_MAX_ARGS]; | ||
451 | ACPI_EXTERN char acpi_gbl_db_line_buf[ACPI_DB_LINE_BUFFER_SIZE]; | ||
452 | ACPI_EXTERN char acpi_gbl_db_parsed_buf[ACPI_DB_LINE_BUFFER_SIZE]; | ||
453 | ACPI_EXTERN char acpi_gbl_db_scope_buf[80]; | ||
454 | ACPI_EXTERN char acpi_gbl_db_debug_filename[80]; | ||
455 | ACPI_EXTERN u8 acpi_gbl_db_output_to_file; | 449 | ACPI_EXTERN u8 acpi_gbl_db_output_to_file; |
456 | ACPI_EXTERN char *acpi_gbl_db_buffer; | 450 | ACPI_EXTERN char *acpi_gbl_db_buffer; |
457 | ACPI_EXTERN char *acpi_gbl_db_filename; | 451 | ACPI_EXTERN char *acpi_gbl_db_filename; |
@@ -459,6 +453,16 @@ ACPI_EXTERN u32 acpi_gbl_db_debug_level; | |||
459 | ACPI_EXTERN u32 acpi_gbl_db_console_debug_level; | 453 | ACPI_EXTERN u32 acpi_gbl_db_console_debug_level; |
460 | ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_db_scope_node; | 454 | ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_db_scope_node; |
461 | 455 | ||
456 | ACPI_EXTERN char *acpi_gbl_db_args[ACPI_DEBUGGER_MAX_ARGS]; | ||
457 | ACPI_EXTERN acpi_object_type acpi_gbl_db_arg_types[ACPI_DEBUGGER_MAX_ARGS]; | ||
458 | |||
459 | /* These buffers should all be the same size */ | ||
460 | |||
461 | ACPI_EXTERN char acpi_gbl_db_line_buf[ACPI_DB_LINE_BUFFER_SIZE]; | ||
462 | ACPI_EXTERN char acpi_gbl_db_parsed_buf[ACPI_DB_LINE_BUFFER_SIZE]; | ||
463 | ACPI_EXTERN char acpi_gbl_db_scope_buf[ACPI_DB_LINE_BUFFER_SIZE]; | ||
464 | ACPI_EXTERN char acpi_gbl_db_debug_filename[ACPI_DB_LINE_BUFFER_SIZE]; | ||
465 | |||
462 | /* | 466 | /* |
463 | * Statistic globals | 467 | * Statistic globals |
464 | */ | 468 | */ |
diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h index 0ed00669cd21..be9e30ee6048 100644 --- a/drivers/acpi/acpica/aclocal.h +++ b/drivers/acpi/acpica/aclocal.h | |||
@@ -398,6 +398,14 @@ struct acpi_simple_repair_info { | |||
398 | * | 398 | * |
399 | ****************************************************************************/ | 399 | ****************************************************************************/ |
400 | 400 | ||
401 | /* Dispatch info for each host-installed SCI handler */ | ||
402 | |||
403 | struct acpi_sci_handler_info { | ||
404 | struct acpi_sci_handler_info *next; | ||
405 | acpi_sci_handler address; /* Address of handler */ | ||
406 | void *context; /* Context to be passed to handler */ | ||
407 | }; | ||
408 | |||
401 | /* Dispatch info for each GPE -- either a method or handler, cannot be both */ | 409 | /* Dispatch info for each GPE -- either a method or handler, cannot be both */ |
402 | 410 | ||
403 | struct acpi_gpe_handler_info { | 411 | struct acpi_gpe_handler_info { |
diff --git a/drivers/acpi/acpica/acnamesp.h b/drivers/acpi/acpica/acnamesp.h index 40b04bd5579e..e6138ac4a160 100644 --- a/drivers/acpi/acpica/acnamesp.h +++ b/drivers/acpi/acpica/acnamesp.h | |||
@@ -213,6 +213,12 @@ acpi_ns_dump_objects(acpi_object_type type, | |||
213 | u8 display_type, | 213 | u8 display_type, |
214 | u32 max_depth, | 214 | u32 max_depth, |
215 | acpi_owner_id owner_id, acpi_handle start_handle); | 215 | acpi_owner_id owner_id, acpi_handle start_handle); |
216 | |||
217 | void | ||
218 | acpi_ns_dump_object_paths(acpi_object_type type, | ||
219 | u8 display_type, | ||
220 | u32 max_depth, | ||
221 | acpi_owner_id owner_id, acpi_handle start_handle); | ||
216 | #endif /* ACPI_FUTURE_USAGE */ | 222 | #endif /* ACPI_FUTURE_USAGE */ |
217 | 223 | ||
218 | /* | 224 | /* |
diff --git a/drivers/acpi/acpica/evgpeutil.c b/drivers/acpi/acpica/evgpeutil.c index b24dbb80fab8..d52339090b60 100644 --- a/drivers/acpi/acpica/evgpeutil.c +++ b/drivers/acpi/acpica/evgpeutil.c | |||
@@ -196,7 +196,7 @@ acpi_ev_get_gpe_device(struct acpi_gpe_xrupt_info *gpe_xrupt_info, | |||
196 | * | 196 | * |
197 | * FUNCTION: acpi_ev_get_gpe_xrupt_block | 197 | * FUNCTION: acpi_ev_get_gpe_xrupt_block |
198 | * | 198 | * |
199 | * PARAMETERS: interrupt_number - Interrupt for a GPE block | 199 | * PARAMETERS: interrupt_number - Interrupt for a GPE block |
200 | * | 200 | * |
201 | * RETURN: A GPE interrupt block | 201 | * RETURN: A GPE interrupt block |
202 | * | 202 | * |
diff --git a/drivers/acpi/acpica/evmisc.c b/drivers/acpi/acpica/evmisc.c index 1b111ef74903..a5687540e9a6 100644 --- a/drivers/acpi/acpica/evmisc.c +++ b/drivers/acpi/acpica/evmisc.c | |||
@@ -264,13 +264,6 @@ void acpi_ev_terminate(void) | |||
264 | 264 | ||
265 | status = acpi_ev_walk_gpe_list(acpi_hw_disable_gpe_block, NULL); | 265 | status = acpi_ev_walk_gpe_list(acpi_hw_disable_gpe_block, NULL); |
266 | 266 | ||
267 | /* Remove SCI handler */ | ||
268 | |||
269 | status = acpi_ev_remove_sci_handler(); | ||
270 | if (ACPI_FAILURE(status)) { | ||
271 | ACPI_ERROR((AE_INFO, "Could not remove SCI handler")); | ||
272 | } | ||
273 | |||
274 | status = acpi_ev_remove_global_lock_handler(); | 267 | status = acpi_ev_remove_global_lock_handler(); |
275 | if (ACPI_FAILURE(status)) { | 268 | if (ACPI_FAILURE(status)) { |
276 | ACPI_ERROR((AE_INFO, | 269 | ACPI_ERROR((AE_INFO, |
@@ -280,6 +273,13 @@ void acpi_ev_terminate(void) | |||
280 | acpi_gbl_events_initialized = FALSE; | 273 | acpi_gbl_events_initialized = FALSE; |
281 | } | 274 | } |
282 | 275 | ||
276 | /* Remove SCI handlers */ | ||
277 | |||
278 | status = acpi_ev_remove_all_sci_handlers(); | ||
279 | if (ACPI_FAILURE(status)) { | ||
280 | ACPI_ERROR((AE_INFO, "Could not remove SCI handler")); | ||
281 | } | ||
282 | |||
283 | /* Deallocate all handler objects installed within GPE info structs */ | 283 | /* Deallocate all handler objects installed within GPE info structs */ |
284 | 284 | ||
285 | status = acpi_ev_walk_gpe_list(acpi_ev_delete_gpe_handlers, NULL); | 285 | status = acpi_ev_walk_gpe_list(acpi_ev_delete_gpe_handlers, NULL); |
diff --git a/drivers/acpi/acpica/evregion.c b/drivers/acpi/acpica/evregion.c index cea14d6fc76c..6293d6bb6fe1 100644 --- a/drivers/acpi/acpica/evregion.c +++ b/drivers/acpi/acpica/evregion.c | |||
@@ -217,16 +217,11 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, | |||
217 | if (!(region_obj->region.flags & AOPOBJ_SETUP_COMPLETE)) { | 217 | if (!(region_obj->region.flags & AOPOBJ_SETUP_COMPLETE)) { |
218 | region_obj->region.flags |= AOPOBJ_SETUP_COMPLETE; | 218 | region_obj->region.flags |= AOPOBJ_SETUP_COMPLETE; |
219 | 219 | ||
220 | if (region_obj2->extra.region_context) { | 220 | /* |
221 | 221 | * Save the returned context for use in all accesses to | |
222 | /* The handler for this region was already installed */ | 222 | * the handler for this particular region |
223 | 223 | */ | |
224 | ACPI_FREE(region_context); | 224 | if (!(region_obj2->extra.region_context)) { |
225 | } else { | ||
226 | /* | ||
227 | * Save the returned context for use in all accesses to | ||
228 | * this particular region | ||
229 | */ | ||
230 | region_obj2->extra.region_context = | 225 | region_obj2->extra.region_context = |
231 | region_context; | 226 | region_context; |
232 | } | 227 | } |
@@ -402,6 +397,14 @@ acpi_ev_detach_region(union acpi_operand_object *region_obj, | |||
402 | handler_obj->address_space. | 397 | handler_obj->address_space. |
403 | context, region_context); | 398 | context, region_context); |
404 | 399 | ||
400 | /* | ||
401 | * region_context should have been released by the deactivate | ||
402 | * operation. We don't need access to it anymore here. | ||
403 | */ | ||
404 | if (region_context) { | ||
405 | *region_context = NULL; | ||
406 | } | ||
407 | |||
405 | /* Init routine may fail, Just ignore errors */ | 408 | /* Init routine may fail, Just ignore errors */ |
406 | 409 | ||
407 | if (ACPI_FAILURE(status)) { | 410 | if (ACPI_FAILURE(status)) { |
diff --git a/drivers/acpi/acpica/evsci.c b/drivers/acpi/acpica/evsci.c index b905acf7aacd..94d9ebddf575 100644 --- a/drivers/acpi/acpica/evsci.c +++ b/drivers/acpi/acpica/evsci.c | |||
@@ -54,6 +54,50 @@ static u32 ACPI_SYSTEM_XFACE acpi_ev_sci_xrupt_handler(void *context); | |||
54 | 54 | ||
55 | /******************************************************************************* | 55 | /******************************************************************************* |
56 | * | 56 | * |
57 | * FUNCTION: acpi_ev_sci_dispatch | ||
58 | * | ||
59 | * PARAMETERS: None | ||
60 | * | ||
61 | * RETURN: Status code indicates whether interrupt was handled. | ||
62 | * | ||
63 | * DESCRIPTION: Dispatch the SCI to all host-installed SCI handlers. | ||
64 | * | ||
65 | ******************************************************************************/ | ||
66 | |||
67 | u32 acpi_ev_sci_dispatch(void) | ||
68 | { | ||
69 | struct acpi_sci_handler_info *sci_handler; | ||
70 | acpi_cpu_flags flags; | ||
71 | u32 int_status = ACPI_INTERRUPT_NOT_HANDLED; | ||
72 | |||
73 | ACPI_FUNCTION_NAME(ev_sci_dispatch); | ||
74 | |||
75 | /* Are there any host-installed SCI handlers? */ | ||
76 | |||
77 | if (!acpi_gbl_sci_handler_list) { | ||
78 | return (int_status); | ||
79 | } | ||
80 | |||
81 | flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock); | ||
82 | |||
83 | /* Invoke all host-installed SCI handlers */ | ||
84 | |||
85 | sci_handler = acpi_gbl_sci_handler_list; | ||
86 | while (sci_handler) { | ||
87 | |||
88 | /* Invoke the installed handler (at interrupt level) */ | ||
89 | |||
90 | int_status |= sci_handler->address(sci_handler->context); | ||
91 | |||
92 | sci_handler = sci_handler->next; | ||
93 | } | ||
94 | |||
95 | acpi_os_release_lock(acpi_gbl_gpe_lock, flags); | ||
96 | return (int_status); | ||
97 | } | ||
98 | |||
99 | /******************************************************************************* | ||
100 | * | ||
57 | * FUNCTION: acpi_ev_sci_xrupt_handler | 101 | * FUNCTION: acpi_ev_sci_xrupt_handler |
58 | * | 102 | * |
59 | * PARAMETERS: context - Calling Context | 103 | * PARAMETERS: context - Calling Context |
@@ -89,6 +133,10 @@ static u32 ACPI_SYSTEM_XFACE acpi_ev_sci_xrupt_handler(void *context) | |||
89 | */ | 133 | */ |
90 | interrupt_handled |= acpi_ev_gpe_detect(gpe_xrupt_list); | 134 | interrupt_handled |= acpi_ev_gpe_detect(gpe_xrupt_list); |
91 | 135 | ||
136 | /* Invoke all host-installed SCI handlers */ | ||
137 | |||
138 | interrupt_handled |= acpi_ev_sci_dispatch(); | ||
139 | |||
92 | return_UINT32(interrupt_handled); | 140 | return_UINT32(interrupt_handled); |
93 | } | 141 | } |
94 | 142 | ||
@@ -112,14 +160,13 @@ u32 ACPI_SYSTEM_XFACE acpi_ev_gpe_xrupt_handler(void *context) | |||
112 | ACPI_FUNCTION_TRACE(ev_gpe_xrupt_handler); | 160 | ACPI_FUNCTION_TRACE(ev_gpe_xrupt_handler); |
113 | 161 | ||
114 | /* | 162 | /* |
115 | * We are guaranteed by the ACPI CA initialization/shutdown code that | 163 | * We are guaranteed by the ACPICA initialization/shutdown code that |
116 | * if this interrupt handler is installed, ACPI is enabled. | 164 | * if this interrupt handler is installed, ACPI is enabled. |
117 | */ | 165 | */ |
118 | 166 | ||
119 | /* GPEs: Check for and dispatch any GPEs that have occurred */ | 167 | /* GPEs: Check for and dispatch any GPEs that have occurred */ |
120 | 168 | ||
121 | interrupt_handled |= acpi_ev_gpe_detect(gpe_xrupt_list); | 169 | interrupt_handled |= acpi_ev_gpe_detect(gpe_xrupt_list); |
122 | |||
123 | return_UINT32(interrupt_handled); | 170 | return_UINT32(interrupt_handled); |
124 | } | 171 | } |
125 | 172 | ||
@@ -150,15 +197,15 @@ u32 acpi_ev_install_sci_handler(void) | |||
150 | 197 | ||
151 | /****************************************************************************** | 198 | /****************************************************************************** |
152 | * | 199 | * |
153 | * FUNCTION: acpi_ev_remove_sci_handler | 200 | * FUNCTION: acpi_ev_remove_all_sci_handlers |
154 | * | 201 | * |
155 | * PARAMETERS: none | 202 | * PARAMETERS: none |
156 | * | 203 | * |
157 | * RETURN: E_OK if handler uninstalled OK, E_ERROR if handler was not | 204 | * RETURN: AE_OK if handler uninstalled, AE_ERROR if handler was not |
158 | * installed to begin with | 205 | * installed to begin with |
159 | * | 206 | * |
160 | * DESCRIPTION: Remove the SCI interrupt handler. No further SCIs will be | 207 | * DESCRIPTION: Remove the SCI interrupt handler. No further SCIs will be |
161 | * taken. | 208 | * taken. Remove all host-installed SCI handlers. |
162 | * | 209 | * |
163 | * Note: It doesn't seem important to disable all events or set the event | 210 | * Note: It doesn't seem important to disable all events or set the event |
164 | * enable registers to their original values. The OS should disable | 211 | * enable registers to their original values. The OS should disable |
@@ -167,11 +214,13 @@ u32 acpi_ev_install_sci_handler(void) | |||
167 | * | 214 | * |
168 | ******************************************************************************/ | 215 | ******************************************************************************/ |
169 | 216 | ||
170 | acpi_status acpi_ev_remove_sci_handler(void) | 217 | acpi_status acpi_ev_remove_all_sci_handlers(void) |
171 | { | 218 | { |
219 | struct acpi_sci_handler_info *sci_handler; | ||
220 | acpi_cpu_flags flags; | ||
172 | acpi_status status; | 221 | acpi_status status; |
173 | 222 | ||
174 | ACPI_FUNCTION_TRACE(ev_remove_sci_handler); | 223 | ACPI_FUNCTION_TRACE(ev_remove_all_sci_handlers); |
175 | 224 | ||
176 | /* Just let the OS remove the handler and disable the level */ | 225 | /* Just let the OS remove the handler and disable the level */ |
177 | 226 | ||
@@ -179,6 +228,21 @@ acpi_status acpi_ev_remove_sci_handler(void) | |||
179 | acpi_os_remove_interrupt_handler((u32) acpi_gbl_FADT.sci_interrupt, | 228 | acpi_os_remove_interrupt_handler((u32) acpi_gbl_FADT.sci_interrupt, |
180 | acpi_ev_sci_xrupt_handler); | 229 | acpi_ev_sci_xrupt_handler); |
181 | 230 | ||
231 | if (!acpi_gbl_sci_handler_list) { | ||
232 | return (status); | ||
233 | } | ||
234 | |||
235 | flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock); | ||
236 | |||
237 | /* Free all host-installed SCI handlers */ | ||
238 | |||
239 | while (acpi_gbl_sci_handler_list) { | ||
240 | sci_handler = acpi_gbl_sci_handler_list; | ||
241 | acpi_gbl_sci_handler_list = sci_handler->next; | ||
242 | ACPI_FREE(sci_handler); | ||
243 | } | ||
244 | |||
245 | acpi_os_release_lock(acpi_gbl_gpe_lock, flags); | ||
182 | return_ACPI_STATUS(status); | 246 | return_ACPI_STATUS(status); |
183 | } | 247 | } |
184 | 248 | ||
diff --git a/drivers/acpi/acpica/evxface.c b/drivers/acpi/acpica/evxface.c index ca5fba99c33b..6f56146a6f88 100644 --- a/drivers/acpi/acpica/evxface.c +++ b/drivers/acpi/acpica/evxface.c | |||
@@ -385,6 +385,144 @@ ACPI_EXPORT_SYMBOL(acpi_install_exception_handler) | |||
385 | #if (!ACPI_REDUCED_HARDWARE) | 385 | #if (!ACPI_REDUCED_HARDWARE) |
386 | /******************************************************************************* | 386 | /******************************************************************************* |
387 | * | 387 | * |
388 | * FUNCTION: acpi_install_sci_handler | ||
389 | * | ||
390 | * PARAMETERS: address - Address of the handler | ||
391 | * context - Value passed to the handler on each SCI | ||
392 | * | ||
393 | * RETURN: Status | ||
394 | * | ||
395 | * DESCRIPTION: Install a handler for a System Control Interrupt. | ||
396 | * | ||
397 | ******************************************************************************/ | ||
398 | acpi_status acpi_install_sci_handler(acpi_sci_handler address, void *context) | ||
399 | { | ||
400 | struct acpi_sci_handler_info *new_sci_handler; | ||
401 | struct acpi_sci_handler_info *sci_handler; | ||
402 | acpi_cpu_flags flags; | ||
403 | acpi_status status; | ||
404 | |||
405 | ACPI_FUNCTION_TRACE(acpi_install_sci_handler); | ||
406 | |||
407 | if (!address) { | ||
408 | return_ACPI_STATUS(AE_BAD_PARAMETER); | ||
409 | } | ||
410 | |||
411 | /* Allocate and init a handler object */ | ||
412 | |||
413 | new_sci_handler = ACPI_ALLOCATE(sizeof(struct acpi_sci_handler_info)); | ||
414 | if (!new_sci_handler) { | ||
415 | return_ACPI_STATUS(AE_NO_MEMORY); | ||
416 | } | ||
417 | |||
418 | new_sci_handler->address = address; | ||
419 | new_sci_handler->context = context; | ||
420 | |||
421 | status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS); | ||
422 | if (ACPI_FAILURE(status)) { | ||
423 | goto exit; | ||
424 | } | ||
425 | |||
426 | /* Lock list during installation */ | ||
427 | |||
428 | flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock); | ||
429 | sci_handler = acpi_gbl_sci_handler_list; | ||
430 | |||
431 | /* Ensure handler does not already exist */ | ||
432 | |||
433 | while (sci_handler) { | ||
434 | if (address == sci_handler->address) { | ||
435 | status = AE_ALREADY_EXISTS; | ||
436 | goto unlock_and_exit; | ||
437 | } | ||
438 | |||
439 | sci_handler = sci_handler->next; | ||
440 | } | ||
441 | |||
442 | /* Install the new handler into the global list (at head) */ | ||
443 | |||
444 | new_sci_handler->next = acpi_gbl_sci_handler_list; | ||
445 | acpi_gbl_sci_handler_list = new_sci_handler; | ||
446 | |||
447 | unlock_and_exit: | ||
448 | |||
449 | acpi_os_release_lock(acpi_gbl_gpe_lock, flags); | ||
450 | (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS); | ||
451 | |||
452 | exit: | ||
453 | if (ACPI_FAILURE(status)) { | ||
454 | ACPI_FREE(new_sci_handler); | ||
455 | } | ||
456 | return_ACPI_STATUS(status); | ||
457 | } | ||
458 | |||
459 | /******************************************************************************* | ||
460 | * | ||
461 | * FUNCTION: acpi_remove_sci_handler | ||
462 | * | ||
463 | * PARAMETERS: address - Address of the handler | ||
464 | * | ||
465 | * RETURN: Status | ||
466 | * | ||
467 | * DESCRIPTION: Remove a handler for a System Control Interrupt. | ||
468 | * | ||
469 | ******************************************************************************/ | ||
470 | |||
471 | acpi_status acpi_remove_sci_handler(acpi_sci_handler address) | ||
472 | { | ||
473 | struct acpi_sci_handler_info *prev_sci_handler; | ||
474 | struct acpi_sci_handler_info *next_sci_handler; | ||
475 | acpi_cpu_flags flags; | ||
476 | acpi_status status; | ||
477 | |||
478 | ACPI_FUNCTION_TRACE(acpi_remove_sci_handler); | ||
479 | |||
480 | if (!address) { | ||
481 | return_ACPI_STATUS(AE_BAD_PARAMETER); | ||
482 | } | ||
483 | |||
484 | status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS); | ||
485 | if (ACPI_FAILURE(status)) { | ||
486 | return_ACPI_STATUS(status); | ||
487 | } | ||
488 | |||
489 | /* Remove the SCI handler with lock */ | ||
490 | |||
491 | flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock); | ||
492 | |||
493 | prev_sci_handler = NULL; | ||
494 | next_sci_handler = acpi_gbl_sci_handler_list; | ||
495 | while (next_sci_handler) { | ||
496 | if (next_sci_handler->address == address) { | ||
497 | |||
498 | /* Unlink and free the SCI handler info block */ | ||
499 | |||
500 | if (prev_sci_handler) { | ||
501 | prev_sci_handler->next = next_sci_handler->next; | ||
502 | } else { | ||
503 | acpi_gbl_sci_handler_list = | ||
504 | next_sci_handler->next; | ||
505 | } | ||
506 | |||
507 | acpi_os_release_lock(acpi_gbl_gpe_lock, flags); | ||
508 | ACPI_FREE(next_sci_handler); | ||
509 | goto unlock_and_exit; | ||
510 | } | ||
511 | |||
512 | prev_sci_handler = next_sci_handler; | ||
513 | next_sci_handler = next_sci_handler->next; | ||
514 | } | ||
515 | |||
516 | acpi_os_release_lock(acpi_gbl_gpe_lock, flags); | ||
517 | status = AE_NOT_EXIST; | ||
518 | |||
519 | unlock_and_exit: | ||
520 | (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS); | ||
521 | return_ACPI_STATUS(status); | ||
522 | } | ||
523 | |||
524 | /******************************************************************************* | ||
525 | * | ||
388 | * FUNCTION: acpi_install_global_event_handler | 526 | * FUNCTION: acpi_install_global_event_handler |
389 | * | 527 | * |
390 | * PARAMETERS: handler - Pointer to the global event handler function | 528 | * PARAMETERS: handler - Pointer to the global event handler function |
@@ -398,6 +536,7 @@ ACPI_EXPORT_SYMBOL(acpi_install_exception_handler) | |||
398 | * Can be used to update event counters, etc. | 536 | * Can be used to update event counters, etc. |
399 | * | 537 | * |
400 | ******************************************************************************/ | 538 | ******************************************************************************/ |
539 | |||
401 | acpi_status | 540 | acpi_status |
402 | acpi_install_global_event_handler(acpi_gbl_event_handler handler, void *context) | 541 | acpi_install_global_event_handler(acpi_gbl_event_handler handler, void *context) |
403 | { | 542 | { |
diff --git a/drivers/acpi/acpica/hwxface.c b/drivers/acpi/acpica/hwxface.c index 5ee7a814cd92..f81fb068d20e 100644 --- a/drivers/acpi/acpica/hwxface.c +++ b/drivers/acpi/acpica/hwxface.c | |||
@@ -119,7 +119,8 @@ ACPI_EXPORT_SYMBOL(acpi_reset) | |||
119 | ******************************************************************************/ | 119 | ******************************************************************************/ |
120 | acpi_status acpi_read(u64 *return_value, struct acpi_generic_address *reg) | 120 | acpi_status acpi_read(u64 *return_value, struct acpi_generic_address *reg) |
121 | { | 121 | { |
122 | u32 value; | 122 | u32 value_lo; |
123 | u32 value_hi; | ||
123 | u32 width; | 124 | u32 width; |
124 | u64 address; | 125 | u64 address; |
125 | acpi_status status; | 126 | acpi_status status; |
@@ -137,13 +138,8 @@ acpi_status acpi_read(u64 *return_value, struct acpi_generic_address *reg) | |||
137 | return (status); | 138 | return (status); |
138 | } | 139 | } |
139 | 140 | ||
140 | /* Initialize entire 64-bit return value to zero */ | ||
141 | |||
142 | *return_value = 0; | ||
143 | value = 0; | ||
144 | |||
145 | /* | 141 | /* |
146 | * Two address spaces supported: Memory or IO. PCI_Config is | 142 | * Two address spaces supported: Memory or I/O. PCI_Config is |
147 | * not supported here because the GAS structure is insufficient | 143 | * not supported here because the GAS structure is insufficient |
148 | */ | 144 | */ |
149 | if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) { | 145 | if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) { |
@@ -155,29 +151,35 @@ acpi_status acpi_read(u64 *return_value, struct acpi_generic_address *reg) | |||
155 | } | 151 | } |
156 | } else { /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */ | 152 | } else { /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */ |
157 | 153 | ||
154 | value_lo = 0; | ||
155 | value_hi = 0; | ||
156 | |||
158 | width = reg->bit_width; | 157 | width = reg->bit_width; |
159 | if (width == 64) { | 158 | if (width == 64) { |
160 | width = 32; /* Break into two 32-bit transfers */ | 159 | width = 32; /* Break into two 32-bit transfers */ |
161 | } | 160 | } |
162 | 161 | ||
163 | status = acpi_hw_read_port((acpi_io_address) | 162 | status = acpi_hw_read_port((acpi_io_address) |
164 | address, &value, width); | 163 | address, &value_lo, width); |
165 | if (ACPI_FAILURE(status)) { | 164 | if (ACPI_FAILURE(status)) { |
166 | return (status); | 165 | return (status); |
167 | } | 166 | } |
168 | *return_value = value; | ||
169 | 167 | ||
170 | if (reg->bit_width == 64) { | 168 | if (reg->bit_width == 64) { |
171 | 169 | ||
172 | /* Read the top 32 bits */ | 170 | /* Read the top 32 bits */ |
173 | 171 | ||
174 | status = acpi_hw_read_port((acpi_io_address) | 172 | status = acpi_hw_read_port((acpi_io_address) |
175 | (address + 4), &value, 32); | 173 | (address + 4), &value_hi, |
174 | 32); | ||
176 | if (ACPI_FAILURE(status)) { | 175 | if (ACPI_FAILURE(status)) { |
177 | return (status); | 176 | return (status); |
178 | } | 177 | } |
179 | *return_value |= ((u64)value << 32); | ||
180 | } | 178 | } |
179 | |||
180 | /* Set the return value only if status is AE_OK */ | ||
181 | |||
182 | *return_value = (value_lo | ((u64)value_hi << 32)); | ||
181 | } | 183 | } |
182 | 184 | ||
183 | ACPI_DEBUG_PRINT((ACPI_DB_IO, | 185 | ACPI_DEBUG_PRINT((ACPI_DB_IO, |
@@ -186,7 +188,7 @@ acpi_status acpi_read(u64 *return_value, struct acpi_generic_address *reg) | |||
186 | ACPI_FORMAT_UINT64(address), | 188 | ACPI_FORMAT_UINT64(address), |
187 | acpi_ut_get_region_name(reg->space_id))); | 189 | acpi_ut_get_region_name(reg->space_id))); |
188 | 190 | ||
189 | return (status); | 191 | return (AE_OK); |
190 | } | 192 | } |
191 | 193 | ||
192 | ACPI_EXPORT_SYMBOL(acpi_read) | 194 | ACPI_EXPORT_SYMBOL(acpi_read) |
diff --git a/drivers/acpi/acpica/nsaccess.c b/drivers/acpi/acpica/nsaccess.c index c5316e5bd4ab..aff79c7392ff 100644 --- a/drivers/acpi/acpica/nsaccess.c +++ b/drivers/acpi/acpica/nsaccess.c | |||
@@ -424,8 +424,9 @@ acpi_ns_lookup(union acpi_generic_state *scope_info, | |||
424 | /* Current scope has no parent scope */ | 424 | /* Current scope has no parent scope */ |
425 | 425 | ||
426 | ACPI_ERROR((AE_INFO, | 426 | ACPI_ERROR((AE_INFO, |
427 | "ACPI path has too many parent prefixes (^) " | 427 | "%s: Path has too many parent prefixes (^) " |
428 | "- reached beyond root node")); | 428 | "- reached beyond root node", |
429 | pathname)); | ||
429 | return_ACPI_STATUS(AE_NOT_FOUND); | 430 | return_ACPI_STATUS(AE_NOT_FOUND); |
430 | } | 431 | } |
431 | } | 432 | } |
diff --git a/drivers/acpi/acpica/nsdump.c b/drivers/acpi/acpica/nsdump.c index 7418c77fde8c..80633851cb2f 100644 --- a/drivers/acpi/acpica/nsdump.c +++ b/drivers/acpi/acpica/nsdump.c | |||
@@ -59,6 +59,17 @@ acpi_ns_dump_one_device(acpi_handle obj_handle, | |||
59 | #endif | 59 | #endif |
60 | 60 | ||
61 | #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) | 61 | #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) |
62 | |||
63 | #ifdef ACPI_FUTURE_USAGE | ||
64 | static acpi_status | ||
65 | acpi_ns_dump_one_object_path(acpi_handle obj_handle, | ||
66 | u32 level, void *context, void **return_value); | ||
67 | |||
68 | static acpi_status | ||
69 | acpi_ns_get_max_depth(acpi_handle obj_handle, | ||
70 | u32 level, void *context, void **return_value); | ||
71 | #endif /* ACPI_FUTURE_USAGE */ | ||
72 | |||
62 | /******************************************************************************* | 73 | /******************************************************************************* |
63 | * | 74 | * |
64 | * FUNCTION: acpi_ns_print_pathname | 75 | * FUNCTION: acpi_ns_print_pathname |
@@ -671,6 +682,129 @@ acpi_ns_dump_objects(acpi_object_type type, | |||
671 | } | 682 | } |
672 | #endif /* ACPI_FUTURE_USAGE */ | 683 | #endif /* ACPI_FUTURE_USAGE */ |
673 | 684 | ||
685 | #ifdef ACPI_FUTURE_USAGE | ||
686 | /******************************************************************************* | ||
687 | * | ||
688 | * FUNCTION: acpi_ns_dump_one_object_path, acpi_ns_get_max_depth | ||
689 | * | ||
690 | * PARAMETERS: obj_handle - Node to be dumped | ||
691 | * level - Nesting level of the handle | ||
692 | * context - Passed into walk_namespace | ||
693 | * return_value - Not used | ||
694 | * | ||
695 | * RETURN: Status | ||
696 | * | ||
697 | * DESCRIPTION: Dump the full pathname to a namespace object. acp_ns_get_max_depth | ||
698 | * computes the maximum nesting depth in the namespace tree, in | ||
699 | * order to simplify formatting in acpi_ns_dump_one_object_path. | ||
700 | * These procedures are user_functions called by acpi_ns_walk_namespace. | ||
701 | * | ||
702 | ******************************************************************************/ | ||
703 | |||
704 | static acpi_status | ||
705 | acpi_ns_dump_one_object_path(acpi_handle obj_handle, | ||
706 | u32 level, void *context, void **return_value) | ||
707 | { | ||
708 | u32 max_level = *((u32 *)context); | ||
709 | char *pathname; | ||
710 | struct acpi_namespace_node *node; | ||
711 | int path_indent; | ||
712 | |||
713 | if (!obj_handle) { | ||
714 | return (AE_OK); | ||
715 | } | ||
716 | |||
717 | node = acpi_ns_validate_handle(obj_handle); | ||
718 | pathname = acpi_ns_get_external_pathname(node); | ||
719 | |||
720 | path_indent = 1; | ||
721 | if (level <= max_level) { | ||
722 | path_indent = max_level - level + 1; | ||
723 | } | ||
724 | |||
725 | acpi_os_printf("%2d%*s%-12s%*s", | ||
726 | level, level, " ", acpi_ut_get_type_name(node->type), | ||
727 | path_indent, " "); | ||
728 | |||
729 | acpi_os_printf("%s\n", &pathname[1]); | ||
730 | ACPI_FREE(pathname); | ||
731 | return (AE_OK); | ||
732 | } | ||
733 | |||
734 | static acpi_status | ||
735 | acpi_ns_get_max_depth(acpi_handle obj_handle, | ||
736 | u32 level, void *context, void **return_value) | ||
737 | { | ||
738 | u32 *max_level = (u32 *)context; | ||
739 | |||
740 | if (level > *max_level) { | ||
741 | *max_level = level; | ||
742 | } | ||
743 | return (AE_OK); | ||
744 | } | ||
745 | |||
746 | /******************************************************************************* | ||
747 | * | ||
748 | * FUNCTION: acpi_ns_dump_object_paths | ||
749 | * | ||
750 | * PARAMETERS: type - Object type to be dumped | ||
751 | * display_type - 0 or ACPI_DISPLAY_SUMMARY | ||
752 | * max_depth - Maximum depth of dump. Use ACPI_UINT32_MAX | ||
753 | * for an effectively unlimited depth. | ||
754 | * owner_id - Dump only objects owned by this ID. Use | ||
755 | * ACPI_UINT32_MAX to match all owners. | ||
756 | * start_handle - Where in namespace to start/end search | ||
757 | * | ||
758 | * RETURN: None | ||
759 | * | ||
760 | * DESCRIPTION: Dump full object pathnames within the loaded namespace. Uses | ||
761 | * acpi_ns_walk_namespace in conjunction with acpi_ns_dump_one_object_path. | ||
762 | * | ||
763 | ******************************************************************************/ | ||
764 | |||
765 | void | ||
766 | acpi_ns_dump_object_paths(acpi_object_type type, | ||
767 | u8 display_type, | ||
768 | u32 max_depth, | ||
769 | acpi_owner_id owner_id, acpi_handle start_handle) | ||
770 | { | ||
771 | acpi_status status; | ||
772 | u32 max_level = 0; | ||
773 | |||
774 | ACPI_FUNCTION_ENTRY(); | ||
775 | |||
776 | /* | ||
777 | * Just lock the entire namespace for the duration of the dump. | ||
778 | * We don't want any changes to the namespace during this time, | ||
779 | * especially the temporary nodes since we are going to display | ||
780 | * them also. | ||
781 | */ | ||
782 | status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE); | ||
783 | if (ACPI_FAILURE(status)) { | ||
784 | acpi_os_printf("Could not acquire namespace mutex\n"); | ||
785 | return; | ||
786 | } | ||
787 | |||
788 | /* Get the max depth of the namespace tree, for formatting later */ | ||
789 | |||
790 | (void)acpi_ns_walk_namespace(type, start_handle, max_depth, | ||
791 | ACPI_NS_WALK_NO_UNLOCK | | ||
792 | ACPI_NS_WALK_TEMP_NODES, | ||
793 | acpi_ns_get_max_depth, NULL, | ||
794 | (void *)&max_level, NULL); | ||
795 | |||
796 | /* Now dump the entire namespace */ | ||
797 | |||
798 | (void)acpi_ns_walk_namespace(type, start_handle, max_depth, | ||
799 | ACPI_NS_WALK_NO_UNLOCK | | ||
800 | ACPI_NS_WALK_TEMP_NODES, | ||
801 | acpi_ns_dump_one_object_path, NULL, | ||
802 | (void *)&max_level, NULL); | ||
803 | |||
804 | (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); | ||
805 | } | ||
806 | #endif /* ACPI_FUTURE_USAGE */ | ||
807 | |||
674 | /******************************************************************************* | 808 | /******************************************************************************* |
675 | * | 809 | * |
676 | * FUNCTION: acpi_ns_dump_entry | 810 | * FUNCTION: acpi_ns_dump_entry |
diff --git a/drivers/acpi/acpica/nsxfeval.c b/drivers/acpi/acpica/nsxfeval.c index b38b4b07f86e..481a6b4a9b2f 100644 --- a/drivers/acpi/acpica/nsxfeval.c +++ b/drivers/acpi/acpica/nsxfeval.c | |||
@@ -605,11 +605,19 @@ acpi_walk_namespace(acpi_object_type type, | |||
605 | goto unlock_and_exit; | 605 | goto unlock_and_exit; |
606 | } | 606 | } |
607 | 607 | ||
608 | /* Now we can validate the starting node */ | ||
609 | |||
610 | if (!acpi_ns_validate_handle(start_object)) { | ||
611 | status = AE_BAD_PARAMETER; | ||
612 | goto unlock_and_exit2; | ||
613 | } | ||
614 | |||
608 | status = acpi_ns_walk_namespace(type, start_object, max_depth, | 615 | status = acpi_ns_walk_namespace(type, start_object, max_depth, |
609 | ACPI_NS_WALK_UNLOCK, | 616 | ACPI_NS_WALK_UNLOCK, |
610 | descending_callback, ascending_callback, | 617 | descending_callback, ascending_callback, |
611 | context, return_value); | 618 | context, return_value); |
612 | 619 | ||
620 | unlock_and_exit2: | ||
613 | (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); | 621 | (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); |
614 | 622 | ||
615 | unlock_and_exit: | 623 | unlock_and_exit: |
diff --git a/drivers/acpi/acpica/tbinstal.c b/drivers/acpi/acpica/tbinstal.c index 42a13c0d7015..9e6788f9ba0f 100644 --- a/drivers/acpi/acpica/tbinstal.c +++ b/drivers/acpi/acpica/tbinstal.c | |||
@@ -80,16 +80,10 @@ acpi_status acpi_tb_verify_table(struct acpi_table_desc *table_desc) | |||
80 | } | 80 | } |
81 | } | 81 | } |
82 | 82 | ||
83 | /* FACS is the odd table, has no standard ACPI header and no checksum */ | 83 | /* Always calculate checksum, ignore bad checksum if requested */ |
84 | 84 | ||
85 | if (!ACPI_COMPARE_NAME(&table_desc->signature, ACPI_SIG_FACS)) { | 85 | status = |
86 | 86 | acpi_tb_verify_checksum(table_desc->pointer, table_desc->length); | |
87 | /* Always calculate checksum, ignore bad checksum if requested */ | ||
88 | |||
89 | status = | ||
90 | acpi_tb_verify_checksum(table_desc->pointer, | ||
91 | table_desc->length); | ||
92 | } | ||
93 | 87 | ||
94 | return_ACPI_STATUS(status); | 88 | return_ACPI_STATUS(status); |
95 | } | 89 | } |
diff --git a/drivers/acpi/acpica/tbprint.c b/drivers/acpi/acpica/tbprint.c index dc963f823d2c..9a47715af1f3 100644 --- a/drivers/acpi/acpica/tbprint.c +++ b/drivers/acpi/acpica/tbprint.c | |||
@@ -138,7 +138,7 @@ acpi_tb_print_table_header(acpi_physical_address address, | |||
138 | ACPI_INFO((AE_INFO, "%4.4s %p %05X", | 138 | ACPI_INFO((AE_INFO, "%4.4s %p %05X", |
139 | header->signature, ACPI_CAST_PTR(void, address), | 139 | header->signature, ACPI_CAST_PTR(void, address), |
140 | header->length)); | 140 | header->length)); |
141 | } else if (ACPI_COMPARE_NAME(header->signature, ACPI_SIG_RSDP)) { | 141 | } else if (ACPI_VALIDATE_RSDP_SIG(header->signature)) { |
142 | 142 | ||
143 | /* RSDP has no common fields */ | 143 | /* RSDP has no common fields */ |
144 | 144 | ||
@@ -190,6 +190,16 @@ acpi_status acpi_tb_verify_checksum(struct acpi_table_header *table, u32 length) | |||
190 | { | 190 | { |
191 | u8 checksum; | 191 | u8 checksum; |
192 | 192 | ||
193 | /* | ||
194 | * FACS/S3PT: | ||
195 | * They are the odd tables, have no standard ACPI header and no checksum | ||
196 | */ | ||
197 | |||
198 | if (ACPI_COMPARE_NAME(table->signature, ACPI_SIG_S3PT) || | ||
199 | ACPI_COMPARE_NAME(table->signature, ACPI_SIG_FACS)) { | ||
200 | return (AE_OK); | ||
201 | } | ||
202 | |||
193 | /* Compute the checksum on the table */ | 203 | /* Compute the checksum on the table */ |
194 | 204 | ||
195 | checksum = acpi_tb_checksum(ACPI_CAST_PTR(u8, table), length); | 205 | checksum = acpi_tb_checksum(ACPI_CAST_PTR(u8, table), length); |
diff --git a/drivers/acpi/acpica/tbxfroot.c b/drivers/acpi/acpica/tbxfroot.c index 948c95e80d44..1c95fabbe6a4 100644 --- a/drivers/acpi/acpica/tbxfroot.c +++ b/drivers/acpi/acpica/tbxfroot.c | |||
@@ -68,8 +68,7 @@ acpi_status acpi_tb_validate_rsdp(struct acpi_table_rsdp *rsdp) | |||
68 | * Note: Sometimes there exists more than one RSDP in memory; the valid | 68 | * Note: Sometimes there exists more than one RSDP in memory; the valid |
69 | * RSDP has a valid checksum, all others have an invalid checksum. | 69 | * RSDP has a valid checksum, all others have an invalid checksum. |
70 | */ | 70 | */ |
71 | if (ACPI_STRNCMP((char *)rsdp->signature, ACPI_SIG_RSDP, | 71 | if (!ACPI_VALIDATE_RSDP_SIG(rsdp->signature)) { |
72 | sizeof(ACPI_SIG_RSDP) - 1) != 0) { | ||
73 | 72 | ||
74 | /* Nope, BAD Signature */ | 73 | /* Nope, BAD Signature */ |
75 | 74 | ||
diff --git a/drivers/acpi/acpica/utdebug.c b/drivers/acpi/acpica/utdebug.c index 5796e11a0671..ffd0db509d34 100644 --- a/drivers/acpi/acpica/utdebug.c +++ b/drivers/acpi/acpica/utdebug.c | |||
@@ -190,7 +190,7 @@ acpi_debug_print(u32 requested_debug_level, | |||
190 | * Display the module name, current line number, thread ID (if requested), | 190 | * Display the module name, current line number, thread ID (if requested), |
191 | * current procedure nesting level, and the current procedure name | 191 | * current procedure nesting level, and the current procedure name |
192 | */ | 192 | */ |
193 | acpi_os_printf("%8s-%04ld ", module_name, line_number); | 193 | acpi_os_printf("%9s-%04ld ", module_name, line_number); |
194 | 194 | ||
195 | if (ACPI_LV_THREADS & acpi_dbg_level) { | 195 | if (ACPI_LV_THREADS & acpi_dbg_level) { |
196 | acpi_os_printf("[%u] ", (u32)thread_id); | 196 | acpi_os_printf("[%u] ", (u32)thread_id); |
diff --git a/drivers/acpi/acpica/utglobal.c b/drivers/acpi/acpica/utglobal.c index d6f26bf8a062..046d5b059c07 100644 --- a/drivers/acpi/acpica/utglobal.c +++ b/drivers/acpi/acpica/utglobal.c | |||
@@ -291,7 +291,7 @@ acpi_status acpi_ut_init_globals(void) | |||
291 | 291 | ||
292 | #if (!ACPI_REDUCED_HARDWARE) | 292 | #if (!ACPI_REDUCED_HARDWARE) |
293 | 293 | ||
294 | /* GPE support */ | 294 | /* GPE/SCI support */ |
295 | 295 | ||
296 | acpi_gbl_all_gpes_initialized = FALSE; | 296 | acpi_gbl_all_gpes_initialized = FALSE; |
297 | acpi_gbl_gpe_xrupt_list_head = NULL; | 297 | acpi_gbl_gpe_xrupt_list_head = NULL; |
@@ -300,6 +300,7 @@ acpi_status acpi_ut_init_globals(void) | |||
300 | acpi_current_gpe_count = 0; | 300 | acpi_current_gpe_count = 0; |
301 | 301 | ||
302 | acpi_gbl_global_event_handler = NULL; | 302 | acpi_gbl_global_event_handler = NULL; |
303 | acpi_gbl_sci_handler_list = NULL; | ||
303 | 304 | ||
304 | #endif /* !ACPI_REDUCED_HARDWARE */ | 305 | #endif /* !ACPI_REDUCED_HARDWARE */ |
305 | 306 | ||
diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h index cf051e05a8fe..4e280bd226dd 100644 --- a/include/acpi/acexcep.h +++ b/include/acpi/acexcep.h | |||
@@ -125,8 +125,9 @@ struct acpi_exception_info { | |||
125 | #define AE_NO_HANDLER EXCEP_ENV (0x001A) | 125 | #define AE_NO_HANDLER EXCEP_ENV (0x001A) |
126 | #define AE_OWNER_ID_LIMIT EXCEP_ENV (0x001B) | 126 | #define AE_OWNER_ID_LIMIT EXCEP_ENV (0x001B) |
127 | #define AE_NOT_CONFIGURED EXCEP_ENV (0x001C) | 127 | #define AE_NOT_CONFIGURED EXCEP_ENV (0x001C) |
128 | #define AE_ACCESS EXCEP_ENV (0x001D) | ||
128 | 129 | ||
129 | #define AE_CODE_ENV_MAX 0x001C | 130 | #define AE_CODE_ENV_MAX 0x001D |
130 | 131 | ||
131 | /* | 132 | /* |
132 | * Programmer exceptions | 133 | * Programmer exceptions |
@@ -227,7 +228,7 @@ static const struct acpi_exception_info acpi_gbl_exception_names_env[] = { | |||
227 | EXCEP_TXT("AE_NO_ACPI_TABLES", "ACPI tables could not be found"), | 228 | EXCEP_TXT("AE_NO_ACPI_TABLES", "ACPI tables could not be found"), |
228 | EXCEP_TXT("AE_NO_NAMESPACE", "A namespace has not been loaded"), | 229 | EXCEP_TXT("AE_NO_NAMESPACE", "A namespace has not been loaded"), |
229 | EXCEP_TXT("AE_NO_MEMORY", "Insufficient dynamic memory"), | 230 | EXCEP_TXT("AE_NO_MEMORY", "Insufficient dynamic memory"), |
230 | EXCEP_TXT("AE_NOT_FOUND", "The name was not found in the namespace"), | 231 | EXCEP_TXT("AE_NOT_FOUND", "A requested entity is not found"), |
231 | EXCEP_TXT("AE_NOT_EXIST", "A required entity does not exist"), | 232 | EXCEP_TXT("AE_NOT_EXIST", "A required entity does not exist"), |
232 | EXCEP_TXT("AE_ALREADY_EXISTS", "An entity already exists"), | 233 | EXCEP_TXT("AE_ALREADY_EXISTS", "An entity already exists"), |
233 | EXCEP_TXT("AE_TYPE", "The object type is incorrect"), | 234 | EXCEP_TXT("AE_TYPE", "The object type is incorrect"), |
@@ -259,7 +260,8 @@ static const struct acpi_exception_info acpi_gbl_exception_names_env[] = { | |||
259 | EXCEP_TXT("AE_OWNER_ID_LIMIT", | 260 | EXCEP_TXT("AE_OWNER_ID_LIMIT", |
260 | "There are no more Owner IDs available for ACPI tables or control methods"), | 261 | "There are no more Owner IDs available for ACPI tables or control methods"), |
261 | EXCEP_TXT("AE_NOT_CONFIGURED", | 262 | EXCEP_TXT("AE_NOT_CONFIGURED", |
262 | "The interface is not part of the current subsystem configuration") | 263 | "The interface is not part of the current subsystem configuration"), |
264 | EXCEP_TXT("AE_ACCESS", "Permission denied for the requested operation") | ||
263 | }; | 265 | }; |
264 | 266 | ||
265 | static const struct acpi_exception_info acpi_gbl_exception_names_pgm[] = { | 267 | static const struct acpi_exception_info acpi_gbl_exception_names_pgm[] = { |
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index 85bfdbe17805..c7b1475422b3 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h | |||
@@ -46,7 +46,7 @@ | |||
46 | 46 | ||
47 | /* Current ACPICA subsystem version in YYYYMMDD format */ | 47 | /* Current ACPICA subsystem version in YYYYMMDD format */ |
48 | 48 | ||
49 | #define ACPI_CA_VERSION 0x20130725 | 49 | #define ACPI_CA_VERSION 0x20130823 |
50 | 50 | ||
51 | #include <acpi/acconfig.h> | 51 | #include <acpi/acconfig.h> |
52 | #include <acpi/actypes.h> | 52 | #include <acpi/actypes.h> |
@@ -280,9 +280,16 @@ acpi_status | |||
280 | acpi_install_initialization_handler(acpi_init_handler handler, u32 function); | 280 | acpi_install_initialization_handler(acpi_init_handler handler, u32 function); |
281 | 281 | ||
282 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | 282 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
283 | acpi_install_global_event_handler | 283 | acpi_install_sci_handler(acpi_sci_handler |
284 | (acpi_gbl_event_handler handler, void *context)) | 284 | address, |
285 | 285 | void *context)) | |
286 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | ||
287 | acpi_remove_sci_handler(acpi_sci_handler | ||
288 | address)) | ||
289 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | ||
290 | acpi_install_global_event_handler | ||
291 | (acpi_gbl_event_handler handler, | ||
292 | void *context)) | ||
286 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | 293 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
287 | acpi_install_fixed_event_handler(u32 | 294 | acpi_install_fixed_event_handler(u32 |
288 | acpi_event, | 295 | acpi_event, |
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index b748aefce929..f6abf23ad0a7 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h | |||
@@ -474,6 +474,11 @@ typedef u64 acpi_integer; | |||
474 | #define ACPI_MOVE_NAME(dest,src) (ACPI_STRNCPY (ACPI_CAST_PTR (char, (dest)), ACPI_CAST_PTR (char, (src)), ACPI_NAME_SIZE)) | 474 | #define ACPI_MOVE_NAME(dest,src) (ACPI_STRNCPY (ACPI_CAST_PTR (char, (dest)), ACPI_CAST_PTR (char, (src)), ACPI_NAME_SIZE)) |
475 | #endif | 475 | #endif |
476 | 476 | ||
477 | /* Support for the special RSDP signature (8 characters) */ | ||
478 | |||
479 | #define ACPI_VALIDATE_RSDP_SIG(a) (!ACPI_STRNCMP (ACPI_CAST_PTR (char, (a)), ACPI_SIG_RSDP, 8)) | ||
480 | #define ACPI_MAKE_RSDP_SIG(dest) (ACPI_MEMCPY (ACPI_CAST_PTR (char, (dest)), ACPI_SIG_RSDP, 8)) | ||
481 | |||
477 | /******************************************************************************* | 482 | /******************************************************************************* |
478 | * | 483 | * |
479 | * Miscellaneous constants | 484 | * Miscellaneous constants |
@@ -946,6 +951,9 @@ typedef void | |||
946 | * Various handlers and callback procedures | 951 | * Various handlers and callback procedures |
947 | */ | 952 | */ |
948 | typedef | 953 | typedef |
954 | u32 (*acpi_sci_handler) (void *context); | ||
955 | |||
956 | typedef | ||
949 | void (*acpi_gbl_event_handler) (u32 event_type, | 957 | void (*acpi_gbl_event_handler) (u32 event_type, |
950 | acpi_handle device, | 958 | acpi_handle device, |
951 | u32 event_number, void *context); | 959 | u32 event_number, void *context); |
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index 68534ef86ec8..fda0f3e35c03 100644 --- a/include/acpi/platform/aclinux.h +++ b/include/acpi/platform/aclinux.h | |||
@@ -87,7 +87,7 @@ | |||
87 | #define ACPI_FLUSH_CPU_CACHE() | 87 | #define ACPI_FLUSH_CPU_CACHE() |
88 | #define ACPI_CAST_PTHREAD_T(pthread) ((acpi_thread_id) (pthread)) | 88 | #define ACPI_CAST_PTHREAD_T(pthread) ((acpi_thread_id) (pthread)) |
89 | 89 | ||
90 | #if defined(__ia64__) || defined(__x86_64__) | 90 | #if defined(__ia64__) || defined(__x86_64__) || defined(__aarch64__) |
91 | #define ACPI_MACHINE_WIDTH 64 | 91 | #define ACPI_MACHINE_WIDTH 64 |
92 | #define COMPILER_DEPENDENT_INT64 long | 92 | #define COMPILER_DEPENDENT_INT64 long |
93 | #define COMPILER_DEPENDENT_UINT64 unsigned long | 93 | #define COMPILER_DEPENDENT_UINT64 unsigned long |