aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-11-13 23:41:48 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-13 23:41:48 -0500
commitf9300eaaac1ca300083ad41937923a90cc3a2394 (patch)
tree724b72ad729a8b85c09d2d54f8ca7d8ba22d774f /drivers/acpi/acpica
parent7f2dc5c4bcbff035b0d03f7aa78a182664b21e47 (diff)
parentfaddf2f5d278f1656e9444961bdd8d9db4deb5bf (diff)
Merge tag 'pm+acpi-3.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI and power management updates from Rafael J Wysocki: - New power capping framework and the the Intel Running Average Power Limit (RAPL) driver using it from Srinivas Pandruvada and Jacob Pan. - Addition of the in-kernel switching feature to the arm_big_little cpufreq driver from Viresh Kumar and Nicolas Pitre. - cpufreq support for iMac G5 from Aaro Koskinen. - Baytrail processors support for intel_pstate from Dirk Brandewie. - cpufreq support for Midway/ECX-2000 from Mark Langsdorf. - ARM vexpress/TC2 cpufreq support from Sudeep KarkadaNagesha. - ACPI power management support for the I2C and SPI bus types from Mika Westerberg and Lv Zheng. - cpufreq core fixes and cleanups from Viresh Kumar, Srivatsa S Bhat, Stratos Karafotis, Xiaoguang Chen, Lan Tianyu. - cpufreq drivers updates (mostly fixes and cleanups) from Viresh Kumar, Aaro Koskinen, Jungseok Lee, Sudeep KarkadaNagesha, Lukasz Majewski, Manish Badarkhe, Hans-Christian Egtvedt, Evgeny Kapaev. - intel_pstate updates from Dirk Brandewie and Adrian Huang. - ACPICA update to version 20130927 includig fixes and cleanups and some reduction of divergences between the ACPICA code in the kernel and ACPICA upstream in order to improve the automatic ACPICA patch generation process. From Bob Moore, Lv Zheng, Tomasz Nowicki, Naresh Bhat, Bjorn Helgaas, David E Box. - ACPI IPMI driver fixes and cleanups from Lv Zheng. - ACPI hotplug fixes and cleanups from Bjorn Helgaas, Toshi Kani, Zhang Yanfei, Rafael J Wysocki. - Conversion of the ACPI AC driver to the platform bus type and multiple driver fixes and cleanups related to ACPI from Zhang Rui. - ACPI processor driver fixes and cleanups from Hanjun Guo, Jiang Liu, Bartlomiej Zolnierkiewicz, Mathieu Rhéaume, Rafael J Wysocki. - Fixes and cleanups and new blacklist entries related to the ACPI video support from Aaron Lu, Felipe Contreras, Lennart Poettering, Kirill Tkhai. - cpuidle core cleanups from Viresh Kumar and Lorenzo Pieralisi. - cpuidle drivers fixes and cleanups from Daniel Lezcano, Jingoo Han, Bartlomiej Zolnierkiewicz, Prarit Bhargava. - devfreq updates from Sachin Kamat, Dan Carpenter, Manish Badarkhe. - Operation Performance Points (OPP) core updates from Nishanth Menon. - Runtime power management core fix from Rafael J Wysocki and update from Ulf Hansson. - Hibernation fixes from Aaron Lu and Rafael J Wysocki. - Device suspend/resume lockup detection mechanism from Benoit Goby. - Removal of unused proc directories created for various ACPI drivers from Lan Tianyu. - ACPI LPSS driver fix and new device IDs for the ACPI platform scan handler from Heikki Krogerus and Jarkko Nikula. - New ACPI _OSI blacklist entry for Toshiba NB100 from Levente Kurusa. - Assorted fixes and cleanups related to ACPI from Andy Shevchenko, Al Stone, Bartlomiej Zolnierkiewicz, Colin Ian King, Dan Carpenter, Felipe Contreras, Jianguo Wu, Lan Tianyu, Yinghai Lu, Mathias Krause, Liu Chuansheng. - Assorted PM fixes and cleanups from Andy Shevchenko, Thierry Reding, Jean-Christophe Plagniol-Villard. * tag 'pm+acpi-3.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (386 commits) cpufreq: conservative: fix requested_freq reduction issue ACPI / hotplug: Consolidate deferred execution of ACPI hotplug routines PM / runtime: Use pm_runtime_put_sync() in __device_release_driver() ACPI / event: remove unneeded NULL pointer check Revert "ACPI / video: Ignore BIOS initial backlight value for HP 250 G1" ACPI / video: Quirk initial backlight level 0 ACPI / video: Fix initial level validity test intel_pstate: skip the driver if ACPI has power mgmt option PM / hibernate: Avoid overflow in hibernate_preallocate_memory() ACPI / hotplug: Do not execute "insert in progress" _OST ACPI / hotplug: Carry out PCI root eject directly ACPI / hotplug: Merge device hot-removal routines ACPI / hotplug: Make acpi_bus_hot_remove_device() internal ACPI / hotplug: Simplify device ejection routines ACPI / hotplug: Fix handle_root_bridge_removal() ACPI / hotplug: Refuse to hot-remove all objects with disabled hotplug ACPI / scan: Start matching drivers after trying scan handlers ACPI: Remove acpi_pci_slot_init() headers from internal.h ACPI / blacklist: fix name of ThinkPad Edge E530 PowerCap: Fix build error with option -Werror=format-security ... Conflicts: arch/arm/mach-omap2/opp.c drivers/Kconfig drivers/spi/spi.c
Diffstat (limited to 'drivers/acpi/acpica')
-rw-r--r--drivers/acpi/acpica/acdebug.h8
-rw-r--r--drivers/acpi/acpica/acevents.h9
-rw-r--r--drivers/acpi/acpica/acglobal.h20
-rw-r--r--drivers/acpi/acpica/aclocal.h11
-rw-r--r--drivers/acpi/acpica/acmacros.h31
-rw-r--r--drivers/acpi/acpica/acnamesp.h6
-rw-r--r--drivers/acpi/acpica/acutils.h17
-rw-r--r--drivers/acpi/acpica/dsargs.c2
-rw-r--r--drivers/acpi/acpica/dsfield.c2
-rw-r--r--drivers/acpi/acpica/dsmethod.c5
-rw-r--r--drivers/acpi/acpica/dsobject.c2
-rw-r--r--drivers/acpi/acpica/dsopcode.c2
-rw-r--r--drivers/acpi/acpica/dsutils.c10
-rw-r--r--drivers/acpi/acpica/dswexec.c6
-rw-r--r--drivers/acpi/acpica/dswload2.c2
-rw-r--r--drivers/acpi/acpica/evglock.c2
-rw-r--r--drivers/acpi/acpica/evgpe.c3
-rw-r--r--drivers/acpi/acpica/evgpeblk.c6
-rw-r--r--drivers/acpi/acpica/evgpeinit.c2
-rw-r--r--drivers/acpi/acpica/evgpeutil.c4
-rw-r--r--drivers/acpi/acpica/evhandler.c4
-rw-r--r--drivers/acpi/acpica/evmisc.c14
-rw-r--r--drivers/acpi/acpica/evregion.c29
-rw-r--r--drivers/acpi/acpica/evsci.c79
-rw-r--r--drivers/acpi/acpica/evxface.c148
-rw-r--r--drivers/acpi/acpica/evxfevnt.c3
-rw-r--r--drivers/acpi/acpica/evxfgpe.c9
-rw-r--r--drivers/acpi/acpica/evxfregn.c7
-rw-r--r--drivers/acpi/acpica/excreate.c8
-rw-r--r--drivers/acpi/acpica/exfield.c2
-rw-r--r--drivers/acpi/acpica/exfldio.c8
-rw-r--r--drivers/acpi/acpica/exmisc.c4
-rw-r--r--drivers/acpi/acpica/exoparg1.c8
-rw-r--r--drivers/acpi/acpica/exoparg2.c10
-rw-r--r--drivers/acpi/acpica/exoparg3.c4
-rw-r--r--drivers/acpi/acpica/exoparg6.c2
-rw-r--r--drivers/acpi/acpica/exregion.c1
-rw-r--r--drivers/acpi/acpica/exresolv.c2
-rw-r--r--drivers/acpi/acpica/exresop.c2
-rw-r--r--drivers/acpi/acpica/hwregs.c2
-rw-r--r--drivers/acpi/acpica/hwtimer.c3
-rw-r--r--drivers/acpi/acpica/hwxface.c43
-rw-r--r--drivers/acpi/acpica/hwxfsleep.c7
-rw-r--r--drivers/acpi/acpica/nsaccess.c7
-rw-r--r--drivers/acpi/acpica/nsdump.c143
-rw-r--r--drivers/acpi/acpica/nsdumpdv.c7
-rw-r--r--drivers/acpi/acpica/nseval.c4
-rw-r--r--drivers/acpi/acpica/nsinit.c2
-rw-r--r--drivers/acpi/acpica/nsload.c2
-rw-r--r--drivers/acpi/acpica/nsparse.c2
-rw-r--r--drivers/acpi/acpica/nspredef.c2
-rw-r--r--drivers/acpi/acpica/nsprepkg.c4
-rw-r--r--drivers/acpi/acpica/nsrepair.c2
-rw-r--r--drivers/acpi/acpica/nsrepair2.c2
-rw-r--r--drivers/acpi/acpica/nssearch.c3
-rw-r--r--drivers/acpi/acpica/nsutils.c2
-rw-r--r--drivers/acpi/acpica/nsxfeval.c23
-rw-r--r--drivers/acpi/acpica/nsxfname.c7
-rw-r--r--drivers/acpi/acpica/nsxfobj.c7
-rw-r--r--drivers/acpi/acpica/psparse.c2
-rw-r--r--drivers/acpi/acpica/psxface.c6
-rw-r--r--drivers/acpi/acpica/rsmisc.c4
-rw-r--r--drivers/acpi/acpica/rsutils.c2
-rw-r--r--drivers/acpi/acpica/rsxface.c3
-rw-r--r--drivers/acpi/acpica/tbinstal.c18
-rw-r--r--drivers/acpi/acpica/tbprint.c18
-rw-r--r--drivers/acpi/acpica/tbutils.c5
-rw-r--r--drivers/acpi/acpica/tbxface.c16
-rw-r--r--drivers/acpi/acpica/tbxfload.c11
-rw-r--r--drivers/acpi/acpica/tbxfroot.c5
-rw-r--r--drivers/acpi/acpica/utalloc.c117
-rw-r--r--drivers/acpi/acpica/utcache.c2
-rw-r--r--drivers/acpi/acpica/utcopy.c4
-rw-r--r--drivers/acpi/acpica/utdebug.c5
-rw-r--r--drivers/acpi/acpica/utdecode.c1
-rw-r--r--drivers/acpi/acpica/utdelete.c2
-rw-r--r--drivers/acpi/acpica/uteval.c2
-rw-r--r--drivers/acpi/acpica/utexcep.c3
-rw-r--r--drivers/acpi/acpica/utglobal.c20
-rw-r--r--drivers/acpi/acpica/utids.c2
-rw-r--r--drivers/acpi/acpica/utobject.c26
-rw-r--r--drivers/acpi/acpica/utownerid.c2
-rw-r--r--drivers/acpi/acpica/utresrc.c4
-rw-r--r--drivers/acpi/acpica/utstate.c1
-rw-r--r--drivers/acpi/acpica/utstring.c66
-rw-r--r--drivers/acpi/acpica/uttrack.c31
-rw-r--r--drivers/acpi/acpica/utxface.c45
-rw-r--r--drivers/acpi/acpica/utxferror.c3
-rw-r--r--drivers/acpi/acpica/utxfinit.c18
89 files changed, 850 insertions, 362 deletions
diff --git a/drivers/acpi/acpica/acdebug.h b/drivers/acpi/acpica/acdebug.h
index 9feba08c29fe..a9fd0b872062 100644
--- a/drivers/acpi/acpica/acdebug.h
+++ b/drivers/acpi/acpica/acdebug.h
@@ -114,10 +114,12 @@ 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 116
117ACPI_HW_DEPENDENT_RETURN_VOID(void acpi_db_generate_sci(void))
118
117/* 119/*
118 * dbconvert - miscellaneous conversion routines 120 * dbconvert - miscellaneous conversion routines
119 */ 121 */
120 acpi_status acpi_db_hex_char_to_value(int hex_char, u8 *return_value); 122acpi_status acpi_db_hex_char_to_value(int hex_char, u8 *return_value);
121 123
122acpi_status acpi_db_convert_to_package(char *string, union acpi_object *object); 124acpi_status acpi_db_convert_to_package(char *string, union acpi_object *object);
123 125
@@ -154,6 +156,8 @@ void acpi_db_set_scope(char *name);
154 156
155void acpi_db_dump_namespace(char *start_arg, char *depth_arg); 157void acpi_db_dump_namespace(char *start_arg, char *depth_arg);
156 158
159void acpi_db_dump_namespace_paths(void);
160
157void acpi_db_dump_namespace_by_owner(char *owner_arg, char *depth_arg); 161void acpi_db_dump_namespace_by_owner(char *owner_arg, char *depth_arg);
158 162
159acpi_status acpi_db_find_name_in_namespace(char *name_arg); 163acpi_status acpi_db_find_name_in_namespace(char *name_arg);
@@ -240,6 +244,8 @@ void acpi_db_display_history(void);
240 244
241char *acpi_db_get_from_history(char *command_num_arg); 245char *acpi_db_get_from_history(char *command_num_arg);
242 246
247char *acpi_db_get_history_by_index(u32 commandd_num);
248
243/* 249/*
244 * dbinput - user front-end to the AML debugger 250 * dbinput - user front-end to the AML debugger
245 */ 251 */
diff --git a/drivers/acpi/acpica/acevents.h b/drivers/acpi/acpica/acevents.h
index ab0e97710381..41abe552c7a3 100644
--- a/drivers/acpi/acpica/acevents.h
+++ b/drivers/acpi/acpica/acevents.h
@@ -71,7 +71,8 @@ acpi_status acpi_ev_init_global_lock_handler(void);
71 71
72ACPI_HW_DEPENDENT_RETURN_OK(acpi_status 72ACPI_HW_DEPENDENT_RETURN_OK(acpi_status
73 acpi_ev_acquire_global_lock(u16 timeout)) 73 acpi_ev_acquire_global_lock(u16 timeout))
74 ACPI_HW_DEPENDENT_RETURN_OK(acpi_status acpi_ev_release_global_lock(void)) 74
75ACPI_HW_DEPENDENT_RETURN_OK(acpi_status acpi_ev_release_global_lock(void))
75 acpi_status acpi_ev_remove_global_lock_handler(void); 76 acpi_status acpi_ev_remove_global_lock_handler(void);
76 77
77/* 78/*
@@ -242,11 +243,11 @@ acpi_ev_initialize_region(union acpi_operand_object *region_obj,
242 */ 243 */
243u32 ACPI_SYSTEM_XFACE acpi_ev_gpe_xrupt_handler(void *context); 244u32 ACPI_SYSTEM_XFACE acpi_ev_gpe_xrupt_handler(void *context);
244 245
245u32 acpi_ev_install_sci_handler(void); 246u32 acpi_ev_sci_dispatch(void);
246 247
247acpi_status acpi_ev_remove_sci_handler(void); 248u32 acpi_ev_install_sci_handler(void);
248 249
249u32 acpi_ev_initialize_SCI(u32 program_SCI); 250acpi_status acpi_ev_remove_all_sci_handlers(void);
250 251
251ACPI_HW_DEPENDENT_RETURN_VOID(void acpi_ev_terminate(void)) 252ACPI_HW_DEPENDENT_RETURN_VOID(void acpi_ev_terminate(void))
252#endif /* __ACEVENTS_H__ */ 253#endif /* __ACEVENTS_H__ */
diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h
index 90e846f985fa..e9f1fc7f99c7 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;
269ACPI_EXTERN void *acpi_gbl_table_handler_context; 269ACPI_EXTERN void *acpi_gbl_table_handler_context;
270ACPI_EXTERN struct acpi_walk_state *acpi_gbl_breakpoint_walk; 270ACPI_EXTERN struct acpi_walk_state *acpi_gbl_breakpoint_walk;
271ACPI_EXTERN acpi_interface_handler acpi_gbl_interface_handler; 271ACPI_EXTERN acpi_interface_handler acpi_gbl_interface_handler;
272ACPI_EXTERN struct acpi_sci_handler_info *acpi_gbl_sci_handler_list;
272 273
273/* Owner ID support */ 274/* Owner ID support */
274 275
@@ -405,7 +406,9 @@ extern u32 acpi_gbl_nesting_level;
405 406
406/* Event counters */ 407/* Event counters */
407 408
409ACPI_EXTERN u32 acpi_method_count;
408ACPI_EXTERN u32 acpi_gpe_count; 410ACPI_EXTERN u32 acpi_gpe_count;
411ACPI_EXTERN u32 acpi_sci_count;
409ACPI_EXTERN u32 acpi_fixed_event_count[ACPI_NUM_FIXED_EVENTS]; 412ACPI_EXTERN u32 acpi_fixed_event_count[ACPI_NUM_FIXED_EVENTS];
410 413
411/* Support for dynamic control method tracing mechanism */ 414/* Support for dynamic control method tracing mechanism */
@@ -445,13 +448,6 @@ ACPI_EXTERN u8 acpi_gbl_db_opt_tables;
445ACPI_EXTERN u8 acpi_gbl_db_opt_stats; 448ACPI_EXTERN u8 acpi_gbl_db_opt_stats;
446ACPI_EXTERN u8 acpi_gbl_db_opt_ini_methods; 449ACPI_EXTERN u8 acpi_gbl_db_opt_ini_methods;
447ACPI_EXTERN u8 acpi_gbl_db_opt_no_region_support; 450ACPI_EXTERN u8 acpi_gbl_db_opt_no_region_support;
448
449ACPI_EXTERN char *acpi_gbl_db_args[ACPI_DEBUGGER_MAX_ARGS];
450ACPI_EXTERN acpi_object_type acpi_gbl_db_arg_types[ACPI_DEBUGGER_MAX_ARGS];
451ACPI_EXTERN char acpi_gbl_db_line_buf[ACPI_DB_LINE_BUFFER_SIZE];
452ACPI_EXTERN char acpi_gbl_db_parsed_buf[ACPI_DB_LINE_BUFFER_SIZE];
453ACPI_EXTERN char acpi_gbl_db_scope_buf[80];
454ACPI_EXTERN char acpi_gbl_db_debug_filename[80];
455ACPI_EXTERN u8 acpi_gbl_db_output_to_file; 451ACPI_EXTERN u8 acpi_gbl_db_output_to_file;
456ACPI_EXTERN char *acpi_gbl_db_buffer; 452ACPI_EXTERN char *acpi_gbl_db_buffer;
457ACPI_EXTERN char *acpi_gbl_db_filename; 453ACPI_EXTERN char *acpi_gbl_db_filename;
@@ -459,6 +455,16 @@ ACPI_EXTERN u32 acpi_gbl_db_debug_level;
459ACPI_EXTERN u32 acpi_gbl_db_console_debug_level; 455ACPI_EXTERN u32 acpi_gbl_db_console_debug_level;
460ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_db_scope_node; 456ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_db_scope_node;
461 457
458ACPI_EXTERN char *acpi_gbl_db_args[ACPI_DEBUGGER_MAX_ARGS];
459ACPI_EXTERN acpi_object_type acpi_gbl_db_arg_types[ACPI_DEBUGGER_MAX_ARGS];
460
461/* These buffers should all be the same size */
462
463ACPI_EXTERN char acpi_gbl_db_line_buf[ACPI_DB_LINE_BUFFER_SIZE];
464ACPI_EXTERN char acpi_gbl_db_parsed_buf[ACPI_DB_LINE_BUFFER_SIZE];
465ACPI_EXTERN char acpi_gbl_db_scope_buf[ACPI_DB_LINE_BUFFER_SIZE];
466ACPI_EXTERN char acpi_gbl_db_debug_filename[ACPI_DB_LINE_BUFFER_SIZE];
467
462/* 468/*
463 * Statistic globals 469 * Statistic globals
464 */ 470 */
diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h
index 0ed00669cd21..53ed1a8ba4f0 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
403struct 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
403struct acpi_gpe_handler_info { 411struct acpi_gpe_handler_info {
@@ -1064,7 +1072,7 @@ struct acpi_db_method_info {
1064 char *name; 1072 char *name;
1065 u32 flags; 1073 u32 flags;
1066 u32 num_loops; 1074 u32 num_loops;
1067 char pathname[128]; 1075 char pathname[ACPI_DB_LINE_BUFFER_SIZE];
1068 char **args; 1076 char **args;
1069 acpi_object_type *types; 1077 acpi_object_type *types;
1070 1078
@@ -1086,6 +1094,7 @@ struct acpi_integrity_info {
1086 u32 objects; 1094 u32 objects;
1087}; 1095};
1088 1096
1097#define ACPI_DB_DISABLE_OUTPUT 0x00
1089#define ACPI_DB_REDIRECTABLE_OUTPUT 0x01 1098#define ACPI_DB_REDIRECTABLE_OUTPUT 0x01
1090#define ACPI_DB_CONSOLE_OUTPUT 0x02 1099#define ACPI_DB_CONSOLE_OUTPUT 0x02
1091#define ACPI_DB_DUPLICATE_OUTPUT 0x03 1100#define ACPI_DB_DUPLICATE_OUTPUT 0x03
diff --git a/drivers/acpi/acpica/acmacros.h b/drivers/acpi/acpica/acmacros.h
index 530a2f8c1252..2a86c65d873b 100644
--- a/drivers/acpi/acpica/acmacros.h
+++ b/drivers/acpi/acpica/acmacros.h
@@ -410,37 +410,6 @@
410#endif 410#endif
411 411
412/* 412/*
413 * Memory allocation tracking (DEBUG ONLY)
414 */
415#define ACPI_MEM_PARAMETERS _COMPONENT, _acpi_module_name, __LINE__
416
417#ifndef ACPI_DBG_TRACK_ALLOCATIONS
418
419/* Memory allocation */
420
421#ifndef ACPI_ALLOCATE
422#define ACPI_ALLOCATE(a) acpi_ut_allocate((acpi_size) (a), ACPI_MEM_PARAMETERS)
423#endif
424#ifndef ACPI_ALLOCATE_ZEROED
425#define ACPI_ALLOCATE_ZEROED(a) acpi_ut_allocate_zeroed((acpi_size) (a), ACPI_MEM_PARAMETERS)
426#endif
427#ifndef ACPI_FREE
428#define ACPI_FREE(a) acpi_os_free(a)
429#endif
430#define ACPI_MEM_TRACKING(a)
431
432#else
433
434/* Memory allocation */
435
436#define ACPI_ALLOCATE(a) acpi_ut_allocate_and_track((acpi_size) (a), ACPI_MEM_PARAMETERS)
437#define ACPI_ALLOCATE_ZEROED(a) acpi_ut_allocate_zeroed_and_track((acpi_size) (a), ACPI_MEM_PARAMETERS)
438#define ACPI_FREE(a) acpi_ut_free_and_track(a, ACPI_MEM_PARAMETERS)
439#define ACPI_MEM_TRACKING(a) a
440
441#endif /* ACPI_DBG_TRACK_ALLOCATIONS */
442
443/*
444 * Macros used for ACPICA utilities only 413 * Macros used for ACPICA utilities only
445 */ 414 */
446 415
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
217void
218acpi_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/acutils.h b/drivers/acpi/acpica/acutils.h
index d5a62a6182bb..be8180c17d7e 100644
--- a/drivers/acpi/acpica/acutils.h
+++ b/drivers/acpi/acpica/acutils.h
@@ -628,6 +628,17 @@ u8 acpi_ut_valid_acpi_char(char character, u32 position);
628 628
629void acpi_ut_repair_name(char *name); 629void acpi_ut_repair_name(char *name);
630 630
631#if defined (ACPI_DEBUGGER) || defined (ACPI_APPLICATION)
632u8 acpi_ut_safe_strcpy(char *dest, acpi_size dest_size, char *source);
633
634u8 acpi_ut_safe_strcat(char *dest, acpi_size dest_size, char *source);
635
636u8
637acpi_ut_safe_strncat(char *dest,
638 acpi_size dest_size,
639 char *source, acpi_size max_transfer_length);
640#endif
641
631/* 642/*
632 * utmutex - mutex support 643 * utmutex - mutex support
633 */ 644 */
@@ -652,12 +663,6 @@ acpi_status
652acpi_ut_initialize_buffer(struct acpi_buffer *buffer, 663acpi_ut_initialize_buffer(struct acpi_buffer *buffer,
653 acpi_size required_length); 664 acpi_size required_length);
654 665
655void *acpi_ut_allocate(acpi_size size,
656 u32 component, const char *module, u32 line);
657
658void *acpi_ut_allocate_zeroed(acpi_size size,
659 u32 component, const char *module, u32 line);
660
661#ifdef ACPI_DBG_TRACK_ALLOCATIONS 666#ifdef ACPI_DBG_TRACK_ALLOCATIONS
662void *acpi_ut_allocate_and_track(acpi_size size, 667void *acpi_ut_allocate_and_track(acpi_size size,
663 u32 component, const char *module, u32 line); 668 u32 component, const char *module, u32 line);
diff --git a/drivers/acpi/acpica/dsargs.c b/drivers/acpi/acpica/dsargs.c
index fb09b08d7080..afdc6df17abf 100644
--- a/drivers/acpi/acpica/dsargs.c
+++ b/drivers/acpi/acpica/dsargs.c
@@ -158,7 +158,7 @@ acpi_ds_execute_arguments(struct acpi_namespace_node *node,
158 walk_state->deferred_node = node; 158 walk_state->deferred_node = node;
159 status = acpi_ps_parse_aml(walk_state); 159 status = acpi_ps_parse_aml(walk_state);
160 160
161 cleanup: 161cleanup:
162 acpi_ps_delete_parse_tree(op); 162 acpi_ps_delete_parse_tree(op);
163 return_ACPI_STATUS(status); 163 return_ACPI_STATUS(status);
164} 164}
diff --git a/drivers/acpi/acpica/dsfield.c b/drivers/acpi/acpica/dsfield.c
index d4bfe7b7f90a..2d4c07322576 100644
--- a/drivers/acpi/acpica/dsfield.c
+++ b/drivers/acpi/acpica/dsfield.c
@@ -259,7 +259,7 @@ acpi_ds_create_buffer_field(union acpi_parse_object *op,
259 goto cleanup; 259 goto cleanup;
260 } 260 }
261 261
262 cleanup: 262cleanup:
263 263
264 /* Remove local reference to the object */ 264 /* Remove local reference to the object */
265 265
diff --git a/drivers/acpi/acpica/dsmethod.c b/drivers/acpi/acpica/dsmethod.c
index a9ffd44c18fe..81a78ba84311 100644
--- a/drivers/acpi/acpica/dsmethod.c
+++ b/drivers/acpi/acpica/dsmethod.c
@@ -292,9 +292,10 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node,
292 * reentered one more time (even if it is the same thread) 292 * reentered one more time (even if it is the same thread)
293 */ 293 */
294 obj_desc->method.thread_count++; 294 obj_desc->method.thread_count++;
295 acpi_method_count++;
295 return_ACPI_STATUS(status); 296 return_ACPI_STATUS(status);
296 297
297 cleanup: 298cleanup:
298 /* On error, must release the method mutex (if present) */ 299 /* On error, must release the method mutex (if present) */
299 300
300 if (obj_desc->method.mutex) { 301 if (obj_desc->method.mutex) {
@@ -424,7 +425,7 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread,
424 425
425 return_ACPI_STATUS(status); 426 return_ACPI_STATUS(status);
426 427
427 cleanup: 428cleanup:
428 429
429 /* On error, we must terminate the method properly */ 430 /* On error, we must terminate the method properly */
430 431
diff --git a/drivers/acpi/acpica/dsobject.c b/drivers/acpi/acpica/dsobject.c
index 63f0d220ca3d..b1746a68dad1 100644
--- a/drivers/acpi/acpica/dsobject.c
+++ b/drivers/acpi/acpica/dsobject.c
@@ -240,7 +240,7 @@ acpi_ds_build_internal_object(struct acpi_walk_state *walk_state,
240 return_ACPI_STATUS(status); 240 return_ACPI_STATUS(status);
241 } 241 }
242 242
243 exit: 243exit:
244 *obj_desc_ptr = obj_desc; 244 *obj_desc_ptr = obj_desc;
245 return_ACPI_STATUS(status); 245 return_ACPI_STATUS(status);
246} 246}
diff --git a/drivers/acpi/acpica/dsopcode.c b/drivers/acpi/acpica/dsopcode.c
index 1fc1ff114f26..5205edcf2c01 100644
--- a/drivers/acpi/acpica/dsopcode.c
+++ b/drivers/acpi/acpica/dsopcode.c
@@ -257,7 +257,7 @@ acpi_ds_init_buffer_field(u16 aml_opcode,
257 (buffer_desc->common.reference_count + 257 (buffer_desc->common.reference_count +
258 obj_desc->common.reference_count); 258 obj_desc->common.reference_count);
259 259
260 cleanup: 260cleanup:
261 261
262 /* Always delete the operands */ 262 /* Always delete the operands */
263 263
diff --git a/drivers/acpi/acpica/dsutils.c b/drivers/acpi/acpica/dsutils.c
index c666fc014987..ade44e49deb4 100644
--- a/drivers/acpi/acpica/dsutils.c
+++ b/drivers/acpi/acpica/dsutils.c
@@ -299,7 +299,7 @@ acpi_ds_is_result_used(union acpi_parse_object * op,
299 goto result_used; 299 goto result_used;
300 } 300 }
301 301
302 result_used: 302result_used:
303 ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, 303 ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
304 "Result of [%s] used by Parent [%s] Op=%p\n", 304 "Result of [%s] used by Parent [%s] Op=%p\n",
305 acpi_ps_get_opcode_name(op->common.aml_opcode), 305 acpi_ps_get_opcode_name(op->common.aml_opcode),
@@ -308,7 +308,7 @@ acpi_ds_is_result_used(union acpi_parse_object * op,
308 308
309 return_UINT8(TRUE); 309 return_UINT8(TRUE);
310 310
311 result_not_used: 311result_not_used:
312 ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, 312 ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
313 "Result of [%s] not used by Parent [%s] Op=%p\n", 313 "Result of [%s] not used by Parent [%s] Op=%p\n",
314 acpi_ps_get_opcode_name(op->common.aml_opcode), 314 acpi_ps_get_opcode_name(op->common.aml_opcode),
@@ -752,7 +752,7 @@ acpi_ds_create_operands(struct acpi_walk_state *walk_state,
752 752
753 return_ACPI_STATUS(status); 753 return_ACPI_STATUS(status);
754 754
755 cleanup: 755cleanup:
756 /* 756 /*
757 * We must undo everything done above; meaning that we must 757 * We must undo everything done above; meaning that we must
758 * pop everything off of the operand stack and delete those 758 * pop everything off of the operand stack and delete those
@@ -851,7 +851,7 @@ acpi_status acpi_ds_evaluate_name_path(struct acpi_walk_state *walk_state)
851 goto exit; 851 goto exit;
852 } 852 }
853 853
854 push_result: 854push_result:
855 855
856 walk_state->result_obj = new_obj_desc; 856 walk_state->result_obj = new_obj_desc;
857 857
@@ -863,7 +863,7 @@ acpi_status acpi_ds_evaluate_name_path(struct acpi_walk_state *walk_state)
863 op->common.flags |= ACPI_PARSEOP_IN_STACK; 863 op->common.flags |= ACPI_PARSEOP_IN_STACK;
864 } 864 }
865 865
866 exit: 866exit:
867 867
868 return_ACPI_STATUS(status); 868 return_ACPI_STATUS(status);
869} 869}
diff --git a/drivers/acpi/acpica/dswexec.c b/drivers/acpi/acpica/dswexec.c
index 151d924817e1..1bbb22fd6fa0 100644
--- a/drivers/acpi/acpica/dswexec.c
+++ b/drivers/acpi/acpica/dswexec.c
@@ -170,7 +170,7 @@ acpi_ds_get_predicate_value(struct acpi_walk_state *walk_state,
170 170
171 (void)acpi_ds_do_implicit_return(local_obj_desc, walk_state, TRUE); 171 (void)acpi_ds_do_implicit_return(local_obj_desc, walk_state, TRUE);
172 172
173 cleanup: 173cleanup:
174 174
175 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Completed a predicate eval=%X Op=%p\n", 175 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Completed a predicate eval=%X Op=%p\n",
176 walk_state->control_state->common.value, 176 walk_state->control_state->common.value,
@@ -335,7 +335,7 @@ acpi_ds_exec_begin_op(struct acpi_walk_state *walk_state,
335 335
336 return_ACPI_STATUS(status); 336 return_ACPI_STATUS(status);
337 337
338 error_exit: 338error_exit:
339 status = acpi_ds_method_error(status, walk_state); 339 status = acpi_ds_method_error(status, walk_state);
340 return_ACPI_STATUS(status); 340 return_ACPI_STATUS(status);
341} 341}
@@ -722,7 +722,7 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
722 walk_state->result_obj = NULL; 722 walk_state->result_obj = NULL;
723 } 723 }
724 724
725 cleanup: 725cleanup:
726 726
727 if (walk_state->result_obj) { 727 if (walk_state->result_obj) {
728 728
diff --git a/drivers/acpi/acpica/dswload2.c b/drivers/acpi/acpica/dswload2.c
index b1f8f4725c23..7f569d573027 100644
--- a/drivers/acpi/acpica/dswload2.c
+++ b/drivers/acpi/acpica/dswload2.c
@@ -728,7 +728,7 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
728 break; 728 break;
729 } 729 }
730 730
731 cleanup: 731cleanup:
732 732
733 /* Remove the Node pushed at the very beginning */ 733 /* Remove the Node pushed at the very beginning */
734 734
diff --git a/drivers/acpi/acpica/evglock.c b/drivers/acpi/acpica/evglock.c
index fdb0a76e40a3..4c67193a9fa7 100644
--- a/drivers/acpi/acpica/evglock.c
+++ b/drivers/acpi/acpica/evglock.c
@@ -173,7 +173,7 @@ static u32 acpi_ev_global_lock_handler(void *context)
173 173
174 acpi_gbl_global_lock_pending = FALSE; 174 acpi_gbl_global_lock_pending = FALSE;
175 175
176 cleanup_and_exit: 176cleanup_and_exit:
177 177
178 acpi_os_release_lock(acpi_gbl_global_lock_pending_lock, flags); 178 acpi_os_release_lock(acpi_gbl_global_lock_pending_lock, flags);
179 return (ACPI_INTERRUPT_HANDLED); 179 return (ACPI_INTERRUPT_HANDLED);
diff --git a/drivers/acpi/acpica/evgpe.c b/drivers/acpi/acpica/evgpe.c
index c8a1f7d5931f..a9cb4a1a4bb8 100644
--- a/drivers/acpi/acpica/evgpe.c
+++ b/drivers/acpi/acpica/evgpe.c
@@ -458,7 +458,7 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list)
458 gpe_block = gpe_block->next; 458 gpe_block = gpe_block->next;
459 } 459 }
460 460
461 unlock_and_exit: 461unlock_and_exit:
462 462
463 acpi_os_release_lock(acpi_gbl_gpe_lock, flags); 463 acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
464 return (int_status); 464 return (int_status);
@@ -522,6 +522,7 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context)
522 522
523 status = acpi_ut_release_mutex(ACPI_MTX_EVENTS); 523 status = acpi_ut_release_mutex(ACPI_MTX_EVENTS);
524 if (ACPI_FAILURE(status)) { 524 if (ACPI_FAILURE(status)) {
525 ACPI_FREE(local_gpe_event_info);
525 return_VOID; 526 return_VOID;
526 } 527 }
527 528
diff --git a/drivers/acpi/acpica/evgpeblk.c b/drivers/acpi/acpica/evgpeblk.c
index c1aa1eda26c3..a9e76bc4ad97 100644
--- a/drivers/acpi/acpica/evgpeblk.c
+++ b/drivers/acpi/acpica/evgpeblk.c
@@ -111,7 +111,7 @@ acpi_ev_install_gpe_block(struct acpi_gpe_block_info *gpe_block,
111 gpe_block->xrupt_block = gpe_xrupt_block; 111 gpe_block->xrupt_block = gpe_xrupt_block;
112 acpi_os_release_lock(acpi_gbl_gpe_lock, flags); 112 acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
113 113
114 unlock_and_exit: 114unlock_and_exit:
115 status = acpi_ut_release_mutex(ACPI_MTX_EVENTS); 115 status = acpi_ut_release_mutex(ACPI_MTX_EVENTS);
116 return_ACPI_STATUS(status); 116 return_ACPI_STATUS(status);
117} 117}
@@ -178,7 +178,7 @@ acpi_status acpi_ev_delete_gpe_block(struct acpi_gpe_block_info *gpe_block)
178 ACPI_FREE(gpe_block->event_info); 178 ACPI_FREE(gpe_block->event_info);
179 ACPI_FREE(gpe_block); 179 ACPI_FREE(gpe_block);
180 180
181 unlock_and_exit: 181unlock_and_exit:
182 status = acpi_ut_release_mutex(ACPI_MTX_EVENTS); 182 status = acpi_ut_release_mutex(ACPI_MTX_EVENTS);
183 return_ACPI_STATUS(status); 183 return_ACPI_STATUS(status);
184} 184}
@@ -302,7 +302,7 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block)
302 302
303 return_ACPI_STATUS(AE_OK); 303 return_ACPI_STATUS(AE_OK);
304 304
305 error_exit: 305error_exit:
306 if (gpe_register_info) { 306 if (gpe_register_info) {
307 ACPI_FREE(gpe_register_info); 307 ACPI_FREE(gpe_register_info);
308 } 308 }
diff --git a/drivers/acpi/acpica/evgpeinit.c b/drivers/acpi/acpica/evgpeinit.c
index 7842700346a4..a3e2f38aadf6 100644
--- a/drivers/acpi/acpica/evgpeinit.c
+++ b/drivers/acpi/acpica/evgpeinit.c
@@ -203,7 +203,7 @@ acpi_status acpi_ev_gpe_initialize(void)
203 goto cleanup; 203 goto cleanup;
204 } 204 }
205 205
206 cleanup: 206cleanup:
207 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); 207 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
208 return_ACPI_STATUS(AE_OK); 208 return_ACPI_STATUS(AE_OK);
209} 209}
diff --git a/drivers/acpi/acpica/evgpeutil.c b/drivers/acpi/acpica/evgpeutil.c
index b24dbb80fab8..d3f5e1e2a2b1 100644
--- a/drivers/acpi/acpica/evgpeutil.c
+++ b/drivers/acpi/acpica/evgpeutil.c
@@ -101,7 +101,7 @@ acpi_ev_walk_gpe_list(acpi_gpe_callback gpe_walk_callback, void *context)
101 gpe_xrupt_info = gpe_xrupt_info->next; 101 gpe_xrupt_info = gpe_xrupt_info->next;
102 } 102 }
103 103
104 unlock_and_exit: 104unlock_and_exit:
105 acpi_os_release_lock(acpi_gbl_gpe_lock, flags); 105 acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
106 return_ACPI_STATUS(status); 106 return_ACPI_STATUS(status);
107} 107}
@@ -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/evhandler.c b/drivers/acpi/acpica/evhandler.c
index 068af96134b8..e3157313eb27 100644
--- a/drivers/acpi/acpica/evhandler.c
+++ b/drivers/acpi/acpica/evhandler.c
@@ -129,7 +129,7 @@ acpi_status acpi_ev_install_region_handlers(void)
129 } 129 }
130 } 130 }
131 131
132 unlock_and_exit: 132unlock_and_exit:
133 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); 133 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
134 return_ACPI_STATUS(status); 134 return_ACPI_STATUS(status);
135} 135}
@@ -531,6 +531,6 @@ acpi_ev_install_space_handler(struct acpi_namespace_node * node,
531 acpi_ev_install_handler, NULL, 531 acpi_ev_install_handler, NULL,
532 handler_obj, NULL); 532 handler_obj, NULL);
533 533
534 unlock_and_exit: 534unlock_and_exit:
535 return_ACPI_STATUS(status); 535 return_ACPI_STATUS(status);
536} 536}
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..144cbb9b73bc 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)) {
@@ -570,10 +573,10 @@ acpi_ev_execute_reg_method(union acpi_operand_object *region_obj, u32 function)
570 status = acpi_ns_evaluate(info); 573 status = acpi_ns_evaluate(info);
571 acpi_ut_remove_reference(args[1]); 574 acpi_ut_remove_reference(args[1]);
572 575
573 cleanup2: 576cleanup2:
574 acpi_ut_remove_reference(args[0]); 577 acpi_ut_remove_reference(args[0]);
575 578
576 cleanup1: 579cleanup1:
577 ACPI_FREE(info); 580 ACPI_FREE(info);
578 return_ACPI_STATUS(status); 581 return_ACPI_STATUS(status);
579} 582}
@@ -758,7 +761,7 @@ acpi_ev_orphan_ec_reg_method(struct acpi_namespace_node *ec_device_node)
758 761
759 status = acpi_evaluate_object(reg_method, NULL, &args, NULL); 762 status = acpi_evaluate_object(reg_method, NULL, &args, NULL);
760 763
761 exit: 764exit:
762 /* We ignore all errors from above, don't care */ 765 /* We ignore all errors from above, don't care */
763 766
764 status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE); 767 status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
diff --git a/drivers/acpi/acpica/evsci.c b/drivers/acpi/acpica/evsci.c
index b905acf7aacd..9e9e3454d893 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
67u32 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,11 @@ 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
140 acpi_sci_count++;
92 return_UINT32(interrupt_handled); 141 return_UINT32(interrupt_handled);
93} 142}
94 143
@@ -112,14 +161,13 @@ u32 ACPI_SYSTEM_XFACE acpi_ev_gpe_xrupt_handler(void *context)
112 ACPI_FUNCTION_TRACE(ev_gpe_xrupt_handler); 161 ACPI_FUNCTION_TRACE(ev_gpe_xrupt_handler);
113 162
114 /* 163 /*
115 * We are guaranteed by the ACPI CA initialization/shutdown code that 164 * We are guaranteed by the ACPICA initialization/shutdown code that
116 * if this interrupt handler is installed, ACPI is enabled. 165 * if this interrupt handler is installed, ACPI is enabled.
117 */ 166 */
118 167
119 /* GPEs: Check for and dispatch any GPEs that have occurred */ 168 /* GPEs: Check for and dispatch any GPEs that have occurred */
120 169
121 interrupt_handled |= acpi_ev_gpe_detect(gpe_xrupt_list); 170 interrupt_handled |= acpi_ev_gpe_detect(gpe_xrupt_list);
122
123 return_UINT32(interrupt_handled); 171 return_UINT32(interrupt_handled);
124} 172}
125 173
@@ -150,15 +198,15 @@ u32 acpi_ev_install_sci_handler(void)
150 198
151/****************************************************************************** 199/******************************************************************************
152 * 200 *
153 * FUNCTION: acpi_ev_remove_sci_handler 201 * FUNCTION: acpi_ev_remove_all_sci_handlers
154 * 202 *
155 * PARAMETERS: none 203 * PARAMETERS: none
156 * 204 *
157 * RETURN: E_OK if handler uninstalled OK, E_ERROR if handler was not 205 * RETURN: AE_OK if handler uninstalled, AE_ERROR if handler was not
158 * installed to begin with 206 * installed to begin with
159 * 207 *
160 * DESCRIPTION: Remove the SCI interrupt handler. No further SCIs will be 208 * DESCRIPTION: Remove the SCI interrupt handler. No further SCIs will be
161 * taken. 209 * taken. Remove all host-installed SCI handlers.
162 * 210 *
163 * Note: It doesn't seem important to disable all events or set the event 211 * 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 212 * enable registers to their original values. The OS should disable
@@ -167,11 +215,13 @@ u32 acpi_ev_install_sci_handler(void)
167 * 215 *
168 ******************************************************************************/ 216 ******************************************************************************/
169 217
170acpi_status acpi_ev_remove_sci_handler(void) 218acpi_status acpi_ev_remove_all_sci_handlers(void)
171{ 219{
220 struct acpi_sci_handler_info *sci_handler;
221 acpi_cpu_flags flags;
172 acpi_status status; 222 acpi_status status;
173 223
174 ACPI_FUNCTION_TRACE(ev_remove_sci_handler); 224 ACPI_FUNCTION_TRACE(ev_remove_all_sci_handlers);
175 225
176 /* Just let the OS remove the handler and disable the level */ 226 /* Just let the OS remove the handler and disable the level */
177 227
@@ -179,6 +229,21 @@ acpi_status acpi_ev_remove_sci_handler(void)
179 acpi_os_remove_interrupt_handler((u32) acpi_gbl_FADT.sci_interrupt, 229 acpi_os_remove_interrupt_handler((u32) acpi_gbl_FADT.sci_interrupt,
180 acpi_ev_sci_xrupt_handler); 230 acpi_ev_sci_xrupt_handler);
181 231
232 if (!acpi_gbl_sci_handler_list) {
233 return (status);
234 }
235
236 flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
237
238 /* Free all host-installed SCI handlers */
239
240 while (acpi_gbl_sci_handler_list) {
241 sci_handler = acpi_gbl_sci_handler_list;
242 acpi_gbl_sci_handler_list = sci_handler->next;
243 ACPI_FREE(sci_handler);
244 }
245
246 acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
182 return_ACPI_STATUS(status); 247 return_ACPI_STATUS(status);
183} 248}
184 249
diff --git a/drivers/acpi/acpica/evxface.c b/drivers/acpi/acpica/evxface.c
index ca5fba99c33b..23a7fadca412 100644
--- a/drivers/acpi/acpica/evxface.c
+++ b/drivers/acpi/acpica/evxface.c
@@ -41,7 +41,8 @@
41 * POSSIBILITY OF SUCH DAMAGES. 41 * POSSIBILITY OF SUCH DAMAGES.
42 */ 42 */
43 43
44#include <linux/export.h> 44#define EXPORT_ACPI_INTERFACES
45
45#include <acpi/acpi.h> 46#include <acpi/acpi.h>
46#include "accommon.h" 47#include "accommon.h"
47#include "acnamesp.h" 48#include "acnamesp.h"
@@ -374,7 +375,7 @@ acpi_status acpi_install_exception_handler(acpi_exception_handler handler)
374 375
375 acpi_gbl_exception_handler = handler; 376 acpi_gbl_exception_handler = handler;
376 377
377 cleanup: 378cleanup:
378 (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS); 379 (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
379 return_ACPI_STATUS(status); 380 return_ACPI_STATUS(status);
380} 381}
@@ -385,6 +386,144 @@ ACPI_EXPORT_SYMBOL(acpi_install_exception_handler)
385#if (!ACPI_REDUCED_HARDWARE) 386#if (!ACPI_REDUCED_HARDWARE)
386/******************************************************************************* 387/*******************************************************************************
387 * 388 *
389 * FUNCTION: acpi_install_sci_handler
390 *
391 * PARAMETERS: address - Address of the handler
392 * context - Value passed to the handler on each SCI
393 *
394 * RETURN: Status
395 *
396 * DESCRIPTION: Install a handler for a System Control Interrupt.
397 *
398 ******************************************************************************/
399acpi_status acpi_install_sci_handler(acpi_sci_handler address, void *context)
400{
401 struct acpi_sci_handler_info *new_sci_handler;
402 struct acpi_sci_handler_info *sci_handler;
403 acpi_cpu_flags flags;
404 acpi_status status;
405
406 ACPI_FUNCTION_TRACE(acpi_install_sci_handler);
407
408 if (!address) {
409 return_ACPI_STATUS(AE_BAD_PARAMETER);
410 }
411
412 /* Allocate and init a handler object */
413
414 new_sci_handler = ACPI_ALLOCATE(sizeof(struct acpi_sci_handler_info));
415 if (!new_sci_handler) {
416 return_ACPI_STATUS(AE_NO_MEMORY);
417 }
418
419 new_sci_handler->address = address;
420 new_sci_handler->context = context;
421
422 status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS);
423 if (ACPI_FAILURE(status)) {
424 goto exit;
425 }
426
427 /* Lock list during installation */
428
429 flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
430 sci_handler = acpi_gbl_sci_handler_list;
431
432 /* Ensure handler does not already exist */
433
434 while (sci_handler) {
435 if (address == sci_handler->address) {
436 status = AE_ALREADY_EXISTS;
437 goto unlock_and_exit;
438 }
439
440 sci_handler = sci_handler->next;
441 }
442
443 /* Install the new handler into the global list (at head) */
444
445 new_sci_handler->next = acpi_gbl_sci_handler_list;
446 acpi_gbl_sci_handler_list = new_sci_handler;
447
448unlock_and_exit:
449
450 acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
451 (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
452
453exit:
454 if (ACPI_FAILURE(status)) {
455 ACPI_FREE(new_sci_handler);
456 }
457 return_ACPI_STATUS(status);
458}
459
460/*******************************************************************************
461 *
462 * FUNCTION: acpi_remove_sci_handler
463 *
464 * PARAMETERS: address - Address of the handler
465 *
466 * RETURN: Status
467 *
468 * DESCRIPTION: Remove a handler for a System Control Interrupt.
469 *
470 ******************************************************************************/
471
472acpi_status acpi_remove_sci_handler(acpi_sci_handler address)
473{
474 struct acpi_sci_handler_info *prev_sci_handler;
475 struct acpi_sci_handler_info *next_sci_handler;
476 acpi_cpu_flags flags;
477 acpi_status status;
478
479 ACPI_FUNCTION_TRACE(acpi_remove_sci_handler);
480
481 if (!address) {
482 return_ACPI_STATUS(AE_BAD_PARAMETER);
483 }
484
485 status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS);
486 if (ACPI_FAILURE(status)) {
487 return_ACPI_STATUS(status);
488 }
489
490 /* Remove the SCI handler with lock */
491
492 flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
493
494 prev_sci_handler = NULL;
495 next_sci_handler = acpi_gbl_sci_handler_list;
496 while (next_sci_handler) {
497 if (next_sci_handler->address == address) {
498
499 /* Unlink and free the SCI handler info block */
500
501 if (prev_sci_handler) {
502 prev_sci_handler->next = next_sci_handler->next;
503 } else {
504 acpi_gbl_sci_handler_list =
505 next_sci_handler->next;
506 }
507
508 acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
509 ACPI_FREE(next_sci_handler);
510 goto unlock_and_exit;
511 }
512
513 prev_sci_handler = next_sci_handler;
514 next_sci_handler = next_sci_handler->next;
515 }
516
517 acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
518 status = AE_NOT_EXIST;
519
520unlock_and_exit:
521 (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
522 return_ACPI_STATUS(status);
523}
524
525/*******************************************************************************
526 *
388 * FUNCTION: acpi_install_global_event_handler 527 * FUNCTION: acpi_install_global_event_handler
389 * 528 *
390 * PARAMETERS: handler - Pointer to the global event handler function 529 * PARAMETERS: handler - Pointer to the global event handler function
@@ -398,6 +537,7 @@ ACPI_EXPORT_SYMBOL(acpi_install_exception_handler)
398 * Can be used to update event counters, etc. 537 * Can be used to update event counters, etc.
399 * 538 *
400 ******************************************************************************/ 539 ******************************************************************************/
540
401acpi_status 541acpi_status
402acpi_install_global_event_handler(acpi_gbl_event_handler handler, void *context) 542acpi_install_global_event_handler(acpi_gbl_event_handler handler, void *context)
403{ 543{
@@ -426,7 +566,7 @@ acpi_install_global_event_handler(acpi_gbl_event_handler handler, void *context)
426 acpi_gbl_global_event_handler = handler; 566 acpi_gbl_global_event_handler = handler;
427 acpi_gbl_global_event_handler_context = context; 567 acpi_gbl_global_event_handler_context = context;
428 568
429 cleanup: 569cleanup:
430 (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS); 570 (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
431 return_ACPI_STATUS(status); 571 return_ACPI_STATUS(status);
432} 572}
@@ -498,7 +638,7 @@ acpi_install_fixed_event_handler(u32 event,
498 handler)); 638 handler));
499 } 639 }
500 640
501 cleanup: 641cleanup:
502 (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS); 642 (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
503 return_ACPI_STATUS(status); 643 return_ACPI_STATUS(status);
504} 644}
diff --git a/drivers/acpi/acpica/evxfevnt.c b/drivers/acpi/acpica/evxfevnt.c
index 7039606a0ba8..39d06af5e347 100644
--- a/drivers/acpi/acpica/evxfevnt.c
+++ b/drivers/acpi/acpica/evxfevnt.c
@@ -41,7 +41,8 @@
41 * POSSIBILITY OF SUCH DAMAGES. 41 * POSSIBILITY OF SUCH DAMAGES.
42 */ 42 */
43 43
44#include <linux/export.h> 44#define EXPORT_ACPI_INTERFACES
45
45#include <acpi/acpi.h> 46#include <acpi/acpi.h>
46#include "accommon.h" 47#include "accommon.h"
47#include "actables.h" 48#include "actables.h"
diff --git a/drivers/acpi/acpica/evxfgpe.c b/drivers/acpi/acpica/evxfgpe.c
index 7662f1a42ff6..5713da77c665 100644
--- a/drivers/acpi/acpica/evxfgpe.c
+++ b/drivers/acpi/acpica/evxfgpe.c
@@ -41,7 +41,8 @@
41 * POSSIBILITY OF SUCH DAMAGES. 41 * POSSIBILITY OF SUCH DAMAGES.
42 */ 42 */
43 43
44#include <linux/export.h> 44#define EXPORT_ACPI_INTERFACES
45
45#include <acpi/acpi.h> 46#include <acpi/acpi.h>
46#include "accommon.h" 47#include "accommon.h"
47#include "acevents.h" 48#include "acevents.h"
@@ -471,7 +472,7 @@ acpi_get_gpe_status(acpi_handle gpe_device,
471 if (gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) 472 if (gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK)
472 *event_status |= ACPI_EVENT_FLAG_HANDLE; 473 *event_status |= ACPI_EVENT_FLAG_HANDLE;
473 474
474 unlock_and_exit: 475unlock_and_exit:
475 acpi_os_release_lock(acpi_gbl_gpe_lock, flags); 476 acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
476 return_ACPI_STATUS(status); 477 return_ACPI_STATUS(status);
477} 478}
@@ -624,7 +625,7 @@ acpi_install_gpe_block(acpi_handle gpe_device,
624 625
625 obj_desc->device.gpe_block = gpe_block; 626 obj_desc->device.gpe_block = gpe_block;
626 627
627 unlock_and_exit: 628unlock_and_exit:
628 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); 629 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
629 return_ACPI_STATUS(status); 630 return_ACPI_STATUS(status);
630} 631}
@@ -679,7 +680,7 @@ acpi_status acpi_remove_gpe_block(acpi_handle gpe_device)
679 obj_desc->device.gpe_block = NULL; 680 obj_desc->device.gpe_block = NULL;
680 } 681 }
681 682
682 unlock_and_exit: 683unlock_and_exit:
683 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); 684 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
684 return_ACPI_STATUS(status); 685 return_ACPI_STATUS(status);
685} 686}
diff --git a/drivers/acpi/acpica/evxfregn.c b/drivers/acpi/acpica/evxfregn.c
index 80cecf838591..02ed75ac56cd 100644
--- a/drivers/acpi/acpica/evxfregn.c
+++ b/drivers/acpi/acpica/evxfregn.c
@@ -42,7 +42,8 @@
42 * POSSIBILITY OF SUCH DAMAGES. 42 * POSSIBILITY OF SUCH DAMAGES.
43 */ 43 */
44 44
45#include <linux/export.h> 45#define EXPORT_ACPI_INTERFACES
46
46#include <acpi/acpi.h> 47#include <acpi/acpi.h>
47#include "accommon.h" 48#include "accommon.h"
48#include "acnamesp.h" 49#include "acnamesp.h"
@@ -147,7 +148,7 @@ acpi_install_address_space_handler(acpi_handle device,
147 148
148 status = acpi_ev_execute_reg_methods(node, space_id); 149 status = acpi_ev_execute_reg_methods(node, space_id);
149 150
150 unlock_and_exit: 151unlock_and_exit:
151 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); 152 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
152 return_ACPI_STATUS(status); 153 return_ACPI_STATUS(status);
153} 154}
@@ -286,7 +287,7 @@ acpi_remove_address_space_handler(acpi_handle device,
286 287
287 status = AE_NOT_EXIST; 288 status = AE_NOT_EXIST;
288 289
289 unlock_and_exit: 290unlock_and_exit:
290 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); 291 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
291 return_ACPI_STATUS(status); 292 return_ACPI_STATUS(status);
292} 293}
diff --git a/drivers/acpi/acpica/excreate.c b/drivers/acpi/acpica/excreate.c
index 269e81d86ef4..3c2e6dcdad3e 100644
--- a/drivers/acpi/acpica/excreate.c
+++ b/drivers/acpi/acpica/excreate.c
@@ -193,7 +193,7 @@ acpi_status acpi_ex_create_event(struct acpi_walk_state *walk_state)
193 acpi_ns_attach_object((struct acpi_namespace_node *)walk_state-> 193 acpi_ns_attach_object((struct acpi_namespace_node *)walk_state->
194 operands[0], obj_desc, ACPI_TYPE_EVENT); 194 operands[0], obj_desc, ACPI_TYPE_EVENT);
195 195
196 cleanup: 196cleanup:
197 /* 197 /*
198 * Remove local reference to the object (on error, will cause deletion 198 * Remove local reference to the object (on error, will cause deletion
199 * of both object and semaphore if present.) 199 * of both object and semaphore if present.)
@@ -248,7 +248,7 @@ acpi_status acpi_ex_create_mutex(struct acpi_walk_state *walk_state)
248 acpi_ns_attach_object(obj_desc->mutex.node, obj_desc, 248 acpi_ns_attach_object(obj_desc->mutex.node, obj_desc,
249 ACPI_TYPE_MUTEX); 249 ACPI_TYPE_MUTEX);
250 250
251 cleanup: 251cleanup:
252 /* 252 /*
253 * Remove local reference to the object (on error, will cause deletion 253 * Remove local reference to the object (on error, will cause deletion
254 * of both object and semaphore if present.) 254 * of both object and semaphore if present.)
@@ -347,7 +347,7 @@ acpi_ex_create_region(u8 * aml_start,
347 347
348 status = acpi_ns_attach_object(node, obj_desc, ACPI_TYPE_REGION); 348 status = acpi_ns_attach_object(node, obj_desc, ACPI_TYPE_REGION);
349 349
350 cleanup: 350cleanup:
351 351
352 /* Remove local reference to the object */ 352 /* Remove local reference to the object */
353 353
@@ -520,7 +520,7 @@ acpi_ex_create_method(u8 * aml_start,
520 520
521 acpi_ut_remove_reference(obj_desc); 521 acpi_ut_remove_reference(obj_desc);
522 522
523 exit: 523exit:
524 /* Remove a reference to the operand */ 524 /* Remove a reference to the operand */
525 525
526 acpi_ut_remove_reference(operand[1]); 526 acpi_ut_remove_reference(operand[1]);
diff --git a/drivers/acpi/acpica/exfield.c b/drivers/acpi/acpica/exfield.c
index c2a65aaf29af..cfd875243421 100644
--- a/drivers/acpi/acpica/exfield.c
+++ b/drivers/acpi/acpica/exfield.c
@@ -197,7 +197,7 @@ acpi_ex_read_data_from_field(struct acpi_walk_state *walk_state,
197 status = acpi_ex_extract_from_field(obj_desc, buffer, (u32) length); 197 status = acpi_ex_extract_from_field(obj_desc, buffer, (u32) length);
198 acpi_ex_release_global_lock(obj_desc->common_field.field_flags); 198 acpi_ex_release_global_lock(obj_desc->common_field.field_flags);
199 199
200 exit: 200exit:
201 if (ACPI_FAILURE(status)) { 201 if (ACPI_FAILURE(status)) {
202 acpi_ut_remove_reference(buffer_desc); 202 acpi_ut_remove_reference(buffer_desc);
203 } else { 203 } else {
diff --git a/drivers/acpi/acpica/exfldio.c b/drivers/acpi/acpica/exfldio.c
index 7e0afe72487e..49fb742d61b9 100644
--- a/drivers/acpi/acpica/exfldio.c
+++ b/drivers/acpi/acpica/exfldio.c
@@ -123,12 +123,6 @@ acpi_ex_setup_region(union acpi_operand_object *obj_desc,
123 } 123 }
124 } 124 }
125 125
126 /* Exit if Address/Length have been disallowed by the host OS */
127
128 if (rgn_desc->common.flags & AOPOBJ_INVALID) {
129 return_ACPI_STATUS(AE_AML_ILLEGAL_ADDRESS);
130 }
131
132 /* 126 /*
133 * Exit now for SMBus, GSBus or IPMI address space, it has a non-linear 127 * Exit now for SMBus, GSBus or IPMI address space, it has a non-linear
134 * address space and the request cannot be directly validated 128 * address space and the request cannot be directly validated
@@ -1002,7 +996,7 @@ acpi_ex_insert_into_field(union acpi_operand_object *obj_desc,
1002 mask, merged_datum, 996 mask, merged_datum,
1003 field_offset); 997 field_offset);
1004 998
1005 exit: 999exit:
1006 /* Free temporary buffer if we used one */ 1000 /* Free temporary buffer if we used one */
1007 1001
1008 if (new_buffer) { 1002 if (new_buffer) {
diff --git a/drivers/acpi/acpica/exmisc.c b/drivers/acpi/acpica/exmisc.c
index 00bf29877574..65d93607f368 100644
--- a/drivers/acpi/acpica/exmisc.c
+++ b/drivers/acpi/acpica/exmisc.c
@@ -388,7 +388,7 @@ acpi_ex_do_concatenate(union acpi_operand_object *operand0,
388 388
389 *actual_return_desc = return_desc; 389 *actual_return_desc = return_desc;
390 390
391 cleanup: 391cleanup:
392 if (local_operand1 != operand1) { 392 if (local_operand1 != operand1) {
393 acpi_ut_remove_reference(local_operand1); 393 acpi_ut_remove_reference(local_operand1);
394 } 394 }
@@ -718,7 +718,7 @@ acpi_ex_do_logical_op(u16 opcode,
718 } 718 }
719 } 719 }
720 720
721 cleanup: 721cleanup:
722 722
723 /* New object was created if implicit conversion performed - delete */ 723 /* New object was created if implicit conversion performed - delete */
724 724
diff --git a/drivers/acpi/acpica/exoparg1.c b/drivers/acpi/acpica/exoparg1.c
index 2cdd41d8ade6..d74cea416ca0 100644
--- a/drivers/acpi/acpica/exoparg1.c
+++ b/drivers/acpi/acpica/exoparg1.c
@@ -115,7 +115,7 @@ acpi_status acpi_ex_opcode_0A_0T_1R(struct acpi_walk_state *walk_state)
115 break; 115 break;
116 } 116 }
117 117
118 cleanup: 118cleanup:
119 119
120 /* Delete return object on error */ 120 /* Delete return object on error */
121 121
@@ -234,7 +234,7 @@ acpi_status acpi_ex_opcode_1A_1T_0R(struct acpi_walk_state *walk_state)
234 goto cleanup; 234 goto cleanup;
235 } 235 }
236 236
237 cleanup: 237cleanup:
238 238
239 return_ACPI_STATUS(status); 239 return_ACPI_STATUS(status);
240} 240}
@@ -551,7 +551,7 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state)
551 status = acpi_ex_store(return_desc, operand[1], walk_state); 551 status = acpi_ex_store(return_desc, operand[1], walk_state);
552 } 552 }
553 553
554 cleanup: 554cleanup:
555 555
556 /* Delete return object on error */ 556 /* Delete return object on error */
557 557
@@ -1054,7 +1054,7 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
1054 goto cleanup; 1054 goto cleanup;
1055 } 1055 }
1056 1056
1057 cleanup: 1057cleanup:
1058 1058
1059 /* Delete return object on error */ 1059 /* Delete return object on error */
1060 1060
diff --git a/drivers/acpi/acpica/exoparg2.c b/drivers/acpi/acpica/exoparg2.c
index d5088f7030c7..d6fa0fce1fc9 100644
--- a/drivers/acpi/acpica/exoparg2.c
+++ b/drivers/acpi/acpica/exoparg2.c
@@ -215,7 +215,7 @@ acpi_status acpi_ex_opcode_2A_2T_1R(struct acpi_walk_state *walk_state)
215 goto cleanup; 215 goto cleanup;
216 } 216 }
217 217
218 cleanup: 218cleanup:
219 /* 219 /*
220 * Since the remainder is not returned indirectly, remove a reference to 220 * Since the remainder is not returned indirectly, remove a reference to
221 * it. Only the quotient is returned indirectly. 221 * it. Only the quotient is returned indirectly.
@@ -445,7 +445,7 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state)
445 break; 445 break;
446 } 446 }
447 447
448 store_result_to_target: 448store_result_to_target:
449 449
450 if (ACPI_SUCCESS(status)) { 450 if (ACPI_SUCCESS(status)) {
451 /* 451 /*
@@ -462,7 +462,7 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state)
462 } 462 }
463 } 463 }
464 464
465 cleanup: 465cleanup:
466 466
467 /* Delete return object on error */ 467 /* Delete return object on error */
468 468
@@ -553,7 +553,7 @@ acpi_status acpi_ex_opcode_2A_0T_1R(struct acpi_walk_state *walk_state)
553 goto cleanup; 553 goto cleanup;
554 } 554 }
555 555
556 store_logical_result: 556store_logical_result:
557 /* 557 /*
558 * Set return value to according to logical_result. logical TRUE (all ones) 558 * Set return value to according to logical_result. logical TRUE (all ones)
559 * Default is FALSE (zero) 559 * Default is FALSE (zero)
@@ -562,7 +562,7 @@ acpi_status acpi_ex_opcode_2A_0T_1R(struct acpi_walk_state *walk_state)
562 return_desc->integer.value = ACPI_UINT64_MAX; 562 return_desc->integer.value = ACPI_UINT64_MAX;
563 } 563 }
564 564
565 cleanup: 565cleanup:
566 566
567 /* Delete return object on error */ 567 /* Delete return object on error */
568 568
diff --git a/drivers/acpi/acpica/exoparg3.c b/drivers/acpi/acpica/exoparg3.c
index 37656f12f204..bc042adf8804 100644
--- a/drivers/acpi/acpica/exoparg3.c
+++ b/drivers/acpi/acpica/exoparg3.c
@@ -124,7 +124,7 @@ acpi_status acpi_ex_opcode_3A_0T_0R(struct acpi_walk_state *walk_state)
124 goto cleanup; 124 goto cleanup;
125 } 125 }
126 126
127 cleanup: 127cleanup:
128 128
129 return_ACPI_STATUS(status); 129 return_ACPI_STATUS(status);
130} 130}
@@ -252,7 +252,7 @@ acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state)
252 252
253 status = acpi_ex_store(return_desc, operand[3], walk_state); 253 status = acpi_ex_store(return_desc, operand[3], walk_state);
254 254
255 cleanup: 255cleanup:
256 256
257 /* Delete return object on error */ 257 /* Delete return object on error */
258 258
diff --git a/drivers/acpi/acpica/exoparg6.c b/drivers/acpi/acpica/exoparg6.c
index 879b6cd8319c..4459e32c683d 100644
--- a/drivers/acpi/acpica/exoparg6.c
+++ b/drivers/acpi/acpica/exoparg6.c
@@ -314,7 +314,7 @@ acpi_status acpi_ex_opcode_6A_0T_1R(struct acpi_walk_state * walk_state)
314 goto cleanup; 314 goto cleanup;
315 } 315 }
316 316
317 cleanup: 317cleanup:
318 318
319 /* Delete return object on error */ 319 /* Delete return object on error */
320 320
diff --git a/drivers/acpi/acpica/exregion.c b/drivers/acpi/acpica/exregion.c
index 303429bb4d5d..9d28867e60dc 100644
--- a/drivers/acpi/acpica/exregion.c
+++ b/drivers/acpi/acpica/exregion.c
@@ -400,6 +400,7 @@ acpi_ex_pci_config_space_handler(u32 function,
400 switch (function) { 400 switch (function) {
401 case ACPI_READ: 401 case ACPI_READ:
402 402
403 *value = 0;
403 status = acpi_os_read_pci_configuration(pci_id, pci_register, 404 status = acpi_os_read_pci_configuration(pci_id, pci_register,
404 value, bit_width); 405 value, bit_width);
405 break; 406 break;
diff --git a/drivers/acpi/acpica/exresolv.c b/drivers/acpi/acpica/exresolv.c
index ac04278ad28f..1606524312e3 100644
--- a/drivers/acpi/acpica/exresolv.c
+++ b/drivers/acpi/acpica/exresolv.c
@@ -521,7 +521,7 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
521 */ 521 */
522 type = obj_desc->common.type; 522 type = obj_desc->common.type;
523 523
524 exit: 524exit:
525 /* Convert internal types to external types */ 525 /* Convert internal types to external types */
526 526
527 switch (type) { 527 switch (type) {
diff --git a/drivers/acpi/acpica/exresop.c b/drivers/acpi/acpica/exresop.c
index 00e5af7129c1..be3f66973ee8 100644
--- a/drivers/acpi/acpica/exresop.c
+++ b/drivers/acpi/acpica/exresop.c
@@ -683,7 +683,7 @@ acpi_ex_resolve_operands(u16 opcode,
683 return_ACPI_STATUS(status); 683 return_ACPI_STATUS(status);
684 } 684 }
685 685
686 next_operand: 686next_operand:
687 /* 687 /*
688 * If more operands needed, decrement stack_ptr to point 688 * If more operands needed, decrement stack_ptr to point
689 * to next operand on stack 689 * to next operand on stack
diff --git a/drivers/acpi/acpica/hwregs.c b/drivers/acpi/acpica/hwregs.c
index 8d2e866be15f..12e6cff54f78 100644
--- a/drivers/acpi/acpica/hwregs.c
+++ b/drivers/acpi/acpica/hwregs.c
@@ -560,7 +560,7 @@ acpi_status acpi_hw_register_write(u32 register_id, u32 value)
560 break; 560 break;
561 } 561 }
562 562
563 exit: 563exit:
564 return_ACPI_STATUS(status); 564 return_ACPI_STATUS(status);
565} 565}
566 566
diff --git a/drivers/acpi/acpica/hwtimer.c b/drivers/acpi/acpica/hwtimer.c
index 2d7d22ebc782..3c498dc1636e 100644
--- a/drivers/acpi/acpica/hwtimer.c
+++ b/drivers/acpi/acpica/hwtimer.c
@@ -41,7 +41,8 @@
41 * POSSIBILITY OF SUCH DAMAGES. 41 * POSSIBILITY OF SUCH DAMAGES.
42 */ 42 */
43 43
44#include <linux/export.h> 44#define EXPORT_ACPI_INTERFACES
45
45#include <acpi/acpi.h> 46#include <acpi/acpi.h>
46#include "accommon.h" 47#include "accommon.h"
47 48
diff --git a/drivers/acpi/acpica/hwxface.c b/drivers/acpi/acpica/hwxface.c
index 5ee7a814cd92..b4b47db2dee2 100644
--- a/drivers/acpi/acpica/hwxface.c
+++ b/drivers/acpi/acpica/hwxface.c
@@ -41,7 +41,8 @@
41 * POSSIBILITY OF SUCH DAMAGES. 41 * POSSIBILITY OF SUCH DAMAGES.
42 */ 42 */
43 43
44#include <linux/export.h> 44#define EXPORT_ACPI_INTERFACES
45
45#include <acpi/acpi.h> 46#include <acpi/acpi.h>
46#include "accommon.h" 47#include "accommon.h"
47#include "acnamesp.h" 48#include "acnamesp.h"
@@ -83,11 +84,17 @@ acpi_status acpi_reset(void)
83 * For I/O space, write directly to the OSL. This bypasses the port 84 * For I/O space, write directly to the OSL. This bypasses the port
84 * validation mechanism, which may block a valid write to the reset 85 * validation mechanism, which may block a valid write to the reset
85 * register. 86 * register.
86 * Spec section 4.7.3.6 requires register width to be 8. 87 *
88 * NOTE:
89 * The ACPI spec requires the reset register width to be 8, so we
90 * hardcode it here and ignore the FADT value. This maintains
91 * compatibility with other ACPI implementations that have allowed
92 * BIOS code with bad register width values to go unnoticed.
87 */ 93 */
88 status = 94 status =
89 acpi_os_write_port((acpi_io_address) reset_reg->address, 95 acpi_os_write_port((acpi_io_address) reset_reg->address,
90 acpi_gbl_FADT.reset_value, 8); 96 acpi_gbl_FADT.reset_value,
97 ACPI_RESET_REGISTER_WIDTH);
91 } else { 98 } else {
92 /* Write the reset value to the reset register */ 99 /* Write the reset value to the reset register */
93 100
@@ -119,7 +126,8 @@ ACPI_EXPORT_SYMBOL(acpi_reset)
119 ******************************************************************************/ 126 ******************************************************************************/
120acpi_status acpi_read(u64 *return_value, struct acpi_generic_address *reg) 127acpi_status acpi_read(u64 *return_value, struct acpi_generic_address *reg)
121{ 128{
122 u32 value; 129 u32 value_lo;
130 u32 value_hi;
123 u32 width; 131 u32 width;
124 u64 address; 132 u64 address;
125 acpi_status status; 133 acpi_status status;
@@ -137,13 +145,8 @@ acpi_status acpi_read(u64 *return_value, struct acpi_generic_address *reg)
137 return (status); 145 return (status);
138 } 146 }
139 147
140 /* Initialize entire 64-bit return value to zero */
141
142 *return_value = 0;
143 value = 0;
144
145 /* 148 /*
146 * Two address spaces supported: Memory or IO. PCI_Config is 149 * Two address spaces supported: Memory or I/O. PCI_Config is
147 * not supported here because the GAS structure is insufficient 150 * not supported here because the GAS structure is insufficient
148 */ 151 */
149 if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) { 152 if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) {
@@ -155,29 +158,35 @@ acpi_status acpi_read(u64 *return_value, struct acpi_generic_address *reg)
155 } 158 }
156 } else { /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */ 159 } else { /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */
157 160
161 value_lo = 0;
162 value_hi = 0;
163
158 width = reg->bit_width; 164 width = reg->bit_width;
159 if (width == 64) { 165 if (width == 64) {
160 width = 32; /* Break into two 32-bit transfers */ 166 width = 32; /* Break into two 32-bit transfers */
161 } 167 }
162 168
163 status = acpi_hw_read_port((acpi_io_address) 169 status = acpi_hw_read_port((acpi_io_address)
164 address, &value, width); 170 address, &value_lo, width);
165 if (ACPI_FAILURE(status)) { 171 if (ACPI_FAILURE(status)) {
166 return (status); 172 return (status);
167 } 173 }
168 *return_value = value;
169 174
170 if (reg->bit_width == 64) { 175 if (reg->bit_width == 64) {
171 176
172 /* Read the top 32 bits */ 177 /* Read the top 32 bits */
173 178
174 status = acpi_hw_read_port((acpi_io_address) 179 status = acpi_hw_read_port((acpi_io_address)
175 (address + 4), &value, 32); 180 (address + 4), &value_hi,
181 32);
176 if (ACPI_FAILURE(status)) { 182 if (ACPI_FAILURE(status)) {
177 return (status); 183 return (status);
178 } 184 }
179 *return_value |= ((u64)value << 32);
180 } 185 }
186
187 /* Set the return value only if status is AE_OK */
188
189 *return_value = (value_lo | ((u64)value_hi << 32));
181 } 190 }
182 191
183 ACPI_DEBUG_PRINT((ACPI_DB_IO, 192 ACPI_DEBUG_PRINT((ACPI_DB_IO,
@@ -186,7 +195,7 @@ acpi_status acpi_read(u64 *return_value, struct acpi_generic_address *reg)
186 ACPI_FORMAT_UINT64(address), 195 ACPI_FORMAT_UINT64(address),
187 acpi_ut_get_region_name(reg->space_id))); 196 acpi_ut_get_region_name(reg->space_id)));
188 197
189 return (status); 198 return (AE_OK);
190} 199}
191 200
192ACPI_EXPORT_SYMBOL(acpi_read) 201ACPI_EXPORT_SYMBOL(acpi_read)
@@ -561,10 +570,10 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 *sleep_type_a, u8 *sleep_type_b)
561 break; 570 break;
562 } 571 }
563 572
564 cleanup1: 573cleanup1:
565 acpi_ut_remove_reference(info->return_object); 574 acpi_ut_remove_reference(info->return_object);
566 575
567 cleanup: 576cleanup:
568 if (ACPI_FAILURE(status)) { 577 if (ACPI_FAILURE(status)) {
569 ACPI_EXCEPTION((AE_INFO, status, 578 ACPI_EXCEPTION((AE_INFO, status,
570 "While evaluating Sleep State [%s]", 579 "While evaluating Sleep State [%s]",
diff --git a/drivers/acpi/acpica/hwxfsleep.c b/drivers/acpi/acpica/hwxfsleep.c
index f2e669db8b65..15dddc10fc9b 100644
--- a/drivers/acpi/acpica/hwxfsleep.c
+++ b/drivers/acpi/acpica/hwxfsleep.c
@@ -41,7 +41,8 @@
41 * POSSIBILITY OF SUCH DAMAGES. 41 * POSSIBILITY OF SUCH DAMAGES.
42 */ 42 */
43 43
44#include <linux/export.h> 44#define EXPORT_ACPI_INTERFACES
45
45#include <acpi/acpi.h> 46#include <acpi/acpi.h>
46#include "accommon.h" 47#include "accommon.h"
47 48
@@ -166,7 +167,7 @@ ACPI_EXPORT_SYMBOL(acpi_set_firmware_waking_vector64)
166 * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED 167 * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED
167 * 168 *
168 ******************************************************************************/ 169 ******************************************************************************/
169acpi_status asmlinkage acpi_enter_sleep_state_s4bios(void) 170acpi_status acpi_enter_sleep_state_s4bios(void)
170{ 171{
171 u32 in_value; 172 u32 in_value;
172 acpi_status status; 173 acpi_status status;
@@ -360,7 +361,7 @@ ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_prep)
360 * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED 361 * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED
361 * 362 *
362 ******************************************************************************/ 363 ******************************************************************************/
363acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state) 364acpi_status acpi_enter_sleep_state(u8 sleep_state)
364{ 365{
365 acpi_status status; 366 acpi_status status;
366 367
diff --git a/drivers/acpi/acpica/nsaccess.c b/drivers/acpi/acpica/nsaccess.c
index c5316e5bd4ab..14f65f6345b9 100644
--- a/drivers/acpi/acpica/nsaccess.c
+++ b/drivers/acpi/acpica/nsaccess.c
@@ -240,7 +240,7 @@ acpi_status acpi_ns_root_initialize(void)
240 } 240 }
241 } 241 }
242 242
243 unlock_and_exit: 243unlock_and_exit:
244 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); 244 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
245 245
246 /* Save a handle to "_GPE", it is always present */ 246 /* Save a handle to "_GPE", it is always present */
@@ -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..48b9c6f12643 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
64static acpi_status
65acpi_ns_dump_one_object_path(acpi_handle obj_handle,
66 u32 level, void *context, void **return_value);
67
68static acpi_status
69acpi_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
@@ -609,7 +620,7 @@ acpi_ns_dump_one_object(acpi_handle obj_handle,
609 obj_type = ACPI_TYPE_INVALID; /* Terminate loop after next pass */ 620 obj_type = ACPI_TYPE_INVALID; /* Terminate loop after next pass */
610 } 621 }
611 622
612 cleanup: 623cleanup:
613 acpi_os_printf("\n"); 624 acpi_os_printf("\n");
614 return (AE_OK); 625 return (AE_OK);
615} 626}
@@ -671,6 +682,136 @@ 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
704static acpi_status
705acpi_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 if (!node) {
719
720 /* Ignore bad node during namespace walk */
721
722 return (AE_OK);
723 }
724
725 pathname = acpi_ns_get_external_pathname(node);
726
727 path_indent = 1;
728 if (level <= max_level) {
729 path_indent = max_level - level + 1;
730 }
731
732 acpi_os_printf("%2d%*s%-12s%*s",
733 level, level, " ", acpi_ut_get_type_name(node->type),
734 path_indent, " ");
735
736 acpi_os_printf("%s\n", &pathname[1]);
737 ACPI_FREE(pathname);
738 return (AE_OK);
739}
740
741static acpi_status
742acpi_ns_get_max_depth(acpi_handle obj_handle,
743 u32 level, void *context, void **return_value)
744{
745 u32 *max_level = (u32 *)context;
746
747 if (level > *max_level) {
748 *max_level = level;
749 }
750 return (AE_OK);
751}
752
753/*******************************************************************************
754 *
755 * FUNCTION: acpi_ns_dump_object_paths
756 *
757 * PARAMETERS: type - Object type to be dumped
758 * display_type - 0 or ACPI_DISPLAY_SUMMARY
759 * max_depth - Maximum depth of dump. Use ACPI_UINT32_MAX
760 * for an effectively unlimited depth.
761 * owner_id - Dump only objects owned by this ID. Use
762 * ACPI_UINT32_MAX to match all owners.
763 * start_handle - Where in namespace to start/end search
764 *
765 * RETURN: None
766 *
767 * DESCRIPTION: Dump full object pathnames within the loaded namespace. Uses
768 * acpi_ns_walk_namespace in conjunction with acpi_ns_dump_one_object_path.
769 *
770 ******************************************************************************/
771
772void
773acpi_ns_dump_object_paths(acpi_object_type type,
774 u8 display_type,
775 u32 max_depth,
776 acpi_owner_id owner_id, acpi_handle start_handle)
777{
778 acpi_status status;
779 u32 max_level = 0;
780
781 ACPI_FUNCTION_ENTRY();
782
783 /*
784 * Just lock the entire namespace for the duration of the dump.
785 * We don't want any changes to the namespace during this time,
786 * especially the temporary nodes since we are going to display
787 * them also.
788 */
789 status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
790 if (ACPI_FAILURE(status)) {
791 acpi_os_printf("Could not acquire namespace mutex\n");
792 return;
793 }
794
795 /* Get the max depth of the namespace tree, for formatting later */
796
797 (void)acpi_ns_walk_namespace(type, start_handle, max_depth,
798 ACPI_NS_WALK_NO_UNLOCK |
799 ACPI_NS_WALK_TEMP_NODES,
800 acpi_ns_get_max_depth, NULL,
801 (void *)&max_level, NULL);
802
803 /* Now dump the entire namespace */
804
805 (void)acpi_ns_walk_namespace(type, start_handle, max_depth,
806 ACPI_NS_WALK_NO_UNLOCK |
807 ACPI_NS_WALK_TEMP_NODES,
808 acpi_ns_dump_one_object_path, NULL,
809 (void *)&max_level, NULL);
810
811 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
812}
813#endif /* ACPI_FUTURE_USAGE */
814
674/******************************************************************************* 815/*******************************************************************************
675 * 816 *
676 * FUNCTION: acpi_ns_dump_entry 817 * FUNCTION: acpi_ns_dump_entry
diff --git a/drivers/acpi/acpica/nsdumpdv.c b/drivers/acpi/acpica/nsdumpdv.c
index 409ae80824d1..283762511b73 100644
--- a/drivers/acpi/acpica/nsdumpdv.c
+++ b/drivers/acpi/acpica/nsdumpdv.c
@@ -69,6 +69,7 @@ static acpi_status
69acpi_ns_dump_one_device(acpi_handle obj_handle, 69acpi_ns_dump_one_device(acpi_handle obj_handle,
70 u32 level, void *context, void **return_value) 70 u32 level, void *context, void **return_value)
71{ 71{
72 struct acpi_buffer buffer;
72 struct acpi_device_info *info; 73 struct acpi_device_info *info;
73 acpi_status status; 74 acpi_status status;
74 u32 i; 75 u32 i;
@@ -78,15 +79,17 @@ acpi_ns_dump_one_device(acpi_handle obj_handle,
78 status = 79 status =
79 acpi_ns_dump_one_object(obj_handle, level, context, return_value); 80 acpi_ns_dump_one_object(obj_handle, level, context, return_value);
80 81
81 status = acpi_get_object_info(obj_handle, &info); 82 buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER;
83 status = acpi_get_object_info(obj_handle, &buffer);
82 if (ACPI_SUCCESS(status)) { 84 if (ACPI_SUCCESS(status)) {
85 info = buffer.pointer;
83 for (i = 0; i < level; i++) { 86 for (i = 0; i < level; i++) {
84 ACPI_DEBUG_PRINT_RAW((ACPI_DB_TABLES, " ")); 87 ACPI_DEBUG_PRINT_RAW((ACPI_DB_TABLES, " "));
85 } 88 }
86 89
87 ACPI_DEBUG_PRINT_RAW((ACPI_DB_TABLES, 90 ACPI_DEBUG_PRINT_RAW((ACPI_DB_TABLES,
88 " HID: %s, ADR: %8.8X%8.8X, Status: %X\n", 91 " HID: %s, ADR: %8.8X%8.8X, Status: %X\n",
89 info->hardware_id.string, 92 info->hardware_id.value,
90 ACPI_FORMAT_UINT64(info->address), 93 ACPI_FORMAT_UINT64(info->address),
91 info->current_status)); 94 info->current_status));
92 ACPI_FREE(info); 95 ACPI_FREE(info);
diff --git a/drivers/acpi/acpica/nseval.c b/drivers/acpi/acpica/nseval.c
index 18108bc2e51c..963ceef063f8 100644
--- a/drivers/acpi/acpica/nseval.c
+++ b/drivers/acpi/acpica/nseval.c
@@ -314,7 +314,7 @@ acpi_status acpi_ns_evaluate(struct acpi_evaluate_info *info)
314 "*** Completed evaluation of object %s ***\n", 314 "*** Completed evaluation of object %s ***\n",
315 info->relative_pathname)); 315 info->relative_pathname));
316 316
317 cleanup: 317cleanup:
318 /* 318 /*
319 * Namespace was unlocked by the handling acpi_ns* function, so we 319 * Namespace was unlocked by the handling acpi_ns* function, so we
320 * just free the pathname and return 320 * just free the pathname and return
@@ -486,7 +486,7 @@ acpi_ns_exec_module_code(union acpi_operand_object *method_obj,
486 parent_node->type = (u8)type; 486 parent_node->type = (u8)type;
487 } 487 }
488 488
489 exit: 489exit:
490 if (parent_obj) { 490 if (parent_obj) {
491 acpi_ut_remove_reference(parent_obj); 491 acpi_ut_remove_reference(parent_obj);
492 } 492 }
diff --git a/drivers/acpi/acpica/nsinit.c b/drivers/acpi/acpica/nsinit.c
index dd2ceae3f717..3a0423af968c 100644
--- a/drivers/acpi/acpica/nsinit.c
+++ b/drivers/acpi/acpica/nsinit.c
@@ -213,7 +213,7 @@ acpi_status acpi_ns_initialize_devices(void)
213 213
214 return_ACPI_STATUS(status); 214 return_ACPI_STATUS(status);
215 215
216 error_exit: 216error_exit:
217 ACPI_EXCEPTION((AE_INFO, status, "During device initialization")); 217 ACPI_EXCEPTION((AE_INFO, status, "During device initialization"));
218 return_ACPI_STATUS(status); 218 return_ACPI_STATUS(status);
219} 219}
diff --git a/drivers/acpi/acpica/nsload.c b/drivers/acpi/acpica/nsload.c
index 0a7badc3179f..89ec645e7730 100644
--- a/drivers/acpi/acpica/nsload.c
+++ b/drivers/acpi/acpica/nsload.c
@@ -114,7 +114,7 @@ acpi_ns_load_table(u32 table_index, struct acpi_namespace_node *node)
114 (void)acpi_tb_release_owner_id(table_index); 114 (void)acpi_tb_release_owner_id(table_index);
115 } 115 }
116 116
117 unlock: 117unlock:
118 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); 118 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
119 119
120 if (ACPI_FAILURE(status)) { 120 if (ACPI_FAILURE(status)) {
diff --git a/drivers/acpi/acpica/nsparse.c b/drivers/acpi/acpica/nsparse.c
index 35dde8151c0d..177857340271 100644
--- a/drivers/acpi/acpica/nsparse.c
+++ b/drivers/acpi/acpica/nsparse.c
@@ -140,7 +140,7 @@ acpi_ns_one_complete_parse(u32 pass_number,
140 pass_number)); 140 pass_number));
141 status = acpi_ps_parse_aml(walk_state); 141 status = acpi_ps_parse_aml(walk_state);
142 142
143 cleanup: 143cleanup:
144 acpi_ps_delete_parse_tree(parse_root); 144 acpi_ps_delete_parse_tree(parse_root);
145 return_ACPI_STATUS(status); 145 return_ACPI_STATUS(status);
146} 146}
diff --git a/drivers/acpi/acpica/nspredef.c b/drivers/acpi/acpica/nspredef.c
index 098e7666cbc9..d2855d9857c4 100644
--- a/drivers/acpi/acpica/nspredef.c
+++ b/drivers/acpi/acpica/nspredef.c
@@ -271,7 +271,7 @@ acpi_ns_check_object_type(struct acpi_evaluate_info *info,
271 return (AE_OK); /* Successful repair */ 271 return (AE_OK); /* Successful repair */
272 } 272 }
273 273
274 type_error_exit: 274type_error_exit:
275 275
276 /* Create a string with all expected types for this predefined object */ 276 /* Create a string with all expected types for this predefined object */
277 277
diff --git a/drivers/acpi/acpica/nsprepkg.c b/drivers/acpi/acpica/nsprepkg.c
index 6d55cef7916c..3d5391f9bcb5 100644
--- a/drivers/acpi/acpica/nsprepkg.c
+++ b/drivers/acpi/acpica/nsprepkg.c
@@ -330,7 +330,7 @@ acpi_ns_check_package(struct acpi_evaluate_info *info,
330 330
331 return (status); 331 return (status);
332 332
333 package_too_small: 333package_too_small:
334 334
335 /* Error exit for the case with an incorrect package count */ 335 /* Error exit for the case with an incorrect package count */
336 336
@@ -555,7 +555,7 @@ acpi_ns_check_package_list(struct acpi_evaluate_info *info,
555 555
556 return (AE_OK); 556 return (AE_OK);
557 557
558 package_too_small: 558package_too_small:
559 559
560 /* The sub-package count was smaller than required */ 560 /* The sub-package count was smaller than required */
561 561
diff --git a/drivers/acpi/acpica/nsrepair.c b/drivers/acpi/acpica/nsrepair.c
index f8e71ea60319..a05afff50eb9 100644
--- a/drivers/acpi/acpica/nsrepair.c
+++ b/drivers/acpi/acpica/nsrepair.c
@@ -263,7 +263,7 @@ acpi_ns_simple_repair(struct acpi_evaluate_info *info,
263 263
264 return (AE_AML_OPERAND_TYPE); 264 return (AE_AML_OPERAND_TYPE);
265 265
266 object_repaired: 266object_repaired:
267 267
268 /* Object was successfully repaired */ 268 /* Object was successfully repaired */
269 269
diff --git a/drivers/acpi/acpica/nsrepair2.c b/drivers/acpi/acpica/nsrepair2.c
index c84603ee83ae..6a25d320b169 100644
--- a/drivers/acpi/acpica/nsrepair2.c
+++ b/drivers/acpi/acpica/nsrepair2.c
@@ -478,7 +478,7 @@ acpi_ns_repair_CST(struct acpi_evaluate_info *info,
478 removing = TRUE; 478 removing = TRUE;
479 } 479 }
480 480
481 remove_element: 481remove_element:
482 if (removing) { 482 if (removing) {
483 acpi_ns_remove_element(return_object, i + 1); 483 acpi_ns_remove_element(return_object, i + 1);
484 outer_element_count--; 484 outer_element_count--;
diff --git a/drivers/acpi/acpica/nssearch.c b/drivers/acpi/acpica/nssearch.c
index 5d43efc53a61..47420faef073 100644
--- a/drivers/acpi/acpica/nssearch.c
+++ b/drivers/acpi/acpica/nssearch.c
@@ -381,7 +381,8 @@ acpi_ns_search_and_enter(u32 target_name,
381 381
382 /* Node is an object defined by an External() statement */ 382 /* Node is an object defined by an External() statement */
383 383
384 if (flags & ACPI_NS_EXTERNAL) { 384 if (flags & ACPI_NS_EXTERNAL ||
385 (walk_state && walk_state->opcode == AML_SCOPE_OP)) {
385 new_node->flags |= ANOBJ_IS_EXTERNAL; 386 new_node->flags |= ANOBJ_IS_EXTERNAL;
386 } 387 }
387#endif 388#endif
diff --git a/drivers/acpi/acpica/nsutils.c b/drivers/acpi/acpica/nsutils.c
index 08c0b5beec88..cc2fea94c5f0 100644
--- a/drivers/acpi/acpica/nsutils.c
+++ b/drivers/acpi/acpica/nsutils.c
@@ -722,7 +722,7 @@ acpi_ns_get_node(struct acpi_namespace_node *prefix_node,
722 722
723 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); 723 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
724 724
725 cleanup: 725cleanup:
726 ACPI_FREE(internal_path); 726 ACPI_FREE(internal_path);
727 return_ACPI_STATUS(status); 727 return_ACPI_STATUS(status);
728} 728}
diff --git a/drivers/acpi/acpica/nsxfeval.c b/drivers/acpi/acpica/nsxfeval.c
index b38b4b07f86e..e973e311f856 100644
--- a/drivers/acpi/acpica/nsxfeval.c
+++ b/drivers/acpi/acpica/nsxfeval.c
@@ -42,7 +42,8 @@
42 * POSSIBILITY OF SUCH DAMAGES. 42 * POSSIBILITY OF SUCH DAMAGES.
43 */ 43 */
44 44
45#include <linux/export.h> 45#define EXPORT_ACPI_INTERFACES
46
46#include <acpi/acpi.h> 47#include <acpi/acpi.h>
47#include "accommon.h" 48#include "accommon.h"
48#include "acnamesp.h" 49#include "acnamesp.h"
@@ -138,7 +139,7 @@ acpi_evaluate_object_typed(acpi_handle handle,
138 139
139 /* Caller used ACPI_ALLOCATE_BUFFER, free the return buffer */ 140 /* Caller used ACPI_ALLOCATE_BUFFER, free the return buffer */
140 141
141 ACPI_FREE(return_buffer->pointer); 142 ACPI_FREE_BUFFER(*return_buffer);
142 return_buffer->pointer = NULL; 143 return_buffer->pointer = NULL;
143 } 144 }
144 145
@@ -441,7 +442,7 @@ acpi_evaluate_object(acpi_handle handle,
441 acpi_ex_exit_interpreter(); 442 acpi_ex_exit_interpreter();
442 } 443 }
443 444
444 cleanup: 445cleanup:
445 446
446 /* Free the input parameter list (if we created one) */ 447 /* Free the input parameter list (if we created one) */
447 448
@@ -605,14 +606,22 @@ acpi_walk_namespace(acpi_object_type type,
605 goto unlock_and_exit; 606 goto unlock_and_exit;
606 } 607 }
607 608
609 /* Now we can validate the starting node */
610
611 if (!acpi_ns_validate_handle(start_object)) {
612 status = AE_BAD_PARAMETER;
613 goto unlock_and_exit2;
614 }
615
608 status = acpi_ns_walk_namespace(type, start_object, max_depth, 616 status = acpi_ns_walk_namespace(type, start_object, max_depth,
609 ACPI_NS_WALK_UNLOCK, 617 ACPI_NS_WALK_UNLOCK,
610 descending_callback, ascending_callback, 618 descending_callback, ascending_callback,
611 context, return_value); 619 context, return_value);
612 620
621unlock_and_exit2:
613 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); 622 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
614 623
615 unlock_and_exit: 624unlock_and_exit:
616 (void)acpi_ut_release_read_lock(&acpi_gbl_namespace_rw_lock); 625 (void)acpi_ut_release_read_lock(&acpi_gbl_namespace_rw_lock);
617 return_ACPI_STATUS(status); 626 return_ACPI_STATUS(status);
618} 627}
@@ -856,7 +865,7 @@ acpi_attach_data(acpi_handle obj_handle,
856 865
857 status = acpi_ns_attach_data(node, handler, data); 866 status = acpi_ns_attach_data(node, handler, data);
858 867
859 unlock_and_exit: 868unlock_and_exit:
860 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); 869 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
861 return (status); 870 return (status);
862} 871}
@@ -902,7 +911,7 @@ acpi_detach_data(acpi_handle obj_handle, acpi_object_handler handler)
902 911
903 status = acpi_ns_detach_data(node, handler); 912 status = acpi_ns_detach_data(node, handler);
904 913
905 unlock_and_exit: 914unlock_and_exit:
906 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); 915 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
907 return (status); 916 return (status);
908} 917}
@@ -949,7 +958,7 @@ acpi_get_data(acpi_handle obj_handle, acpi_object_handler handler, void **data)
949 958
950 status = acpi_ns_get_attached_data(node, handler, data); 959 status = acpi_ns_get_attached_data(node, handler, data);
951 960
952 unlock_and_exit: 961unlock_and_exit:
953 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); 962 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
954 return (status); 963 return (status);
955} 964}
diff --git a/drivers/acpi/acpica/nsxfname.c b/drivers/acpi/acpica/nsxfname.c
index 83c164434580..3a4bd3ff49a3 100644
--- a/drivers/acpi/acpica/nsxfname.c
+++ b/drivers/acpi/acpica/nsxfname.c
@@ -42,7 +42,8 @@
42 * POSSIBILITY OF SUCH DAMAGES. 42 * POSSIBILITY OF SUCH DAMAGES.
43 */ 43 */
44 44
45#include <linux/export.h> 45#define EXPORT_ACPI_INTERFACES
46
46#include <acpi/acpi.h> 47#include <acpi/acpi.h>
47#include "accommon.h" 48#include "accommon.h"
48#include "acnamesp.h" 49#include "acnamesp.h"
@@ -208,7 +209,7 @@ acpi_get_name(acpi_handle handle, u32 name_type, struct acpi_buffer * buffer)
208 ((char *)buffer->pointer)[ACPI_NAME_SIZE] = 0; 209 ((char *)buffer->pointer)[ACPI_NAME_SIZE] = 0;
209 status = AE_OK; 210 status = AE_OK;
210 211
211 unlock_and_exit: 212unlock_and_exit:
212 213
213 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); 214 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
214 return (status); 215 return (status);
@@ -496,7 +497,7 @@ acpi_get_object_info(acpi_handle handle,
496 *return_buffer = info; 497 *return_buffer = info;
497 status = AE_OK; 498 status = AE_OK;
498 499
499 cleanup: 500cleanup:
500 if (hid) { 501 if (hid) {
501 ACPI_FREE(hid); 502 ACPI_FREE(hid);
502 } 503 }
diff --git a/drivers/acpi/acpica/nsxfobj.c b/drivers/acpi/acpica/nsxfobj.c
index c0853ef294e4..0e6d79e462d4 100644
--- a/drivers/acpi/acpica/nsxfobj.c
+++ b/drivers/acpi/acpica/nsxfobj.c
@@ -42,7 +42,8 @@
42 * POSSIBILITY OF SUCH DAMAGES. 42 * POSSIBILITY OF SUCH DAMAGES.
43 */ 43 */
44 44
45#include <linux/export.h> 45#define EXPORT_ACPI_INTERFACES
46
46#include <acpi/acpi.h> 47#include <acpi/acpi.h>
47#include "accommon.h" 48#include "accommon.h"
48#include "acnamesp.h" 49#include "acnamesp.h"
@@ -200,7 +201,7 @@ acpi_status acpi_get_parent(acpi_handle handle, acpi_handle * ret_handle)
200 status = AE_NULL_ENTRY; 201 status = AE_NULL_ENTRY;
201 } 202 }
202 203
203 unlock_and_exit: 204unlock_and_exit:
204 205
205 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); 206 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
206 return (status); 207 return (status);
@@ -280,7 +281,7 @@ acpi_get_next_object(acpi_object_type type,
280 *ret_handle = ACPI_CAST_PTR(acpi_handle, node); 281 *ret_handle = ACPI_CAST_PTR(acpi_handle, node);
281 } 282 }
282 283
283 unlock_and_exit: 284unlock_and_exit:
284 285
285 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); 286 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
286 return (status); 287 return (status);
diff --git a/drivers/acpi/acpica/psparse.c b/drivers/acpi/acpica/psparse.c
index 86198a9139b5..79d9a28dedef 100644
--- a/drivers/acpi/acpica/psparse.c
+++ b/drivers/acpi/acpica/psparse.c
@@ -297,7 +297,7 @@ acpi_ps_complete_this_op(struct acpi_walk_state * walk_state,
297 } 297 }
298 } 298 }
299 299
300 cleanup: 300cleanup:
301 301
302 /* Now we can actually delete the subtree rooted at Op */ 302 /* Now we can actually delete the subtree rooted at Op */
303 303
diff --git a/drivers/acpi/acpica/psxface.c b/drivers/acpi/acpica/psxface.c
index 11b99ab20bb3..fcb7a840e996 100644
--- a/drivers/acpi/acpica/psxface.c
+++ b/drivers/acpi/acpica/psxface.c
@@ -142,7 +142,7 @@ static void acpi_ps_start_trace(struct acpi_evaluate_info *info)
142 acpi_dbg_layer = acpi_gbl_trace_dbg_layer; 142 acpi_dbg_layer = acpi_gbl_trace_dbg_layer;
143 } 143 }
144 144
145 exit: 145exit:
146 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); 146 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
147} 147}
148 148
@@ -185,7 +185,7 @@ static void acpi_ps_stop_trace(struct acpi_evaluate_info *info)
185 acpi_dbg_level = acpi_gbl_original_dbg_level; 185 acpi_dbg_level = acpi_gbl_original_dbg_level;
186 acpi_dbg_layer = acpi_gbl_original_dbg_layer; 186 acpi_dbg_layer = acpi_gbl_original_dbg_layer;
187 187
188 exit: 188exit:
189 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); 189 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
190} 190}
191 191
@@ -323,7 +323,7 @@ acpi_status acpi_ps_execute_method(struct acpi_evaluate_info *info)
323 323
324 /* walk_state was deleted by parse_aml */ 324 /* walk_state was deleted by parse_aml */
325 325
326 cleanup: 326cleanup:
327 acpi_ps_delete_parse_tree(op); 327 acpi_ps_delete_parse_tree(op);
328 328
329 /* End optional tracing */ 329 /* End optional tracing */
diff --git a/drivers/acpi/acpica/rsmisc.c b/drivers/acpi/acpica/rsmisc.c
index 80d12994e0d0..c99cec9cefde 100644
--- a/drivers/acpi/acpica/rsmisc.c
+++ b/drivers/acpi/acpica/rsmisc.c
@@ -440,7 +440,7 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
440 info++; 440 info++;
441 } 441 }
442 442
443 exit: 443exit:
444 if (!flags_mode) { 444 if (!flags_mode) {
445 445
446 /* Round the resource struct length up to the next boundary (32 or 64) */ 446 /* Round the resource struct length up to the next boundary (32 or 64) */
@@ -783,7 +783,7 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource,
783 info++; 783 info++;
784 } 784 }
785 785
786 exit: 786exit:
787 return_ACPI_STATUS(AE_OK); 787 return_ACPI_STATUS(AE_OK);
788} 788}
789 789
diff --git a/drivers/acpi/acpica/rsutils.c b/drivers/acpi/acpica/rsutils.c
index 480b6b40c5ea..aef303d56d86 100644
--- a/drivers/acpi/acpica/rsutils.c
+++ b/drivers/acpi/acpica/rsutils.c
@@ -784,7 +784,7 @@ acpi_rs_set_srs_method_data(struct acpi_namespace_node *node,
784 784
785 acpi_ut_remove_reference(args[0]); 785 acpi_ut_remove_reference(args[0]);
786 786
787 cleanup: 787cleanup:
788 ACPI_FREE(info); 788 ACPI_FREE(info);
789 return_ACPI_STATUS(status); 789 return_ACPI_STATUS(status);
790} 790}
diff --git a/drivers/acpi/acpica/rsxface.c b/drivers/acpi/acpica/rsxface.c
index 94e3517554f9..01e476988aae 100644
--- a/drivers/acpi/acpica/rsxface.c
+++ b/drivers/acpi/acpica/rsxface.c
@@ -41,7 +41,8 @@
41 * POSSIBILITY OF SUCH DAMAGES. 41 * POSSIBILITY OF SUCH DAMAGES.
42 */ 42 */
43 43
44#include <linux/export.h> 44#define EXPORT_ACPI_INTERFACES
45
45#include <acpi/acpi.h> 46#include <acpi/acpi.h>
46#include "accommon.h" 47#include "accommon.h"
47#include "acresrc.h" 48#include "acresrc.h"
diff --git a/drivers/acpi/acpica/tbinstal.c b/drivers/acpi/acpica/tbinstal.c
index 42a13c0d7015..634357d51fe9 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}
@@ -237,10 +231,10 @@ acpi_tb_add_table(struct acpi_table_desc *table_desc, u32 *table_index)
237 goto release; 231 goto release;
238 } 232 }
239 233
240 print_header: 234print_header:
241 acpi_tb_print_table_header(table_desc->address, table_desc->pointer); 235 acpi_tb_print_table_header(table_desc->address, table_desc->pointer);
242 236
243 release: 237release:
244 (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); 238 (void)acpi_ut_release_mutex(ACPI_MTX_TABLES);
245 return_ACPI_STATUS(status); 239 return_ACPI_STATUS(status);
246} 240}
@@ -312,7 +306,7 @@ struct acpi_table_header *acpi_tb_table_override(struct acpi_table_header
312 306
313 return (NULL); /* There was no override */ 307 return (NULL); /* There was no override */
314 308
315 finish_override: 309finish_override:
316 310
317 ACPI_INFO((AE_INFO, 311 ACPI_INFO((AE_INFO,
318 "%4.4s %p %s table override, new table: %p", 312 "%4.4s %p %s table override, new table: %p",
diff --git a/drivers/acpi/acpica/tbprint.c b/drivers/acpi/acpica/tbprint.c
index dc963f823d2c..6866e767ba90 100644
--- a/drivers/acpi/acpica/tbprint.c
+++ b/drivers/acpi/acpica/tbprint.c
@@ -135,10 +135,10 @@ acpi_tb_print_table_header(acpi_physical_address address,
135 135
136 /* FACS only has signature and length fields */ 136 /* FACS only has signature and length fields */
137 137
138 ACPI_INFO((AE_INFO, "%4.4s %p %05X", 138 ACPI_INFO((AE_INFO, "%4.4s %p %06X",
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
@@ -147,7 +147,7 @@ acpi_tb_print_table_header(acpi_physical_address address,
147 header)->oem_id, ACPI_OEM_ID_SIZE); 147 header)->oem_id, ACPI_OEM_ID_SIZE);
148 acpi_tb_fix_string(local_header.oem_id, ACPI_OEM_ID_SIZE); 148 acpi_tb_fix_string(local_header.oem_id, ACPI_OEM_ID_SIZE);
149 149
150 ACPI_INFO((AE_INFO, "RSDP %p %05X (v%.2d %6.6s)", 150 ACPI_INFO((AE_INFO, "RSDP %p %06X (v%.2d %6.6s)",
151 ACPI_CAST_PTR(void, address), 151 ACPI_CAST_PTR(void, address),
152 (ACPI_CAST_PTR(struct acpi_table_rsdp, header)-> 152 (ACPI_CAST_PTR(struct acpi_table_rsdp, header)->
153 revision > 153 revision >
@@ -162,7 +162,7 @@ acpi_tb_print_table_header(acpi_physical_address address,
162 acpi_tb_cleanup_table_header(&local_header, header); 162 acpi_tb_cleanup_table_header(&local_header, header);
163 163
164 ACPI_INFO((AE_INFO, 164 ACPI_INFO((AE_INFO,
165 "%4.4s %p %05X (v%.2d %6.6s %8.8s %08X %4.4s %08X)", 165 "%4.4s %p %06X (v%.2d %6.6s %8.8s %08X %4.4s %08X)",
166 local_header.signature, ACPI_CAST_PTR(void, address), 166 local_header.signature, ACPI_CAST_PTR(void, address),
167 local_header.length, local_header.revision, 167 local_header.length, local_header.revision,
168 local_header.oem_id, local_header.oem_table_id, 168 local_header.oem_id, local_header.oem_table_id,
@@ -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/tbutils.c b/drivers/acpi/acpica/tbutils.c
index bffdfc7b8322..3d6bb83aa7e7 100644
--- a/drivers/acpi/acpica/tbutils.c
+++ b/drivers/acpi/acpica/tbutils.c
@@ -350,7 +350,7 @@ acpi_tb_install_table(acpi_physical_address address,
350 acpi_tb_delete_table(table_desc); 350 acpi_tb_delete_table(table_desc);
351 } 351 }
352 352
353 unmap_and_exit: 353unmap_and_exit:
354 354
355 /* Always unmap the table header that we mapped above */ 355 /* Always unmap the table header that we mapped above */
356 356
@@ -430,8 +430,7 @@ acpi_tb_get_root_table_entry(u8 *table_entry, u32 table_entry_size)
430 * 430 *
431 ******************************************************************************/ 431 ******************************************************************************/
432 432
433acpi_status __init 433acpi_status __init acpi_tb_parse_root_table(acpi_physical_address rsdp_address)
434acpi_tb_parse_root_table(acpi_physical_address rsdp_address)
435{ 434{
436 struct acpi_table_rsdp *rsdp; 435 struct acpi_table_rsdp *rsdp;
437 u32 table_entry_size; 436 u32 table_entry_size;
diff --git a/drivers/acpi/acpica/tbxface.c b/drivers/acpi/acpica/tbxface.c
index ad11162482ff..db826eaadd1c 100644
--- a/drivers/acpi/acpica/tbxface.c
+++ b/drivers/acpi/acpica/tbxface.c
@@ -41,7 +41,8 @@
41 * POSSIBILITY OF SUCH DAMAGES. 41 * POSSIBILITY OF SUCH DAMAGES.
42 */ 42 */
43 43
44#include <linux/export.h> 44#define EXPORT_ACPI_INTERFACES
45
45#include <acpi/acpi.h> 46#include <acpi/acpi.h>
46#include "accommon.h" 47#include "accommon.h"
47#include "actables.h" 48#include "actables.h"
@@ -147,6 +148,8 @@ acpi_initialize_tables(struct acpi_table_desc * initial_table_array,
147 return_ACPI_STATUS(status); 148 return_ACPI_STATUS(status);
148} 149}
149 150
151ACPI_EXPORT_SYMBOL_INIT(acpi_initialize_tables)
152
150/******************************************************************************* 153/*******************************************************************************
151 * 154 *
152 * FUNCTION: acpi_reallocate_root_table 155 * FUNCTION: acpi_reallocate_root_table
@@ -161,7 +164,7 @@ acpi_initialize_tables(struct acpi_table_desc * initial_table_array,
161 * kernel. 164 * kernel.
162 * 165 *
163 ******************************************************************************/ 166 ******************************************************************************/
164acpi_status acpi_reallocate_root_table(void) 167acpi_status __init acpi_reallocate_root_table(void)
165{ 168{
166 acpi_status status; 169 acpi_status status;
167 170
@@ -181,6 +184,8 @@ acpi_status acpi_reallocate_root_table(void)
181 return_ACPI_STATUS(status); 184 return_ACPI_STATUS(status);
182} 185}
183 186
187ACPI_EXPORT_SYMBOL_INIT(acpi_reallocate_root_table)
188
184/******************************************************************************* 189/*******************************************************************************
185 * 190 *
186 * FUNCTION: acpi_get_table_header 191 * FUNCTION: acpi_get_table_header
@@ -356,6 +361,7 @@ acpi_get_table_with_size(char *signature,
356 361
357 return (AE_NOT_FOUND); 362 return (AE_NOT_FOUND);
358} 363}
364
359ACPI_EXPORT_SYMBOL(acpi_get_table_with_size) 365ACPI_EXPORT_SYMBOL(acpi_get_table_with_size)
360 366
361acpi_status 367acpi_status
@@ -367,6 +373,7 @@ acpi_get_table(char *signature,
367 return acpi_get_table_with_size(signature, 373 return acpi_get_table_with_size(signature,
368 instance, out_table, &tbl_size); 374 instance, out_table, &tbl_size);
369} 375}
376
370ACPI_EXPORT_SYMBOL(acpi_get_table) 377ACPI_EXPORT_SYMBOL(acpi_get_table)
371 378
372/******************************************************************************* 379/*******************************************************************************
@@ -424,7 +431,6 @@ acpi_get_table_by_index(u32 table_index, struct acpi_table_header **table)
424 431
425ACPI_EXPORT_SYMBOL(acpi_get_table_by_index) 432ACPI_EXPORT_SYMBOL(acpi_get_table_by_index)
426 433
427
428/******************************************************************************* 434/*******************************************************************************
429 * 435 *
430 * FUNCTION: acpi_install_table_handler 436 * FUNCTION: acpi_install_table_handler
@@ -465,7 +471,7 @@ acpi_install_table_handler(acpi_table_handler handler, void *context)
465 acpi_gbl_table_handler = handler; 471 acpi_gbl_table_handler = handler;
466 acpi_gbl_table_handler_context = context; 472 acpi_gbl_table_handler_context = context;
467 473
468 cleanup: 474cleanup:
469 (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS); 475 (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
470 return_ACPI_STATUS(status); 476 return_ACPI_STATUS(status);
471} 477}
@@ -506,7 +512,7 @@ acpi_status acpi_remove_table_handler(acpi_table_handler handler)
506 512
507 acpi_gbl_table_handler = NULL; 513 acpi_gbl_table_handler = NULL;
508 514
509 cleanup: 515cleanup:
510 (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS); 516 (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
511 return_ACPI_STATUS(status); 517 return_ACPI_STATUS(status);
512} 518}
diff --git a/drivers/acpi/acpica/tbxfload.c b/drivers/acpi/acpica/tbxfload.c
index 0ba9e328d5d7..60b5a871833c 100644
--- a/drivers/acpi/acpica/tbxfload.c
+++ b/drivers/acpi/acpica/tbxfload.c
@@ -41,7 +41,8 @@
41 * POSSIBILITY OF SUCH DAMAGES. 41 * POSSIBILITY OF SUCH DAMAGES.
42 */ 42 */
43 43
44#include <linux/export.h> 44#define EXPORT_ACPI_INTERFACES
45
45#include <acpi/acpi.h> 46#include <acpi/acpi.h>
46#include "accommon.h" 47#include "accommon.h"
47#include "acnamesp.h" 48#include "acnamesp.h"
@@ -65,7 +66,7 @@ static acpi_status acpi_tb_load_namespace(void);
65 * 66 *
66 ******************************************************************************/ 67 ******************************************************************************/
67 68
68acpi_status acpi_load_tables(void) 69acpi_status __init acpi_load_tables(void)
69{ 70{
70 acpi_status status; 71 acpi_status status;
71 72
@@ -82,7 +83,7 @@ acpi_status acpi_load_tables(void)
82 return_ACPI_STATUS(status); 83 return_ACPI_STATUS(status);
83} 84}
84 85
85ACPI_EXPORT_SYMBOL(acpi_load_tables) 86ACPI_EXPORT_SYMBOL_INIT(acpi_load_tables)
86 87
87/******************************************************************************* 88/*******************************************************************************
88 * 89 *
@@ -200,7 +201,7 @@ static acpi_status acpi_tb_load_namespace(void)
200 201
201 ACPI_INFO((AE_INFO, "All ACPI Tables successfully acquired")); 202 ACPI_INFO((AE_INFO, "All ACPI Tables successfully acquired"));
202 203
203 unlock_and_exit: 204unlock_and_exit:
204 (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); 205 (void)acpi_ut_release_mutex(ACPI_MTX_TABLES);
205 return_ACPI_STATUS(status); 206 return_ACPI_STATUS(status);
206} 207}
@@ -268,7 +269,7 @@ acpi_status acpi_load_table(struct acpi_table_header *table)
268 acpi_gbl_table_handler_context); 269 acpi_gbl_table_handler_context);
269 } 270 }
270 271
271 unlock_and_exit: 272unlock_and_exit:
272 (void)acpi_ut_release_mutex(ACPI_MTX_INTERPRETER); 273 (void)acpi_ut_release_mutex(ACPI_MTX_INTERPRETER);
273 return_ACPI_STATUS(status); 274 return_ACPI_STATUS(status);
274} 275}
diff --git a/drivers/acpi/acpica/tbxfroot.c b/drivers/acpi/acpica/tbxfroot.c
index 948c95e80d44..e4e1468877c3 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
@@ -112,7 +111,7 @@ acpi_status acpi_tb_validate_rsdp(struct acpi_table_rsdp *rsdp)
112 * 111 *
113 ******************************************************************************/ 112 ******************************************************************************/
114 113
115acpi_status acpi_find_root_pointer(acpi_size *table_address) 114acpi_status __init acpi_find_root_pointer(acpi_size *table_address)
116{ 115{
117 u8 *table_ptr; 116 u8 *table_ptr;
118 u8 *mem_rover; 117 u8 *mem_rover;
diff --git a/drivers/acpi/acpica/utalloc.c b/drivers/acpi/acpica/utalloc.c
index e0ffb580f4b0..814267f52715 100644
--- a/drivers/acpi/acpica/utalloc.c
+++ b/drivers/acpi/acpica/utalloc.c
@@ -48,6 +48,39 @@
48#define _COMPONENT ACPI_UTILITIES 48#define _COMPONENT ACPI_UTILITIES
49ACPI_MODULE_NAME("utalloc") 49ACPI_MODULE_NAME("utalloc")
50 50
51#if !defined (USE_NATIVE_ALLOCATE_ZEROED)
52/*******************************************************************************
53 *
54 * FUNCTION: acpi_os_allocate_zeroed
55 *
56 * PARAMETERS: size - Size of the allocation
57 *
58 * RETURN: Address of the allocated memory on success, NULL on failure.
59 *
60 * DESCRIPTION: Subsystem equivalent of calloc. Allocate and zero memory.
61 * This is the default implementation. Can be overridden via the
62 * USE_NATIVE_ALLOCATE_ZEROED flag.
63 *
64 ******************************************************************************/
65void *acpi_os_allocate_zeroed(acpi_size size)
66{
67 void *allocation;
68
69 ACPI_FUNCTION_ENTRY();
70
71 allocation = acpi_os_allocate(size);
72 if (allocation) {
73
74 /* Clear the memory block */
75
76 ACPI_MEMSET(allocation, 0, size);
77 }
78
79 return (allocation);
80}
81
82#endif /* !USE_NATIVE_ALLOCATE_ZEROED */
83
51/******************************************************************************* 84/*******************************************************************************
52 * 85 *
53 * FUNCTION: acpi_ut_create_caches 86 * FUNCTION: acpi_ut_create_caches
@@ -59,6 +92,7 @@ ACPI_MODULE_NAME("utalloc")
59 * DESCRIPTION: Create all local caches 92 * DESCRIPTION: Create all local caches
60 * 93 *
61 ******************************************************************************/ 94 ******************************************************************************/
95
62acpi_status acpi_ut_create_caches(void) 96acpi_status acpi_ut_create_caches(void)
63{ 97{
64 acpi_status status; 98 acpi_status status;
@@ -175,10 +209,10 @@ acpi_status acpi_ut_delete_caches(void)
175 209
176 /* Free memory lists */ 210 /* Free memory lists */
177 211
178 ACPI_FREE(acpi_gbl_global_list); 212 acpi_os_free(acpi_gbl_global_list);
179 acpi_gbl_global_list = NULL; 213 acpi_gbl_global_list = NULL;
180 214
181 ACPI_FREE(acpi_gbl_ns_node_list); 215 acpi_os_free(acpi_gbl_ns_node_list);
182 acpi_gbl_ns_node_list = NULL; 216 acpi_gbl_ns_node_list = NULL;
183#endif 217#endif
184 218
@@ -302,82 +336,3 @@ acpi_ut_initialize_buffer(struct acpi_buffer * buffer,
302 ACPI_MEMSET(buffer->pointer, 0, required_length); 336 ACPI_MEMSET(buffer->pointer, 0, required_length);
303 return (AE_OK); 337 return (AE_OK);
304} 338}
305
306#ifdef NOT_USED_BY_LINUX
307/*******************************************************************************
308 *
309 * FUNCTION: acpi_ut_allocate
310 *
311 * PARAMETERS: size - Size of the allocation
312 * component - Component type of caller
313 * module - Source file name of caller
314 * line - Line number of caller
315 *
316 * RETURN: Address of the allocated memory on success, NULL on failure.
317 *
318 * DESCRIPTION: Subsystem equivalent of malloc.
319 *
320 ******************************************************************************/
321
322void *acpi_ut_allocate(acpi_size size,
323 u32 component, const char *module, u32 line)
324{
325 void *allocation;
326
327 ACPI_FUNCTION_TRACE_U32(ut_allocate, size);
328
329 /* Check for an inadvertent size of zero bytes */
330
331 if (!size) {
332 ACPI_WARNING((module, line,
333 "Attempt to allocate zero bytes, allocating 1 byte"));
334 size = 1;
335 }
336
337 allocation = acpi_os_allocate(size);
338 if (!allocation) {
339
340 /* Report allocation error */
341
342 ACPI_WARNING((module, line,
343 "Could not allocate size %u", (u32) size));
344
345 return_PTR(NULL);
346 }
347
348 return_PTR(allocation);
349}
350
351/*******************************************************************************
352 *
353 * FUNCTION: acpi_ut_allocate_zeroed
354 *
355 * PARAMETERS: size - Size of the allocation
356 * component - Component type of caller
357 * module - Source file name of caller
358 * line - Line number of caller
359 *
360 * RETURN: Address of the allocated memory on success, NULL on failure.
361 *
362 * DESCRIPTION: Subsystem equivalent of calloc. Allocate and zero memory.
363 *
364 ******************************************************************************/
365
366void *acpi_ut_allocate_zeroed(acpi_size size,
367 u32 component, const char *module, u32 line)
368{
369 void *allocation;
370
371 ACPI_FUNCTION_ENTRY();
372
373 allocation = acpi_ut_allocate(size, component, module, line);
374 if (allocation) {
375
376 /* Clear the memory block */
377
378 ACPI_MEMSET(allocation, 0, size);
379 }
380
381 return (allocation);
382}
383#endif
diff --git a/drivers/acpi/acpica/utcache.c b/drivers/acpi/acpica/utcache.c
index a877a9647fd9..366bfec4b770 100644
--- a/drivers/acpi/acpica/utcache.c
+++ b/drivers/acpi/acpica/utcache.c
@@ -65,7 +65,7 @@ ACPI_MODULE_NAME("utcache")
65acpi_status 65acpi_status
66acpi_os_create_cache(char *cache_name, 66acpi_os_create_cache(char *cache_name,
67 u16 object_size, 67 u16 object_size,
68 u16 max_depth, struct acpi_memory_list ** return_cache) 68 u16 max_depth, struct acpi_memory_list **return_cache)
69{ 69{
70 struct acpi_memory_list *cache; 70 struct acpi_memory_list *cache;
71 71
diff --git a/drivers/acpi/acpica/utcopy.c b/drivers/acpi/acpica/utcopy.c
index 1731c27c36a6..edff4e653d9a 100644
--- a/drivers/acpi/acpica/utcopy.c
+++ b/drivers/acpi/acpica/utcopy.c
@@ -552,7 +552,7 @@ acpi_ut_copy_esimple_to_isimple(union acpi_object *external_object,
552 *ret_internal_object = internal_object; 552 *ret_internal_object = internal_object;
553 return_ACPI_STATUS(AE_OK); 553 return_ACPI_STATUS(AE_OK);
554 554
555 error_exit: 555error_exit:
556 acpi_ut_remove_reference(internal_object); 556 acpi_ut_remove_reference(internal_object);
557 return_ACPI_STATUS(AE_NO_MEMORY); 557 return_ACPI_STATUS(AE_NO_MEMORY);
558} 558}
@@ -899,7 +899,7 @@ acpi_ut_copy_ielement_to_ielement(u8 object_type,
899 899
900 return (status); 900 return (status);
901 901
902 error_exit: 902error_exit:
903 acpi_ut_remove_reference(target_object); 903 acpi_ut_remove_reference(target_object);
904 return (status); 904 return (status);
905} 905}
diff --git a/drivers/acpi/acpica/utdebug.c b/drivers/acpi/acpica/utdebug.c
index 5796e11a0671..1a67b3944b3b 100644
--- a/drivers/acpi/acpica/utdebug.c
+++ b/drivers/acpi/acpica/utdebug.c
@@ -41,7 +41,8 @@
41 * POSSIBILITY OF SUCH DAMAGES. 41 * POSSIBILITY OF SUCH DAMAGES.
42 */ 42 */
43 43
44#include <linux/export.h> 44#define EXPORT_ACPI_INTERFACES
45
45#include <acpi/acpi.h> 46#include <acpi/acpi.h>
46#include "accommon.h" 47#include "accommon.h"
47 48
@@ -190,7 +191,7 @@ acpi_debug_print(u32 requested_debug_level,
190 * Display the module name, current line number, thread ID (if requested), 191 * Display the module name, current line number, thread ID (if requested),
191 * current procedure nesting level, and the current procedure name 192 * current procedure nesting level, and the current procedure name
192 */ 193 */
193 acpi_os_printf("%8s-%04ld ", module_name, line_number); 194 acpi_os_printf("%9s-%04ld ", module_name, line_number);
194 195
195 if (ACPI_LV_THREADS & acpi_dbg_level) { 196 if (ACPI_LV_THREADS & acpi_dbg_level) {
196 acpi_os_printf("[%u] ", (u32)thread_id); 197 acpi_os_printf("[%u] ", (u32)thread_id);
diff --git a/drivers/acpi/acpica/utdecode.c b/drivers/acpi/acpica/utdecode.c
index 11e2e02e1618..b3f31dd89a45 100644
--- a/drivers/acpi/acpica/utdecode.c
+++ b/drivers/acpi/acpica/utdecode.c
@@ -41,7 +41,6 @@
41 * POSSIBILITY OF SUCH DAMAGES. 41 * POSSIBILITY OF SUCH DAMAGES.
42 */ 42 */
43 43
44#include <linux/export.h>
45#include <acpi/acpi.h> 44#include <acpi/acpi.h>
46#include "accommon.h" 45#include "accommon.h"
47#include "acnamesp.h" 46#include "acnamesp.h"
diff --git a/drivers/acpi/acpica/utdelete.c b/drivers/acpi/acpica/utdelete.c
index d6b33f29d327..c07d2227ea42 100644
--- a/drivers/acpi/acpica/utdelete.c
+++ b/drivers/acpi/acpica/utdelete.c
@@ -649,7 +649,7 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action)
649 649
650 return (AE_OK); 650 return (AE_OK);
651 651
652 error_exit: 652error_exit:
653 653
654 ACPI_EXCEPTION((AE_INFO, status, 654 ACPI_EXCEPTION((AE_INFO, status,
655 "Could not update object reference count")); 655 "Could not update object reference count"));
diff --git a/drivers/acpi/acpica/uteval.c b/drivers/acpi/acpica/uteval.c
index 4fd68971019b..16fb90506db7 100644
--- a/drivers/acpi/acpica/uteval.c
+++ b/drivers/acpi/acpica/uteval.c
@@ -181,7 +181,7 @@ acpi_ut_evaluate_object(struct acpi_namespace_node *prefix_node,
181 181
182 *return_desc = info->return_object; 182 *return_desc = info->return_object;
183 183
184 cleanup: 184cleanup:
185 ACPI_FREE(info); 185 ACPI_FREE(info);
186 return_ACPI_STATUS(status); 186 return_ACPI_STATUS(status);
187} 187}
diff --git a/drivers/acpi/acpica/utexcep.c b/drivers/acpi/acpica/utexcep.c
index ff6d9e8aa842..3cf7b597edb9 100644
--- a/drivers/acpi/acpica/utexcep.c
+++ b/drivers/acpi/acpica/utexcep.c
@@ -41,8 +41,9 @@
41 * POSSIBILITY OF SUCH DAMAGES. 41 * POSSIBILITY OF SUCH DAMAGES.
42 */ 42 */
43 43
44#define EXPORT_ACPI_INTERFACES
45
44#define ACPI_DEFINE_EXCEPTION_TABLE 46#define ACPI_DEFINE_EXCEPTION_TABLE
45#include <linux/export.h>
46#include <acpi/acpi.h> 47#include <acpi/acpi.h>
47#include "accommon.h" 48#include "accommon.h"
48 49
diff --git a/drivers/acpi/acpica/utglobal.c b/drivers/acpi/acpica/utglobal.c
index d6f26bf8a062..81f9a9584451 100644
--- a/drivers/acpi/acpica/utglobal.c
+++ b/drivers/acpi/acpica/utglobal.c
@@ -41,9 +41,9 @@
41 * POSSIBILITY OF SUCH DAMAGES. 41 * POSSIBILITY OF SUCH DAMAGES.
42 */ 42 */
43 43
44#define EXPORT_ACPI_INTERFACES
44#define DEFINE_ACPI_GLOBALS 45#define DEFINE_ACPI_GLOBALS
45 46
46#include <linux/export.h>
47#include <acpi/acpi.h> 47#include <acpi/acpi.h>
48#include "accommon.h" 48#include "accommon.h"
49 49
@@ -289,9 +289,19 @@ acpi_status acpi_ut_init_globals(void)
289 289
290 acpi_gbl_owner_id_mask[ACPI_NUM_OWNERID_MASKS - 1] = 0x80000000; 290 acpi_gbl_owner_id_mask[ACPI_NUM_OWNERID_MASKS - 1] = 0x80000000;
291 291
292 /* Event counters */
293
294 acpi_method_count = 0;
295 acpi_sci_count = 0;
296 acpi_gpe_count = 0;
297
298 for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++) {
299 acpi_fixed_event_count[i] = 0;
300 }
301
292#if (!ACPI_REDUCED_HARDWARE) 302#if (!ACPI_REDUCED_HARDWARE)
293 303
294 /* GPE support */ 304 /* GPE/SCI support */
295 305
296 acpi_gbl_all_gpes_initialized = FALSE; 306 acpi_gbl_all_gpes_initialized = FALSE;
297 acpi_gbl_gpe_xrupt_list_head = NULL; 307 acpi_gbl_gpe_xrupt_list_head = NULL;
@@ -300,6 +310,7 @@ acpi_status acpi_ut_init_globals(void)
300 acpi_current_gpe_count = 0; 310 acpi_current_gpe_count = 0;
301 311
302 acpi_gbl_global_event_handler = NULL; 312 acpi_gbl_global_event_handler = NULL;
313 acpi_gbl_sci_handler_list = NULL;
303 314
304#endif /* !ACPI_REDUCED_HARDWARE */ 315#endif /* !ACPI_REDUCED_HARDWARE */
305 316
@@ -377,6 +388,11 @@ acpi_status acpi_ut_init_globals(void)
377/* Public globals */ 388/* Public globals */
378 389
379ACPI_EXPORT_SYMBOL(acpi_gbl_FADT) 390ACPI_EXPORT_SYMBOL(acpi_gbl_FADT)
391
380ACPI_EXPORT_SYMBOL(acpi_dbg_level) 392ACPI_EXPORT_SYMBOL(acpi_dbg_level)
393
381ACPI_EXPORT_SYMBOL(acpi_dbg_layer) 394ACPI_EXPORT_SYMBOL(acpi_dbg_layer)
395
396ACPI_EXPORT_SYMBOL(acpi_gpe_count)
397
382ACPI_EXPORT_SYMBOL(acpi_current_gpe_count) 398ACPI_EXPORT_SYMBOL(acpi_current_gpe_count)
diff --git a/drivers/acpi/acpica/utids.c b/drivers/acpi/acpica/utids.c
index fa69071db418..bfca7b4b6731 100644
--- a/drivers/acpi/acpica/utids.c
+++ b/drivers/acpi/acpica/utids.c
@@ -184,7 +184,7 @@ acpi_ut_execute_SUB(struct acpi_namespace_node *device_node,
184 sub->length = length; 184 sub->length = length;
185 *return_id = sub; 185 *return_id = sub;
186 186
187 cleanup: 187cleanup:
188 188
189 /* On exit, we must delete the return object */ 189 /* On exit, we must delete the return object */
190 190
diff --git a/drivers/acpi/acpica/utobject.c b/drivers/acpi/acpica/utobject.c
index aa61f66ee861..13e045025c33 100644
--- a/drivers/acpi/acpica/utobject.c
+++ b/drivers/acpi/acpica/utobject.c
@@ -180,7 +180,7 @@ union acpi_operand_object *acpi_ut_create_package_object(u32 count)
180 package_elements = ACPI_ALLOCATE_ZEROED(((acpi_size) count + 180 package_elements = ACPI_ALLOCATE_ZEROED(((acpi_size) count +
181 1) * sizeof(void *)); 181 1) * sizeof(void *));
182 if (!package_elements) { 182 if (!package_elements) {
183 acpi_ut_remove_reference(package_desc); 183 ACPI_FREE(package_desc);
184 return_PTR(NULL); 184 return_PTR(NULL);
185 } 185 }
186 186
@@ -396,7 +396,6 @@ void *acpi_ut_allocate_object_desc_dbg(const char *module_name,
396 396
397 /* Mark the descriptor type */ 397 /* Mark the descriptor type */
398 398
399 memset(object, 0, sizeof(union acpi_operand_object));
400 ACPI_SET_DESCRIPTOR_TYPE(object, ACPI_DESC_TYPE_OPERAND); 399 ACPI_SET_DESCRIPTOR_TYPE(object, ACPI_DESC_TYPE_OPERAND);
401 400
402 ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, "%p Size %X\n", 401 ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, "%p Size %X\n",
@@ -461,25 +460,28 @@ acpi_ut_get_simple_object_size(union acpi_operand_object *internal_object,
461 460
462 ACPI_FUNCTION_TRACE_PTR(ut_get_simple_object_size, internal_object); 461 ACPI_FUNCTION_TRACE_PTR(ut_get_simple_object_size, internal_object);
463 462
463 /* Start with the length of the (external) Acpi object */
464
465 length = sizeof(union acpi_object);
466
467 /* A NULL object is allowed, can be a legal uninitialized package element */
468
469 if (!internal_object) {
464 /* 470 /*
465 * Handle a null object (Could be a uninitialized package 471 * Object is NULL, just return the length of union acpi_object
466 * element -- which is legal) 472 * (A NULL union acpi_object is an object of all zeroes.)
467 */ 473 */
468 if (!internal_object) { 474 *obj_length = ACPI_ROUND_UP_TO_NATIVE_WORD(length);
469 *obj_length = sizeof(union acpi_object);
470 return_ACPI_STATUS(AE_OK); 475 return_ACPI_STATUS(AE_OK);
471 } 476 }
472 477
473 /* Start with the length of the Acpi object */ 478 /* A Namespace Node should never appear here */
474
475 length = sizeof(union acpi_object);
476 479
477 if (ACPI_GET_DESCRIPTOR_TYPE(internal_object) == ACPI_DESC_TYPE_NAMED) { 480 if (ACPI_GET_DESCRIPTOR_TYPE(internal_object) == ACPI_DESC_TYPE_NAMED) {
478 481
479 /* Object is a named object (reference), just return the length */ 482 /* A namespace node should never get here */
480 483
481 *obj_length = ACPI_ROUND_UP_TO_NATIVE_WORD(length); 484 return_ACPI_STATUS(AE_AML_INTERNAL);
482 return_ACPI_STATUS(status);
483 } 485 }
484 486
485 /* 487 /*
diff --git a/drivers/acpi/acpica/utownerid.c b/drivers/acpi/acpica/utownerid.c
index 835340b26d37..eb3aca761369 100644
--- a/drivers/acpi/acpica/utownerid.c
+++ b/drivers/acpi/acpica/utownerid.c
@@ -148,7 +148,7 @@ acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id)
148 ACPI_ERROR((AE_INFO, 148 ACPI_ERROR((AE_INFO,
149 "Could not allocate new OwnerId (255 max), AE_OWNER_ID_LIMIT")); 149 "Could not allocate new OwnerId (255 max), AE_OWNER_ID_LIMIT"));
150 150
151 exit: 151exit:
152 (void)acpi_ut_release_mutex(ACPI_MTX_CACHES); 152 (void)acpi_ut_release_mutex(ACPI_MTX_CACHES);
153 return_ACPI_STATUS(status); 153 return_ACPI_STATUS(status);
154} 154}
diff --git a/drivers/acpi/acpica/utresrc.c b/drivers/acpi/acpica/utresrc.c
index cb7fa491decf..2c2accb9e534 100644
--- a/drivers/acpi/acpica/utresrc.c
+++ b/drivers/acpi/acpica/utresrc.c
@@ -643,7 +643,7 @@ acpi_ut_validate_resource(struct acpi_walk_state *walk_state,
643 643
644 return (AE_OK); 644 return (AE_OK);
645 645
646 invalid_resource: 646invalid_resource:
647 647
648 if (walk_state) { 648 if (walk_state) {
649 ACPI_ERROR((AE_INFO, 649 ACPI_ERROR((AE_INFO,
@@ -652,7 +652,7 @@ acpi_ut_validate_resource(struct acpi_walk_state *walk_state,
652 } 652 }
653 return (AE_AML_INVALID_RESOURCE_TYPE); 653 return (AE_AML_INVALID_RESOURCE_TYPE);
654 654
655 bad_resource_length: 655bad_resource_length:
656 656
657 if (walk_state) { 657 if (walk_state) {
658 ACPI_ERROR((AE_INFO, 658 ACPI_ERROR((AE_INFO,
diff --git a/drivers/acpi/acpica/utstate.c b/drivers/acpi/acpica/utstate.c
index a6b729d4c1dc..03c4c2febd84 100644
--- a/drivers/acpi/acpica/utstate.c
+++ b/drivers/acpi/acpica/utstate.c
@@ -161,7 +161,6 @@ union acpi_generic_state *acpi_ut_create_generic_state(void)
161 if (state) { 161 if (state) {
162 162
163 /* Initialize */ 163 /* Initialize */
164 memset(state, 0, sizeof(union acpi_generic_state));
165 state->common.descriptor_type = ACPI_DESC_TYPE_STATE; 164 state->common.descriptor_type = ACPI_DESC_TYPE_STATE;
166 } 165 }
167 166
diff --git a/drivers/acpi/acpica/utstring.c b/drivers/acpi/acpica/utstring.c
index cb1e9cc32d5f..45c0eb26b33d 100644
--- a/drivers/acpi/acpica/utstring.c
+++ b/drivers/acpi/acpica/utstring.c
@@ -310,7 +310,7 @@ acpi_status acpi_ut_strtoul64(char *string, u32 base, u64 *ret_integer)
310 310
311 /* All done, normal exit */ 311 /* All done, normal exit */
312 312
313 all_done: 313all_done:
314 314
315 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Converted value: %8.8X%8.8X\n", 315 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Converted value: %8.8X%8.8X\n",
316 ACPI_FORMAT_UINT64(return_value))); 316 ACPI_FORMAT_UINT64(return_value)));
@@ -318,7 +318,7 @@ acpi_status acpi_ut_strtoul64(char *string, u32 base, u64 *ret_integer)
318 *ret_integer = return_value; 318 *ret_integer = return_value;
319 return_ACPI_STATUS(AE_OK); 319 return_ACPI_STATUS(AE_OK);
320 320
321 error_exit: 321error_exit:
322 /* Base was set/validated above */ 322 /* Base was set/validated above */
323 323
324 if (base == 10) { 324 if (base == 10) {
@@ -584,3 +584,65 @@ void ut_convert_backslashes(char *pathname)
584 } 584 }
585} 585}
586#endif 586#endif
587
588#if defined (ACPI_DEBUGGER) || defined (ACPI_APPLICATION)
589/*******************************************************************************
590 *
591 * FUNCTION: acpi_ut_safe_strcpy, acpi_ut_safe_strcat, acpi_ut_safe_strncat
592 *
593 * PARAMETERS: Adds a "DestSize" parameter to each of the standard string
594 * functions. This is the size of the Destination buffer.
595 *
596 * RETURN: TRUE if the operation would overflow the destination buffer.
597 *
598 * DESCRIPTION: Safe versions of standard Clib string functions. Ensure that
599 * the result of the operation will not overflow the output string
600 * buffer.
601 *
602 * NOTE: These functions are typically only helpful for processing
603 * user input and command lines. For most ACPICA code, the
604 * required buffer length is precisely calculated before buffer
605 * allocation, so the use of these functions is unnecessary.
606 *
607 ******************************************************************************/
608
609u8 acpi_ut_safe_strcpy(char *dest, acpi_size dest_size, char *source)
610{
611
612 if (ACPI_STRLEN(source) >= dest_size) {
613 return (TRUE);
614 }
615
616 ACPI_STRCPY(dest, source);
617 return (FALSE);
618}
619
620u8 acpi_ut_safe_strcat(char *dest, acpi_size dest_size, char *source)
621{
622
623 if ((ACPI_STRLEN(dest) + ACPI_STRLEN(source)) >= dest_size) {
624 return (TRUE);
625 }
626
627 ACPI_STRCAT(dest, source);
628 return (FALSE);
629}
630
631u8
632acpi_ut_safe_strncat(char *dest,
633 acpi_size dest_size,
634 char *source, acpi_size max_transfer_length)
635{
636 acpi_size actual_transfer_length;
637
638 actual_transfer_length =
639 ACPI_MIN(max_transfer_length, ACPI_STRLEN(source));
640
641 if ((ACPI_STRLEN(dest) + actual_transfer_length) >= dest_size) {
642 return (TRUE);
643 }
644
645 ACPI_STRNCAT(dest, source, max_transfer_length);
646 return (FALSE);
647}
648#endif
diff --git a/drivers/acpi/acpica/uttrack.c b/drivers/acpi/acpica/uttrack.c
index 160f13f4aab5..c0027773cccb 100644
--- a/drivers/acpi/acpica/uttrack.c
+++ b/drivers/acpi/acpica/uttrack.c
@@ -130,10 +130,23 @@ void *acpi_ut_allocate_and_track(acpi_size size,
130 struct acpi_debug_mem_block *allocation; 130 struct acpi_debug_mem_block *allocation;
131 acpi_status status; 131 acpi_status status;
132 132
133 /* Check for an inadvertent size of zero bytes */
134
135 if (!size) {
136 ACPI_WARNING((module, line,
137 "Attempt to allocate zero bytes, allocating 1 byte"));
138 size = 1;
139 }
140
133 allocation = 141 allocation =
134 acpi_ut_allocate(size + sizeof(struct acpi_debug_mem_header), 142 acpi_os_allocate(size + sizeof(struct acpi_debug_mem_header));
135 component, module, line);
136 if (!allocation) { 143 if (!allocation) {
144
145 /* Report allocation error */
146
147 ACPI_WARNING((module, line,
148 "Could not allocate size %u", (u32)size));
149
137 return (NULL); 150 return (NULL);
138 } 151 }
139 152
@@ -179,9 +192,17 @@ void *acpi_ut_allocate_zeroed_and_track(acpi_size size,
179 struct acpi_debug_mem_block *allocation; 192 struct acpi_debug_mem_block *allocation;
180 acpi_status status; 193 acpi_status status;
181 194
195 /* Check for an inadvertent size of zero bytes */
196
197 if (!size) {
198 ACPI_WARNING((module, line,
199 "Attempt to allocate zero bytes, allocating 1 byte"));
200 size = 1;
201 }
202
182 allocation = 203 allocation =
183 acpi_ut_allocate_zeroed(size + sizeof(struct acpi_debug_mem_header), 204 acpi_os_allocate_zeroed(size +
184 component, module, line); 205 sizeof(struct acpi_debug_mem_header));
185 if (!allocation) { 206 if (!allocation) {
186 207
187 /* Report allocation error */ 208 /* Report allocation error */
@@ -409,7 +430,7 @@ acpi_ut_track_allocation(struct acpi_debug_mem_block *allocation,
409 element->next = allocation; 430 element->next = allocation;
410 } 431 }
411 432
412 unlock_and_exit: 433unlock_and_exit:
413 status = acpi_ut_release_mutex(ACPI_MTX_MEMORY); 434 status = acpi_ut_release_mutex(ACPI_MTX_MEMORY);
414 return_ACPI_STATUS(status); 435 return_ACPI_STATUS(status);
415} 436}
diff --git a/drivers/acpi/acpica/utxface.c b/drivers/acpi/acpica/utxface.c
index 03a211e6e26a..be322c83643a 100644
--- a/drivers/acpi/acpica/utxface.c
+++ b/drivers/acpi/acpica/utxface.c
@@ -41,7 +41,8 @@
41 * POSSIBILITY OF SUCH DAMAGES. 41 * POSSIBILITY OF SUCH DAMAGES.
42 */ 42 */
43 43
44#include <linux/export.h> 44#define EXPORT_ACPI_INTERFACES
45
45#include <acpi/acpi.h> 46#include <acpi/acpi.h>
46#include "accommon.h" 47#include "accommon.h"
47#include "acdebug.h" 48#include "acdebug.h"
@@ -60,7 +61,7 @@ ACPI_MODULE_NAME("utxface")
60 * DESCRIPTION: Shutdown the ACPICA subsystem and release all resources. 61 * DESCRIPTION: Shutdown the ACPICA subsystem and release all resources.
61 * 62 *
62 ******************************************************************************/ 63 ******************************************************************************/
63acpi_status acpi_terminate(void) 64acpi_status __init acpi_terminate(void)
64{ 65{
65 acpi_status status; 66 acpi_status status;
66 67
@@ -104,7 +105,7 @@ acpi_status acpi_terminate(void)
104 return_ACPI_STATUS(status); 105 return_ACPI_STATUS(status);
105} 106}
106 107
107ACPI_EXPORT_SYMBOL(acpi_terminate) 108ACPI_EXPORT_SYMBOL_INIT(acpi_terminate)
108 109
109#ifndef ACPI_ASL_COMPILER 110#ifndef ACPI_ASL_COMPILER
110#ifdef ACPI_FUTURE_USAGE 111#ifdef ACPI_FUTURE_USAGE
@@ -207,6 +208,44 @@ acpi_status acpi_get_system_info(struct acpi_buffer * out_buffer)
207 208
208ACPI_EXPORT_SYMBOL(acpi_get_system_info) 209ACPI_EXPORT_SYMBOL(acpi_get_system_info)
209 210
211/*******************************************************************************
212 *
213 * FUNCTION: acpi_get_statistics
214 *
215 * PARAMETERS: stats - Where the statistics are returned
216 *
217 * RETURN: status - the status of the call
218 *
219 * DESCRIPTION: Get the contents of the various system counters
220 *
221 ******************************************************************************/
222acpi_status acpi_get_statistics(struct acpi_statistics *stats)
223{
224 ACPI_FUNCTION_TRACE(acpi_get_statistics);
225
226 /* Parameter validation */
227
228 if (!stats) {
229 return_ACPI_STATUS(AE_BAD_PARAMETER);
230 }
231
232 /* Various interrupt-based event counters */
233
234 stats->sci_count = acpi_sci_count;
235 stats->gpe_count = acpi_gpe_count;
236
237 ACPI_MEMCPY(stats->fixed_event_count, acpi_fixed_event_count,
238 sizeof(acpi_fixed_event_count));
239
240 /* Other counters */
241
242 stats->method_count = acpi_method_count;
243
244 return_ACPI_STATUS(AE_OK);
245}
246
247ACPI_EXPORT_SYMBOL(acpi_get_statistics)
248
210/***************************************************************************** 249/*****************************************************************************
211 * 250 *
212 * FUNCTION: acpi_install_initialization_handler 251 * FUNCTION: acpi_install_initialization_handler
diff --git a/drivers/acpi/acpica/utxferror.c b/drivers/acpi/acpica/utxferror.c
index e966a2e47b76..f7edb88f6054 100644
--- a/drivers/acpi/acpica/utxferror.c
+++ b/drivers/acpi/acpica/utxferror.c
@@ -41,7 +41,8 @@
41 * POSSIBILITY OF SUCH DAMAGES. 41 * POSSIBILITY OF SUCH DAMAGES.
42 */ 42 */
43 43
44#include <linux/export.h> 44#define EXPORT_ACPI_INTERFACES
45
45#include <acpi/acpi.h> 46#include <acpi/acpi.h>
46#include "accommon.h" 47#include "accommon.h"
47 48
diff --git a/drivers/acpi/acpica/utxfinit.c b/drivers/acpi/acpica/utxfinit.c
index 41ebaaf8bb1a..75efea0539c1 100644
--- a/drivers/acpi/acpica/utxfinit.c
+++ b/drivers/acpi/acpica/utxfinit.c
@@ -41,7 +41,8 @@
41 * POSSIBILITY OF SUCH DAMAGES. 41 * POSSIBILITY OF SUCH DAMAGES.
42 */ 42 */
43 43
44#include <linux/export.h> 44#define EXPORT_ACPI_INTERFACES
45
45#include <acpi/acpi.h> 46#include <acpi/acpi.h>
46#include "accommon.h" 47#include "accommon.h"
47#include "acevents.h" 48#include "acevents.h"
@@ -64,7 +65,7 @@ ACPI_MODULE_NAME("utxfinit")
64 * called, so any early initialization belongs here. 65 * called, so any early initialization belongs here.
65 * 66 *
66 ******************************************************************************/ 67 ******************************************************************************/
67acpi_status acpi_initialize_subsystem(void) 68acpi_status __init acpi_initialize_subsystem(void)
68{ 69{
69 acpi_status status; 70 acpi_status status;
70 71
@@ -124,7 +125,8 @@ acpi_status acpi_initialize_subsystem(void)
124 ACPI_DEBUGGER_EXEC(status = acpi_db_initialize()); 125 ACPI_DEBUGGER_EXEC(status = acpi_db_initialize());
125 return_ACPI_STATUS(status); 126 return_ACPI_STATUS(status);
126} 127}
127ACPI_EXPORT_SYMBOL(acpi_initialize_subsystem) 128
129ACPI_EXPORT_SYMBOL_INIT(acpi_initialize_subsystem)
128 130
129/******************************************************************************* 131/*******************************************************************************
130 * 132 *
@@ -138,7 +140,7 @@ ACPI_EXPORT_SYMBOL(acpi_initialize_subsystem)
138 * Puts system into ACPI mode if it isn't already. 140 * Puts system into ACPI mode if it isn't already.
139 * 141 *
140 ******************************************************************************/ 142 ******************************************************************************/
141acpi_status acpi_enable_subsystem(u32 flags) 143acpi_status __init acpi_enable_subsystem(u32 flags)
142{ 144{
143 acpi_status status = AE_OK; 145 acpi_status status = AE_OK;
144 146
@@ -228,7 +230,8 @@ acpi_status acpi_enable_subsystem(u32 flags)
228 230
229 return_ACPI_STATUS(status); 231 return_ACPI_STATUS(status);
230} 232}
231ACPI_EXPORT_SYMBOL(acpi_enable_subsystem) 233
234ACPI_EXPORT_SYMBOL_INIT(acpi_enable_subsystem)
232 235
233/******************************************************************************* 236/*******************************************************************************
234 * 237 *
@@ -242,7 +245,7 @@ ACPI_EXPORT_SYMBOL(acpi_enable_subsystem)
242 * objects and executing AML code for Regions, buffers, etc. 245 * objects and executing AML code for Regions, buffers, etc.
243 * 246 *
244 ******************************************************************************/ 247 ******************************************************************************/
245acpi_status acpi_initialize_objects(u32 flags) 248acpi_status __init acpi_initialize_objects(u32 flags)
246{ 249{
247 acpi_status status = AE_OK; 250 acpi_status status = AE_OK;
248 251
@@ -314,4 +317,5 @@ acpi_status acpi_initialize_objects(u32 flags)
314 acpi_gbl_startup_flags |= ACPI_INITIALIZED_OK; 317 acpi_gbl_startup_flags |= ACPI_INITIALIZED_OK;
315 return_ACPI_STATUS(status); 318 return_ACPI_STATUS(status);
316} 319}
317ACPI_EXPORT_SYMBOL(acpi_initialize_objects) 320
321ACPI_EXPORT_SYMBOL_INIT(acpi_initialize_objects)