aboutsummaryrefslogtreecommitdiff
path: root/drivers/acpi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/asus_acpi.c2
-rw-r--r--drivers/acpi/bus.c2
-rw-r--r--drivers/acpi/dispatcher/dsfield.c12
-rw-r--r--drivers/acpi/dispatcher/dsinit.c6
-rw-r--r--drivers/acpi/dispatcher/dsmethod.c180
-rw-r--r--drivers/acpi/dispatcher/dsmthdat.c22
-rw-r--r--drivers/acpi/dispatcher/dsobject.c10
-rw-r--r--drivers/acpi/dispatcher/dsopcode.c59
-rw-r--r--drivers/acpi/dispatcher/dsutils.c16
-rw-r--r--drivers/acpi/dispatcher/dswexec.c20
-rw-r--r--drivers/acpi/dispatcher/dswload.c16
-rw-r--r--drivers/acpi/dispatcher/dswscope.c6
-rw-r--r--drivers/acpi/dispatcher/dswstate.c42
-rw-r--r--drivers/acpi/events/evevent.c8
-rw-r--r--drivers/acpi/events/evgpe.c18
-rw-r--r--drivers/acpi/events/evgpeblk.c42
-rw-r--r--drivers/acpi/events/evmisc.c12
-rw-r--r--drivers/acpi/events/evregion.c18
-rw-r--r--drivers/acpi/events/evrgnini.c18
-rw-r--r--drivers/acpi/events/evsci.c8
-rw-r--r--drivers/acpi/events/evxface.c14
-rw-r--r--drivers/acpi/events/evxfevnt.c26
-rw-r--r--drivers/acpi/events/evxfregn.c6
-rw-r--r--drivers/acpi/executer/exconfig.c18
-rw-r--r--drivers/acpi/executer/exconvrt.c10
-rw-r--r--drivers/acpi/executer/excreate.c18
-rw-r--r--drivers/acpi/executer/exdump.c24
-rw-r--r--drivers/acpi/executer/exfield.c12
-rw-r--r--drivers/acpi/executer/exfldio.c30
-rw-r--r--drivers/acpi/executer/exmisc.c10
-rw-r--r--drivers/acpi/executer/exmutex.c12
-rw-r--r--drivers/acpi/executer/exnames.c16
-rw-r--r--drivers/acpi/executer/exoparg1.c12
-rw-r--r--drivers/acpi/executer/exoparg2.c10
-rw-r--r--drivers/acpi/executer/exoparg3.c6
-rw-r--r--drivers/acpi/executer/exoparg6.c2
-rw-r--r--drivers/acpi/executer/exprep.c40
-rw-r--r--drivers/acpi/executer/exregion.c14
-rw-r--r--drivers/acpi/executer/exresnte.c6
-rw-r--r--drivers/acpi/executer/exresolv.c14
-rw-r--r--drivers/acpi/executer/exresop.c8
-rw-r--r--drivers/acpi/executer/exstore.c13
-rw-r--r--drivers/acpi/executer/exstoren.c4
-rw-r--r--drivers/acpi/executer/exstorob.c4
-rw-r--r--drivers/acpi/executer/exsystem.c10
-rw-r--r--drivers/acpi/executer/exutils.c10
-rw-r--r--drivers/acpi/hardware/hwacpi.c6
-rw-r--r--drivers/acpi/hardware/hwgpe.c6
-rw-r--r--drivers/acpi/hardware/hwregs.c24
-rw-r--r--drivers/acpi/hardware/hwsleep.c12
-rw-r--r--drivers/acpi/hardware/hwtimer.c6
-rw-r--r--drivers/acpi/namespace/nsaccess.c6
-rw-r--r--drivers/acpi/namespace/nsalloc.c12
-rw-r--r--drivers/acpi/namespace/nsdump.c8
-rw-r--r--drivers/acpi/namespace/nsdumpdv.c4
-rw-r--r--drivers/acpi/namespace/nseval.c10
-rw-r--r--drivers/acpi/namespace/nsinit.c265
-rw-r--r--drivers/acpi/namespace/nsload.c24
-rw-r--r--drivers/acpi/namespace/nsnames.c4
-rw-r--r--drivers/acpi/namespace/nsobject.c12
-rw-r--r--drivers/acpi/namespace/nsparse.c4
-rw-r--r--drivers/acpi/namespace/nssearch.c8
-rw-r--r--drivers/acpi/namespace/nsutils.c18
-rw-r--r--drivers/acpi/namespace/nswalk.c2
-rw-r--r--drivers/acpi/namespace/nsxfeval.c8
-rw-r--r--drivers/acpi/osl.c63
-rw-r--r--drivers/acpi/parser/psargs.c18
-rw-r--r--drivers/acpi/parser/psloop.c6
-rw-r--r--drivers/acpi/parser/psopcode.c4
-rw-r--r--drivers/acpi/parser/psparse.c28
-rw-r--r--drivers/acpi/parser/psscope.c8
-rw-r--r--drivers/acpi/parser/psutils.c2
-rw-r--r--drivers/acpi/parser/pswalk.c2
-rw-r--r--drivers/acpi/parser/psxface.c7
-rw-r--r--drivers/acpi/resources/rscalc.c8
-rw-r--r--drivers/acpi/resources/rscreate.c24
-rw-r--r--drivers/acpi/resources/rsdump.c42
-rw-r--r--drivers/acpi/resources/rslist.c6
-rw-r--r--drivers/acpi/resources/rsmisc.c4
-rw-r--r--drivers/acpi/resources/rsutils.c10
-rw-r--r--drivers/acpi/resources/rsxface.c14
-rw-r--r--drivers/acpi/system.c4
-rw-r--r--drivers/acpi/tables/tbconvrt.c6
-rw-r--r--drivers/acpi/tables/tbget.c16
-rw-r--r--drivers/acpi/tables/tbgetall.c10
-rw-r--r--drivers/acpi/tables/tbinstal.c41
-rw-r--r--drivers/acpi/tables/tbrsdt.c25
-rw-r--r--drivers/acpi/tables/tbutils.c10
-rw-r--r--drivers/acpi/tables/tbxface.c24
-rw-r--r--drivers/acpi/tables/tbxfroot.c24
-rw-r--r--drivers/acpi/utilities/utalloc.c4
-rw-r--r--drivers/acpi/utilities/utcache.c2
-rw-r--r--drivers/acpi/utilities/utcopy.c16
-rw-r--r--drivers/acpi/utilities/utdelete.c12
-rw-r--r--drivers/acpi/utilities/uteval.c88
-rw-r--r--drivers/acpi/utilities/utglobal.c38
-rw-r--r--drivers/acpi/utilities/utinit.c4
-rw-r--r--drivers/acpi/utilities/utmath.c8
-rw-r--r--drivers/acpi/utilities/utmisc.c16
-rw-r--r--drivers/acpi/utilities/utmutex.c12
-rw-r--r--drivers/acpi/utilities/utobject.c16
-rw-r--r--drivers/acpi/utilities/utresrc.c106
-rw-r--r--drivers/acpi/utilities/utstate.c14
-rw-r--r--drivers/acpi/utilities/utxface.c20
104 files changed, 1144 insertions, 923 deletions
diff --git a/drivers/acpi/asus_acpi.c b/drivers/acpi/asus_acpi.c
index f4c87750dbf..216c072dee5 100644
--- a/drivers/acpi/asus_acpi.c
+++ b/drivers/acpi/asus_acpi.c
@@ -970,7 +970,7 @@ static int __init asus_hotk_get_info(void)
* HID), this bit will be moved. A global variable asus_info contains
* the DSDT header.
*/
- status = acpi_get_table(ACPI_TABLE_DSDT, 1, &dsdt);
+ status = acpi_get_table(ACPI_TABLE_ID_DSDT, 1, &dsdt);
if (ACPI_FAILURE(status))
printk(KERN_WARNING " Couldn't get the DSDT table header\n");
else
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index b3a214db56f..b77f03d51f0 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -619,7 +619,7 @@ void __init acpi_early_init(void)
/*
* Get a separate copy of the FADT for use by other drivers.
*/
- status = acpi_get_table(ACPI_TABLE_FADT, 1, &buffer);
+ status = acpi_get_table(ACPI_TABLE_ID_FADT, 1, &buffer);
if (ACPI_FAILURE(status)) {
printk(KERN_ERR PREFIX "Unable to get the FADT\n");
goto error0;
diff --git a/drivers/acpi/dispatcher/dsfield.c b/drivers/acpi/dispatcher/dsfield.c
index 3d33bcc9867..a6d77efb41a 100644
--- a/drivers/acpi/dispatcher/dsfield.c
+++ b/drivers/acpi/dispatcher/dsfield.c
@@ -87,7 +87,7 @@ acpi_ds_create_buffer_field(union acpi_parse_object *op,
union acpi_operand_object *second_desc = NULL;
u32 flags;
- ACPI_FUNCTION_TRACE("ds_create_buffer_field");
+ ACPI_FUNCTION_TRACE(ds_create_buffer_field);
/* Get the name_string argument */
@@ -210,7 +210,7 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info,
acpi_status status;
acpi_integer position;
- ACPI_FUNCTION_TRACE_PTR("ds_get_field_names", info);
+ ACPI_FUNCTION_TRACE_PTR(ds_get_field_names, info);
/* First field starts at bit zero */
@@ -342,7 +342,7 @@ acpi_ds_create_field(union acpi_parse_object *op,
union acpi_parse_object *arg;
struct acpi_create_field_info info;
- ACPI_FUNCTION_TRACE_PTR("ds_create_field", op);
+ ACPI_FUNCTION_TRACE_PTR(ds_create_field, op);
/* First arg is the name of the parent op_region (must already exist) */
@@ -399,7 +399,7 @@ acpi_ds_init_field_objects(union acpi_parse_object *op,
struct acpi_namespace_node *node;
u8 type = 0;
- ACPI_FUNCTION_TRACE_PTR("ds_init_field_objects", op);
+ ACPI_FUNCTION_TRACE_PTR(ds_init_field_objects, op);
switch (walk_state->opcode) {
case AML_FIELD_OP:
@@ -482,7 +482,7 @@ acpi_ds_create_bank_field(union acpi_parse_object *op,
union acpi_parse_object *arg;
struct acpi_create_field_info info;
- ACPI_FUNCTION_TRACE_PTR("ds_create_bank_field", op);
+ ACPI_FUNCTION_TRACE_PTR(ds_create_bank_field, op);
/* First arg is the name of the parent op_region (must already exist) */
@@ -555,7 +555,7 @@ acpi_ds_create_index_field(union acpi_parse_object *op,
union acpi_parse_object *arg;
struct acpi_create_field_info info;
- ACPI_FUNCTION_TRACE_PTR("ds_create_index_field", op);
+ ACPI_FUNCTION_TRACE_PTR(ds_create_index_field, op);
/* First arg is the name of the Index register (must already exist) */
diff --git a/drivers/acpi/dispatcher/dsinit.c b/drivers/acpi/dispatcher/dsinit.c
index e65a07ad242..bbdf990e9f6 100644
--- a/drivers/acpi/dispatcher/dsinit.c
+++ b/drivers/acpi/dispatcher/dsinit.c
@@ -184,7 +184,7 @@ acpi_ds_init_one_object(acpi_handle obj_handle,
*
* RETURN: Status
*
- * DESCRIPTION: Walk the namespace starting at "start_node" and perform any
+ * DESCRIPTION: Walk the namespace starting at "StartNode" and perform any
* necessary initialization on the objects found therein
*
******************************************************************************/
@@ -196,7 +196,7 @@ acpi_ds_initialize_objects(struct acpi_table_desc * table_desc,
acpi_status status;
struct acpi_init_walk_info info;
- ACPI_FUNCTION_TRACE("ds_initialize_objects");
+ ACPI_FUNCTION_TRACE(ds_initialize_objects);
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
"**** Starting initialization of namespace objects ****\n"));
@@ -213,7 +213,7 @@ acpi_ds_initialize_objects(struct acpi_table_desc * table_desc,
status = acpi_walk_namespace(ACPI_TYPE_ANY, start_node, ACPI_UINT32_MAX,
acpi_ds_init_one_object, &info, NULL);
if (ACPI_FAILURE(status)) {
- ACPI_EXCEPTION((AE_INFO, status, "During walk_namespace"));
+ ACPI_EXCEPTION((AE_INFO, status, "During WalkNamespace"));
}
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
diff --git a/drivers/acpi/dispatcher/dsmethod.c b/drivers/acpi/dispatcher/dsmethod.c
index 7dc59fc7344..651f2b68531 100644
--- a/drivers/acpi/dispatcher/dsmethod.c
+++ b/drivers/acpi/dispatcher/dsmethod.c
@@ -134,7 +134,7 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node * method_node,
{
acpi_status status = AE_OK;
- ACPI_FUNCTION_TRACE_PTR("ds_begin_method_execution", method_node);
+ ACPI_FUNCTION_TRACE_PTR(ds_begin_method_execution, method_node);
if (!method_node) {
return_ACPI_STATUS(AE_NULL_ENTRY);
@@ -170,11 +170,14 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node * method_node,
/*
* Get a unit from the method semaphore. This releases the
- * interpreter if we block
+ * interpreter if we block (then reacquires it)
*/
status =
acpi_ex_system_wait_semaphore(obj_desc->method.semaphore,
ACPI_WAIT_FOREVER);
+ if (ACPI_FAILURE(status)) {
+ return_ACPI_STATUS(status);
+ }
}
/*
@@ -185,7 +188,7 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node * method_node,
if (!obj_desc->method.owner_id) {
status = acpi_ut_allocate_owner_id(&obj_desc->method.owner_id);
if (ACPI_FAILURE(status)) {
- return_ACPI_STATUS(status);
+ goto cleanup;
}
}
@@ -195,6 +198,14 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node * method_node,
*/
obj_desc->method.thread_count++;
return_ACPI_STATUS(status);
+
+ cleanup:
+ /* On error, must signal the method semaphore if present */
+
+ if (obj_desc->method.semaphore) {
+ (void)acpi_os_signal_semaphore(obj_desc->method.semaphore, 1);
+ }
+ return_ACPI_STATUS(status);
}
/*******************************************************************************
@@ -223,7 +234,7 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread,
struct acpi_parameter_info info;
u32 i;
- ACPI_FUNCTION_TRACE_PTR("ds_call_control_method", this_walk_state);
+ ACPI_FUNCTION_TRACE_PTR(ds_call_control_method, this_walk_state);
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
"Execute method %p, currentstate=%p\n",
@@ -242,26 +253,31 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread,
return_ACPI_STATUS(AE_NULL_OBJECT);
}
- /* Init for new method, wait on concurrency semaphore */
+ /* Init for new method, possibly wait on concurrency semaphore */
status = acpi_ds_begin_method_execution(method_node, obj_desc,
this_walk_state->method_node);
if (ACPI_FAILURE(status)) {
- goto cleanup;
+ return_ACPI_STATUS(status);
}
+ /*
+ * 1) Parse the method. All "normal" methods are parsed for each execution.
+ * Internal methods (_OSI, etc.) do not require parsing.
+ */
if (!(obj_desc->method.method_flags & AML_METHOD_INTERNAL_ONLY)) {
- /* 1) Parse: Create a new walk state for the preempting walk */
+ /* Create a new walk state for the parse */
next_walk_state =
acpi_ds_create_walk_state(obj_desc->method.owner_id, op,
obj_desc, NULL);
if (!next_walk_state) {
- return_ACPI_STATUS(AE_NO_MEMORY);
+ status = AE_NO_MEMORY;
+ goto cleanup;
}
- /* Create and init a Root Node */
+ /* Create and init a parse tree root */
op = acpi_ps_create_scope_op();
if (!op) {
@@ -274,17 +290,20 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread,
obj_desc->method.aml_length,
NULL, 1);
if (ACPI_FAILURE(status)) {
- acpi_ds_delete_walk_state(next_walk_state);
+ acpi_ps_delete_parse_tree(op);
goto cleanup;
}
- /* Begin AML parse */
+ /* Begin AML parse (deletes next_walk_state) */
status = acpi_ps_parse_aml(next_walk_state);
acpi_ps_delete_parse_tree(op);
+ if (ACPI_FAILURE(status)) {
+ goto cleanup;
+ }
}
- /* 2) Execute: Create a new state for the preempting walk */
+ /* 2) Begin method execution. Create a new walk state */
next_walk_state = acpi_ds_create_walk_state(obj_desc->method.owner_id,
NULL, obj_desc, thread);
@@ -292,6 +311,7 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread,
status = AE_NO_MEMORY;
goto cleanup;
}
+
/*
* The resolved arguments were put on the previous walk state's operand
* stack. Operands on the previous walk state stack always
@@ -326,6 +346,8 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread,
"Starting nested execution, newstate=%p\n",
next_walk_state));
+ /* Invoke an internal method if necessary */
+
if (obj_desc->method.method_flags & AML_METHOD_INTERNAL_ONLY) {
status = obj_desc->method.implementation(next_walk_state);
}