Linux/ACPI vs ACPICA audit -- 20070126
Subsystems (2)
Len Brown
reviewerBob, Alexey,
For the files that Linux gets from ACPICA, this diff shows how Linux has diverged from upstream.
There are a couple of nits that ACPICA should pick up -- as gcc knows the difference between a void* and a void**; and gcc knows the difference between %zX and %X. There are a couple things Linux should clean up too, and then there are some places where we are known to diverge.
acpica-unix-20070126.audit.diff:# 52 files changed, 379 insertions(+), 191 deletions(-) acpica-unix-20060707.audit.diff:# 42 files changed, 221 insertions(+), 76 deletions(-) acpica-unix-20060623.audit.diff:# 37 files changed, 198 insertions(+), 78 deletions(-) acpica-unix-20060608.audit.diff:# 35 files changed, 190 insertions(+), 70 deletions(-) acpica-unix-20060526.audit.diff:# 34 files changed, 162 insertions(+), 53 deletions(-)
# 140 ACPICA files
# drivers/acpi/dispatcher/dswload.c | 3 # drivers/acpi/dispatcher/dswstate.c | 2 # drivers/acpi/events/evmisc.c | 9 - # drivers/acpi/events/evxface.c | 59 +++++++++- # drivers/acpi/events/evxfevnt.c | 2 # drivers/acpi/executer/exconfig.c | 1 # drivers/acpi/executer/exmutex.c | 6 - # drivers/acpi/hardware/hwgpe.c | 2 # drivers/acpi/hardware/hwregs.c | 2 # drivers/acpi/hardware/hwsleep.c | 23 --- # drivers/acpi/namespace/nsdump.c | 6 - # drivers/acpi/namespace/nsparse.c | 2 # drivers/acpi/namespace/nsxfeval.c | 8 - # drivers/acpi/namespace/nsxfobj.c | 44 +++++++ # drivers/acpi/parser/pstree.c | 2 # drivers/acpi/parser/psutils.c | 2 # drivers/acpi/resources/rsinfo.c | 2 # drivers/acpi/resources/rslist.c | 2 # drivers/acpi/resources/rsutils.c | 2 # drivers/acpi/resources/rsxface.c | 4 # drivers/acpi/tables/tbfadt.c | 4 # drivers/acpi/tables/tbinstal.c | 11 - # drivers/acpi/tables/tbutils.c | 3 # drivers/acpi/tables/tbxface.c | 98 ++++++++++++++--- # drivers/acpi/utilities/utalloc.c | 6 - # drivers/acpi/utilities/utcache.c | 2 # drivers/acpi/utilities/utdebug.c | 8 - # drivers/acpi/utilities/utglobal.c | 14 -- # drivers/acpi/utilities/utmisc.c | 3 # drivers/acpi/utilities/utmutex.c | 23 +-- # drivers/acpi/utilities/utobject.c | 1 # drivers/acpi/utilities/utresrc.c | 6 - # drivers/acpi/utilities/utstate.c | 5 # drivers/acpi/utilities/utxface.c | 2 # include/acpi/acconfig.h | 2 # include/acpi/acdebug.h | 2 # include/acpi/acdispat.h | 2 # include/acpi/acglobal.h | 7 - # include/acpi/achware.h | 4 # include/acpi/acinterp.h | 2 # include/acpi/aclocal.h | 4 # include/acpi/acmacros.h | 8 + # include/acpi/acnamesp.h | 4 # include/acpi/acparser.h | 4 # include/acpi/acpiosxf.h | 17 +- # include/acpi/acpixf.h | 28 ++++ # include/acpi/acresrc.h | 3 # include/acpi/actbl.h | 7 - # include/acpi/actbl1.h | 10 - # include/acpi/actbl2.h | 49 -------- # include/acpi/acutils.h | 8 + # include/acpi/platform/aclinux.h | 40 ++++++ # 52 files changed, 379 insertions(+), 191 deletions(-)
drivers/acpi/dispatcher/dswload.c +0 -3
@@ -1062,9 +1062,6 @@/* * If we have a valid region, initialize it * Namespace is NOT locked at this point. -* -* TBD: need to unlock interpreter if it is locked, in order -* to allow _REG methods to be run. */ status = acpi_ev_initialize_region
drivers/acpi/dispatcher/dswstate.c +2 -0
@@ -65,6 +65,7 @@ struct acpi_walk_state *walk_state);#endif +#ifdef ACPI_FUTURE_USAGE /******************************************************************************* * * FUNCTION: acpi_ds_result_remove
@@ -126,6 +127,7 @@ return (AE_OK); } +#endif /* ACPI_FUTURE_USAGE */ /******************************************************************************* *
drivers/acpi/executer/exmutex.c +3 -3
@@ -270,10 +270,10 @@ walk_state->thread->thread_id) && (obj_desc->mutex.os_mutex != acpi_gbl_global_lock_mutex)) {ACPI_ERROR ((AE_INFO , -"Thread %X cannot release Mutex [%4.4s] acquired by thread %X" , - walk_state->thread->thread_id, +"Thread %lX cannot release Mutex [%4.4s] acquired by thread %lX" , + (unsigned long )walk_state->thread->thread_id,acpi_ut_get_node_name (obj_desc->mutex.node), - obj_desc->mutex.owner_thread->thread_id)); + (unsigned long )obj_desc->mutex.owner_thread->thread_id));return_ACPI_STATUS (AE_AML_NOT_OWNER ); }
drivers/acpi/executer/exconfig.c +0 -1
@@ -272,7 +272,6 @@ACPI_FUNCTION_TRACE (ex_load_op);ACPI_MEMSET (&table_desc,0 ,sizeof (struct acpi_table_desc )); - table_desc.flags =ACPI_TABLE_ORIGIN_ALLOCATED ;/* Source Object can be either an op_region or a Buffer/Field */
drivers/acpi/resources/rsinfo.c +2 -0
@@ -116,6 +116,7 @@ acpi_rs_convert_ext_address64 /* 0x0B, ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 */ }; +#ifdef ACPI_FUTURE_USAGE #if defined(ACPI_DEBUG_OUTPUT ) || defined(ACPI_DEBUGGER )/* Dispatch table for resource dump functions */
@@ -141,6 +142,7 @@ };#endif +#endif /* ACPI_FUTURE_USAGE */ /* * Base sizes for external AML resource descriptors, indexed by internal type. * Includes size of the descriptor header (1 byte for small descriptors,
drivers/acpi/resources/rsxface.c +4 -0
@@ -218,6 +218,7 @@ACPI_EXPORT_SYMBOL (acpi_get_current_resources) +#ifdef ACPI_FUTURE_USAGE/******************************************************************************* * * FUNCTION: acpi_get_possible_resources
@@ -259,6 +260,7 @@ } ACPI_EXPORT_SYMBOL(acpi_get_possible_resources) +#endif /* ACPI_FUTURE_USAGE */ /******************************************************************************* *
@@ -474,6 +476,8 @@return (AE_CTRL_TERMINATE ); } +ACPI_EXPORT_SYMBOL (acpi_rs_match_vendor_resource) +/******************************************************************************* * * FUNCTION: acpi_walk_resources
drivers/acpi/resources/rslist.c +1 -1
@@ -64,7 +64,7 @@acpi_status acpi_rs_convert_aml_to_resources (u8 * aml,u32 length, -u32 offset,u8 resource_index,void *context) +u32 offset,u8 resource_index,void **context) {struct acpi_resource **resource_ptr = ACPI_CAST_INDIRECT_PTR(struct acpi_resource, context);
drivers/acpi/resources/rsutils.c +2 -0
@@ -555,6 +555,7 @@* ******************************************************************************/ +#ifdef ACPI_FUTURE_USAGE acpi_status acpi_rs_get_prs_method_data (struct acpi_namespace_node *node,struct acpi_buffer *ret_buffer)
@@ -586,6 +587,7 @@acpi_ut_remove_reference (obj_desc); return_ACPI_STATUS(status); } +#endif /* ACPI_FUTURE_USAGE */ /******************************************************************************* *
drivers/acpi/tables/tbfadt.c +2 -2
@@ -222,8 +222,8 @@*/ if (length >sizeof (struct acpi_table_fadt )) {ACPI_WARNING ((AE_INFO , -"FADT (revision %u) is longer than ACPI 2.0 version, truncating length 0x%X to 0x%X" , - table->revision, length, +"FADT (revision %u) is longer than ACPI 2.0 version, truncating length 0x%X to 0x%zX" , + table->revision, (unsigned )length,sizeof (struct acpi_table_fadt ))); }
drivers/acpi/tables/tbutils.c +2 -1
@@ -158,6 +158,7 @@ (u8) (table->checksum - checksum)));#if (ACPI_CHECKSUM_ABORT ) +return (AE_BAD_CHECKSUM );#endif }
@@ -331,7 +332,7 @@* ******************************************************************************/ -acpi_status +acpi_status __init acpi_tb_parse_root_table (acpi_physical_address rsdp_address,u8 flags) {struct acpi_table_rsdp *rsdp;
drivers/acpi/tables/tbinstal.c +2 -9
@@ -74,7 +74,6 @@acpi_os_map_memory (table_desc->address, table_desc->length); } -if (!table_desc->pointer) {return_ACPI_STATUS (AE_NO_MEMORY ); }
@@ -307,24 +306,18 @@void acpi_tb_delete_table (struct acpi_table_desc *table_desc) { -/* Table must be mapped or allocated */ -if (!table_desc->pointer) {return ; } -switch (table_desc->flags &ACPI_TABLE_ORIGIN_MASK ) {case ACPI_TABLE_ORIGIN_MAPPED :acpi_os_unmap_memory (table_desc->pointer, table_desc->length);break ; -case ACPI_TABLE_ORIGIN_ALLOCATED :ACPI_FREE (table_desc->pointer);break ; - -default : -break ; +default :; } table_desc->pointer =NULL ;
@@ -352,7 +345,7 @@/* Delete the individual tables */ -for (i =0 ; i < acpi_gbl_root_table_list.count; i++) { +for (i =0 ; i < acpi_gbl_root_table_list.count; ++i) {acpi_tb_delete_table (&acpi_gbl_root_table_list.tables[i]); }
drivers/acpi/tables/tbxface.c +86 -12
148 lines not on this page · raw message
drivers/acpi/namespace/nsdump.c +4 -2
@@ -594,6 +594,7 @@return (AE_OK ); } +#ifdef ACPI_FUTURE_USAGE /******************************************************************************* * * FUNCTION: acpi_ns_dump_objects
@@ -633,6 +634,7 @@ acpi_ns_dump_one_object, (void *)&info, NULL); } +#endif /* ACPI_FUTURE_USAGE */ /******************************************************************************* *
@@ -704,5 +706,5 @@ ACPI_OWNER_ID_MAX, search_handle); return_VOID; } -#endif -#endif +#endif /* _ACPI_ASL_COMPILER */ +#endif /* defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) */
drivers/acpi/namespace/nsxfeval.c +5 -3
@@ -49,6 +49,7 @@#define _COMPONENT ACPI_NAMESPACE ACPI_MODULE_NAME("nsxfeval") +#ifdef ACPI_FUTURE_USAGE /******************************************************************************* * * FUNCTION: acpi_evaluate_object_typed
@@ -72,8 +73,8 @@acpi_status acpi_evaluate_object_typed (acpi_handle handle,acpi_string pathname, -struct acpi_object_list *external_params, -struct acpi_buffer *return_buffer, +struct acpi_object_list * external_params, +struct acpi_buffer * return_buffer,acpi_object_type return_type) {acpi_status status;
@@ -132,7 +133,7 @@/* Caller used ACPI_ALLOCATE_BUFFER, free the return buffer */ -acpi_os_free (return_buffer->pointer); +ACPI_FREE (return_buffer->pointer); return_buffer->pointer =NULL ; }
@@ -141,6 +142,7 @@ } ACPI_EXPORT_SYMBOL(acpi_evaluate_object_typed) +#endif /* ACPI_FUTURE_USAGE */ /******************************************************************************* *
drivers/acpi/namespace/nsxfobj.c +44 -0
50 lines not on this page · raw message
drivers/acpi/namespace/nsparse.c +1 -1
@@ -124,7 +124,7 @@/* Parse the AML */ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE ,"*PARSE* pass %d parse\n" , - pass_number)); + (unsigned )pass_number)); status =acpi_ps_parse_aml (walk_state);acpi_ps_delete_parse_tree (parse_root);
drivers/acpi/hardware/hwregs.c +0 -2
@@ -660,8 +660,6 @@/* * Perform a read first to preserve certain bits (per ACPI spec) -* -* Note: This includes SCI_EN, we never want to change this bit */ status = acpi_hw_register_read(ACPI_MTX_DO_NOT_LOCK, ACPI_REGISTER_PM1_CONTROL,
drivers/acpi/hardware/hwsleep.c +4 -19
@@ -109,6 +109,7 @@* DESCRIPTION: Access function for the firmware_waking_vector field in FACS * ******************************************************************************/ +#ifdef ACPI_FUTURE_USAGE acpi_status acpi_get_firmware_waking_vector (acpi_physical_address * physical_address) {
@@ -150,6 +151,7 @@ } ACPI_EXPORT_SYMBOL(acpi_get_firmware_waking_vector) +#endif /******************************************************************************* *
@@ -250,7 +252,7 @@* THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED * ******************************************************************************/ -acpi_status acpi_enter_sleep_state (u8 sleep_state) +acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state) {u32 PM1Acontrol;u32 PM1Bcontrol;
@@ -287,16 +289,6 @@return_ACPI_STATUS (status); } -if (sleep_state !=ACPI_STATE_S5 ) { - -/* Disable BM arbitration */ - - status =acpi_set_register (ACPI_BITREG_ARB_DISABLE ,1 ); -if (ACPI_FAILURE (status)) { -return_ACPI_STATUS (status); - } - } -/* * 1) Disable/Clear all GPEs * 2) Enable all wakeup GPEs
@@ -431,7 +423,7 @@* THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED * ******************************************************************************/ -acpi_status acpi_enter_sleep_state_s4bios (void ) +acpi_status asmlinkage acpi_enter_sleep_state_s4bios(void) {u32 in_value;acpi_status status;
@@ -609,13 +601,6 @@acpi_set_register (acpi_gbl_fixed_event_info [ACPI_EVENT_POWER_BUTTON ].status_register_id,1 ); -/* Enable BM arbitration */ - - status =acpi_set_register (ACPI_BITREG_ARB_DISABLE ,0 ); -if (ACPI_FAILURE (status)) { -return_ACPI_STATUS (status); - } - arg.integer.value =ACPI_SST_WORKING ; status =acpi_evaluate_object (NULL ,METHOD_NAME__SST , &arg_list,NULL );if (ACPI_FAILURE (status) && status !=AE_NOT_FOUND ) {
drivers/acpi/hardware/hwgpe.c +2 -0
@@ -138,6 +138,7 @@* ******************************************************************************/ +#ifdef ACPI_FUTURE_USAGE acpi_status acpi_hw_get_gpe_status (struct acpi_gpe_event_info * gpe_event_info,acpi_event_status * event_status)
@@ -197,6 +198,7 @@ unlock_and_exit: return (status); } +#endif /* ACPI_FUTURE_USAGE */ /****************************************************************************** *
drivers/acpi/parser/psutils.c +2 -0
@@ -211,6 +211,7 @@/* * Get op's name (4-byte name segment) or 0 if unnamed */ +#ifdef ACPI_FUTURE_USAGE u32 acpi_ps_get_name (union acpi_parse_object * op) {
@@ -224,6 +225,7 @@ return (op->named.name); } +#endif /* ACPI_FUTURE_USAGE */ /* * Set op's name
drivers/acpi/parser/pstree.c +2 -0
@@ -174,6 +174,7 @@ } } +#ifdef ACPI_FUTURE_USAGE /******************************************************************************* * * FUNCTION: acpi_ps_get_depth_next
@@ -305,3 +306,4 @@return (child); }#endif +#endif /* ACPI_FUTURE_USAGE */
drivers/acpi/utilities/utmisc.c +3 -0
@@ -41,6 +41,8 @@* POSSIBILITY OF SUCH DAMAGES. */ +#include <linux/module.h> +#include <acpi/acpi.h> #include <acpi/acnamesp.h>
@@ -1047,6 +1049,7 @@acpi_os_vprintf (format, args);acpi_os_printf (" [%X]\n" ,ACPI_CA_VERSION ); } +EXPORT_SYMBOL (acpi_ut_exception); void ACPI_INTERNAL_VAR_XFACEacpi_ut_warning (char *module_name,u32 line_number,char *format, ...)
drivers/acpi/utilities/utmutex.c +11 -12
@@ -82,12 +82,9 @@/* Create the spinlocks for use at interrupt level */ - status =acpi_os_create_lock (&acpi_gbl_gpe_lock); -if (ACPI_FAILURE (status)) { -return_ACPI_STATUS (status); - } +spin_lock_init (acpi_gbl_gpe_lock); +spin_lock_init (acpi_gbl_hardware_lock); - status =acpi_os_create_lock (&acpi_gbl_hardware_lock);return_ACPI_STATUS (status); }
@@ -246,23 +243,24 @@#endif ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX , -"Thread %X attempting to acquire Mutex [%s]\n" , - this_thread_id,acpi_ut_get_mutex_name (mutex_id))); +"Thread %lX attempting to acquire Mutex [%s]\n" , + (unsigned long ) this_thread_id, +acpi_ut_get_mutex_name (mutex_id))); status =acpi_os_acquire_mutex (acpi_gbl_mutex_info[mutex_id].mutex,ACPI_WAIT_FOREVER );if (ACPI_SUCCESS (status)) {ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX , -"Thread %X acquired Mutex [%s]\n" , - this_thread_id, +"Thread %lX acquired Mutex [%s]\n" , + (unsigned long ) this_thread_id,acpi_ut_get_mutex_name (mutex_id))); acpi_gbl_mutex_info[mutex_id].use_count++; acpi_gbl_mutex_info[mutex_id].thread_id = this_thread_id; }else {ACPI_EXCEPTION ((AE_INFO , status, -"Thread %X could not acquire Mutex [%X]" , - this_thread_id, mutex_id)); +"Thread %lX could not acquire Mutex [%X]" , + (unsigned long ) this_thread_id, mutex_id)); }return (status);
@@ -288,7 +286,8 @@ this_thread_id =acpi_os_get_thread_id ();ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX , -"Thread %X releasing Mutex [%s]\n" , this_thread_id, +"Thread %lX releasing Mutex [%s]\n" , + (unsigned long ) this_thread_id,acpi_ut_get_mutex_name (mutex_id)));if (mutex_id >ACPI_MAX_MUTEX ) {
drivers/acpi/utilities/utdebug.c +4 -4
@@ -47,7 +47,7 @@ ACPI_MODULE_NAME("utdebug")#ifdef ACPI_DEBUG_OUTPUT -static u32 acpi_gbl_prev_thread_id =0xFFFFFFFF ; +static acpi_thread_id acpi_gbl_prev_thread_id;static char *acpi_gbl_fn_entry_str ="----Entry" ;static char *acpi_gbl_fn_exit_str ="----Exit-" ;
@@ -180,8 +180,8 @@if (thread_id != acpi_gbl_prev_thread_id) {if (ACPI_LV_THREADS & acpi_dbg_level) {acpi_os_printf - ("\n**** Context Switch from TID %X to TID %X ****\n\n" , - acpi_gbl_prev_thread_id, thread_id); + ("\n**** Context Switch from TID %lX to TID %lX ****\n\n" , + (unsigned long )acpi_gbl_prev_thread_id, (unsigned long )thread_id); } acpi_gbl_prev_thread_id = thread_id;
@@ -194,7 +194,7 @@acpi_os_printf ("%8s-%04ld " , module_name, line_number);if (ACPI_LV_THREADS & acpi_dbg_level) { -acpi_os_printf ("[%04lX] " , thread_id); +acpi_os_printf ("[%04lX] " , (unsigned long )thread_id); } acpi_os_printf("[%02ld] %-22.22s: ",
drivers/acpi/utilities/utobject.c +1 -0
@@ -321,6 +321,7 @@/* Mark the descriptor type */ +memset (object,0 ,sizeof (union acpi_operand_object ));ACPI_SET_DESCRIPTOR_TYPE (object,ACPI_DESC_TYPE_OPERAND ); ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, "%p Size %X\n",
drivers/acpi/utilities/utglobal.c +5 -9
@@ -55,20 +55,18 @@* Static global variable initialization. * ******************************************************************************/ +/* * We want the debug switches statically initialized so they * are already set when the debugger is entered. */ +/* Debug switch - level and trace mask */ -#ifdef ACPI_DEBUG_OUTPUT u32 acpi_dbg_level =ACPI_DEBUG_DEFAULT ; -#else -u32 acpi_dbg_level =ACPI_NORMAL_DEFAULT ; -#endif /* Debug switch - layer (component) mask */ -u32 acpi_dbg_layer =ACPI_COMPONENT_DEFAULT ; +u32 acpi_dbg_layer =ACPI_COMPONENT_DEFAULT |ACPI_ALL_DRIVERS ;u32 acpi_gbl_nesting_level =0 ;/* Debugger globals */
@@ -736,8 +734,6 @@ return_VOID; } -/* Public globals */ - ACPI_EXPORT_SYMBOL(acpi_dbg_level) - ACPI_EXPORT_SYMBOL(acpi_dbg_layer) - ACPI_EXPORT_SYMBOL(acpi_gpe_count) +ACPI_EXPORT_SYMBOL(acpi_dbg_layer) +ACPI_EXPORT_SYMBOL(acpi_gpe_count)
drivers/acpi/utilities/utcache.c +1 -1
@@ -162,7 +162,7 @@/* Now we can delete the cache object */ -acpi_os_free (cache); +ACPI_FREE (cache);return (AE_OK ); }
drivers/acpi/utilities/utstate.c +3 -2
@@ -63,7 +63,7 @@acpi_ut_create_pkg_state_and_push (void *internal_object, void *external_object, u16 index, - union acpi_generic_state ** state_list) + union acpi_generic_state **state_list) {union acpi_generic_state *state;
@@ -161,6 +161,7 @@if (state) {/* Initialize */ +memset (state,0 ,sizeof (union acpi_generic_state )); state->common.descriptor_type =ACPI_DESC_TYPE_STATE ; }
@@ -202,7 +203,7 @@if (!state->thread.thread_id) {ACPI_ERROR ((AE_INFO ,"Invalid zero ID from AcpiOsGetThreadId" )); - state->thread.thread_id =1 ; + state->thread.thread_id = (acpi_thread_id )1 ; }return_PTR ((struct acpi_thread_state *)state);
drivers/acpi/utilities/utalloc.c +4 -2
@@ -175,10 +175,10 @@/* Free memory lists */ -acpi_os_free (acpi_gbl_global_list); +ACPI_FREE (acpi_gbl_global_list); acpi_gbl_global_list =NULL ; -acpi_os_free (acpi_gbl_ns_node_list); +ACPI_FREE (acpi_gbl_ns_node_list); acpi_gbl_ns_node_list =NULL ;#endif
@@ -294,6 +294,7 @@return (status); } +#ifdef NOT_USED_BY_LINUX /******************************************************************************* * * FUNCTION: acpi_ut_allocate
@@ -369,3 +370,4 @@ return (allocation); } +#endif
drivers/acpi/utilities/utxface.c +2 -0
@@ -338,6 +338,7 @@ACPI_EXPORT_SYMBOL (acpi_terminate) +#ifdef ACPI_FUTURE_USAGE/******************************************************************************* * * FUNCTION: acpi_subsystem_status
@@ -468,6 +469,7 @@ } ACPI_EXPORT_SYMBOL(acpi_install_initialization_handler) +#endif /* ACPI_FUTURE_USAGE */ /***************************************************************************** *
drivers/acpi/utilities/utresrc.c +3 -3
@@ -258,7 +258,7 @@acpi_status acpi_ut_walk_aml_resources (u8 * aml,acpi_size aml_length, -acpi_walk_aml_callback user_function,void *context) +acpi_walk_aml_callback user_function,void **context) {acpi_status status;u8 *end_aml;
@@ -319,7 +319,7 @@/* Return the pointer to the end_tag if requested */ if (!user_function) { - *(void **)context = aml; + *context = aml; }/* Normal exit */
@@ -610,7 +610,7 @@ status =acpi_ut_walk_aml_resources (obj_desc->buffer.pointer, obj_desc->buffer.length,NULL , - end_tag); + (void **)end_tag);return_ACPI_STATUS (status); }
drivers/acpi/events/evmisc.c +3 -6
@@ -305,7 +305,6 @@static u32 acpi_ev_global_lock_handler (void *context) {u8 acquired = FALSE; -acpi_status status;/* * Attempt to get the lock.
@@ -316,15 +315,13 @@ACPI_ACQUIRE_GLOBAL_LOCK (facs, acquired);if (acquired) { -/* Got the lock, now wake the thread waiting for it */ +/* Got the lock, now wake all threads waiting for it */ acpi_gbl_global_lock_acquired = TRUE; -/* Send a unit to the semaphore */ - status = -acpi_os_signal_semaphore (acpi_gbl_global_lock_semaphore,1 ); -if (ACPI_FAILURE (status)) { +if (ACPI_FAILURE (acpi_os_signal_semaphore ( + acpi_gbl_global_lock_semaphore,1 ))) {ACPI_ERROR ((AE_INFO ,"Could not signal Global Lock semaphore" )); }
drivers/acpi/events/evxface.c +52 -7
137 lines not on this page · raw message
drivers/acpi/events/evxfevnt.c +2 -0
@@ -473,6 +473,7 @@ACPI_EXPORT_SYMBOL (acpi_clear_gpe) +#ifdef ACPI_FUTURE_USAGE/******************************************************************************* * * FUNCTION: acpi_get_event_status
@@ -566,6 +567,7 @@ } ACPI_EXPORT_SYMBOL(acpi_get_gpe_status) +#endif /* ACPI_FUTURE_USAGE */ /******************************************************************************* *
include/acpi/actbl1.h +0 -10
@@ -669,16 +669,6 @@#define ACPI_SRAT_MEM_HOT_PLUGGABLE (1<<1)/* 01: Memory region is hot pluggable */ #define ACPI_SRAT_MEM_NON_VOLATILE (1<<2)/* 02: Memory region is non-volatile */ -/* Memory types */ - -enum acpi_address_range_id { -ACPI_ADDRESS_RANGE_MEMORY =1 , -ACPI_ADDRESS_RANGE_RESERVED =2 , -ACPI_ADDRESS_RANGE_ACPI =3 , -ACPI_ADDRESS_RANGE_NVS =4 , -ACPI_ADDRESS_RANGE_COUNT =5 -}; -/******************************************************************************* * * TCPA - Trusted Computing Platform Alliance table
include/acpi/acglobal.h +5 -2
@@ -144,6 +144,7 @@*/ ACPI_EXTERN struct acpi_internal_rsdt acpi_gbl_root_table_list; ACPI_EXTERN struct acpi_table_fadt acpi_gbl_FADT; +extern acpi_native_uint acpi_gbl_permanent_mmap;/* These addresses are calculated from FADT address values */
@@ -182,8 +183,10 @@* Spinlocks are used for interfaces that can be possibly called at * interrupt level */ -ACPI_EXTERN acpi_spinlock acpi_gbl_gpe_lock; /* For GPE data structs and registers */ -ACPI_EXTERN acpi_spinlock acpi_gbl_hardware_lock; /* For ACPI H/W except GPE registers */ +ACPI_EXTERN spinlock_t _acpi_gbl_gpe_lock; /* For GPE data structs and registers */ +ACPI_EXTERN spinlock_t _acpi_gbl_hardware_lock; /* For ACPI H/W except GPE registers */ +#define acpi_gbl_gpe_lock &_acpi_gbl_gpe_lock +#define acpi_gbl_hardware_lock &_acpi_gbl_hardware_lock/***************************************************************************** *
include/acpi/acparser.h +4 -0
@@ -167,8 +167,10 @@union acpi_parse_object *acpi_ps_get_arg (union acpi_parse_object *op,u32 argn); +#ifdef ACPI_FUTURE_USAGE union acpi_parse_object *acpi_ps_get_depth_next (union acpi_parse_object *origin,union acpi_parse_object *op); +#endif /* ACPI_FUTURE_USAGE */ /* * pswalk - parse tree walk routines
@@ -208,7 +210,9 @@u8 acpi_ps_is_prefix_char (u32 c); +#ifdef ACPI_FUTURE_USAGE u32 acpi_ps_get_name (union acpi_parse_object *op); +#endif /* ACPI_FUTURE_USAGE */ void acpi_ps_set_name (union acpi_parse_object *op,u32 name);
include/acpi/acpixf.h +26 -2
@@ -63,20 +63,26 @@acpi_status acpi_terminate (void ); +#ifdef ACPI_FUTURE_USAGE acpi_status acpi_subsystem_status (void ); +#endif acpi_status acpi_enable (void );acpi_status acpi_disable (void ); +#ifdef ACPI_FUTURE_USAGE acpi_status acpi_get_system_info (struct acpi_buffer *ret_buffer); +#endif const char *acpi_format_exception (acpi_status exception);acpi_status acpi_purge_cached_objects (void ); +#ifdef ACPI_FUTURE_USAGE acpi_status acpi_install_initialization_handler (acpi_init_handler handler,u32 function); +#endif /* * ACPI Memory managment
@@ -96,6 +102,10 @@acpi_status acpi_load_tables (void ); +acpi_status acpi_load_table (struct acpi_table_header *table_ptr); + +acpi_status acpi_unload_table_id (acpi_owner_id id); + acpi_status acpi_get_table_header(acpi_string signature, acpi_native_uint instance,
@@ -154,12 +164,14 @@struct acpi_object_list *parameter_objects, struct acpi_buffer *return_object_buffer); +#ifdef ACPI_FUTURE_USAGE acpi_status acpi_evaluate_object_typed (acpi_handle object,acpi_string pathname,struct acpi_object_list *external_params,struct acpi_buffer *return_buffer,acpi_object_type return_type); +#endif acpi_status acpi_get_object_info (acpi_handle handle,struct acpi_buffer *return_buffer);
@@ -171,6 +183,8 @@acpi_status acpi_get_type (acpi_handle object,acpi_object_type * out_type); +acpi_status acpi_get_id (acpi_handle object,acpi_owner_id * out_type); +acpi_status acpi_get_parent (acpi_handle object,acpi_handle * out_handle);/*
@@ -208,7 +222,9 @@u32 gpe_number, u32 type, acpi_event_handler address, void *context); +#ifdef ACPI_FUTURE_USAGE acpi_status acpi_install_exception_handler (acpi_exception_handler handler); +#endif /* * Event interfaces
@@ -227,7 +243,9 @@acpi_status acpi_clear_event (u32 event); +#ifdef ACPI_FUTURE_USAGE acpi_status acpi_get_event_status (u32 event,acpi_event_status * event_status); +#endif /* ACPI_FUTURE_USAGE */ acpi_status acpi_set_gpe_type (acpi_handle gpe_device,u32 gpe_number,u8 type);
@@ -237,10 +255,12 @@acpi_status acpi_clear_gpe (acpi_handle gpe_device,u32 gpe_number,u32 flags); +#ifdef ACPI_FUTURE_USAGE acpi_status acpi_get_gpe_status (acpi_handle gpe_device,u32 gpe_number,u32 flags,acpi_event_status * event_status); +#endif /* ACPI_FUTURE_USAGE */ acpi_status acpi_install_gpe_block(acpi_handle gpe_device,
@@ -266,9 +286,11 @@ acpi_get_current_resources(acpi_handle device_handle, struct acpi_buffer *ret_buffer); +#ifdef ACPI_FUTURE_USAGE acpi_status acpi_get_possible_resources (acpi_handle device_handle,struct acpi_buffer *ret_buffer); +#endif acpi_status acpi_walk_resources(acpi_handle device_handle,
@@ -297,17 +319,19 @@acpi_status acpi_set_firmware_waking_vector (acpi_physical_address physical_address); +#ifdef ACPI_FUTURE_USAGE acpi_status acpi_get_firmware_waking_vector (acpi_physical_address * physical_address); +#endif acpi_status acpi_get_sleep_type_data (u8 sleep_state,u8 * slp_typ_a,u8 * slp_typ_b);acpi_status acpi_enter_sleep_state_prep (u8 sleep_state); -acpi_status acpi_enter_sleep_state (u8 sleep_state); +acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state); -acpi_status acpi_enter_sleep_state_s4bios (void ); +acpi_status asmlinkage acpi_enter_sleep_state_s4bios(void);acpi_status acpi_leave_sleep_state (u8 sleep_state);
include/acpi/acdebug.h +0 -2
@@ -200,8 +200,6 @@ void ACPI_SYSTEM_XFACE acpi_db_execute_thread(void *context); -acpi_status acpi_db_user_commands (char prompt,union acpi_parse_object *op); -/* * dbstats - Generation and display of ACPI table statistics */
include/acpi/acutils.h +6 -2
@@ -81,7 +81,7 @@acpi_status (*acpi_walk_aml_callback) (u8 * aml,u32 length,u32 offset, -u8 resource_index,void *context); +u8 resource_index,void **context);typedef acpi_status(*acpi_pkg_callback) (u8 object_type,
@@ -423,11 +423,13 @@u16 action, union acpi_generic_state **state_list); +#ifdef ACPI_FUTURE_USAGE acpi_status acpi_ut_create_pkg_state_and_push (void *internal_object,void *external_object,u16 index,union acpi_generic_state **state_list); +#endif /* ACPI_FUTURE_USAGE */ union acpi_generic_state *acpi_ut_create_control_state (void );
@@ -496,7 +498,7 @@acpi_status acpi_ut_walk_aml_resources (u8 * aml,acpi_size aml_length, -acpi_walk_aml_callback user_function,void *context); +acpi_walk_aml_callback user_function,void **context);acpi_status acpi_ut_validate_resource (void *aml,u8 * return_index);
@@ -551,7 +553,9 @@void acpi_ut_free_and_track (void *address,u32 component,char *module,u32 line); +#ifdef ACPI_FUTURE_USAGE void acpi_ut_dump_allocation_info (void ); +#endif /* ACPI_FUTURE_USAGE */ void acpi_ut_dump_allocations (u32 component,char *module);
include/acpi/acpiosxf.h +10 -7
@@ -143,15 +143,15 @@*/ void *acpi_os_allocate (acpi_size size); -void acpi_os_free (void *memory); +void __iomem *acpi_os_map_memory (acpi_physical_address where,acpi_native_uint length); -void *acpi_os_map_memory (acpi_physical_address where,acpi_native_uint length); - -void acpi_os_unmap_memory (void *logical_address,acpi_size size); +void acpi_os_unmap_memory (void __iomem * logical_address,acpi_size size); +#ifdef ACPI_FUTURE_USAGE acpi_status acpi_os_get_physical_address (void *logical_address,acpi_physical_address * physical_address); +#endif /* * Memory/Object Cache
@@ -173,13 +173,12 @@* Interrupt handlers */ acpi_status -acpi_os_install_interrupt_handler (u32 interrupt_number, +acpi_os_install_interrupt_handler (u32 gsi,acpi_osd_handler service_routine,void *context);acpi_status -acpi_os_remove_interrupt_handler (u32 interrupt_number, -acpi_osd_handler service_routine); +acpi_os_remove_interrupt_handler (u32 gsi,acpi_osd_handler service_routine);/* * Threads and Scheduling
@@ -243,7 +242,9 @@u8 acpi_os_readable (void *pointer,acpi_size length); +#ifdef ACPI_FUTURE_USAGE u8 acpi_os_writable (void *pointer,acpi_size length); +#endif u64 acpi_os_get_timer (void );
@@ -258,10 +259,12 @@void acpi_os_redirect_output (void *destination); +#ifdef ACPI_FUTURE_USAGE /* * Debug input */ u32 acpi_os_get_line (char *buffer); +#endif /* * Directory manipulation
include/acpi/acconfig.h +1 -1
@@ -105,7 +105,7 @@/* Maximum object reference count (detects object deletion issues) */ -#define ACPI_MAX_REFERENCE_COUNT 0x800 +#define ACPI_MAX_REFERENCE_COUNT 0x1000/* Size of cached memory mapping for system memory operation region */
include/acpi/actbl2.h +0 -49
49 lines not on this page · raw message
include/acpi/actbl.h +3 -4
@@ -284,13 +284,12 @@#pragma pack() +#define ACPI_FADT_OFFSET (f) (u8) ACPI_OFFSET (struct acpi_table_fadt, f) +/* * Get the remaining ACPI tables */ -#include "actbl1.h" -/* Macros used to generate offsets to specific table fields */ - -#define ACPI_FADT_OFFSET (f) (u8) ACPI_OFFSET (struct acpi_table_fadt, f) +#include <acpi/actbl1.h> #endif /* __ACTBL_H__ */
include/acpi/acmacros.h +7 -1
@@ -659,9 +659,15 @@/* Memory allocation */ +#ifndef ACPI_ALLOCATE #define ACPI_ALLOCATE (a) acpi_ut_allocate((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__) +#endif +#ifndef ACPI_ALLOCATE_ZEROED #define ACPI_ALLOCATE_ZEROED (a) acpi_ut_allocate_zeroed((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__) -#define ACPI_FREE (a) acpi_os_free(a) +#endif +#ifndef ACPI_FREE +#define ACPI_FREE (a) acpio_os_free(a) +#endif #define ACPI_MEM_TRACKING (a)#else
include/acpi/aclocal.h +2 -2
@@ -127,7 +127,7 @@/* This Thread ID means that the mutex is not in use (unlocked) */ -#define ACPI_MUTEX_NOT_ACQUIRED (u32) -1 +#define ACPI_MUTEX_NOT_ACQUIRED (acpi_thread_id) 0/* Table for the global mutexes */
@@ -725,7 +725,7 @@* must be preserved. */ #define ACPI_PM1_STATUS_PRESERVED_BITS 0x0800/* Bit 11 */ -#define ACPI_PM1_CONTROL_PRESERVED_BITS 0x0201/* Bit 9, Bit 0 (SCI_EN) */ +#define ACPI_PM1_CONTROL_PRESERVED_BITS 0x0200/* Bit 9 (whatever) */ /* * Register IDs
include/acpi/achware.h +4 -0
@@ -100,9 +100,11 @@ acpi_hw_clear_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info, struct acpi_gpe_block_info *gpe_block); +#ifdef ACPI_FUTURE_USAGE acpi_status acpi_hw_get_gpe_status (struct acpi_gpe_event_info *gpe_event_info,acpi_event_status * event_status); +#endif /* ACPI_FUTURE_USAGE */ acpi_status acpi_hw_disable_all_gpes (void );
@@ -114,6 +116,7 @@ acpi_hw_enable_runtime_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info, struct acpi_gpe_block_info *gpe_block); +#ifdef ACPI_FUTURE_USAGE /* * hwtimer - ACPI Timer prototypes */
@@ -123,5 +126,6 @@acpi_status acpi_get_timer_duration (u32 start_ticks,u32 end_ticks,u32 * time_elapsed); +#endif /* ACPI_FUTURE_USAGE */ #endif /* __ACHWARE_H__ */
include/acpi/acdispat.h +2 -0
@@ -328,9 +328,11 @@struct acpi_walk_state *acpi_ds_get_current_walk_state (struct acpi_thread_state *thread); +#ifdef ACPI_FUTURE_USAGE acpi_status acpi_ds_result_remove (union acpi_operand_object **object,u32 index,struct acpi_walk_state *walk_state); +#endif acpi_status acpi_ds_result_pop(union acpi_operand_object **object,
include/acpi/platform/aclinux.h +37 -3
@@ -49,23 +49,29 @@#ifdef __KERNEL__ -#include <linux/config.h> #include <linux/string.h> #include <linux/kernel.h> +#include <linux/module.h> #include <linux/ctype.h> #include <asm/system.h> #include <asm/atomic.h> #include <asm/div64.h> #include <asm/acpi.h> +#include <linux/slab.h> +#include <linux/spinlock_types.h> +#include <asm/current.h> /* Host-dependent types and defines */ #define ACPI_MACHINE_WIDTH BITS_PER_LONG -#define acpi_cache_t kmem_cache_t -#define acpi_spinlock spinlock_t +#define acpi_cache_t struct kmem_cache +#define acpi_spinlock spinlock_t *#define ACPI_EXPORT_SYMBOL (symbol) EXPORT_SYMBOL(symbol);#define strtoul simple_strtoul +/* Full namespace pathname length limit - arbitrary */ +#define ACPI_PATHNAME_MAX 256 +#else /* !__KERNEL__ */ #include <stdarg.h>
@@ -93,4 +99,32 @@#include "acgcc.h" +#define acpi_cpu_flags unsigned long + +#define acpi_thread_id struct task_struct * + +static inline acpi_thread_id acpi_os_get_thread_id (void ) {return current; } + +/* +* The irqs_disabled() check is for resume from RAM. +* Interrupts are off during resume, just like they are for boot. +* However, boot has (system_state != SYSTEM_RUNNING) +* to quiet __might_sleep() in kmalloc() and resume does not. +*/ +#include <acpi/actypes.h> +static inline void *acpi_os_allocate (acpi_size size) { +return kmalloc (size,irqs_disabled () ?GFP_ATOMIC :GFP_KERNEL ); +} +static inline void *acpi_os_allocate_zeroed (acpi_size size) { +return kzalloc (size,irqs_disabled () ?GFP_ATOMIC :GFP_KERNEL ); +} + +static inline void *acpi_os_acquire_object (acpi_cache_t * cache) { +return kmem_cache_zalloc (cache,irqs_disabled () ?GFP_ATOMIC :GFP_KERNEL ); +} + +#define ACPI_ALLOCATE (a) acpi_os_allocate(a) +#define ACPI_ALLOCATE_ZEROED (a) acpi_os_allocate_zeroed(a) +#define ACPI_FREE (a) kfree(a) +#endif /* __ACLINUX_H__ */
include/acpi/acresrc.h +2 -1
@@ -168,6 +168,7 @@/* * rsutils */ +acpi_status acpi_rs_get_prt_method_data (struct acpi_namespace_node *node,struct acpi_buffer *ret_buffer);
@@ -206,7 +207,7 @@acpi_status acpi_rs_convert_aml_to_resources (u8 * aml,u32 length, -u32 offset,u8 resource_index,void *context); +u32 offset,u8 resource_index,void **context); acpi_status acpi_rs_convert_resources_to_aml(struct acpi_resource *resource,
include/acpi/acinterp.h +2 -0
@@ -366,10 +366,12 @@u32 num_levels, char *note, char *module_name, u32 line_number); +#ifdef ACPI_FUTURE_USAGE void acpi_ex_dump_object_descriptor (union acpi_operand_object *object,u32 flags);void acpi_ex_dump_namespace_node (struct acpi_namespace_node *node,u32 flags); +#endif /* ACPI_FUTURE_USAGE */ /* * exnames - AML namestring support
include/acpi/acnamesp.h +4 -0
@@ -152,7 +152,9 @@/* * nsdump - Namespace dump/print utilities */ +#ifdef ACPI_FUTURE_USAGE void acpi_ns_dump_tables (acpi_handle search_base,u32 max_depth); +#endif /* ACPI_FUTURE_USAGE */ void acpi_ns_dump_entry (acpi_handle handle,u32 debug_level);
@@ -165,11 +167,13 @@ acpi_ns_dump_one_object(acpi_handle obj_handle, u32 level, void *context, void **return_value); +#ifdef ACPI_FUTURE_USAGE void acpi_ns_dump_objects (acpi_object_type type,u8 display_type,u32 max_depth,acpi_owner_id owner_id,acpi_handle start_handle); +#endif /* ACPI_FUTURE_USAGE */ /* * nseval - Namespace evaluation functions