Skip to content

Commit

Permalink
Merge branch 'acpica' into test
Browse files Browse the repository at this point in the history
  • Loading branch information
lenb committed Oct 23, 2008
2 parents 955ba39 + ed37a71 commit bcb631f
Show file tree
Hide file tree
Showing 62 changed files with 2,411 additions and 690 deletions.
4 changes: 2 additions & 2 deletions drivers/acpi/acpi_memhotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -454,8 +454,8 @@ static int acpi_memory_device_start (struct acpi_device *device)
/* call add_memory func */
result = acpi_memory_enable_device(mem_device);
if (result)
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Error in acpi_memory_enable_device\n"));
printk(KERN_ERR PREFIX
"Error in acpi_memory_enable_device\n");
}
return result;
}
Expand Down
8 changes: 4 additions & 4 deletions drivers/acpi/cm_sbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ struct proc_dir_entry *acpi_lock_ac_dir(void)
if (acpi_ac_dir) {
lock_ac_dir_cnt++;
} else {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Cannot create %s\n", ACPI_AC_CLASS));
printk(KERN_ERR PREFIX
"Cannot create %s\n", ACPI_AC_CLASS);
}
mutex_unlock(&cm_sbs_mutex);
return acpi_ac_dir;
Expand Down Expand Up @@ -83,8 +83,8 @@ struct proc_dir_entry *acpi_lock_battery_dir(void)
if (acpi_battery_dir) {
lock_battery_dir_cnt++;
} else {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Cannot create %s\n", ACPI_BATTERY_CLASS));
printk(KERN_ERR PREFIX
"Cannot create %s\n", ACPI_BATTERY_CLASS);
}
mutex_unlock(&cm_sbs_mutex);
return acpi_battery_dir;
Expand Down
2 changes: 0 additions & 2 deletions drivers/acpi/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ static const struct acpi_dlayer acpi_debug_layers[] = {
};

static const struct acpi_dlevel acpi_debug_levels[] = {
ACPI_DEBUG_INIT(ACPI_LV_ERROR),
ACPI_DEBUG_INIT(ACPI_LV_WARN),
ACPI_DEBUG_INIT(ACPI_LV_INIT),
ACPI_DEBUG_INIT(ACPI_LV_DEBUG_OBJECT),
ACPI_DEBUG_INIT(ACPI_LV_INFO),
Expand Down
3 changes: 3 additions & 0 deletions drivers/acpi/dispatcher/dsmethod.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ acpi_ds_method_error(acpi_status status, struct acpi_walk_state *walk_state)
NULL);
acpi_ex_enter_interpreter();
}

acpi_ds_clear_implicit_return(walk_state);

#ifdef ACPI_DISASSEMBLER
if (ACPI_FAILURE(status)) {

Expand Down
83 changes: 43 additions & 40 deletions drivers/acpi/dispatcher/dsmthdat.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@

#include <acpi/acpi.h>
#include <acpi/acdispat.h>
#include <acpi/amlcode.h>
#include <acpi/acnamesp.h>
#include <acpi/acinterp.h>

Expand All @@ -52,11 +51,11 @@ ACPI_MODULE_NAME("dsmthdat")

/* Local prototypes */
static void
acpi_ds_method_data_delete_value(u16 opcode,
acpi_ds_method_data_delete_value(u8 type,
u32 index, struct acpi_walk_state *walk_state);

static acpi_status
acpi_ds_method_data_set_value(u16 opcode,
acpi_ds_method_data_set_value(u8 type,
u32 index,
union acpi_operand_object *object,
struct acpi_walk_state *walk_state);
Expand Down Expand Up @@ -216,7 +215,7 @@ acpi_ds_method_data_init_args(union acpi_operand_object **params,
* Store the argument in the method/walk descriptor.
* Do not copy the arg in order to implement call by reference
*/
status = acpi_ds_method_data_set_value(AML_ARG_OP, index,
status = acpi_ds_method_data_set_value(ACPI_REFCLASS_ARG, index,
params[index],
walk_state);
if (ACPI_FAILURE(status)) {
Expand All @@ -234,7 +233,8 @@ acpi_ds_method_data_init_args(union acpi_operand_object **params,
*
* FUNCTION: acpi_ds_method_data_get_node
*
* PARAMETERS: Opcode - Either AML_LOCAL_OP or AML_ARG_OP
* PARAMETERS: Type - Either ACPI_REFCLASS_LOCAL or
* ACPI_REFCLASS_ARG
* Index - Which Local or Arg whose type to get
* walk_state - Current walk state object
* Node - Where the node is returned.
Expand All @@ -246,7 +246,7 @@ acpi_ds_method_data_init_args(union acpi_operand_object **params,
******************************************************************************/

acpi_status
acpi_ds_method_data_get_node(u16 opcode,
acpi_ds_method_data_get_node(u8 type,
u32 index,
struct acpi_walk_state *walk_state,
struct acpi_namespace_node **node)
Expand All @@ -256,8 +256,8 @@ acpi_ds_method_data_get_node(u16 opcode,
/*
* Method Locals and Arguments are supported
*/
switch (opcode) {
case AML_LOCAL_OP:
switch (type) {
case ACPI_REFCLASS_LOCAL:

if (index > ACPI_METHOD_MAX_LOCAL) {
ACPI_ERROR((AE_INFO,
Expand All @@ -271,7 +271,7 @@ acpi_ds_method_data_get_node(u16 opcode,
*node = &walk_state->local_variables[index];
break;

case AML_ARG_OP:
case ACPI_REFCLASS_ARG:

if (index > ACPI_METHOD_MAX_ARG) {
ACPI_ERROR((AE_INFO,
Expand All @@ -286,8 +286,8 @@ acpi_ds_method_data_get_node(u16 opcode,
break;

default:
ACPI_ERROR((AE_INFO, "Opcode %d is invalid", opcode));
return_ACPI_STATUS(AE_AML_BAD_OPCODE);
ACPI_ERROR((AE_INFO, "Type %d is invalid", type));
return_ACPI_STATUS(AE_TYPE);
}

return_ACPI_STATUS(AE_OK);
Expand All @@ -297,7 +297,8 @@ acpi_ds_method_data_get_node(u16 opcode,
*
* FUNCTION: acpi_ds_method_data_set_value
*
* PARAMETERS: Opcode - Either AML_LOCAL_OP or AML_ARG_OP
* PARAMETERS: Type - Either ACPI_REFCLASS_LOCAL or
* ACPI_REFCLASS_ARG
* Index - Which Local or Arg to get
* Object - Object to be inserted into the stack entry
* walk_state - Current walk state object
Expand All @@ -310,7 +311,7 @@ acpi_ds_method_data_get_node(u16 opcode,
******************************************************************************/

static acpi_status
acpi_ds_method_data_set_value(u16 opcode,
acpi_ds_method_data_set_value(u8 type,
u32 index,
union acpi_operand_object *object,
struct acpi_walk_state *walk_state)
Expand All @@ -321,13 +322,13 @@ acpi_ds_method_data_set_value(u16 opcode,
ACPI_FUNCTION_TRACE(ds_method_data_set_value);

ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
"NewObj %p Opcode %X, Refs=%d [%s]\n", object,
opcode, object->common.reference_count,
"NewObj %p Type %2.2X, Refs=%d [%s]\n", object,
type, object->common.reference_count,
acpi_ut_get_type_name(object->common.type)));

/* Get the namespace node for the arg/local */

status = acpi_ds_method_data_get_node(opcode, index, walk_state, &node);
status = acpi_ds_method_data_get_node(type, index, walk_state, &node);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
Expand All @@ -350,7 +351,8 @@ acpi_ds_method_data_set_value(u16 opcode,
*
* FUNCTION: acpi_ds_method_data_get_value
*
* PARAMETERS: Opcode - Either AML_LOCAL_OP or AML_ARG_OP
* PARAMETERS: Type - Either ACPI_REFCLASS_LOCAL or
* ACPI_REFCLASS_ARG
* Index - Which local_var or argument to get
* walk_state - Current walk state object
* dest_desc - Where Arg or Local value is returned
Expand All @@ -363,7 +365,7 @@ acpi_ds_method_data_set_value(u16 opcode,
******************************************************************************/

acpi_status
acpi_ds_method_data_get_value(u16 opcode,
acpi_ds_method_data_get_value(u8 type,
u32 index,
struct acpi_walk_state *walk_state,
union acpi_operand_object **dest_desc)
Expand All @@ -383,7 +385,7 @@ acpi_ds_method_data_get_value(u16 opcode,

/* Get the namespace node for the arg/local */

status = acpi_ds_method_data_get_node(opcode, index, walk_state, &node);
status = acpi_ds_method_data_get_node(type, index, walk_state, &node);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
Expand Down Expand Up @@ -419,16 +421,16 @@ acpi_ds_method_data_get_value(u16 opcode,
/* Otherwise, return the error */

else
switch (opcode) {
case AML_ARG_OP:
switch (type) {
case ACPI_REFCLASS_ARG:

ACPI_ERROR((AE_INFO,
"Uninitialized Arg[%d] at node %p",
index, node));

return_ACPI_STATUS(AE_AML_UNINITIALIZED_ARG);

case AML_LOCAL_OP:
case ACPI_REFCLASS_LOCAL:

ACPI_ERROR((AE_INFO,
"Uninitialized Local[%d] at node %p",
Expand All @@ -437,9 +439,10 @@ acpi_ds_method_data_get_value(u16 opcode,
return_ACPI_STATUS(AE_AML_UNINITIALIZED_LOCAL);

default:

ACPI_ERROR((AE_INFO,
"Not a Arg/Local opcode: %X",
opcode));
type));
return_ACPI_STATUS(AE_AML_INTERNAL);
}
}
Expand All @@ -458,7 +461,8 @@ acpi_ds_method_data_get_value(u16 opcode,
*
* FUNCTION: acpi_ds_method_data_delete_value
*
* PARAMETERS: Opcode - Either AML_LOCAL_OP or AML_ARG_OP
* PARAMETERS: Type - Either ACPI_REFCLASS_LOCAL or
* ACPI_REFCLASS_ARG
* Index - Which local_var or argument to delete
* walk_state - Current walk state object
*
Expand All @@ -470,7 +474,7 @@ acpi_ds_method_data_get_value(u16 opcode,
******************************************************************************/

static void
acpi_ds_method_data_delete_value(u16 opcode,
acpi_ds_method_data_delete_value(u8 type,
u32 index, struct acpi_walk_state *walk_state)
{
acpi_status status;
Expand All @@ -481,7 +485,7 @@ acpi_ds_method_data_delete_value(u16 opcode,

/* Get the namespace node for the arg/local */

status = acpi_ds_method_data_get_node(opcode, index, walk_state, &node);
status = acpi_ds_method_data_get_node(type, index, walk_state, &node);
if (ACPI_FAILURE(status)) {
return_VOID;
}
Expand Down Expand Up @@ -514,7 +518,8 @@ acpi_ds_method_data_delete_value(u16 opcode,
*
* FUNCTION: acpi_ds_store_object_to_local
*
* PARAMETERS: Opcode - Either AML_LOCAL_OP or AML_ARG_OP
* PARAMETERS: Type - Either ACPI_REFCLASS_LOCAL or
* ACPI_REFCLASS_ARG
* Index - Which Local or Arg to set
* obj_desc - Value to be stored
* walk_state - Current walk state
Expand All @@ -528,7 +533,7 @@ acpi_ds_method_data_delete_value(u16 opcode,
******************************************************************************/

acpi_status
acpi_ds_store_object_to_local(u16 opcode,
acpi_ds_store_object_to_local(u8 type,
u32 index,
union acpi_operand_object *obj_desc,
struct acpi_walk_state *walk_state)
Expand All @@ -539,8 +544,8 @@ acpi_ds_store_object_to_local(u16 opcode,
union acpi_operand_object *new_obj_desc;

ACPI_FUNCTION_TRACE(ds_store_object_to_local);
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Opcode=%X Index=%d Obj=%p\n",
opcode, index, obj_desc));
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Type=%2.2X Index=%d Obj=%p\n",
type, index, obj_desc));

/* Parameter validation */

Expand All @@ -550,7 +555,7 @@ acpi_ds_store_object_to_local(u16 opcode,

/* Get the namespace node for the arg/local */

status = acpi_ds_method_data_get_node(opcode, index, walk_state, &node);
status = acpi_ds_method_data_get_node(type, index, walk_state, &node);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
Expand Down Expand Up @@ -602,7 +607,7 @@ acpi_ds_store_object_to_local(u16 opcode,
*
* Weird, but true.
*/
if (opcode == AML_ARG_OP) {
if (type == ACPI_REFCLASS_ARG) {
/*
* If we have a valid reference object that came from ref_of(),
* do the indirect store
Expand All @@ -611,8 +616,8 @@ acpi_ds_store_object_to_local(u16 opcode,
ACPI_DESC_TYPE_OPERAND)
&& (current_obj_desc->common.type ==
ACPI_TYPE_LOCAL_REFERENCE)
&& (current_obj_desc->reference.opcode ==
AML_REF_OF_OP)) {
&& (current_obj_desc->reference.class ==
ACPI_REFCLASS_REFOF)) {
ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
"Arg (%p) is an ObjRef(Node), storing in node %p\n",
new_obj_desc,
Expand Down Expand Up @@ -640,11 +645,9 @@ acpi_ds_store_object_to_local(u16 opcode,
}
}

/*
* Delete the existing object
* before storing the new one
*/
acpi_ds_method_data_delete_value(opcode, index, walk_state);
/* Delete the existing object before storing the new one */

acpi_ds_method_data_delete_value(type, index, walk_state);
}

/*
Expand All @@ -653,7 +656,7 @@ acpi_ds_store_object_to_local(u16 opcode,
* (increments the object reference count by one)
*/
status =
acpi_ds_method_data_set_value(opcode, index, new_obj_desc,
acpi_ds_method_data_set_value(type, index, new_obj_desc,
walk_state);

/* Remove local reference if we copied the object above */
Expand Down
Loading

0 comments on commit bcb631f

Please sign in to comment.