aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-11-07 13:21:11 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-11-07 13:21:11 -0500
commit0faf996f4dd02a361158a705afcc31284d732276 (patch)
tree9d0907fced6600cdd0d9cef78f532838220157f7
parentee360d688c8e37f81c92039f76bebaddbe36befe (diff)
parent45c9f78b25ad9ce6cdf259ac4b652e6783adcb23 (diff)
Merge branch 'acpica'
* acpica: (35 commits) ACPICA: Add __init for ACPICA initializers/finalizers. ACPICA: Cleanup asmlinkage for ACPICA APIs. ACPICA: Update acpidump related header file changes. ACPICA: Update compilation environment settings. ACPICA: Fix cached object deletion code. ACPICA: Remove dead AOPOBJ_INVALID check. ACPICA: Cleanup useless memset invocations. ACPICA: Fix an ACPI_ALLOCATE_ZEROED() reversal. ACPICA: Fix wrong object length returned by acpi_ut_get_simple_object_size(). ACPICA: Add new statistics interface. ACPICA: Update DMAR table definitions. ACPICA: Update RSDP table definitions. ACPICA: Update namespace dump code. ACPICA: Update check for setting the ANOBJ_IS_EXTERNAL flag. ACPICA: Update default space handlers. ACPICA: Update version to 20130927. ACPICA: Update aclinux.h for new OSL override mechanism. ACPICA: Add support to allow host OS to redefine individual OSL prototypes. ACPICA: Simplify configuration of global ACPI_REDUCED_HARDWARE macro. ACPICA: Fix indentation issues for macro invocations. ...
-rw-r--r--arch/x86/kernel/acpi/sleep.c11
-rw-r--r--arch/x86/kernel/acpi/sleep.h2
-rw-r--r--arch/x86/kernel/acpi/wakeup_32.S2
-rw-r--r--arch/x86/kernel/acpi/wakeup_64.S2
-rw-r--r--drivers/acpi/acpica/acdebug.h5
-rw-r--r--drivers/acpi/acpica/acevents.h3
-rw-r--r--drivers/acpi/acpica/acglobal.h2
-rw-r--r--drivers/acpi/acpica/aclocal.h3
-rw-r--r--drivers/acpi/acpica/acmacros.h31
-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.c2
-rw-r--r--drivers/acpi/acpica/evhandler.c4
-rw-r--r--drivers/acpi/acpica/evregion.c6
-rw-r--r--drivers/acpi/acpica/evsci.c1
-rw-r--r--drivers/acpi/acpica/evxface.c15
-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.c17
-rw-r--r--drivers/acpi/acpica/hwxfsleep.c7
-rw-r--r--drivers/acpi/acpica/nsaccess.c2
-rw-r--r--drivers/acpi/acpica/nsdump.c9
-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.c17
-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.c6
-rw-r--r--drivers/acpi/acpica/tbprint.c6
-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.c2
-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.c3
-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.c17
-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
-rw-r--r--drivers/iommu/dmar.c4
-rw-r--r--drivers/iommu/intel_irq_remapping.c8
-rw-r--r--include/acpi/acconfig.h2
-rw-r--r--include/acpi/acnames.h26
-rw-r--r--include/acpi/acpiosxf.h155
-rw-r--r--include/acpi/acpixf.h82
-rw-r--r--include/acpi/actbl.h19
-rw-r--r--include/acpi/actbl2.h4
-rw-r--r--include/acpi/actypes.h69
-rw-r--r--include/acpi/platform/acenv.h8
-rw-r--r--include/acpi/platform/aclinux.h132
102 files changed, 827 insertions, 417 deletions
diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c
index 33120100ff5e..3a2ae4c88948 100644
--- a/arch/x86/kernel/acpi/sleep.c
+++ b/arch/x86/kernel/acpi/sleep.c
@@ -26,6 +26,17 @@ static char temp_stack[4096];
26#endif 26#endif
27 27
28/** 28/**
29 * x86_acpi_enter_sleep_state - enter sleep state
30 * @state: Sleep state to enter.
31 *
32 * Wrapper around acpi_enter_sleep_state() to be called by assmebly.
33 */
34acpi_status asmlinkage x86_acpi_enter_sleep_state(u8 state)
35{
36 return acpi_enter_sleep_state(state);
37}
38
39/**
29 * x86_acpi_suspend_lowlevel - save kernel state 40 * x86_acpi_suspend_lowlevel - save kernel state
30 * 41 *
31 * Create an identity mapped page table and copy the wakeup routine to 42 * Create an identity mapped page table and copy the wakeup routine to
diff --git a/arch/x86/kernel/acpi/sleep.h b/arch/x86/kernel/acpi/sleep.h
index c9c2c982d5e4..65c7b606b606 100644
--- a/arch/x86/kernel/acpi/sleep.h
+++ b/arch/x86/kernel/acpi/sleep.h
@@ -17,3 +17,5 @@ extern void wakeup_long64(void);
17extern void do_suspend_lowlevel(void); 17extern void do_suspend_lowlevel(void);
18 18
19extern int x86_acpi_suspend_lowlevel(void); 19extern int x86_acpi_suspend_lowlevel(void);
20
21acpi_status asmlinkage x86_acpi_enter_sleep_state(u8 state);
diff --git a/arch/x86/kernel/acpi/wakeup_32.S b/arch/x86/kernel/acpi/wakeup_32.S
index d1daa66ab162..665c6b7d2ea9 100644
--- a/arch/x86/kernel/acpi/wakeup_32.S
+++ b/arch/x86/kernel/acpi/wakeup_32.S
@@ -73,7 +73,7 @@ ENTRY(do_suspend_lowlevel)
73 call save_processor_state 73 call save_processor_state
74 call save_registers 74 call save_registers
75 pushl $3 75 pushl $3
76 call acpi_enter_sleep_state 76 call x86_acpi_enter_sleep_state
77 addl $4, %esp 77 addl $4, %esp
78 78
79# In case of S3 failure, we'll emerge here. Jump 79# In case of S3 failure, we'll emerge here. Jump
diff --git a/arch/x86/kernel/acpi/wakeup_64.S b/arch/x86/kernel/acpi/wakeup_64.S
index 8ea5164cbd04..ae693b51ed8e 100644
--- a/arch/x86/kernel/acpi/wakeup_64.S
+++ b/arch/x86/kernel/acpi/wakeup_64.S
@@ -73,7 +73,7 @@ ENTRY(do_suspend_lowlevel)
73 addq $8, %rsp 73 addq $8, %rsp
74 movl $3, %edi 74 movl $3, %edi
75 xorl %eax, %eax 75 xorl %eax, %eax
76 call acpi_enter_sleep_state 76 call x86_acpi_enter_sleep_state
77 /* in case something went wrong, restore the machine status and go on */ 77 /* in case something went wrong, restore the machine status and go on */
78 jmp resume_point 78 jmp resume_point
79 79
diff --git a/drivers/acpi/acpica/acdebug.h b/drivers/acpi/acpica/acdebug.h
index 27c36a5251b5..a9fd0b872062 100644
--- a/drivers/acpi/acpica/acdebug.h
+++ b/drivers/acpi/acpica/acdebug.h
@@ -113,7 +113,8 @@ void acpi_db_display_handlers(void);
113ACPI_HW_DEPENDENT_RETURN_VOID(void 113ACPI_HW_DEPENDENT_RETURN_VOID(void
114 acpi_db_generate_gpe(char *gpe_arg, 114 acpi_db_generate_gpe(char *gpe_arg,
115 char *block_arg)) 115 char *block_arg))
116 ACPI_HW_DEPENDENT_RETURN_VOID(void acpi_db_generate_sci(void)) 116
117ACPI_HW_DEPENDENT_RETURN_VOID(void acpi_db_generate_sci(void))
117 118
118/* 119/*
119 * dbconvert - miscellaneous conversion routines 120 * dbconvert - miscellaneous conversion routines
@@ -243,6 +244,8 @@ void acpi_db_display_history(void);
243 244
244char *acpi_db_get_from_history(char *command_num_arg); 245char *acpi_db_get_from_history(char *command_num_arg);
245 246
247char *acpi_db_get_history_by_index(u32 commandd_num);
248
246/* 249/*
247 * dbinput - user front-end to the AML debugger 250 * dbinput - user front-end to the AML debugger
248 */ 251 */
diff --git a/drivers/acpi/acpica/acevents.h b/drivers/acpi/acpica/acevents.h
index 3ae5fd02ae64..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/*
diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h
index 0fba431f4fcb..e9f1fc7f99c7 100644
--- a/drivers/acpi/acpica/acglobal.h
+++ b/drivers/acpi/acpica/acglobal.h
@@ -406,7 +406,9 @@ extern u32 acpi_gbl_nesting_level;
406 406
407/* Event counters */ 407/* Event counters */
408 408
409ACPI_EXTERN u32 acpi_method_count;
409ACPI_EXTERN u32 acpi_gpe_count; 410ACPI_EXTERN u32 acpi_gpe_count;
411ACPI_EXTERN u32 acpi_sci_count;
410ACPI_EXTERN u32 acpi_fixed_event_count[ACPI_NUM_FIXED_EVENTS]; 412ACPI_EXTERN u32 acpi_fixed_event_count[ACPI_NUM_FIXED_EVENTS];
411 413
412/* Support for dynamic control method tracing mechanism */ 414/* Support for dynamic control method tracing mechanism */
diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h
index be9e30ee6048..53ed1a8ba4f0 100644
--- a/drivers/acpi/acpica/aclocal.h
+++ b/drivers/acpi/acpica/aclocal.h
@@ -1072,7 +1072,7 @@ struct acpi_db_method_info {
1072 char *name; 1072 char *name;
1073 u32 flags; 1073 u32 flags;
1074 u32 num_loops; 1074 u32 num_loops;
1075 char pathname[128]; 1075 char pathname[ACPI_DB_LINE_BUFFER_SIZE];
1076 char **args; 1076 char **args;
1077 acpi_object_type *types; 1077 acpi_object_type *types;
1078 1078
@@ -1094,6 +1094,7 @@ struct acpi_integrity_info {
1094 u32 objects; 1094 u32 objects;
1095}; 1095};
1096 1096
1097#define ACPI_DB_DISABLE_OUTPUT 0x00
1097#define ACPI_DB_REDIRECTABLE_OUTPUT 0x01 1098#define ACPI_DB_REDIRECTABLE_OUTPUT 0x01
1098#define ACPI_DB_CONSOLE_OUTPUT 0x02 1099#define ACPI_DB_CONSOLE_OUTPUT 0x02
1099#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/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 d52339090b60..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}
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/evregion.c b/drivers/acpi/acpica/evregion.c
index 6293d6bb6fe1..144cbb9b73bc 100644
--- a/drivers/acpi/acpica/evregion.c
+++ b/drivers/acpi/acpica/evregion.c
@@ -573,10 +573,10 @@ acpi_ev_execute_reg_method(union acpi_operand_object *region_obj, u32 function)
573 status = acpi_ns_evaluate(info); 573 status = acpi_ns_evaluate(info);
574 acpi_ut_remove_reference(args[1]); 574 acpi_ut_remove_reference(args[1]);
575 575
576 cleanup2: 576cleanup2:
577 acpi_ut_remove_reference(args[0]); 577 acpi_ut_remove_reference(args[0]);
578 578
579 cleanup1: 579cleanup1:
580 ACPI_FREE(info); 580 ACPI_FREE(info);
581 return_ACPI_STATUS(status); 581 return_ACPI_STATUS(status);
582} 582}
@@ -761,7 +761,7 @@ acpi_ev_orphan_ec_reg_method(struct acpi_namespace_node *ec_device_node)
761 761
762 status = acpi_evaluate_object(reg_method, NULL, &args, NULL); 762 status = acpi_evaluate_object(reg_method, NULL, &args, NULL);
763 763
764 exit: 764exit:
765 /* We ignore all errors from above, don't care */ 765 /* We ignore all errors from above, don't care */
766 766
767 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 94d9ebddf575..9e9e3454d893 100644
--- a/drivers/acpi/acpica/evsci.c
+++ b/drivers/acpi/acpica/evsci.c
@@ -137,6 +137,7 @@ static u32 ACPI_SYSTEM_XFACE acpi_ev_sci_xrupt_handler(void *context)
137 137
138 interrupt_handled |= acpi_ev_sci_dispatch(); 138 interrupt_handled |= acpi_ev_sci_dispatch();
139 139
140 acpi_sci_count++;
140 return_UINT32(interrupt_handled); 141 return_UINT32(interrupt_handled);
141} 142}
142 143
diff --git a/drivers/acpi/acpica/evxface.c b/drivers/acpi/acpica/evxface.c
index 6f56146a6f88..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}
@@ -444,12 +445,12 @@ acpi_status acpi_install_sci_handler(acpi_sci_handler address, void *context)
444 new_sci_handler->next = acpi_gbl_sci_handler_list; 445 new_sci_handler->next = acpi_gbl_sci_handler_list;
445 acpi_gbl_sci_handler_list = new_sci_handler; 446 acpi_gbl_sci_handler_list = new_sci_handler;
446 447
447 unlock_and_exit: 448unlock_and_exit:
448 449
449 acpi_os_release_lock(acpi_gbl_gpe_lock, flags); 450 acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
450 (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS); 451 (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
451 452
452 exit: 453exit:
453 if (ACPI_FAILURE(status)) { 454 if (ACPI_FAILURE(status)) {
454 ACPI_FREE(new_sci_handler); 455 ACPI_FREE(new_sci_handler);
455 } 456 }
@@ -516,7 +517,7 @@ acpi_status acpi_remove_sci_handler(acpi_sci_handler address)
516 acpi_os_release_lock(acpi_gbl_gpe_lock, flags); 517 acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
517 status = AE_NOT_EXIST; 518 status = AE_NOT_EXIST;
518 519
519 unlock_and_exit: 520unlock_and_exit:
520 (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS); 521 (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
521 return_ACPI_STATUS(status); 522 return_ACPI_STATUS(status);
522} 523}
@@ -565,7 +566,7 @@ acpi_install_global_event_handler(acpi_gbl_event_handler handler, void *context)
565 acpi_gbl_global_event_handler = handler; 566 acpi_gbl_global_event_handler = handler;
566 acpi_gbl_global_event_handler_context = context; 567 acpi_gbl_global_event_handler_context = context;
567 568
568 cleanup: 569cleanup:
569 (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS); 570 (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
570 return_ACPI_STATUS(status); 571 return_ACPI_STATUS(status);
571} 572}
@@ -637,7 +638,7 @@ acpi_install_fixed_event_handler(u32 event,
637 handler)); 638 handler));
638 } 639 }
639 640
640 cleanup: 641cleanup:
641 (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS); 642 (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
642 return_ACPI_STATUS(status); 643 return_ACPI_STATUS(status);
643} 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 f81fb068d20e..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
@@ -563,10 +570,10 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 *sleep_type_a, u8 *sleep_type_b)
563 break; 570 break;
564 } 571 }
565 572
566 cleanup1: 573cleanup1:
567 acpi_ut_remove_reference(info->return_object); 574 acpi_ut_remove_reference(info->return_object);
568 575
569 cleanup: 576cleanup:
570 if (ACPI_FAILURE(status)) { 577 if (ACPI_FAILURE(status)) {
571 ACPI_EXCEPTION((AE_INFO, status, 578 ACPI_EXCEPTION((AE_INFO, status,
572 "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 aff79c7392ff..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 */
diff --git a/drivers/acpi/acpica/nsdump.c b/drivers/acpi/acpica/nsdump.c
index 80633851cb2f..48b9c6f12643 100644
--- a/drivers/acpi/acpica/nsdump.c
+++ b/drivers/acpi/acpica/nsdump.c
@@ -620,7 +620,7 @@ acpi_ns_dump_one_object(acpi_handle obj_handle,
620 obj_type = ACPI_TYPE_INVALID; /* Terminate loop after next pass */ 620 obj_type = ACPI_TYPE_INVALID; /* Terminate loop after next pass */
621 } 621 }
622 622
623 cleanup: 623cleanup:
624 acpi_os_printf("\n"); 624 acpi_os_printf("\n");
625 return (AE_OK); 625 return (AE_OK);
626} 626}
@@ -715,6 +715,13 @@ acpi_ns_dump_one_object_path(acpi_handle obj_handle,
715 } 715 }
716 716
717 node = acpi_ns_validate_handle(obj_handle); 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
718 pathname = acpi_ns_get_external_pathname(node); 725 pathname = acpi_ns_get_external_pathname(node);
719 726
720 path_indent = 1; 727 path_indent = 1;
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 481a6b4a9b2f..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
@@ -617,10 +618,10 @@ acpi_walk_namespace(acpi_object_type type,
617 descending_callback, ascending_callback, 618 descending_callback, ascending_callback,
618 context, return_value); 619 context, return_value);
619 620
620 unlock_and_exit2: 621unlock_and_exit2:
621 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); 622 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
622 623
623 unlock_and_exit: 624unlock_and_exit:
624 (void)acpi_ut_release_read_lock(&acpi_gbl_namespace_rw_lock); 625 (void)acpi_ut_release_read_lock(&acpi_gbl_namespace_rw_lock);
625 return_ACPI_STATUS(status); 626 return_ACPI_STATUS(status);
626} 627}
@@ -864,7 +865,7 @@ acpi_attach_data(acpi_handle obj_handle,
864 865
865 status = acpi_ns_attach_data(node, handler, data); 866 status = acpi_ns_attach_data(node, handler, data);
866 867
867 unlock_and_exit: 868unlock_and_exit:
868 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); 869 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
869 return (status); 870 return (status);
870} 871}
@@ -910,7 +911,7 @@ acpi_detach_data(acpi_handle obj_handle, acpi_object_handler handler)
910 911
911 status = acpi_ns_detach_data(node, handler); 912 status = acpi_ns_detach_data(node, handler);
912 913
913 unlock_and_exit: 914unlock_and_exit:
914 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); 915 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
915 return (status); 916 return (status);
916} 917}
@@ -957,7 +958,7 @@ acpi_get_data(acpi_handle obj_handle, acpi_object_handler handler, void **data)
957 958
958 status = acpi_ns_get_attached_data(node, handler, data); 959 status = acpi_ns_get_attached_data(node, handler, data);
959 960
960 unlock_and_exit: 961unlock_and_exit:
961 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); 962 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
962 return (status); 963 return (status);
963} 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 9e6788f9ba0f..634357d51fe9 100644
--- a/drivers/acpi/acpica/tbinstal.c
+++ b/drivers/acpi/acpica/tbinstal.c
@@ -231,10 +231,10 @@ acpi_tb_add_table(struct acpi_table_desc *table_desc, u32 *table_index)
231 goto release; 231 goto release;
232 } 232 }
233 233
234 print_header: 234print_header:
235 acpi_tb_print_table_header(table_desc->address, table_desc->pointer); 235 acpi_tb_print_table_header(table_desc->address, table_desc->pointer);
236 236
237 release: 237release:
238 (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); 238 (void)acpi_ut_release_mutex(ACPI_MTX_TABLES);
239 return_ACPI_STATUS(status); 239 return_ACPI_STATUS(status);
240} 240}
@@ -306,7 +306,7 @@ struct acpi_table_header *acpi_tb_table_override(struct acpi_table_header
306 306
307 return (NULL); /* There was no override */ 307 return (NULL); /* There was no override */
308 308
309 finish_override: 309finish_override:
310 310
311 ACPI_INFO((AE_INFO, 311 ACPI_INFO((AE_INFO,
312 "%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 9a47715af1f3..6866e767ba90 100644
--- a/drivers/acpi/acpica/tbprint.c
+++ b/drivers/acpi/acpica/tbprint.c
@@ -135,7 +135,7 @@ 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_VALIDATE_RSDP_SIG(header->signature)) { 141 } else if (ACPI_VALIDATE_RSDP_SIG(header->signature)) {
@@ -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,
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 1c95fabbe6a4..e4e1468877c3 100644
--- a/drivers/acpi/acpica/tbxfroot.c
+++ b/drivers/acpi/acpica/tbxfroot.c
@@ -111,7 +111,7 @@ acpi_status acpi_tb_validate_rsdp(struct acpi_table_rsdp *rsdp)
111 * 111 *
112 ******************************************************************************/ 112 ******************************************************************************/
113 113
114acpi_status acpi_find_root_pointer(acpi_size *table_address) 114acpi_status __init acpi_find_root_pointer(acpi_size *table_address)
115{ 115{
116 u8 *table_ptr; 116 u8 *table_ptr;
117 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 ffd0db509d34..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
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 046d5b059c07..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,6 +289,16 @@ 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/SCI support */ 304 /* GPE/SCI support */
@@ -378,6 +388,11 @@ acpi_status acpi_ut_init_globals(void)
378/* Public globals */ 388/* Public globals */
379 389
380ACPI_EXPORT_SYMBOL(acpi_gbl_FADT) 390ACPI_EXPORT_SYMBOL(acpi_gbl_FADT)
391
381ACPI_EXPORT_SYMBOL(acpi_dbg_level) 392ACPI_EXPORT_SYMBOL(acpi_dbg_level)
393
382ACPI_EXPORT_SYMBOL(acpi_dbg_layer) 394ACPI_EXPORT_SYMBOL(acpi_dbg_layer)
395
396ACPI_EXPORT_SYMBOL(acpi_gpe_count)
397
383ACPI_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)
diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c
index 785675a56a10..900946950230 100644
--- a/drivers/iommu/dmar.c
+++ b/drivers/iommu/dmar.c
@@ -88,7 +88,7 @@ static int __init dmar_parse_one_dev_scope(struct acpi_dmar_device_scope *scope,
88 pr_warn("Device scope bus [%d] not found\n", scope->bus); 88 pr_warn("Device scope bus [%d] not found\n", scope->bus);
89 break; 89 break;
90 } 90 }
91 pdev = pci_get_slot(bus, PCI_DEVFN(path->dev, path->fn)); 91 pdev = pci_get_slot(bus, PCI_DEVFN(path->device, path->function));
92 if (!pdev) { 92 if (!pdev) {
93 /* warning will be printed below */ 93 /* warning will be printed below */
94 break; 94 break;
@@ -99,7 +99,7 @@ static int __init dmar_parse_one_dev_scope(struct acpi_dmar_device_scope *scope,
99 } 99 }
100 if (!pdev) { 100 if (!pdev) {
101 pr_warn("Device scope device [%04x:%02x:%02x.%02x] not found\n", 101 pr_warn("Device scope device [%04x:%02x:%02x.%02x] not found\n",
102 segment, scope->bus, path->dev, path->fn); 102 segment, scope->bus, path->device, path->function);
103 *dev = NULL; 103 *dev = NULL;
104 return 0; 104 return 0;
105 } 105 }
diff --git a/drivers/iommu/intel_irq_remapping.c b/drivers/iommu/intel_irq_remapping.c
index f71673dbb23d..ab86902fd9ff 100644
--- a/drivers/iommu/intel_irq_remapping.c
+++ b/drivers/iommu/intel_irq_remapping.c
@@ -686,12 +686,12 @@ static void ir_parse_one_hpet_scope(struct acpi_dmar_device_scope *scope,
686 * Access PCI directly due to the PCI 686 * Access PCI directly due to the PCI
687 * subsystem isn't initialized yet. 687 * subsystem isn't initialized yet.
688 */ 688 */
689 bus = read_pci_config_byte(bus, path->dev, path->fn, 689 bus = read_pci_config_byte(bus, path->device, path->function,
690 PCI_SECONDARY_BUS); 690 PCI_SECONDARY_BUS);
691 path++; 691 path++;
692 } 692 }
693 ir_hpet[ir_hpet_num].bus = bus; 693 ir_hpet[ir_hpet_num].bus = bus;
694 ir_hpet[ir_hpet_num].devfn = PCI_DEVFN(path->dev, path->fn); 694 ir_hpet[ir_hpet_num].devfn = PCI_DEVFN(path->device, path->function);
695 ir_hpet[ir_hpet_num].iommu = iommu; 695 ir_hpet[ir_hpet_num].iommu = iommu;
696 ir_hpet[ir_hpet_num].id = scope->enumeration_id; 696 ir_hpet[ir_hpet_num].id = scope->enumeration_id;
697 ir_hpet_num++; 697 ir_hpet_num++;
@@ -714,13 +714,13 @@ static void ir_parse_one_ioapic_scope(struct acpi_dmar_device_scope *scope,
714 * Access PCI directly due to the PCI 714 * Access PCI directly due to the PCI
715 * subsystem isn't initialized yet. 715 * subsystem isn't initialized yet.
716 */ 716 */
717 bus = read_pci_config_byte(bus, path->dev, path->fn, 717 bus = read_pci_config_byte(bus, path->device, path->function,
718 PCI_SECONDARY_BUS); 718 PCI_SECONDARY_BUS);
719 path++; 719 path++;
720 } 720 }
721 721
722 ir_ioapic[ir_ioapic_num].bus = bus; 722 ir_ioapic[ir_ioapic_num].bus = bus;
723 ir_ioapic[ir_ioapic_num].devfn = PCI_DEVFN(path->dev, path->fn); 723 ir_ioapic[ir_ioapic_num].devfn = PCI_DEVFN(path->device, path->function);
724 ir_ioapic[ir_ioapic_num].iommu = iommu; 724 ir_ioapic[ir_ioapic_num].iommu = iommu;
725 ir_ioapic[ir_ioapic_num].id = scope->enumeration_id; 725 ir_ioapic[ir_ioapic_num].id = scope->enumeration_id;
726 ir_ioapic_num++; 726 ir_ioapic_num++;
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index 1c16f821434f..d98c67001840 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -100,7 +100,9 @@
100 * ACPI PM timer 100 * ACPI PM timer
101 * FACS table (Waking vectors and Global Lock) 101 * FACS table (Waking vectors and Global Lock)
102 */ 102 */
103#ifndef ACPI_REDUCED_HARDWARE
103#define ACPI_REDUCED_HARDWARE FALSE 104#define ACPI_REDUCED_HARDWARE FALSE
105#endif
104 106
105/****************************************************************************** 107/******************************************************************************
106 * 108 *
diff --git a/include/acpi/acnames.h b/include/acpi/acnames.h
index ce08ef7d969c..1f36777e26fe 100644
--- a/include/acpi/acnames.h
+++ b/include/acpi/acnames.h
@@ -46,25 +46,25 @@
46 46
47/* Method names - these methods can appear anywhere in the namespace */ 47/* Method names - these methods can appear anywhere in the namespace */
48 48
49#define METHOD_NAME__SB_ "_SB_"
50#define METHOD_NAME__HID "_HID"
51#define METHOD_NAME__CID "_CID"
52#define METHOD_NAME__UID "_UID"
53#define METHOD_NAME__SUB "_SUB"
54#define METHOD_NAME__ADR "_ADR" 49#define METHOD_NAME__ADR "_ADR"
55#define METHOD_NAME__INI "_INI" 50#define METHOD_NAME__AEI "_AEI"
56#define METHOD_NAME__STA "_STA"
57#define METHOD_NAME__REG "_REG"
58#define METHOD_NAME__SEG "_SEG"
59#define METHOD_NAME__BBN "_BBN" 51#define METHOD_NAME__BBN "_BBN"
60#define METHOD_NAME__PRT "_PRT" 52#define METHOD_NAME__CBA "_CBA"
53#define METHOD_NAME__CID "_CID"
61#define METHOD_NAME__CRS "_CRS" 54#define METHOD_NAME__CRS "_CRS"
55#define METHOD_NAME__HID "_HID"
56#define METHOD_NAME__INI "_INI"
57#define METHOD_NAME__PLD "_PLD"
62#define METHOD_NAME__PRS "_PRS" 58#define METHOD_NAME__PRS "_PRS"
63#define METHOD_NAME__AEI "_AEI" 59#define METHOD_NAME__PRT "_PRT"
64#define METHOD_NAME__PRW "_PRW" 60#define METHOD_NAME__PRW "_PRW"
61#define METHOD_NAME__REG "_REG"
62#define METHOD_NAME__SB_ "_SB_"
63#define METHOD_NAME__SEG "_SEG"
65#define METHOD_NAME__SRS "_SRS" 64#define METHOD_NAME__SRS "_SRS"
66#define METHOD_NAME__CBA "_CBA" 65#define METHOD_NAME__STA "_STA"
67#define METHOD_NAME__PLD "_PLD" 66#define METHOD_NAME__SUB "_SUB"
67#define METHOD_NAME__UID "_UID"
68 68
69/* Method names - these methods must appear at the namespace root */ 69/* Method names - these methods must appear at the namespace root */
70 70
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index 64b8c7639520..01e6c6d8b7e1 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -77,54 +77,80 @@ struct acpi_signal_fatal_info {
77/* 77/*
78 * OSL Initialization and shutdown primitives 78 * OSL Initialization and shutdown primitives
79 */ 79 */
80acpi_status __init acpi_os_initialize(void); 80#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_initialize
81acpi_status acpi_os_initialize(void);
82#endif
81 83
84#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_terminate
82acpi_status acpi_os_terminate(void); 85acpi_status acpi_os_terminate(void);
86#endif
83 87
84/* 88/*
85 * ACPI Table interfaces 89 * ACPI Table interfaces
86 */ 90 */
91#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_root_pointer
87acpi_physical_address acpi_os_get_root_pointer(void); 92acpi_physical_address acpi_os_get_root_pointer(void);
93#endif
88 94
95#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_predefined_override
89acpi_status 96acpi_status
90acpi_os_predefined_override(const struct acpi_predefined_names *init_val, 97acpi_os_predefined_override(const struct acpi_predefined_names *init_val,
91 acpi_string * new_val); 98 acpi_string * new_val);
99#endif
92 100
101#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_table_override
93acpi_status 102acpi_status
94acpi_os_table_override(struct acpi_table_header *existing_table, 103acpi_os_table_override(struct acpi_table_header *existing_table,
95 struct acpi_table_header **new_table); 104 struct acpi_table_header **new_table);
105#endif
96 106
107#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_physical_table_override
97acpi_status 108acpi_status
98acpi_os_physical_table_override(struct acpi_table_header *existing_table, 109acpi_os_physical_table_override(struct acpi_table_header *existing_table,
99 acpi_physical_address * new_address, 110 acpi_physical_address * new_address,
100 u32 *new_table_length); 111 u32 *new_table_length);
112#endif
101 113
102/* 114/*
103 * Spinlock primitives 115 * Spinlock primitives
104 */ 116 */
105#ifndef acpi_os_create_lock 117#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_create_lock
106acpi_status acpi_os_create_lock(acpi_spinlock * out_handle); 118acpi_status acpi_os_create_lock(acpi_spinlock * out_handle);
107#endif 119#endif
108 120
121#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_delete_lock
109void acpi_os_delete_lock(acpi_spinlock handle); 122void acpi_os_delete_lock(acpi_spinlock handle);
123#endif
110 124
125#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_acquire_lock
111acpi_cpu_flags acpi_os_acquire_lock(acpi_spinlock handle); 126acpi_cpu_flags acpi_os_acquire_lock(acpi_spinlock handle);
127#endif
112 128
129#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_release_lock
113void acpi_os_release_lock(acpi_spinlock handle, acpi_cpu_flags flags); 130void acpi_os_release_lock(acpi_spinlock handle, acpi_cpu_flags flags);
131#endif
114 132
115/* 133/*
116 * Semaphore primitives 134 * Semaphore primitives
117 */ 135 */
136#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_create_semaphore
118acpi_status 137acpi_status
119acpi_os_create_semaphore(u32 max_units, 138acpi_os_create_semaphore(u32 max_units,
120 u32 initial_units, acpi_semaphore * out_handle); 139 u32 initial_units, acpi_semaphore * out_handle);
140#endif
121 141
142#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_delete_semaphore
122acpi_status acpi_os_delete_semaphore(acpi_semaphore handle); 143acpi_status acpi_os_delete_semaphore(acpi_semaphore handle);
144#endif
123 145
146#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_wait_semaphore
124acpi_status 147acpi_status
125acpi_os_wait_semaphore(acpi_semaphore handle, u32 units, u16 timeout); 148acpi_os_wait_semaphore(acpi_semaphore handle, u32 units, u16 timeout);
149#endif
126 150
151#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_signal_semaphore
127acpi_status acpi_os_signal_semaphore(acpi_semaphore handle, u32 units); 152acpi_status acpi_os_signal_semaphore(acpi_semaphore handle, u32 units);
153#endif
128 154
129/* 155/*
130 * Mutex primitives. May be configured to use semaphores instead via 156 * Mutex primitives. May be configured to use semaphores instead via
@@ -132,29 +158,48 @@ acpi_status acpi_os_signal_semaphore(acpi_semaphore handle, u32 units);
132 */ 158 */
133#if (ACPI_MUTEX_TYPE != ACPI_BINARY_SEMAPHORE) 159#if (ACPI_MUTEX_TYPE != ACPI_BINARY_SEMAPHORE)
134 160
161#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_create_mutex
135acpi_status acpi_os_create_mutex(acpi_mutex * out_handle); 162acpi_status acpi_os_create_mutex(acpi_mutex * out_handle);
163#endif
136 164
165#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_delete_mutex
137void acpi_os_delete_mutex(acpi_mutex handle); 166void acpi_os_delete_mutex(acpi_mutex handle);
167#endif
138 168
169#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_acquire_mutex
139acpi_status acpi_os_acquire_mutex(acpi_mutex handle, u16 timeout); 170acpi_status acpi_os_acquire_mutex(acpi_mutex handle, u16 timeout);
171#endif
140 172
173#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_release_mutex
141void acpi_os_release_mutex(acpi_mutex handle); 174void acpi_os_release_mutex(acpi_mutex handle);
142#endif 175#endif
143 176
177#endif
178
144/* 179/*
145 * Memory allocation and mapping 180 * Memory allocation and mapping
146 */ 181 */
182#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_allocate
147void *acpi_os_allocate(acpi_size size); 183void *acpi_os_allocate(acpi_size size);
184#endif
148 185
186#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_allocate_zeroed
187void *acpi_os_allocate_zeroed(acpi_size size);
188#endif
189
190#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_free
149void acpi_os_free(void *memory); 191void acpi_os_free(void *memory);
192#endif
150 193
151void __iomem *acpi_os_map_memory(acpi_physical_address where, 194#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_map_memory
152 acpi_size length); 195void *acpi_os_map_memory(acpi_physical_address where, acpi_size length);
196#endif
153 197
154void acpi_os_unmap_memory(void __iomem * logical_address, acpi_size size); 198#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_unmap_memory
155void early_acpi_os_unmap_memory(void __iomem * virt, acpi_size size); 199void acpi_os_unmap_memory(void *logical_address, acpi_size size);
200#endif
156 201
157#ifdef ACPI_FUTURE_USAGE 202#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_physical_address
158acpi_status 203acpi_status
159acpi_os_get_physical_address(void *logical_address, 204acpi_os_get_physical_address(void *logical_address,
160 acpi_physical_address * physical_address); 205 acpi_physical_address * physical_address);
@@ -163,117 +208,195 @@ acpi_os_get_physical_address(void *logical_address,
163/* 208/*
164 * Memory/Object Cache 209 * Memory/Object Cache
165 */ 210 */
211#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_create_cache
166acpi_status 212acpi_status
167acpi_os_create_cache(char *cache_name, 213acpi_os_create_cache(char *cache_name,
168 u16 object_size, 214 u16 object_size,
169 u16 max_depth, acpi_cache_t ** return_cache); 215 u16 max_depth, acpi_cache_t ** return_cache);
216#endif
170 217
218#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_delete_cache
171acpi_status acpi_os_delete_cache(acpi_cache_t * cache); 219acpi_status acpi_os_delete_cache(acpi_cache_t * cache);
220#endif
172 221
222#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_purge_cache
173acpi_status acpi_os_purge_cache(acpi_cache_t * cache); 223acpi_status acpi_os_purge_cache(acpi_cache_t * cache);
224#endif
174 225
226#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_acquire_object
175void *acpi_os_acquire_object(acpi_cache_t * cache); 227void *acpi_os_acquire_object(acpi_cache_t * cache);
228#endif
176 229
230#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_release_object
177acpi_status acpi_os_release_object(acpi_cache_t * cache, void *object); 231acpi_status acpi_os_release_object(acpi_cache_t * cache, void *object);
232#endif
178 233
179/* 234/*
180 * Interrupt handlers 235 * Interrupt handlers
181 */ 236 */
237#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_install_interrupt_handler
182acpi_status 238acpi_status
183acpi_os_install_interrupt_handler(u32 interrupt_number, 239acpi_os_install_interrupt_handler(u32 interrupt_number,
184 acpi_osd_handler service_routine, 240 acpi_osd_handler service_routine,
185 void *context); 241 void *context);
242#endif
186 243
244#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_remove_interrupt_handler
187acpi_status 245acpi_status
188acpi_os_remove_interrupt_handler(u32 interrupt_number, 246acpi_os_remove_interrupt_handler(u32 interrupt_number,
189 acpi_osd_handler service_routine); 247 acpi_osd_handler service_routine);
190 248#endif
191void acpi_os_gpe_count(u32 gpe_number);
192void acpi_os_fixed_event_count(u32 fixed_event_number);
193 249
194/* 250/*
195 * Threads and Scheduling 251 * Threads and Scheduling
196 */ 252 */
253#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_thread_id
197acpi_thread_id acpi_os_get_thread_id(void); 254acpi_thread_id acpi_os_get_thread_id(void);
255#endif
198 256
257#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_execute
199acpi_status 258acpi_status
200acpi_os_execute(acpi_execute_type type, 259acpi_os_execute(acpi_execute_type type,
201 acpi_osd_exec_callback function, void *context); 260 acpi_osd_exec_callback function, void *context);
261#endif
202 262
203acpi_status 263#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_wait_events_complete
204acpi_os_hotplug_execute(acpi_osd_exec_callback function, void *context);
205
206void acpi_os_wait_events_complete(void); 264void acpi_os_wait_events_complete(void);
265#endif
207 266
267#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_sleep
208void acpi_os_sleep(u64 milliseconds); 268void acpi_os_sleep(u64 milliseconds);
269#endif
209 270
271#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_stall
210void acpi_os_stall(u32 microseconds); 272void acpi_os_stall(u32 microseconds);
273#endif
211 274
212/* 275/*
213 * Platform and hardware-independent I/O interfaces 276 * Platform and hardware-independent I/O interfaces
214 */ 277 */
215acpi_status acpi_os_read_port(acpi_io_address address, u32 * value, u32 width); 278#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_read_port
279acpi_status acpi_os_read_port(acpi_io_address address, u32 *value, u32 width);
280#endif
216 281
282#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_write_port
217acpi_status acpi_os_write_port(acpi_io_address address, u32 value, u32 width); 283acpi_status acpi_os_write_port(acpi_io_address address, u32 value, u32 width);
284#endif
218 285
219/* 286/*
220 * Platform and hardware-independent physical memory interfaces 287 * Platform and hardware-independent physical memory interfaces
221 */ 288 */
289#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_read_memory
222acpi_status 290acpi_status
223acpi_os_read_memory(acpi_physical_address address, u64 *value, u32 width); 291acpi_os_read_memory(acpi_physical_address address, u64 *value, u32 width);
292#endif
224 293
294#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_write_memory
225acpi_status 295acpi_status
226acpi_os_write_memory(acpi_physical_address address, u64 value, u32 width); 296acpi_os_write_memory(acpi_physical_address address, u64 value, u32 width);
297#endif
227 298
228/* 299/*
229 * Platform and hardware-independent PCI configuration space access 300 * Platform and hardware-independent PCI configuration space access
230 * Note: Can't use "Register" as a parameter, changed to "Reg" -- 301 * Note: Can't use "Register" as a parameter, changed to "Reg" --
231 * certain compilers complain. 302 * certain compilers complain.
232 */ 303 */
304#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_read_pci_configuration
233acpi_status 305acpi_status
234acpi_os_read_pci_configuration(struct acpi_pci_id *pci_id, 306acpi_os_read_pci_configuration(struct acpi_pci_id *pci_id,
235 u32 reg, u64 *value, u32 width); 307 u32 reg, u64 *value, u32 width);
308#endif
236 309
310#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_write_pci_configuration
237acpi_status 311acpi_status
238acpi_os_write_pci_configuration(struct acpi_pci_id *pci_id, 312acpi_os_write_pci_configuration(struct acpi_pci_id *pci_id,
239 u32 reg, u64 value, u32 width); 313 u32 reg, u64 value, u32 width);
314#endif
240 315
241/* 316/*
242 * Miscellaneous 317 * Miscellaneous
243 */ 318 */
319#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_readable
320u8 acpi_os_readable(void *pointer, acpi_size length);
321#endif
322
323#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_writable
324u8 acpi_os_writable(void *pointer, acpi_size length);
325#endif
326
327#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_timer
244u64 acpi_os_get_timer(void); 328u64 acpi_os_get_timer(void);
329#endif
245 330
331#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_signal
246acpi_status acpi_os_signal(u32 function, void *info); 332acpi_status acpi_os_signal(u32 function, void *info);
333#endif
247 334
248/* 335/*
249 * Debug print routines 336 * Debug print routines
250 */ 337 */
338#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_printf
251void ACPI_INTERNAL_VAR_XFACE acpi_os_printf(const char *format, ...); 339void ACPI_INTERNAL_VAR_XFACE acpi_os_printf(const char *format, ...);
340#endif
252 341
342#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_vprintf
253void acpi_os_vprintf(const char *format, va_list args); 343void acpi_os_vprintf(const char *format, va_list args);
344#endif
254 345
346#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_redirect_output
255void acpi_os_redirect_output(void *destination); 347void acpi_os_redirect_output(void *destination);
348#endif
256 349
257#ifdef ACPI_FUTURE_USAGE
258/* 350/*
259 * Debug input 351 * Debug input
260 */ 352 */
261u32 acpi_os_get_line(char *buffer); 353#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_line
354acpi_status acpi_os_get_line(char *buffer, u32 buffer_length, u32 *bytes_read);
355#endif
356
357/*
358 * Obtain ACPI table(s)
359 */
360#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_table_by_name
361acpi_status
362acpi_os_get_table_by_name(char *signature,
363 u32 instance,
364 struct acpi_table_header **table,
365 acpi_physical_address * address);
366#endif
367
368#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_table_by_index
369acpi_status
370acpi_os_get_table_by_index(u32 index,
371 struct acpi_table_header **table,
372 u32 *instance, acpi_physical_address * address);
373#endif
374
375#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_table_by_address
376acpi_status
377acpi_os_get_table_by_address(acpi_physical_address address,
378 struct acpi_table_header **table);
262#endif 379#endif
263 380
264/* 381/*
265 * Directory manipulation 382 * Directory manipulation
266 */ 383 */
384#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_open_directory
267void *acpi_os_open_directory(char *pathname, 385void *acpi_os_open_directory(char *pathname,
268 char *wildcard_spec, char requested_file_type); 386 char *wildcard_spec, char requested_file_type);
387#endif
269 388
270/* requeste_file_type values */ 389/* requeste_file_type values */
271 390
272#define REQUEST_FILE_ONLY 0 391#define REQUEST_FILE_ONLY 0
273#define REQUEST_DIR_ONLY 1 392#define REQUEST_DIR_ONLY 1
274 393
394#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_next_filename
275char *acpi_os_get_next_filename(void *dir_handle); 395char *acpi_os_get_next_filename(void *dir_handle);
396#endif
276 397
398#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_close_directory
277void acpi_os_close_directory(void *dir_handle); 399void acpi_os_close_directory(void *dir_handle);
400#endif
278 401
279#endif /* __ACPIOSXF_H__ */ 402#endif /* __ACPIOSXF_H__ */
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index c7b1475422b3..d8f9457755b4 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -46,7 +46,7 @@
46 46
47/* Current ACPICA subsystem version in YYYYMMDD format */ 47/* Current ACPICA subsystem version in YYYYMMDD format */
48 48
49#define ACPI_CA_VERSION 0x20130823 49#define ACPI_CA_VERSION 0x20130927
50 50
51#include <acpi/acconfig.h> 51#include <acpi/acconfig.h>
52#include <acpi/actypes.h> 52#include <acpi/actypes.h>
@@ -54,6 +54,7 @@
54#include <acpi/acbuffer.h> 54#include <acpi/acbuffer.h>
55 55
56extern u8 acpi_gbl_permanent_mmap; 56extern u8 acpi_gbl_permanent_mmap;
57extern u32 acpi_rsdt_forced;
57 58
58/* 59/*
59 * Globals that are publically available 60 * Globals that are publically available
@@ -106,39 +107,41 @@ extern u8 acpi_gbl_disable_ssdt_table_load;
106 static ACPI_INLINE prototype {return(AE_OK);} 107 static ACPI_INLINE prototype {return(AE_OK);}
107 108
108#define ACPI_HW_DEPENDENT_RETURN_VOID(prototype) \ 109#define ACPI_HW_DEPENDENT_RETURN_VOID(prototype) \
109 static ACPI_INLINE prototype {} 110 static ACPI_INLINE prototype {return;}
110 111
111#endif /* !ACPI_REDUCED_HARDWARE */ 112#endif /* !ACPI_REDUCED_HARDWARE */
112 113
113extern u32 acpi_rsdt_forced;
114/* 114/*
115 * Initialization 115 * Initialization
116 */ 116 */
117acpi_status 117acpi_status __init
118acpi_initialize_tables(struct acpi_table_desc *initial_storage, 118acpi_initialize_tables(struct acpi_table_desc *initial_storage,
119 u32 initial_table_count, u8 allow_resize); 119 u32 initial_table_count, u8 allow_resize);
120 120
121acpi_status __init acpi_initialize_subsystem(void); 121acpi_status __init acpi_initialize_subsystem(void);
122 122
123acpi_status acpi_enable_subsystem(u32 flags); 123acpi_status __init acpi_enable_subsystem(u32 flags);
124 124
125acpi_status acpi_initialize_objects(u32 flags); 125acpi_status __init acpi_initialize_objects(u32 flags);
126 126
127acpi_status acpi_terminate(void); 127acpi_status __init acpi_terminate(void);
128 128
129/* 129/*
130 * Miscellaneous global interfaces 130 * Miscellaneous global interfaces
131 */ 131 */
132ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable(void)) 132ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable(void))
133
133ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable(void)) 134ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable(void))
134#ifdef ACPI_FUTURE_USAGE 135#ifdef ACPI_FUTURE_USAGE
135acpi_status acpi_subsystem_status(void); 136 acpi_status acpi_subsystem_status(void);
136#endif 137#endif
137 138
138#ifdef ACPI_FUTURE_USAGE 139#ifdef ACPI_FUTURE_USAGE
139acpi_status acpi_get_system_info(struct acpi_buffer *ret_buffer); 140acpi_status acpi_get_system_info(struct acpi_buffer *ret_buffer);
140#endif 141#endif
141 142
143acpi_status acpi_get_statistics(struct acpi_statistics *stats);
144
142const char *acpi_format_exception(acpi_status exception); 145const char *acpi_format_exception(acpi_status exception);
143 146
144acpi_status acpi_purge_cached_objects(void); 147acpi_status acpi_purge_cached_objects(void);
@@ -159,29 +162,20 @@ acpi_decode_pld_buffer(u8 *in_buffer,
159 acpi_size length, struct acpi_pld_info **return_buffer); 162 acpi_size length, struct acpi_pld_info **return_buffer);
160 163
161/* 164/*
162 * ACPI Memory management
163 */
164void *acpi_allocate(u32 size);
165
166void *acpi_callocate(u32 size);
167
168void acpi_free(void *address);
169
170/*
171 * ACPI table load/unload interfaces 165 * ACPI table load/unload interfaces
172 */ 166 */
173acpi_status acpi_load_table(struct acpi_table_header *table); 167acpi_status acpi_load_table(struct acpi_table_header *table);
174 168
175acpi_status acpi_unload_parent_table(acpi_handle object); 169acpi_status acpi_unload_parent_table(acpi_handle object);
176 170
177acpi_status acpi_load_tables(void); 171acpi_status __init acpi_load_tables(void);
178 172
179/* 173/*
180 * ACPI table manipulation interfaces 174 * ACPI table manipulation interfaces
181 */ 175 */
182acpi_status acpi_reallocate_root_table(void); 176acpi_status __init acpi_reallocate_root_table(void);
183 177
184acpi_status acpi_find_root_pointer(acpi_size *rsdp_address); 178acpi_status __init acpi_find_root_pointer(acpi_size *rsdp_address);
185 179
186acpi_status acpi_unload_table_id(acpi_owner_id id); 180acpi_status acpi_unload_table_id(acpi_owner_id id);
187 181
@@ -193,6 +187,7 @@ acpi_status
193acpi_get_table_with_size(acpi_string signature, 187acpi_get_table_with_size(acpi_string signature,
194 u32 instance, struct acpi_table_header **out_table, 188 u32 instance, struct acpi_table_header **out_table,
195 acpi_size *tbl_size); 189 acpi_size *tbl_size);
190
196acpi_status 191acpi_status
197acpi_get_table(acpi_string signature, 192acpi_get_table(acpi_string signature,
198 u32 instance, struct acpi_table_header **out_table); 193 u32 instance, struct acpi_table_header **out_table);
@@ -283,13 +278,16 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
283 acpi_install_sci_handler(acpi_sci_handler 278 acpi_install_sci_handler(acpi_sci_handler
284 address, 279 address,
285 void *context)) 280 void *context))
281
286ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 282ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
287 acpi_remove_sci_handler(acpi_sci_handler 283 acpi_remove_sci_handler(acpi_sci_handler
288 address)) 284 address))
285
289ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 286ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
290 acpi_install_global_event_handler 287 acpi_install_global_event_handler
291 (acpi_gbl_event_handler handler, 288 (acpi_gbl_event_handler handler,
292 void *context)) 289 void *context))
290
293ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 291ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
294 acpi_install_fixed_event_handler(u32 292 acpi_install_fixed_event_handler(u32
295 acpi_event, 293 acpi_event,
@@ -297,10 +295,12 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
297 handler, 295 handler,
298 void 296 void
299 *context)) 297 *context))
298
300ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 299ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
301 acpi_remove_fixed_event_handler(u32 acpi_event, 300 acpi_remove_fixed_event_handler(u32 acpi_event,
302 acpi_event_handler 301 acpi_event_handler
303 handler)) 302 handler))
303
304ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 304ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
305 acpi_install_gpe_handler(acpi_handle 305 acpi_install_gpe_handler(acpi_handle
306 gpe_device, 306 gpe_device,
@@ -309,6 +309,7 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
309 acpi_gpe_handler 309 acpi_gpe_handler
310 address, 310 address,
311 void *context)) 311 void *context))
312
312ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 313ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
313 acpi_remove_gpe_handler(acpi_handle gpe_device, 314 acpi_remove_gpe_handler(acpi_handle gpe_device,
314 u32 gpe_number, 315 u32 gpe_number,
@@ -345,6 +346,7 @@ acpi_status acpi_install_interface_handler(acpi_interface_handler handler);
345ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 346ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
346 acpi_acquire_global_lock(u16 timeout, 347 acpi_acquire_global_lock(u16 timeout,
347 u32 *handle)) 348 u32 *handle))
349
348ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 350ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
349 acpi_release_global_lock(u32 handle)) 351 acpi_release_global_lock(u32 handle))
350 352
@@ -371,6 +373,7 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
371 acpi_get_event_status(u32 event, 373 acpi_get_event_status(u32 event,
372 acpi_event_status 374 acpi_event_status
373 *event_status)) 375 *event_status))
376
374/* 377/*
375 * General Purpose Event (GPE) Interfaces 378 * General Purpose Event (GPE) Interfaces
376 */ 379 */
@@ -401,10 +404,12 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
401 parent_device, 404 parent_device,
402 acpi_handle gpe_device, 405 acpi_handle gpe_device,
403 u32 gpe_number)) 406 u32 gpe_number))
407
404ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 408ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
405 acpi_set_gpe_wake_mask(acpi_handle gpe_device, 409 acpi_set_gpe_wake_mask(acpi_handle gpe_device,
406 u32 gpe_number, 410 u32 gpe_number,
407 u8 action)) 411 u8 action))
412
408ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 413ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
409 acpi_get_gpe_status(acpi_handle gpe_device, 414 acpi_get_gpe_status(acpi_handle gpe_device,
410 u32 gpe_number, 415 u32 gpe_number,
@@ -426,6 +431,7 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
426 *gpe_block_address, 431 *gpe_block_address,
427 u32 register_count, 432 u32 register_count,
428 u32 interrupt_number)) 433 u32 interrupt_number))
434
429ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 435ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
430 acpi_remove_gpe_block(acpi_handle gpe_device)) 436 acpi_remove_gpe_block(acpi_handle gpe_device))
431 437
@@ -500,13 +506,13 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
500 * Sleep/Wake interfaces 506 * Sleep/Wake interfaces
501 */ 507 */
502acpi_status 508acpi_status
503acpi_get_sleep_type_data(u8 sleep_state, u8 * slp_typ_a, u8 * slp_typ_b); 509acpi_get_sleep_type_data(u8 sleep_state, u8 *slp_typ_a, u8 *slp_typ_b);
504 510
505acpi_status acpi_enter_sleep_state_prep(u8 sleep_state); 511acpi_status acpi_enter_sleep_state_prep(u8 sleep_state);
506 512
507acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state); 513acpi_status acpi_enter_sleep_state(u8 sleep_state);
508 514
509ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status asmlinkage acpi_enter_sleep_state_s4bios(void)) 515ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enter_sleep_state_s4bios(void))
510 516
511acpi_status acpi_leave_sleep_state_prep(u8 sleep_state); 517acpi_status acpi_leave_sleep_state_prep(u8 sleep_state);
512 518
@@ -515,7 +521,6 @@ acpi_status acpi_leave_sleep_state(u8 sleep_state);
515ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 521ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
516 acpi_set_firmware_waking_vector(u32 522 acpi_set_firmware_waking_vector(u32
517 physical_address)) 523 physical_address))
518
519#if ACPI_MACHINE_WIDTH == 64 524#if ACPI_MACHINE_WIDTH == 64
520ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 525ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
521 acpi_set_firmware_waking_vector64(u64 526 acpi_set_firmware_waking_vector64(u64
@@ -539,50 +544,53 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
539/* 544/*
540 * Error/Warning output 545 * Error/Warning output
541 */ 546 */
547ACPI_PRINTF_LIKE(3)
542void ACPI_INTERNAL_VAR_XFACE 548void ACPI_INTERNAL_VAR_XFACE
543acpi_error(const char *module_name, 549acpi_error(const char *module_name, u32 line_number, const char *format, ...);
544 u32 line_number, const char *format, ...) ACPI_PRINTF_LIKE(3);
545 550
551ACPI_PRINTF_LIKE(4)
546void ACPI_INTERNAL_VAR_XFACE 552void ACPI_INTERNAL_VAR_XFACE
547acpi_exception(const char *module_name, 553acpi_exception(const char *module_name,
548 u32 line_number, 554 u32 line_number, acpi_status status, const char *format, ...);
549 acpi_status status, const char *format, ...) ACPI_PRINTF_LIKE(4);
550 555
556ACPI_PRINTF_LIKE(3)
551void ACPI_INTERNAL_VAR_XFACE 557void ACPI_INTERNAL_VAR_XFACE
552acpi_warning(const char *module_name, 558acpi_warning(const char *module_name, u32 line_number, const char *format, ...);
553 u32 line_number, const char *format, ...) ACPI_PRINTF_LIKE(3);
554 559
560ACPI_PRINTF_LIKE(3)
555void ACPI_INTERNAL_VAR_XFACE 561void ACPI_INTERNAL_VAR_XFACE
556acpi_info(const char *module_name, 562acpi_info(const char *module_name, u32 line_number, const char *format, ...);
557 u32 line_number, const char *format, ...) ACPI_PRINTF_LIKE(3);
558 563
564ACPI_PRINTF_LIKE(3)
559void ACPI_INTERNAL_VAR_XFACE 565void ACPI_INTERNAL_VAR_XFACE
560acpi_bios_error(const char *module_name, 566acpi_bios_error(const char *module_name,
561 u32 line_number, const char *format, ...) ACPI_PRINTF_LIKE(3); 567 u32 line_number, const char *format, ...);
562 568
569ACPI_PRINTF_LIKE(3)
563void ACPI_INTERNAL_VAR_XFACE 570void ACPI_INTERNAL_VAR_XFACE
564acpi_bios_warning(const char *module_name, 571acpi_bios_warning(const char *module_name,
565 u32 line_number, const char *format, ...) ACPI_PRINTF_LIKE(3); 572 u32 line_number, const char *format, ...);
566 573
567/* 574/*
568 * Debug output 575 * Debug output
569 */ 576 */
570#ifdef ACPI_DEBUG_OUTPUT 577#ifdef ACPI_DEBUG_OUTPUT
571 578
579ACPI_PRINTF_LIKE(6)
572void ACPI_INTERNAL_VAR_XFACE 580void ACPI_INTERNAL_VAR_XFACE
573acpi_debug_print(u32 requested_debug_level, 581acpi_debug_print(u32 requested_debug_level,
574 u32 line_number, 582 u32 line_number,
575 const char *function_name, 583 const char *function_name,
576 const char *module_name, 584 const char *module_name,
577 u32 component_id, const char *format, ...) ACPI_PRINTF_LIKE(6); 585 u32 component_id, const char *format, ...);
578 586
587ACPI_PRINTF_LIKE(6)
579void ACPI_INTERNAL_VAR_XFACE 588void ACPI_INTERNAL_VAR_XFACE
580acpi_debug_print_raw(u32 requested_debug_level, 589acpi_debug_print_raw(u32 requested_debug_level,
581 u32 line_number, 590 u32 line_number,
582 const char *function_name, 591 const char *function_name,
583 const char *module_name, 592 const char *module_name,
584 u32 component_id, 593 u32 component_id, const char *format, ...);
585 const char *format, ...) ACPI_PRINTF_LIKE(6);
586#endif 594#endif
587 595
588#endif /* __ACXFACE_H__ */ 596#endif /* __ACXFACE_H__ */
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h
index 9b58a8f43771..94970880126f 100644
--- a/include/acpi/actbl.h
+++ b/include/acpi/actbl.h
@@ -146,7 +146,24 @@ struct acpi_table_rsdp {
146 u8 reserved[3]; /* Reserved, must be zero */ 146 u8 reserved[3]; /* Reserved, must be zero */
147}; 147};
148 148
149#define ACPI_RSDP_REV0_SIZE 20 /* Size of original ACPI 1.0 RSDP */ 149/* Standalone struct for the ACPI 1.0 RSDP */
150
151struct acpi_rsdp_common {
152 char signature[8];
153 u8 checksum;
154 char oem_id[ACPI_OEM_ID_SIZE];
155 u8 revision;
156 u32 rsdt_physical_address;
157};
158
159/* Standalone struct for the extended part of the RSDP (ACPI 2.0+) */
160
161struct acpi_rsdp_extension {
162 u32 length;
163 u64 xsdt_physical_address;
164 u8 extended_checksum;
165 u8 reserved[3];
166};
150 167
151/******************************************************************************* 168/*******************************************************************************
152 * 169 *
diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h
index ffaac0e7e0c6..40f7ed115452 100644
--- a/include/acpi/actbl2.h
+++ b/include/acpi/actbl2.h
@@ -444,8 +444,8 @@ enum acpi_dmar_scope_type {
444}; 444};
445 445
446struct acpi_dmar_pci_path { 446struct acpi_dmar_pci_path {
447 u8 dev; 447 u8 device;
448 u8 fn; 448 u8 function;
449}; 449};
450 450
451/* 451/*
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index f6abf23ad0a7..809b1a0fee7f 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -299,13 +299,57 @@ typedef u32 acpi_physical_address;
299#endif 299#endif
300 300
301/* 301/*
302 * All ACPICA functions that are available to the rest of the kernel are 302 * All ACPICA external functions that are available to the rest of the kernel
303 * tagged with this macro which can be defined as appropriate for the host. 303 * are tagged with thes macros which can be defined as appropriate for the host.
304 *
305 * Notes:
306 * ACPI_EXPORT_SYMBOL_INIT is used for initialization and termination
307 * interfaces that may need special processing.
308 * ACPI_EXPORT_SYMBOL is used for all other public external functions.
304 */ 309 */
310#ifndef ACPI_EXPORT_SYMBOL_INIT
311#define ACPI_EXPORT_SYMBOL_INIT(symbol)
312#endif
313
305#ifndef ACPI_EXPORT_SYMBOL 314#ifndef ACPI_EXPORT_SYMBOL
306#define ACPI_EXPORT_SYMBOL(symbol) 315#define ACPI_EXPORT_SYMBOL(symbol)
307#endif 316#endif
308 317
318/*
319 * Compiler/Clibrary-dependent debug initialization. Used for ACPICA
320 * utilities only.
321 */
322#ifndef ACPI_DEBUG_INITIALIZE
323#define ACPI_DEBUG_INITIALIZE()
324#endif
325
326/*******************************************************************************
327 *
328 * Configuration
329 *
330 ******************************************************************************/
331
332#ifdef ACPI_DBG_TRACK_ALLOCATIONS
333/*
334 * Memory allocation tracking (used by acpi_exec to detect memory leaks)
335 */
336#define ACPI_MEM_PARAMETERS _COMPONENT, _acpi_module_name, __LINE__
337#define ACPI_ALLOCATE(a) acpi_ut_allocate_and_track ((acpi_size) (a), ACPI_MEM_PARAMETERS)
338#define ACPI_ALLOCATE_ZEROED(a) acpi_ut_allocate_zeroed_and_track ((acpi_size) (a), ACPI_MEM_PARAMETERS)
339#define ACPI_FREE(a) acpi_ut_free_and_track (a, ACPI_MEM_PARAMETERS)
340#define ACPI_MEM_TRACKING(a) a
341
342#else
343/*
344 * Normal memory allocation directly via the OS services layer
345 */
346#define ACPI_ALLOCATE(a) acpi_os_allocate ((acpi_size) (a))
347#define ACPI_ALLOCATE_ZEROED(a) acpi_os_allocate_zeroed ((acpi_size) (a))
348#define ACPI_FREE(a) acpi_os_free (a)
349#define ACPI_MEM_TRACKING(a)
350
351#endif /* ACPI_DBG_TRACK_ALLOCATIONS */
352
309/****************************************************************************** 353/******************************************************************************
310 * 354 *
311 * ACPI Specification constants (Do not change unless the specification changes) 355 * ACPI Specification constants (Do not change unless the specification changes)
@@ -322,6 +366,7 @@ typedef u32 acpi_physical_address;
322#define ACPI_PM1_REGISTER_WIDTH 16 366#define ACPI_PM1_REGISTER_WIDTH 16
323#define ACPI_PM2_REGISTER_WIDTH 8 367#define ACPI_PM2_REGISTER_WIDTH 8
324#define ACPI_PM_TIMER_WIDTH 32 368#define ACPI_PM_TIMER_WIDTH 32
369#define ACPI_RESET_REGISTER_WIDTH 8
325 370
326/* Names within the namespace are 4 bytes long */ 371/* Names within the namespace are 4 bytes long */
327 372
@@ -891,9 +936,13 @@ struct acpi_buffer {
891 void *pointer; /* pointer to buffer */ 936 void *pointer; /* pointer to buffer */
892}; 937};
893 938
894/* Free a buffer created in an struct acpi_buffer via ACPI_ALLOCATE_LOCAL_BUFFER */ 939/*
895 940 * Free a buffer created in an struct acpi_buffer via ACPI_ALLOCATE_BUFFER.
896#define ACPI_FREE_BUFFER(b) ACPI_FREE(b.pointer) 941 * Note: We use acpi_os_free here because acpi_os_allocate was used to allocate
942 * the buffer. This purposefully bypasses the internal allocation tracking
943 * mechanism (if it is enabled).
944 */
945#define ACPI_FREE_BUFFER(b) acpi_os_free((b).pointer)
897 946
898/* 947/*
899 * name_type for acpi_get_name 948 * name_type for acpi_get_name
@@ -932,6 +981,16 @@ struct acpi_system_info {
932 u32 debug_layer; 981 u32 debug_layer;
933}; 982};
934 983
984/*
985 * System statistics returned by acpi_get_statistics()
986 */
987struct acpi_statistics {
988 u32 sci_count;
989 u32 gpe_count;
990 u32 fixed_event_count[ACPI_NUM_FIXED_EVENTS];
991 u32 method_count;
992};
993
935/* Table Event Types */ 994/* Table Event Types */
936 995
937#define ACPI_TABLE_EVENT_LOAD 0x0 996#define ACPI_TABLE_EVENT_LOAD 0x0
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h
index ef04b36ca6ed..974d3ef7c141 100644
--- a/include/acpi/platform/acenv.h
+++ b/include/acpi/platform/acenv.h
@@ -96,10 +96,11 @@
96#endif 96#endif
97 97
98/* 98/*
99 * acpi_bin/acpi_help/acpi_src configuration. All single threaded, with 99 * acpi_bin/acpi_dump/acpi_src/acpi_xtract configuration. All single
100 * no debug output. 100 * threaded, with no debug output.
101 */ 101 */
102#if (defined ACPI_BIN_APP) || \ 102#if (defined ACPI_BIN_APP) || \
103 (defined ACPI_DUMP_APP) || \
103 (defined ACPI_SRC_APP) || \ 104 (defined ACPI_SRC_APP) || \
104 (defined ACPI_XTRACT_APP) 105 (defined ACPI_XTRACT_APP)
105#define ACPI_APPLICATION 106#define ACPI_APPLICATION
@@ -147,6 +148,9 @@
147#if defined(_LINUX) || defined(__linux__) 148#if defined(_LINUX) || defined(__linux__)
148#include <acpi/platform/aclinux.h> 149#include <acpi/platform/aclinux.h>
149 150
151#elif defined(_APPLE) || defined(__APPLE__)
152#include "acmacosx.h"
153
150#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) 154#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
151#include "acfreebsd.h" 155#include "acfreebsd.h"
152 156
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index fda0f3e35c03..ab57930794a5 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -50,7 +50,6 @@
50#define ACPI_USE_DO_WHILE_0 50#define ACPI_USE_DO_WHILE_0
51#define ACPI_MUTEX_TYPE ACPI_BINARY_SEMAPHORE 51#define ACPI_MUTEX_TYPE ACPI_BINARY_SEMAPHORE
52 52
53
54#ifdef __KERNEL__ 53#ifdef __KERNEL__
55 54
56#include <linux/string.h> 55#include <linux/string.h>
@@ -58,11 +57,13 @@
58#include <linux/ctype.h> 57#include <linux/ctype.h>
59#include <linux/sched.h> 58#include <linux/sched.h>
60#include <linux/atomic.h> 59#include <linux/atomic.h>
61#include <asm/div64.h> 60#include <linux/math64.h>
62#include <asm/acpi.h>
63#include <linux/slab.h> 61#include <linux/slab.h>
64#include <linux/spinlock_types.h> 62#include <linux/spinlock_types.h>
65#include <asm/current.h> 63#ifdef EXPORT_ACPI_INTERFACES
64#include <linux/export.h>
65#endif
66#include <asm/acpi.h>
66 67
67/* Host-dependent types and defines for in-kernel ACPICA */ 68/* Host-dependent types and defines for in-kernel ACPICA */
68 69
@@ -74,7 +75,7 @@
74#define acpi_spinlock spinlock_t * 75#define acpi_spinlock spinlock_t *
75#define acpi_cpu_flags unsigned long 76#define acpi_cpu_flags unsigned long
76 77
77#else /* !__KERNEL__ */ 78#else /* !__KERNEL__ */
78 79
79#include <stdarg.h> 80#include <stdarg.h>
80#include <string.h> 81#include <string.h>
@@ -102,21 +103,35 @@
102#define __cdecl 103#define __cdecl
103#endif 104#endif
104 105
105#endif /* __KERNEL__ */ 106#endif /* __KERNEL__ */
106 107
107/* Linux uses GCC */ 108/* Linux uses GCC */
108 109
109#include <acpi/platform/acgcc.h> 110#include <acpi/platform/acgcc.h>
110 111
111#ifdef __KERNEL__ 112#ifdef __KERNEL__
113
114/*
115 * FIXME: Inclusion of actypes.h
116 * Linux kernel need this before defining inline OSL interfaces as
117 * actypes.h need to be included to find ACPICA type definitions.
118 * Since from ACPICA's perspective, the actypes.h should be included after
119 * acenv.h (aclinux.h), this leads to a inclusion mis-ordering issue.
120 */
112#include <acpi/actypes.h> 121#include <acpi/actypes.h>
122
113/* 123/*
114 * Overrides for in-kernel ACPICA 124 * Overrides for in-kernel ACPICA
115 */ 125 */
116static inline acpi_thread_id acpi_os_get_thread_id(void) 126acpi_status __init acpi_os_initialize(void);
117{ 127#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_initialize
118 return (acpi_thread_id)(unsigned long)current; 128
119} 129acpi_status acpi_os_terminate(void);
130#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_terminate
131
132/*
133 * Memory allocation/deallocation
134 */
120 135
121/* 136/*
122 * The irqs_disabled() check is for resume from RAM. 137 * The irqs_disabled() check is for resume from RAM.
@@ -126,25 +141,45 @@ static inline acpi_thread_id acpi_os_get_thread_id(void)
126 */ 141 */
127static inline void *acpi_os_allocate(acpi_size size) 142static inline void *acpi_os_allocate(acpi_size size)
128{ 143{
129 return kmalloc(size, irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL); 144 return kmalloc(size, irqs_disabled()? GFP_ATOMIC : GFP_KERNEL);
130} 145}
131 146
147#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_allocate
148
149/* Use native linux version of acpi_os_allocate_zeroed */
150
132static inline void *acpi_os_allocate_zeroed(acpi_size size) 151static inline void *acpi_os_allocate_zeroed(acpi_size size)
133{ 152{
134 return kzalloc(size, irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL); 153 return kzalloc(size, irqs_disabled()? GFP_ATOMIC : GFP_KERNEL);
135} 154}
136 155
156#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_allocate_zeroed
157#define USE_NATIVE_ALLOCATE_ZEROED
158
159static inline void acpi_os_free(void *memory)
160{
161 kfree(memory);
162}
163
164#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_free
165
137static inline void *acpi_os_acquire_object(acpi_cache_t * cache) 166static inline void *acpi_os_acquire_object(acpi_cache_t * cache)
138{ 167{
139 return kmem_cache_zalloc(cache, 168 return kmem_cache_zalloc(cache,
140 irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL); 169 irqs_disabled()? GFP_ATOMIC : GFP_KERNEL);
141} 170}
142 171
143#define ACPI_ALLOCATE(a) acpi_os_allocate(a) 172#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_acquire_object
144#define ACPI_ALLOCATE_ZEROED(a) acpi_os_allocate_zeroed(a) 173
145#define ACPI_FREE(a) kfree(a) 174static inline acpi_thread_id acpi_os_get_thread_id(void)
175{
176 return (acpi_thread_id) (unsigned long)current;
177}
178
179#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_thread_id
146 180
147#ifndef CONFIG_PREEMPT 181#ifndef CONFIG_PREEMPT
182
148/* 183/*
149 * Used within ACPICA to show where it is safe to preempt execution 184 * Used within ACPICA to show where it is safe to preempt execution
150 * when CONFIG_PREEMPT=n 185 * when CONFIG_PREEMPT=n
@@ -154,6 +189,7 @@ static inline void *acpi_os_acquire_object(acpi_cache_t * cache)
154 if (!irqs_disabled()) \ 189 if (!irqs_disabled()) \
155 cond_resched(); \ 190 cond_resched(); \
156 } while (0) 191 } while (0)
192
157#endif 193#endif
158 194
159/* 195/*
@@ -163,17 +199,53 @@ static inline void *acpi_os_acquire_object(acpi_cache_t * cache)
163 * all locks to the name of the argument of acpi_os_create_lock(), which 199 * all locks to the name of the argument of acpi_os_create_lock(), which
164 * prevents lockdep from reporting false positives for ACPICA locks. 200 * prevents lockdep from reporting false positives for ACPICA locks.
165 */ 201 */
166#define acpi_os_create_lock(__handle) \ 202#define acpi_os_create_lock(__handle) \
167({ \ 203 ({ \
168 spinlock_t *lock = ACPI_ALLOCATE(sizeof(*lock)); \ 204 spinlock_t *lock = ACPI_ALLOCATE(sizeof(*lock)); \
169 \ 205 if (lock) { \
170 if (lock) { \ 206 *(__handle) = lock; \
171 *(__handle) = lock; \ 207 spin_lock_init(*(__handle)); \
172 spin_lock_init(*(__handle)); \ 208 } \
173 } \ 209 lock ? AE_OK : AE_NO_MEMORY; \
174 lock ? AE_OK : AE_NO_MEMORY; \ 210 })
175}) 211#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_create_lock
176 212
177#endif /* __KERNEL__ */ 213void __iomem *acpi_os_map_memory(acpi_physical_address where, acpi_size length);
178 214#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_map_memory
179#endif /* __ACLINUX_H__ */ 215
216void acpi_os_unmap_memory(void __iomem * logical_address, acpi_size size);
217#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_unmap_memory
218
219/*
220 * OSL interfaces used by debugger/disassembler
221 */
222#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_readable
223#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_writable
224
225/*
226 * OSL interfaces used by utilities
227 */
228#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_redirect_output
229#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_line
230#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_table_by_name
231#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_table_by_index
232#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_table_by_address
233#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_open_directory
234#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_next_filename
235#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_close_directory
236
237/*
238 * OSL interfaces added by Linux
239 */
240void early_acpi_os_unmap_memory(void __iomem * virt, acpi_size size);
241
242void acpi_os_gpe_count(u32 gpe_number);
243
244void acpi_os_fixed_event_count(u32 fixed_event_number);
245
246acpi_status
247acpi_os_hotplug_execute(acpi_osd_exec_callback function, void *context);
248
249#endif /* __KERNEL__ */
250
251#endif /* __ACLINUX_H__ */