Commit bcb631f3 authored by Len Brown's avatar Len Brown

Merge branch 'acpica' into test

parents 955ba395 ed37a71e
...@@ -454,8 +454,8 @@ static int acpi_memory_device_start (struct acpi_device *device) ...@@ -454,8 +454,8 @@ static int acpi_memory_device_start (struct acpi_device *device)
/* call add_memory func */ /* call add_memory func */
result = acpi_memory_enable_device(mem_device); result = acpi_memory_enable_device(mem_device);
if (result) if (result)
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, printk(KERN_ERR PREFIX
"Error in acpi_memory_enable_device\n")); "Error in acpi_memory_enable_device\n");
} }
return result; return result;
} }
......
...@@ -52,8 +52,8 @@ struct proc_dir_entry *acpi_lock_ac_dir(void) ...@@ -52,8 +52,8 @@ struct proc_dir_entry *acpi_lock_ac_dir(void)
if (acpi_ac_dir) { if (acpi_ac_dir) {
lock_ac_dir_cnt++; lock_ac_dir_cnt++;
} else { } else {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, printk(KERN_ERR PREFIX
"Cannot create %s\n", ACPI_AC_CLASS)); "Cannot create %s\n", ACPI_AC_CLASS);
} }
mutex_unlock(&cm_sbs_mutex); mutex_unlock(&cm_sbs_mutex);
return acpi_ac_dir; return acpi_ac_dir;
...@@ -83,8 +83,8 @@ struct proc_dir_entry *acpi_lock_battery_dir(void) ...@@ -83,8 +83,8 @@ struct proc_dir_entry *acpi_lock_battery_dir(void)
if (acpi_battery_dir) { if (acpi_battery_dir) {
lock_battery_dir_cnt++; lock_battery_dir_cnt++;
} else { } else {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, printk(KERN_ERR PREFIX
"Cannot create %s\n", ACPI_BATTERY_CLASS)); "Cannot create %s\n", ACPI_BATTERY_CLASS);
} }
mutex_unlock(&cm_sbs_mutex); mutex_unlock(&cm_sbs_mutex);
return acpi_battery_dir; return acpi_battery_dir;
......
...@@ -47,8 +47,6 @@ static const struct acpi_dlayer acpi_debug_layers[] = { ...@@ -47,8 +47,6 @@ static const struct acpi_dlayer acpi_debug_layers[] = {
}; };
static const struct acpi_dlevel acpi_debug_levels[] = { 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_INIT),
ACPI_DEBUG_INIT(ACPI_LV_DEBUG_OBJECT), ACPI_DEBUG_INIT(ACPI_LV_DEBUG_OBJECT),
ACPI_DEBUG_INIT(ACPI_LV_INFO), ACPI_DEBUG_INIT(ACPI_LV_INFO),
......
...@@ -103,6 +103,9 @@ acpi_ds_method_error(acpi_status status, struct acpi_walk_state *walk_state) ...@@ -103,6 +103,9 @@ acpi_ds_method_error(acpi_status status, struct acpi_walk_state *walk_state)
NULL); NULL);
acpi_ex_enter_interpreter(); acpi_ex_enter_interpreter();
} }
acpi_ds_clear_implicit_return(walk_state);
#ifdef ACPI_DISASSEMBLER #ifdef ACPI_DISASSEMBLER
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
......
This diff is collapsed.
...@@ -731,54 +731,70 @@ acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state, ...@@ -731,54 +731,70 @@ acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state,
switch (op_info->type) { switch (op_info->type) {
case AML_TYPE_LOCAL_VARIABLE: case AML_TYPE_LOCAL_VARIABLE:
/* Split the opcode into a base opcode + offset */ /* Local ID (0-7) is (AML opcode - base AML_LOCAL_OP) */
obj_desc->reference.opcode = AML_LOCAL_OP; obj_desc->reference.value = opcode - AML_LOCAL_OP;
obj_desc->reference.offset = opcode - AML_LOCAL_OP; obj_desc->reference.class = ACPI_REFCLASS_LOCAL;
#ifndef ACPI_NO_METHOD_EXECUTION #ifndef ACPI_NO_METHOD_EXECUTION
status = acpi_ds_method_data_get_node(AML_LOCAL_OP, status =
obj_desc-> acpi_ds_method_data_get_node(ACPI_REFCLASS_LOCAL,
reference.offset, obj_desc->reference.
walk_state, value, walk_state,
(struct ACPI_CAST_INDIRECT_PTR
acpi_namespace_node (struct
**)&obj_desc-> acpi_namespace_node,
reference.object); &obj_desc->reference.
object));
#endif #endif
break; break;
case AML_TYPE_METHOD_ARGUMENT: case AML_TYPE_METHOD_ARGUMENT:
/* Split the opcode into a base opcode + offset */ /* Arg ID (0-6) is (AML opcode - base AML_ARG_OP) */
obj_desc->reference.opcode = AML_ARG_OP; obj_desc->reference.value = opcode - AML_ARG_OP;
obj_desc->reference.offset = opcode - AML_ARG_OP; obj_desc->reference.class = ACPI_REFCLASS_ARG;
#ifndef ACPI_NO_METHOD_EXECUTION #ifndef ACPI_NO_METHOD_EXECUTION
status = acpi_ds_method_data_get_node(AML_ARG_OP, status = acpi_ds_method_data_get_node(ACPI_REFCLASS_ARG,
obj_desc-> obj_desc->
reference.offset, reference.value,
walk_state, walk_state,
ACPI_CAST_INDIRECT_PTR
(struct (struct
acpi_namespace_node acpi_namespace_node,
**)&obj_desc-> &obj_desc->
reference.object); reference.
object));
#endif #endif
break; break;
default: /* Other literals, etc.. */ default: /* Object name or Debug object */
if (op->common.aml_opcode == AML_INT_NAMEPATH_OP) { switch (op->common.aml_opcode) {
case AML_INT_NAMEPATH_OP:
/* Node was saved in Op */ /* Node was saved in Op */
obj_desc->reference.node = op->common.node; obj_desc->reference.node = op->common.node;
obj_desc->reference.object = obj_desc->reference.object =
op->common.node->object; op->common.node->object;
} obj_desc->reference.class = ACPI_REFCLASS_NAME;
break;
case AML_DEBUG_OP:
obj_desc->reference.opcode = opcode; obj_desc->reference.class = ACPI_REFCLASS_DEBUG;
break;
default:
ACPI_ERROR((AE_INFO,
"Unimplemented reference type for AML opcode: %4.4X",
opcode));
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
}
break; break;
} }
break; break;
......
...@@ -1330,7 +1330,7 @@ acpi_ds_exec_end_control_op(struct acpi_walk_state * walk_state, ...@@ -1330,7 +1330,7 @@ acpi_ds_exec_end_control_op(struct acpi_walk_state * walk_state,
(walk_state->results->results.obj_desc[0]) == (walk_state->results->results.obj_desc[0]) ==
ACPI_TYPE_LOCAL_REFERENCE) ACPI_TYPE_LOCAL_REFERENCE)
&& ((walk_state->results->results.obj_desc[0])-> && ((walk_state->results->results.obj_desc[0])->
reference.opcode != AML_INDEX_OP)) { reference.class != ACPI_REFCLASS_INDEX)) {
status = status =
acpi_ex_resolve_to_value(&walk_state-> acpi_ex_resolve_to_value(&walk_state->
results->results. results->results.
......
...@@ -166,6 +166,10 @@ acpi_ds_get_predicate_value(struct acpi_walk_state *walk_state, ...@@ -166,6 +166,10 @@ acpi_ds_get_predicate_value(struct acpi_walk_state *walk_state,
status = AE_CTRL_FALSE; status = AE_CTRL_FALSE;
} }
/* Predicate can be used for an implicit return value */
(void)acpi_ds_do_implicit_return(local_obj_desc, walk_state, TRUE);
cleanup: cleanup:
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Completed a predicate eval=%X Op=%p\n", ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Completed a predicate eval=%X Op=%p\n",
...@@ -429,10 +433,10 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state) ...@@ -429,10 +433,10 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
ACPI_TYPE_LOCAL_REFERENCE) ACPI_TYPE_LOCAL_REFERENCE)
&& (walk_state->operands[1]->common.type == && (walk_state->operands[1]->common.type ==
ACPI_TYPE_LOCAL_REFERENCE) ACPI_TYPE_LOCAL_REFERENCE)
&& (walk_state->operands[0]->reference.opcode == && (walk_state->operands[0]->reference.class ==
walk_state->operands[1]->reference.opcode) walk_state->operands[1]->reference.class)
&& (walk_state->operands[0]->reference.offset == && (walk_state->operands[0]->reference.value ==
walk_state->operands[1]->reference.offset)) { walk_state->operands[1]->reference.value)) {
status = AE_OK; status = AE_OK;
} else { } else {
ACPI_EXCEPTION((AE_INFO, status, ACPI_EXCEPTION((AE_INFO, status,
......
...@@ -43,7 +43,6 @@ ...@@ -43,7 +43,6 @@
#include <acpi/acpi.h> #include <acpi/acpi.h>
#include <acpi/acinterp.h> #include <acpi/acinterp.h>
#include <acpi/amlcode.h>
#include <acpi/acnamesp.h> #include <acpi/acnamesp.h>
#include <acpi/actables.h> #include <acpi/actables.h>
#include <acpi/acdispat.h> #include <acpi/acdispat.h>
...@@ -91,13 +90,12 @@ acpi_ex_add_table(u32 table_index, ...@@ -91,13 +90,12 @@ acpi_ex_add_table(u32 table_index,
/* Init the table handle */ /* Init the table handle */
obj_desc->reference.opcode = AML_LOAD_OP; obj_desc->reference.class = ACPI_REFCLASS_TABLE;
*ddb_handle = obj_desc; *ddb_handle = obj_desc;
/* Install the new table into the local data structures */ /* Install the new table into the local data structures */
obj_desc->reference.object = ACPI_CAST_PTR(void, obj_desc->reference.value = table_index;
(unsigned long)table_index);
/* Add the table to the namespace */ /* Add the table to the namespace */
...@@ -280,6 +278,7 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc, ...@@ -280,6 +278,7 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
struct acpi_walk_state *walk_state) struct acpi_walk_state *walk_state)
{ {
union acpi_operand_object *ddb_handle; union acpi_operand_object *ddb_handle;
struct acpi_table_header *table;
struct acpi_table_desc table_desc; struct acpi_table_desc table_desc;
u32 table_index; u32 table_index;
acpi_status status; acpi_status status;
...@@ -294,9 +293,8 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc, ...@@ -294,9 +293,8 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
switch (ACPI_GET_OBJECT_TYPE(obj_desc)) { switch (ACPI_GET_OBJECT_TYPE(obj_desc)) {
case ACPI_TYPE_REGION: case ACPI_TYPE_REGION:
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Load from Region %p %s\n", ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
obj_desc, "Load table from Region %p\n", obj_desc));
acpi_ut_get_object_type_name(obj_desc)));
/* Region must be system_memory (from ACPI spec) */ /* Region must be system_memory (from ACPI spec) */
...@@ -316,61 +314,112 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc, ...@@ -316,61 +314,112 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
} }
/* /*
* We will simply map the memory region for the table. However, the * Map the table header and get the actual table length. The region
* memory region is technically not guaranteed to remain stable and * length is not guaranteed to be the same as the table length.
* we may eventually have to copy the table to a local buffer. */
table = acpi_os_map_memory(obj_desc->region.address,
sizeof(struct acpi_table_header));
if (!table) {
return_ACPI_STATUS(AE_NO_MEMORY);
}
length = table->length;
acpi_os_unmap_memory(table, sizeof(struct acpi_table_header));
/* Must have at least an ACPI table header */
if (length < sizeof(struct acpi_table_header)) {
return_ACPI_STATUS(AE_INVALID_TABLE_LENGTH);
}
/*
* The memory region is not guaranteed to remain stable and we must
* copy the table to a local buffer. For example, the memory region
* is corrupted after suspend on some machines. Dynamically loaded
* tables are usually small, so this overhead is minimal.
*/ */
/* Allocate a buffer for the table */
table_desc.pointer = ACPI_ALLOCATE(length);
if (!table_desc.pointer) {
return_ACPI_STATUS(AE_NO_MEMORY);
}
/* Map the entire table and copy it */
table = acpi_os_map_memory(obj_desc->region.address, length);
if (!table) {
ACPI_FREE(table_desc.pointer);
return_ACPI_STATUS(AE_NO_MEMORY);
}
ACPI_MEMCPY(table_desc.pointer, table, length);
acpi_os_unmap_memory(table, length);
table_desc.address = obj_desc->region.address; table_desc.address = obj_desc->region.address;
table_desc.length = obj_desc->region.length;
table_desc.flags = ACPI_TABLE_ORIGIN_MAPPED;
break; break;
case ACPI_TYPE_BUFFER: /* Buffer or resolved region_field */ case ACPI_TYPE_BUFFER: /* Buffer or resolved region_field */
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
"Load from Buffer or Field %p %s\n", obj_desc, "Load table from Buffer or Field %p\n",
acpi_ut_get_object_type_name(obj_desc))); obj_desc));
length = obj_desc->buffer.length;
/* Must have at least an ACPI table header */ /* Must have at least an ACPI table header */
if (length < sizeof(struct acpi_table_header)) { if (obj_desc->buffer.length < sizeof(struct acpi_table_header)) {
return_ACPI_STATUS(AE_INVALID_TABLE_LENGTH); return_ACPI_STATUS(AE_INVALID_TABLE_LENGTH);
} }
/* Validate checksum here. It won't get validated in tb_add_table */ /* Get the actual table length from the table header */
status = table =
acpi_tb_verify_checksum(ACPI_CAST_PTR ACPI_CAST_PTR(struct acpi_table_header,
(struct acpi_table_header, obj_desc->buffer.pointer);
obj_desc->buffer.pointer), length); length = table->length;
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status); /* Table cannot extend beyond the buffer */
if (length > obj_desc->buffer.length) {
return_ACPI_STATUS(AE_AML_BUFFER_LIMIT);
}
if (length < sizeof(struct acpi_table_header)) {
return_ACPI_STATUS(AE_INVALID_TABLE_LENGTH);
} }
/* /*
* We need to copy the buffer since the original buffer could be * Copy the table from the buffer because the buffer could be modified
* changed or deleted in the future * or even deleted in the future
*/ */
table_desc.pointer = ACPI_ALLOCATE(length); table_desc.pointer = ACPI_ALLOCATE(length);
if (!table_desc.pointer) { if (!table_desc.pointer) {
return_ACPI_STATUS(AE_NO_MEMORY); return_ACPI_STATUS(AE_NO_MEMORY);
} }
ACPI_MEMCPY(table_desc.pointer, obj_desc->buffer.pointer, ACPI_MEMCPY(table_desc.pointer, table, length);
length); table_desc.address = ACPI_TO_INTEGER(table_desc.pointer);
table_desc.length = length;
table_desc.flags = ACPI_TABLE_ORIGIN_ALLOCATED;
break; break;
default: default:
return_ACPI_STATUS(AE_AML_OPERAND_TYPE); return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
} }
/* /* Validate table checksum (will not get validated in tb_add_table) */
* Install the new table into the local data structures
*/ status = acpi_tb_verify_checksum(table_desc.pointer, length);
if (ACPI_FAILURE(status)) {
ACPI_FREE(table_desc.pointer);
return_ACPI_STATUS(status);
}
/* Complete the table descriptor */
table_desc.length = length;
table_desc.flags = ACPI_TABLE_ORIGIN_ALLOCATED;
/* Install the new table into the local data structures */
status = acpi_tb_add_table(&table_desc, &table_index); status = acpi_tb_add_table(&table_desc, &table_index);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
goto cleanup; goto cleanup;
...@@ -379,7 +428,7 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc, ...@@ -379,7 +428,7 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
/* /*
* Add the table to the namespace. * Add the table to the namespace.
* *
* Note: We load the table objects relative to the root of the namespace. * Note: Load the table objects relative to the root of the namespace.
* This appears to go against the ACPI specification, but we do it for * This appears to go against the ACPI specification, but we do it for
* compatibility with other ACPI implementations. * compatibility with other ACPI implementations.
*/ */
...@@ -415,7 +464,7 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc, ...@@ -415,7 +464,7 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
cleanup: cleanup:
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
/* Delete allocated buffer or mapping */ /* Delete allocated table buffer */
acpi_tb_delete_table(&table_desc); acpi_tb_delete_table(&table_desc);
} }
...@@ -455,9 +504,9 @@ acpi_status acpi_ex_unload_table(union acpi_operand_object *ddb_handle) ...@@ -455,9 +504,9 @@ acpi_status acpi_ex_unload_table(union acpi_operand_object *ddb_handle)
return_ACPI_STATUS(AE_BAD_PARAMETER); return_ACPI_STATUS(AE_BAD_PARAMETER);
} }
/* Get the table index from the ddb_handle (acpi_size for 64-bit case) */ /* Get the table index from the ddb_handle */
table_index = (u32) (acpi_size) table_desc->reference.object; table_index = table_desc->reference.value;
/* Invoke table handler if present */ /* Invoke table handler if present */
......
...@@ -57,7 +57,7 @@ acpi_ex_convert_to_ascii(acpi_integer integer, ...@@ -57,7 +57,7 @@ acpi_ex_convert_to_ascii(acpi_integer integer,
* *
* FUNCTION: acpi_ex_convert_to_integer * FUNCTION: acpi_ex_convert_to_integer
* *
* PARAMETERS: obj_desc - Object to be converted. Must be an * PARAMETERS: obj_desc - Object to be converted. Must be an
* Integer, Buffer, or String * Integer, Buffer, or String
* result_desc - Where the new Integer object is returned * result_desc - Where the new Integer object is returned
* Flags - Used for string conversion * Flags - Used for string conversion
...@@ -103,7 +103,7 @@ acpi_ex_convert_to_integer(union acpi_operand_object *obj_desc, ...@@ -103,7 +103,7 @@ acpi_ex_convert_to_integer(union acpi_operand_object *obj_desc,
} }
/* /*
* Convert the buffer/string to an integer. Note that both buffers and * Convert the buffer/string to an integer. Note that both buffers and
* strings are treated as raw data - we don't convert ascii to hex for * strings are treated as raw data - we don't convert ascii to hex for
* strings. * strings.
* *
...@@ -120,7 +120,7 @@ acpi_ex_convert_to_integer(union acpi_operand_object *obj_desc, ...@@ -120,7 +120,7 @@ acpi_ex_convert_to_integer(union acpi_operand_object *obj_desc,
/* /*
* Convert string to an integer - for most cases, the string must be * Convert string to an integer - for most cases, the string must be
* hexadecimal as per the ACPI specification. The only exception (as * hexadecimal as per the ACPI specification. The only exception (as
* of ACPI 3.0) is that the to_integer() operator allows both decimal * of ACPI 3.0) is that the to_integer() operator allows both decimal
* and hexadecimal strings (hex prefixed with "0x"). * and hexadecimal strings (hex prefixed with "0x").
*/ */
...@@ -159,6 +159,7 @@ acpi_ex_convert_to_integer(union acpi_operand_object *obj_desc, ...@@ -159,6 +159,7 @@ acpi_ex_convert_to_integer(union acpi_operand_object *obj_desc,
break; break;
default: default:
/* No other types can get here */ /* No other types can get here */
break; break;
} }
...@@ -185,7 +186,7 @@ acpi_ex_convert_to_integer(union acpi_operand_object *obj_desc, ...@@ -185,7 +186,7 @@ acpi_ex_convert_to_integer(union acpi_operand_object *obj_desc,
* *
* FUNCTION: acpi_ex_convert_to_buffer * FUNCTION: acpi_ex_convert_to_buffer
* *
* PARAMETERS: obj_desc - Object to be converted. Must be an * PARAMETERS: obj_desc - Object to be converted. Must be an
* Integer, Buffer, or String * Integer, Buffer, or String
* result_desc - Where the new buffer object is returned * result_desc - Where the new buffer object is returned
* *
...@@ -365,7 +366,7 @@ acpi_ex_convert_to_ascii(acpi_integer integer, ...@@ -365,7 +366,7 @@ acpi_ex_convert_to_ascii(acpi_integer integer,
} }
/* /*
* Since leading zeros are supressed, we must check for the case where * Since leading zeros are suppressed, we must check for the case where
* the integer equals 0 * the integer equals 0
* *
* Finally, null terminate the string and return the length * Finally, null terminate the string and return the length
...@@ -383,7 +384,7 @@ acpi_ex_convert_to_ascii(acpi_integer integer, ...@@ -383,7 +384,7 @@ acpi_ex_convert_to_ascii(acpi_integer integer,
* *
* FUNCTION: acpi_ex_convert_to_string * FUNCTION: acpi_ex_convert_to_string
* *
* PARAMETERS: obj_desc - Object to be converted. Must be an * PARAMETERS: obj_desc - Object to be converted. Must be an
* Integer, Buffer, or String * Integer, Buffer, or String
* result_desc - Where the string object is returned * result_desc - Where the string object is returned
* Type - String flags (base and conversion type) * Type - String flags (base and conversion type)
...@@ -472,7 +473,7 @@ acpi_ex_convert_to_string(union acpi_operand_object * obj_desc, ...@@ -472,7 +473,7 @@ acpi_ex_convert_to_string(union acpi_operand_object * obj_desc,
base = 10; base = 10;
/* /*
* Calculate the final string length. Individual string values * Calculate the final string length. Individual string values
* are variable length (include separator for each) * are variable length (include separator for each)
*/ */
for (i = 0; i < obj_desc->buffer.length; i++) { for (i = 0; i < obj_desc->buffer.length; i++) {
...@@ -511,9 +512,14 @@ acpi_ex_convert_to_string(union acpi_operand_object * obj_desc, ...@@ -511,9 +512,14 @@ acpi_ex_convert_to_string(union acpi_operand_object * obj_desc,
/* /*
* Create a new string object and string buffer * Create a new string object and string buffer
* (-1 because of extra separator included in string_length from above) * (-1 because of extra separator included in string_length from above)
* Allow creation of zero-length strings from zero-length buffers.
*/ */
if (string_length) {
string_length--;
}
return_desc = acpi_ut_create_string_object((acpi_size) return_desc = acpi_ut_create_string_object((acpi_size)
(string_length - 1)); string_length);
if (!return_desc) { if (!return_desc) {
return_ACPI_STATUS(AE_NO_MEMORY); return_ACPI_STATUS(AE_NO_MEMORY);
} }
...@@ -536,7 +542,9 @@ acpi_ex_convert_to_string(union acpi_operand_object * obj_desc, ...@@ -536,7 +542,9 @@ acpi_ex_convert_to_string(union acpi_operand_object * obj_desc,
* Null terminate the string * Null terminate the string
* (overwrites final comma/space from above) * (overwrites final comma/space from above)
*/ */
new_buf--; if (obj_desc->buffer.length) {
new_buf--;
}
*new_buf = 0; *new_buf = 0;
break; break;
...@@ -617,7 +625,7 @@ acpi_ex_convert_to_target_type(acpi_object_type destination_type, ...@@ -617,7 +625,7 @@ acpi_ex_convert_to_target_type(acpi_object_type destination_type,
case ACPI_TYPE_LOCAL_BANK_FIELD: case ACPI_TYPE_LOCAL_BANK_FIELD:
case ACPI_TYPE_LOCAL_INDEX_FIELD: case ACPI_TYPE_LOCAL_INDEX_FIELD:
/* /*
* These types require an Integer operand. We can convert * These types require an Integer operand. We can convert
* a Buffer or a String to an Integer if necessary. * a Buffer or a String to an Integer if necessary.
*/ */
status = status =
...@@ -627,7 +635,7 @@ acpi_ex_convert_to_target_type(acpi_object_type destination_type, ...@@ -627,7 +635,7 @@ acpi_ex_convert_to_target_type(acpi_object_type destination_type,
case ACPI_TYPE_STRING: case ACPI_TYPE_STRING:
/* /*
* The operand must be a String. We can convert an * The operand must be a String. We can convert an
* Integer or Buffer if necessary * Integer or Buffer if necessary
*/ */
status = status =
...@@ -637,7 +645,7 @@ acpi_ex_convert_to_target_type(acpi_object_type destination_type, ...@@ -637,7 +645,7 @@ acpi_ex_convert_to_target_type(acpi_object_type destination_type,
case ACPI_TYPE_BUFFER: case ACPI_TYPE_BUFFER:
/* /*
* The operand must be a Buffer. We can convert an * The operand must be a Buffer. We can convert an
* Integer or String if necessary * Integer or String if necessary
*/ */
status = status =
......
...@@ -45,7 +45,6 @@ ...@@ -45,7 +45,6 @@
#include <acpi/acinterp.h> #include <acpi/acinterp.h>
#include <acpi/amlcode.h> #include <acpi/amlcode.h>
#include <acpi/acnamesp.h> #include <acpi/acnamesp.h>
#include <acpi/acparser.h>
#define _COMPONENT ACPI_EXECUTER #define _COMPONENT ACPI_EXECUTER
ACPI_MODULE_NAME("exdump") ACPI_MODULE_NAME("exdump")
...@@ -214,10 +213,11 @@ static struct acpi_exdump_info acpi_ex_dump_index_field[5] = { ...@@ -214,10 +213,11 @@ static struct acpi_exdump_info acpi_ex_dump_index_field[5] = {
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(index_field.data_obj), "Data Object"} {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(index_field.data_obj), "Data Object"}
}; };
static struct acpi_exdump_info acpi_ex_dump_reference[7] = { static struct acpi_exdump_info acpi_ex_dump_reference[8] = {
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_reference), NULL}, {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_reference), NULL},
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET(reference.class), "Class"},
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET(reference.target_type), "Target Type"}, {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(reference.target_type), "Target Type"},
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET(reference.offset), "Offset"}, {ACPI_EXD_UINT32, ACPI_EXD_OFFSET(reference.value), "Value"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(reference.object), "Object Desc"}, {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(reference.object), "Object Desc"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(reference.node), "Node"}, {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(reference.node), "Node"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(reference.where), "Where"}, {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(reference.where), "Where"},
...@@ -413,10 +413,10 @@ acpi_ex_dump_object(union acpi_operand_object *obj_desc, ...@@ -413,10 +413,10 @@ acpi_ex_dump_object(union acpi_operand_object *obj_desc,
case ACPI_EXD_REFERENCE: case ACPI_EXD_REFERENCE:
acpi_ex_out_string("Opcode", acpi_ex_out_string("Class Name",
(acpi_ps_get_opcode_info (char *)
(obj_desc->reference.opcode))-> acpi_ut_get_reference_name
name); (obj_desc));
acpi_ex_dump_reference_obj(obj_desc); acpi_ex_dump_reference_obj(obj_desc);
break; break;
...@@ -494,40 +494,41 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth) ...@@ -494,40 +494,41 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
switch (ACPI_GET_OBJECT_TYPE(obj_desc)) { switch (ACPI_GET_OBJECT_TYPE(obj_desc)) {
case ACPI_TYPE_LOCAL_REFERENCE: case ACPI_TYPE_LOCAL_REFERENCE:
switch (obj_desc->reference.opcode) { acpi_os_printf("Reference: [%s] ",
case AML_DEBUG_OP: acpi_ut_get_reference_name(obj_desc));
switch (obj_desc->reference.class) {
case ACPI_REFCLASS_DEBUG:
acpi_os_printf("Reference: Debug\n"); acpi_os_printf("\n");
break; break;
case AML_INDEX_OP: case ACPI_REFCLASS_INDEX:
acpi_os_printf("Reference: Index %p\n", acpi_os_printf("%p\n", obj_desc->reference.object);
obj_desc->reference.object);
break; break;
case AML_LOAD_OP: case ACPI_REFCLASS_TABLE:
acpi_os_printf("Reference: [DdbHandle] TableIndex %p\n", acpi_os_printf("Table Index %X\n",
obj_desc->reference.object); obj_desc->reference.value);
break; break;
case AML_REF_OF_OP: case ACPI_REFCLASS_REFOF:
acpi_os_printf("Reference: (RefOf) %p [%s]\n", acpi_os_printf("%p [%s]\n", obj_desc->reference.object,
obj_desc->reference.object,
acpi_ut_get_type_name(((union acpi_ut_get_type_name(((union
acpi_operand_object acpi_operand_object
*)obj_desc-> *)
obj_desc->
reference. reference.
object)->common. object)->common.
type)); type));
break; break;
case AML_ARG_OP: case ACPI_REFCLASS_ARG:
acpi_os_printf("Reference: Arg%d", acpi_os_printf("%X", obj_desc->reference.value);
obj_desc->reference.offset);
if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_INTEGER) { if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_INTEGER) {
...@@ -542,10 +543,9 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth) ...@@ -542,10 +543,9 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
acpi_os_printf("\n"); acpi_os_printf("\n");
break; break;
case AML_LOCAL_OP: case ACPI_REFCLASS_LOCAL:
acpi_os_printf("Reference: Local%d", acpi_os_printf("%X", obj_desc->reference.value);
obj_desc->reference.offset);
if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_INTEGER) { if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_INTEGER) {
...@@ -560,21 +560,16 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth) ...@@ -560,21 +560,16 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
acpi_os_printf("\n"); acpi_os_printf("\n");
break; break;
case AML_INT_NAMEPATH_OP: case ACPI_REFCLASS_NAME:
acpi_os_printf("Reference: Namepath %X [%4.4s]\n", acpi_os_printf("- [%4.4s]\n",
obj_desc->reference.node->name.integer,
obj_desc->reference.node->name.ascii); obj_desc->reference.node->name.ascii);
break; break;
default: default: /* Unknown reference class */
/* Unknown opcode */
acpi_os_printf("Unknown Reference opcode=%X\n", acpi_os_printf("%2.2X\n", obj_desc->reference.class);
obj_desc->reference.opcode);
break; break;
} }
break; break;
...@@ -865,8 +860,8 @@ static void acpi_ex_dump_reference_obj(union acpi_operand_object *obj_desc) ...@@ -865,8 +860,8 @@ static void acpi_ex_dump_reference_obj(union acpi_operand_object *obj_desc)
ret_buf.length = ACPI_ALLOCATE_LOCAL_BUFFER; ret_buf.length = ACPI_ALLOCATE_LOCAL_BUFFER;
if (obj_desc->reference.opcode == AML_INT_NAMEPATH_OP) { if (obj_desc->reference.class == ACPI_REFCLASS_NAME) {
acpi_os_printf(" Named Object %p ", obj_desc->reference.node); acpi_os_printf(" %p ", obj_desc->reference.node);
status = status =
acpi_ns_handle_to_pathname(obj_desc->reference.node, acpi_ns_handle_to_pathname(obj_desc->reference.node,
...@@ -882,14 +877,12 @@ static void acpi_ex_dump_reference_obj(union acpi_operand_object *obj_desc) ...@@ -882,14 +877,12 @@ static void acpi_ex_dump_reference_obj(union acpi_operand_object *obj_desc)
ACPI_DESC_TYPE_OPERAND) { ACPI_DESC_TYPE_OPERAND) {
acpi_os_printf(" Target: %p", acpi_os_printf(" Target: %p",
obj_desc->reference.object); obj_desc->reference.object);
if (obj_desc->reference.opcode == AML_LOAD_OP) { if (obj_desc->reference.class == ACPI_REFCLASS_TABLE) {
/* acpi_os_printf(" Table Index: %X\n",
* For DDBHandle reference, obj_desc->reference.value);
* obj_desc->Reference.Object is the table index
*/
acpi_os_printf(" [DDBHandle]\n");
} else { } else {
acpi_os_printf(" [%s]\n", acpi_os_printf(" Target: %p [%s]\n",
obj_desc->reference.object,
acpi_ut_get_type_name(((union acpi_ut_get_type_name(((union
acpi_operand_object acpi_operand_object
*) *)
...@@ -988,9 +981,9 @@ acpi_ex_dump_package_obj(union acpi_operand_object *obj_desc, ...@@ -988,9 +981,9 @@ acpi_ex_dump_package_obj(union acpi_operand_object *obj_desc,
case ACPI_TYPE_LOCAL_REFERENCE: case ACPI_TYPE_LOCAL_REFERENCE:
acpi_os_printf("[Object Reference] %s", acpi_os_printf("[Object Reference] Type [%s] %2.2X",
(acpi_ps_get_opcode_info acpi_ut_get_reference_name(obj_desc),
(obj_desc->reference.opcode))->name); obj_desc->reference.class);
acpi_ex_dump_reference_obj(obj_desc); acpi_ex_dump_reference_obj(obj_desc);
break; break;
......
...@@ -86,10 +86,10 @@ acpi_ex_get_object_reference(union acpi_operand_object *obj_desc, ...@@ -86,10 +86,10 @@ acpi_ex_get_object_reference(union acpi_operand_object *obj_desc,
/* /*
* Must be a reference to a Local or Arg * Must be a reference to a Local or Arg
*/ */
switch (obj_desc->reference.opcode) { switch (obj_desc->reference.class) {
case AML_LOCAL_OP: case ACPI_REFCLASS_LOCAL:
case AML_ARG_OP: case ACPI_REFCLASS_ARG:
case AML_DEBUG_OP: case ACPI_REFCLASS_DEBUG:
/* The referenced object is the pseudo-node for the local/arg */ /* The referenced object is the pseudo-node for the local/arg */
...@@ -98,8 +98,8 @@ acpi_ex_get_object_reference(union acpi_operand_object *obj_desc, ...@@ -98,8 +98,8 @@ acpi_ex_get_object_reference(union acpi_operand_object *obj_desc,
default: default:
ACPI_ERROR((AE_INFO, "Unknown Reference opcode %X", ACPI_ERROR((AE_INFO, "Unknown Reference Class %2.2X",
obj_desc->reference.opcode)); obj_desc->reference.class));
return_ACPI_STATUS(AE_AML_INTERNAL); return_ACPI_STATUS(AE_AML_INTERNAL);
} }
break; break;
...@@ -127,7 +127,7 @@ acpi_ex_get_object_reference(union acpi_operand_object *obj_desc, ...@@ -127,7 +127,7 @@ acpi_ex_get_object_reference(union acpi_operand_object *obj_desc,
return_ACPI_STATUS(AE_NO_MEMORY); return_ACPI_STATUS(AE_NO_MEMORY);
} }
reference_obj->reference.opcode = AML_REF_OF_OP; reference_obj->reference.class = ACPI_REFCLASS_REFOF;
reference_obj->reference.object = referenced_obj; reference_obj->reference.object = referenced_obj;
*return_desc = reference_obj; *return_desc = reference_obj;
......
...@@ -825,16 +825,16 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state) ...@@ -825,16 +825,16 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
* *
* Must resolve/dereference the local/arg reference first * Must resolve/dereference the local/arg reference first
*/ */
switch (operand[0]->reference.opcode) { switch (operand[0]->reference.class) {
case AML_LOCAL_OP: case ACPI_REFCLASS_LOCAL:
case AML_ARG_OP: case ACPI_REFCLASS_ARG:
/* Set Operand[0] to the value of the local/arg */ /* Set Operand[0] to the value of the local/arg */
status = status =
acpi_ds_method_data_get_value acpi_ds_method_data_get_value
(operand[0]->reference.opcode, (operand[0]->reference.class,
operand[0]->reference.offset, operand[0]->reference.value,
walk_state, &temp_desc); walk_state, &temp_desc);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
goto cleanup; goto cleanup;
...@@ -848,7 +848,7 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state) ...@@ -848,7 +848,7 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
operand[0] = temp_desc; operand[0] = temp_desc;
break; break;
case AML_REF_OF_OP: case ACPI_REFCLASS_REFOF:
/* Get the object to which the reference refers */ /* Get the object to which the reference refers */
...@@ -928,8 +928,8 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state) ...@@ -928,8 +928,8 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
* This must be a reference object produced by either the * This must be a reference object produced by either the
* Index() or ref_of() operator * Index() or ref_of() operator
*/ */
switch (operand[0]->reference.opcode) { switch (operand[0]->reference.class) {
case AML_INDEX_OP: case ACPI_REFCLASS_INDEX:
/* /*
* The target type for the Index operator must be * The target type for the Index operator must be
...@@ -965,7 +965,7 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state) ...@@ -965,7 +965,7 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
return_desc->integer.value = return_desc->integer.value =
temp_desc->buffer. temp_desc->buffer.
pointer[operand[0]->reference. pointer[operand[0]->reference.
offset]; value];
break; break;
case ACPI_TYPE_PACKAGE: case ACPI_TYPE_PACKAGE:
...@@ -985,7 +985,7 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state) ...@@ -985,7 +985,7 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
default: default:
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
"Unknown Index TargetType %X in obj %p", "Unknown Index TargetType %X in reference object %p",
operand[0]->reference. operand[0]->reference.
target_type, operand[0])); target_type, operand[0]));
status = AE_AML_OPERAND_TYPE; status = AE_AML_OPERAND_TYPE;
...@@ -993,7 +993,7 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state) ...@@ -993,7 +993,7 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
} }
break; break;
case AML_REF_OF_OP: case ACPI_REFCLASS_REFOF:
return_desc = operand[0]->reference.object; return_desc = operand[0]->reference.object;
...@@ -1013,9 +1013,9 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state) ...@@ -1013,9 +1013,9 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
default: default:
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
"Unknown opcode in reference(%p) - %X", "Unknown class in reference(%p) - %2.2X",
operand[0], operand[0],
operand[0]->reference.opcode)); operand[0]->reference.class));
status = AE_TYPE; status = AE_TYPE;
goto cleanup; goto cleanup;
......
...@@ -391,8 +391,8 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state) ...@@ -391,8 +391,8 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state)
/* Initialize the Index reference object */ /* Initialize the Index reference object */
index = operand[1]->integer.value; index = operand[1]->integer.value;
return_desc->reference.offset = (u32) index; return_desc->reference.value = (u32) index;
return_desc->reference.opcode = AML_INDEX_OP; return_desc->reference.class = ACPI_REFCLASS_INDEX;
/* /*
* At this point, the Source operand is a String, Buffer, or Package. * At this point, the Source operand is a String, Buffer, or Package.
......
...@@ -46,8 +46,6 @@ ...@@ -46,8 +46,6 @@
#include <acpi/acdispat.h> #include <acpi/acdispat.h>
#include <acpi/acinterp.h> #include <acpi/acinterp.h>
#include <acpi/acnamesp.h> #include <acpi/acnamesp.h>
#include <acpi/acparser.h>
#include <acpi/amlcode.h>
#define _COMPONENT ACPI_EXECUTER #define _COMPONENT ACPI_EXECUTER
ACPI_MODULE_NAME("exresnte") ACPI_MODULE_NAME("exresnte")
...@@ -238,10 +236,10 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr, ...@@ -238,10 +236,10 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr,
case ACPI_TYPE_LOCAL_REFERENCE: case ACPI_TYPE_LOCAL_REFERENCE:
switch (source_desc->reference.opcode) { switch (source_desc->reference.class) {
case AML_LOAD_OP: /* This is a ddb_handle */ case ACPI_REFCLASS_TABLE: /* This is a ddb_handle */
case AML_REF_OF_OP: case ACPI_REFCLASS_REFOF:
case AML_INDEX_OP: case ACPI_REFCLASS_INDEX:
/* Return an additional reference to the object */ /* Return an additional reference to the object */
...@@ -253,10 +251,8 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr, ...@@ -253,10 +251,8 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr,
/* No named references are allowed here */ /* No named references are allowed here */
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
"Unsupported Reference opcode %X (%s)", "Unsupported Reference type %X",
source_desc->reference.opcode, source_desc->reference.class));
acpi_ps_get_opcode_name(source_desc->
reference.opcode)));
return_ACPI_STATUS(AE_AML_OPERAND_TYPE); return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
} }
......
...@@ -47,7 +47,6 @@ ...@@ -47,7 +47,6 @@
#include <acpi/acdispat.h> #include <acpi/acdispat.h>
#include <acpi/acinterp.h> #include <acpi/acinterp.h>
#include <acpi/acnamesp.h> #include <acpi/acnamesp.h>
#include <acpi/acparser.h>
#define _COMPONENT ACPI_EXECUTER #define _COMPONENT ACPI_EXECUTER
ACPI_MODULE_NAME("exresolv") ACPI_MODULE_NAME("exresolv")
...@@ -141,7 +140,7 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr, ...@@ -141,7 +140,7 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
acpi_status status = AE_OK; acpi_status status = AE_OK;
union acpi_operand_object *stack_desc; union acpi_operand_object *stack_desc;
union acpi_operand_object *obj_desc = NULL; union acpi_operand_object *obj_desc = NULL;
u16 opcode; u8 ref_type;
ACPI_FUNCTION_TRACE(ex_resolve_object_to_value); ACPI_FUNCTION_TRACE(ex_resolve_object_to_value);
...@@ -152,19 +151,19 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr, ...@@ -152,19 +151,19 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
switch (ACPI_GET_OBJECT_TYPE(stack_desc)) { switch (ACPI_GET_OBJECT_TYPE(stack_desc)) {
case ACPI_TYPE_LOCAL_REFERENCE: case ACPI_TYPE_LOCAL_REFERENCE:
opcode = stack_desc->reference.opcode; ref_type = stack_desc->reference.class;
switch (opcode) { switch (ref_type) {
case AML_LOCAL_OP: case ACPI_REFCLASS_LOCAL:
case AML_ARG_OP: case ACPI_REFCLASS_ARG:
/* /*
* Get the local from the method's state info * Get the local from the method's state info
* Note: this increments the local's object reference count * Note: this increments the local's object reference count
*/ */
status = acpi_ds_method_data_get_value(opcode, status = acpi_ds_method_data_get_value(ref_type,
stack_desc-> stack_desc->
reference.offset, reference.value,
walk_state, walk_state,
&obj_desc); &obj_desc);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
...@@ -173,7 +172,7 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr, ...@@ -173,7 +172,7 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
"[Arg/Local %X] ValueObj is %p\n", "[Arg/Local %X] ValueObj is %p\n",
stack_desc->reference.offset, stack_desc->reference.value,
obj_desc)); obj_desc));
/* /*
...@@ -184,7 +183,7 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr, ...@@ -184,7 +183,7 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
*stack_ptr = obj_desc; *stack_ptr = obj_desc;
break; break;
case AML_INDEX_OP: case ACPI_REFCLASS_INDEX:
switch (stack_desc->reference.target_type) { switch (stack_desc->reference.target_type) {
case ACPI_TYPE_BUFFER_FIELD: case ACPI_TYPE_BUFFER_FIELD:
...@@ -239,15 +238,15 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr, ...@@ -239,15 +238,15 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
} }
break; break;
case AML_REF_OF_OP: case ACPI_REFCLASS_REFOF:
case AML_DEBUG_OP: case ACPI_REFCLASS_DEBUG:
case AML_LOAD_OP: case ACPI_REFCLASS_TABLE:
/* Just leave the object as-is, do not dereference */ /* Just leave the object as-is, do not dereference */
break; break;
case AML_INT_NAMEPATH_OP: /* Reference to a named object */ case ACPI_REFCLASS_NAME: /* Reference to a named object */
/* Dereference the name */ /* Dereference the name */
...@@ -273,8 +272,7 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr, ...@@ -273,8 +272,7 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
default: default:
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
"Unknown Reference opcode %X (%s) in %p", "Unknown Reference type %X in %p", ref_type,
opcode, acpi_ps_get_opcode_name(opcode),
stack_desc)); stack_desc));
status = AE_AML_INTERNAL; status = AE_AML_INTERNAL;
break; break;
...@@ -388,13 +386,13 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state, ...@@ -388,13 +386,13 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
* traversing the list of possibly many nested references. * traversing the list of possibly many nested references.
*/ */
while (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_LOCAL_REFERENCE) { while (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_LOCAL_REFERENCE) {
switch (obj_desc->reference.opcode) { switch (obj_desc->reference.class) {
case AML_REF_OF_OP: case ACPI_REFCLASS_REFOF:
case AML_INT_NAMEPATH_OP: case ACPI_REFCLASS_NAME:
/* Dereference the reference pointer */ /* Dereference the reference pointer */
if (obj_desc->reference.opcode == AML_REF_OF_OP) { if (obj_desc->reference.class == ACPI_REFCLASS_REFOF) {
node = obj_desc->reference.object; node = obj_desc->reference.object;
} else { /* AML_INT_NAMEPATH_OP */ } else { /* AML_INT_NAMEPATH_OP */
...@@ -429,7 +427,7 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state, ...@@ -429,7 +427,7 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
} }
break; break;
case AML_INDEX_OP: case ACPI_REFCLASS_INDEX:
/* Get the type of this reference (index into another object) */ /* Get the type of this reference (index into another object) */
...@@ -455,22 +453,22 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state, ...@@ -455,22 +453,22 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
} }
break; break;
case AML_LOAD_OP: case ACPI_REFCLASS_TABLE:
type = ACPI_TYPE_DDB_HANDLE; type = ACPI_TYPE_DDB_HANDLE;
goto exit; goto exit;
case AML_LOCAL_OP: case ACPI_REFCLASS_LOCAL:
case AML_ARG_OP: case ACPI_REFCLASS_ARG:
if (return_desc) { if (return_desc) {
status = status =
acpi_ds_method_data_get_value(obj_desc-> acpi_ds_method_data_get_value(obj_desc->
reference. reference.
opcode, class,
obj_desc-> obj_desc->
reference. reference.
offset, value,
walk_state, walk_state,
&obj_desc); &obj_desc);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
...@@ -481,10 +479,10 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state, ...@@ -481,10 +479,10 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
status = status =
acpi_ds_method_data_get_node(obj_desc-> acpi_ds_method_data_get_node(obj_desc->
reference. reference.
opcode, class,
obj_desc-> obj_desc->
reference. reference.
offset, value,
walk_state, walk_state,
&node); &node);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
...@@ -499,7 +497,7 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state, ...@@ -499,7 +497,7 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
} }
break; break;
case AML_DEBUG_OP: case ACPI_REFCLASS_DEBUG:
/* The Debug Object is of type "DebugObject" */ /* The Debug Object is of type "DebugObject" */
...@@ -509,8 +507,8 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state, ...@@ -509,8 +507,8 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
default: default:
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
"Unknown Reference subtype %X", "Unknown Reference Class %2.2X",
obj_desc->reference.opcode)); obj_desc->reference.class));
return_ACPI_STATUS(AE_AML_INTERNAL); return_ACPI_STATUS(AE_AML_INTERNAL);
} }
} }
......
...@@ -225,41 +225,36 @@ acpi_ex_resolve_operands(u16 opcode, ...@@ -225,41 +225,36 @@ acpi_ex_resolve_operands(u16 opcode,
if (object_type == (u8) ACPI_TYPE_LOCAL_REFERENCE) { if (object_type == (u8) ACPI_TYPE_LOCAL_REFERENCE) {
/* Decode the Reference */ /* Validate the Reference */
op_info = acpi_ps_get_opcode_info(opcode); switch (obj_desc->reference.class) {
if (op_info->class == AML_CLASS_UNKNOWN) { case ACPI_REFCLASS_DEBUG:
return_ACPI_STATUS(AE_AML_BAD_OPCODE);
}
switch (obj_desc->reference.opcode) {
case AML_DEBUG_OP:
target_op = AML_DEBUG_OP; target_op = AML_DEBUG_OP;
/*lint -fallthrough */ /*lint -fallthrough */
case AML_INDEX_OP: case ACPI_REFCLASS_ARG:
case AML_REF_OF_OP: case ACPI_REFCLASS_LOCAL:
case AML_ARG_OP: case ACPI_REFCLASS_INDEX:
case AML_LOCAL_OP: case ACPI_REFCLASS_REFOF:
case AML_LOAD_OP: /* ddb_handle from LOAD_OP or LOAD_TABLE_OP */ case ACPI_REFCLASS_TABLE: /* ddb_handle from LOAD_OP or LOAD_TABLE_OP */
case AML_INT_NAMEPATH_OP: /* Reference to a named object */ case ACPI_REFCLASS_NAME: /* Reference to a named object */
ACPI_DEBUG_ONLY_MEMBERS(ACPI_DEBUG_PRINT ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
((ACPI_DB_EXEC, "Operand is a Reference, Class [%s] %2.2X\n",
"Operand is a Reference, RefOpcode [%s]\n", acpi_ut_get_reference_name
(acpi_ps_get_opcode_info (obj_desc),
(obj_desc-> obj_desc->reference.
reference. class));
opcode))->
name)));
break; break;
default: default:
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
"Operand is a Reference, Unknown Reference Opcode: %X", "Unknown Reference Class %2.2X in %p",
obj_desc->reference. obj_desc->reference.class,
opcode)); obj_desc));
return_ACPI_STATUS(AE_AML_OPERAND_TYPE); return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
} }
...@@ -270,8 +265,7 @@ acpi_ex_resolve_operands(u16 opcode, ...@@ -270,8 +265,7 @@ acpi_ex_resolve_operands(u16 opcode,
/* Invalid descriptor */ /* Invalid descriptor */
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO, "Invalid descriptor %p [%s]",
"Invalid descriptor %p [%s]",
obj_desc, obj_desc,
acpi_ut_get_descriptor_name(obj_desc))); acpi_ut_get_descriptor_name(obj_desc)));
...@@ -343,7 +337,7 @@ acpi_ex_resolve_operands(u16 opcode, ...@@ -343,7 +337,7 @@ acpi_ex_resolve_operands(u16 opcode,
if ((opcode == AML_STORE_OP) && if ((opcode == AML_STORE_OP) &&
(ACPI_GET_OBJECT_TYPE(*stack_ptr) == (ACPI_GET_OBJECT_TYPE(*stack_ptr) ==
ACPI_TYPE_LOCAL_REFERENCE) ACPI_TYPE_LOCAL_REFERENCE)
&& ((*stack_ptr)->reference.opcode == AML_INDEX_OP)) { && ((*stack_ptr)->reference.class == ACPI_REFCLASS_INDEX)) {
goto next_operand; goto next_operand;
} }
break; break;
......
...@@ -47,7 +47,6 @@ ...@@ -47,7 +47,6 @@
#include <acpi/acinterp.h> #include <acpi/acinterp.h>
#include <acpi/amlcode.h> #include <acpi/amlcode.h>
#include <acpi/acnamesp.h> #include <acpi/acnamesp.h>
#include <acpi/acparser.h>
#define _COMPONENT ACPI_EXECUTER #define _COMPONENT ACPI_EXECUTER
ACPI_MODULE_NAME("exstore") ACPI_MODULE_NAME("exstore")
...@@ -179,22 +178,26 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc, ...@@ -179,22 +178,26 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
case ACPI_TYPE_LOCAL_REFERENCE: case ACPI_TYPE_LOCAL_REFERENCE:
if (source_desc->reference.opcode == AML_INDEX_OP) { ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "[%s] ",
ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, acpi_ut_get_reference_name(source_desc)));
"[%s, 0x%X]\n",
acpi_ps_get_opcode_name /* Decode the reference */
(source_desc->reference.opcode),
source_desc->reference.offset)); switch (source_desc->reference.class) {
} else { case ACPI_REFCLASS_INDEX:
ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "[%s]",
acpi_ps_get_opcode_name ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, "0x%X\n",
(source_desc->reference.opcode))); source_desc->reference.value));
} break;
case ACPI_REFCLASS_TABLE:
if (source_desc->reference.opcode == AML_LOAD_OP) { /* Load and load_table */
ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT, ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT,
" Table OwnerId %p\n", "Table Index 0x%X\n",
source_desc->reference.object)); source_desc->reference.value));
break;
default:
break; break;
} }
...@@ -347,15 +350,15 @@ acpi_ex_store(union acpi_operand_object *source_desc, ...@@ -347,15 +350,15 @@ acpi_ex_store(union acpi_operand_object *source_desc,
} }
/* /*
* Examine the Reference opcode. These cases are handled: * Examine the Reference class. These cases are handled:
* *
* 1) Store to Name (Change the object associated with a name) * 1) Store to Name (Change the object associated with a name)
* 2) Store to an indexed area of a Buffer or Package * 2) Store to an indexed area of a Buffer or Package
* 3) Store to a Method Local or Arg * 3) Store to a Method Local or Arg
* 4) Store to the debug object * 4) Store to the debug object
*/ */
switch (ref_desc->reference.opcode) { switch (ref_desc->reference.class) {
case AML_REF_OF_OP: case ACPI_REFCLASS_REFOF:
/* Storing an object into a Name "container" */ /* Storing an object into a Name "container" */
...@@ -365,7 +368,7 @@ acpi_ex_store(union acpi_operand_object *source_desc, ...@@ -365,7 +368,7 @@ acpi_ex_store(union acpi_operand_object *source_desc,
ACPI_IMPLICIT_CONVERSION); ACPI_IMPLICIT_CONVERSION);
break; break;
case AML_INDEX_OP: case ACPI_REFCLASS_INDEX:
/* Storing to an Index (pointer into a packager or buffer) */ /* Storing to an Index (pointer into a packager or buffer) */
...@@ -374,18 +377,18 @@ acpi_ex_store(union acpi_operand_object *source_desc, ...@@ -374,18 +377,18 @@ acpi_ex_store(union acpi_operand_object *source_desc,
walk_state); walk_state);
break; break;
case AML_LOCAL_OP: case ACPI_REFCLASS_LOCAL:
case AML_ARG_OP: case ACPI_REFCLASS_ARG:
/* Store to a method local/arg */ /* Store to a method local/arg */
status = status =
acpi_ds_store_object_to_local(ref_desc->reference.opcode, acpi_ds_store_object_to_local(ref_desc->reference.class,
ref_desc->reference.offset, ref_desc->reference.value,
source_desc, walk_state); source_desc, walk_state);
break; break;
case AML_DEBUG_OP: case ACPI_REFCLASS_DEBUG:
/* /*
* Storing to the Debug object causes the value stored to be * Storing to the Debug object causes the value stored to be
...@@ -401,9 +404,9 @@ acpi_ex_store(union acpi_operand_object *source_desc, ...@@ -401,9 +404,9 @@ acpi_ex_store(union acpi_operand_object *source_desc,
default: default:
ACPI_ERROR((AE_INFO, "Unknown Reference opcode %X", ACPI_ERROR((AE_INFO, "Unknown Reference Class %2.2X",
ref_desc->reference.opcode)); ref_desc->reference.class));
ACPI_DUMP_ENTRY(ref_desc, ACPI_LV_ERROR); ACPI_DUMP_ENTRY(ref_desc, ACPI_LV_INFO);
status = AE_AML_INTERNAL; status = AE_AML_INTERNAL;
break; break;
...@@ -458,7 +461,7 @@ acpi_ex_store_object_to_index(union acpi_operand_object *source_desc, ...@@ -458,7 +461,7 @@ acpi_ex_store_object_to_index(union acpi_operand_object *source_desc,
if (ACPI_GET_OBJECT_TYPE(source_desc) == if (ACPI_GET_OBJECT_TYPE(source_desc) ==
ACPI_TYPE_LOCAL_REFERENCE ACPI_TYPE_LOCAL_REFERENCE
&& source_desc->reference.opcode == AML_LOAD_OP) { && source_desc->reference.class == ACPI_REFCLASS_TABLE) {
/* This is a DDBHandle, just add a reference to it */ /* This is a DDBHandle, just add a reference to it */
...@@ -553,7 +556,7 @@ acpi_ex_store_object_to_index(union acpi_operand_object *source_desc, ...@@ -553,7 +556,7 @@ acpi_ex_store_object_to_index(union acpi_operand_object *source_desc,
/* Store the source value into the target buffer byte */ /* Store the source value into the target buffer byte */
obj_desc->buffer.pointer[index_desc->reference.offset] = value; obj_desc->buffer.pointer[index_desc->reference.value] = value;
break; break;
default: default:
......
...@@ -121,7 +121,8 @@ acpi_ex_resolve_object(union acpi_operand_object **source_desc_ptr, ...@@ -121,7 +121,8 @@ acpi_ex_resolve_object(union acpi_operand_object **source_desc_ptr,
(ACPI_GET_OBJECT_TYPE(source_desc) != ACPI_TYPE_STRING) && (ACPI_GET_OBJECT_TYPE(source_desc) != ACPI_TYPE_STRING) &&
!((ACPI_GET_OBJECT_TYPE(source_desc) == !((ACPI_GET_OBJECT_TYPE(source_desc) ==
ACPI_TYPE_LOCAL_REFERENCE) ACPI_TYPE_LOCAL_REFERENCE)
&& (source_desc->reference.opcode == AML_LOAD_OP))) { && (source_desc->reference.class ==
ACPI_REFCLASS_TABLE))) {
/* Conversion successful but still not a valid type */ /* Conversion successful but still not a valid type */
......
...@@ -327,8 +327,8 @@ static int acpi_fan_resume(struct acpi_device *device) ...@@ -327,8 +327,8 @@ static int acpi_fan_resume(struct acpi_device *device)
result = acpi_bus_get_power(device->handle, &power_state); result = acpi_bus_get_power(device->handle, &power_state);
if (result) { if (result) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, printk(KERN_ERR PREFIX
"Error reading fan power state\n")); "Error reading fan power state\n");
return result; return result;
} }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
obj-y := nsaccess.o nsload.o nssearch.o nsxfeval.o \ obj-y := nsaccess.o nsload.o nssearch.o nsxfeval.o \
nsalloc.o nseval.o nsnames.o nsutils.o nsxfname.o \ nsalloc.o nseval.o nsnames.o nsutils.o nsxfname.o \
nsdump.o nsinit.o nsobject.o nswalk.o nsxfobj.o \ nsdump.o nsinit.o nsobject.o nswalk.o nsxfobj.o \
nsparse.o nsparse.o nspredef.o
obj-$(ACPI_FUTURE_USAGE) += nsdumpdv.o obj-$(ACPI_FUTURE_USAGE) += nsdumpdv.o
......
...@@ -43,7 +43,6 @@ ...@@ -43,7 +43,6 @@
#include <acpi/acpi.h> #include <acpi/acpi.h>
#include <acpi/acnamesp.h> #include <acpi/acnamesp.h>
#include <acpi/acparser.h>
#define _COMPONENT ACPI_NAMESPACE #define _COMPONENT ACPI_NAMESPACE
ACPI_MODULE_NAME("nsdump") ACPI_MODULE_NAME("nsdump")
...@@ -334,9 +333,7 @@ acpi_ns_dump_one_object(acpi_handle obj_handle, ...@@ -334,9 +333,7 @@ acpi_ns_dump_one_object(acpi_handle obj_handle,
case ACPI_TYPE_LOCAL_REFERENCE: case ACPI_TYPE_LOCAL_REFERENCE:
acpi_os_printf("[%s]\n", acpi_os_printf("[%s]\n",
acpi_ps_get_opcode_name(obj_desc-> acpi_ut_get_reference_name(obj_desc));
reference.
opcode));
break; break;
case ACPI_TYPE_BUFFER_FIELD: case ACPI_TYPE_BUFFER_FIELD:
......
...@@ -78,6 +78,7 @@ ACPI_MODULE_NAME("nseval") ...@@ -78,6 +78,7 @@ ACPI_MODULE_NAME("nseval")
acpi_status acpi_ns_evaluate(struct acpi_evaluate_info * info) acpi_status acpi_ns_evaluate(struct acpi_evaluate_info * info)
{ {
acpi_status status; acpi_status status;
struct acpi_namespace_node *node;
ACPI_FUNCTION_TRACE(ns_evaluate); ACPI_FUNCTION_TRACE(ns_evaluate);
...@@ -117,6 +118,8 @@ acpi_status acpi_ns_evaluate(struct acpi_evaluate_info * info) ...@@ -117,6 +118,8 @@ acpi_status acpi_ns_evaluate(struct acpi_evaluate_info * info)
info->resolved_node, info->resolved_node,
acpi_ns_get_attached_object(info->resolved_node))); acpi_ns_get_attached_object(info->resolved_node)));
node = info->resolved_node;
/* /*
* Two major cases here: * Two major cases here:
* *
...@@ -148,21 +151,22 @@ acpi_status acpi_ns_evaluate(struct acpi_evaluate_info * info) ...@@ -148,21 +151,22 @@ acpi_status acpi_ns_evaluate(struct acpi_evaluate_info * info)
info->param_count++; info->param_count++;
} }
/* Error if too few arguments were passed in */ /*
* Warning if too few or too many arguments have been passed by the
* caller. We don't want to abort here with an error because an
* incorrect number of arguments may not cause the method to fail.
* However, the method will fail if there are too few arguments passed
* and the method attempts to use one of the missing ones.
*/
if (info->param_count < info->obj_desc->method.param_count) { if (info->param_count < info->obj_desc->method.param_count) {
ACPI_ERROR((AE_INFO, ACPI_WARNING((AE_INFO,
"Insufficient arguments - " "Insufficient arguments - "
"method [%4.4s] needs %d, found %d", "method [%4.4s] needs %d, found %d",
acpi_ut_get_node_name(info->resolved_node), acpi_ut_get_node_name(info->resolved_node),
info->obj_desc->method.param_count, info->obj_desc->method.param_count,
info->param_count)); info->param_count));
return_ACPI_STATUS(AE_MISSING_ARGUMENTS); } else if (info->param_count >
}
/* Just a warning if too many arguments */
else if (info->param_count >
info->obj_desc->method.param_count) { info->obj_desc->method.param_count) {
ACPI_WARNING((AE_INFO, ACPI_WARNING((AE_INFO,
"Excess arguments - " "Excess arguments - "
...@@ -195,7 +199,28 @@ acpi_status acpi_ns_evaluate(struct acpi_evaluate_info * info) ...@@ -195,7 +199,28 @@ acpi_status acpi_ns_evaluate(struct acpi_evaluate_info * info)
} else { } else {
/* /*
* 2) Object is not a method, return its current value * 2) Object is not a method, return its current value
*
* Disallow certain object types. For these, "evaluation" is undefined.
*/ */
switch (info->resolved_node->type) {
case ACPI_TYPE_DEVICE:
case ACPI_TYPE_EVENT:
case ACPI_TYPE_MUTEX:
case ACPI_TYPE_REGION:
case ACPI_TYPE_THERMAL:
case ACPI_TYPE_LOCAL_SCOPE:
ACPI_ERROR((AE_INFO,
"[%4.4s] Evaluation of object type [%s] is not supported",
info->resolved_node->name.ascii,
acpi_ut_get_type_name(info->resolved_node->
type)));
return_ACPI_STATUS(AE_TYPE);
default:
break;
}
/* /*
* Objects require additional resolution steps (e.g., the Node may be * Objects require additional resolution steps (e.g., the Node may be
...@@ -239,9 +264,35 @@ acpi_status acpi_ns_evaluate(struct acpi_evaluate_info * info) ...@@ -239,9 +264,35 @@ acpi_status acpi_ns_evaluate(struct acpi_evaluate_info * info)
} }
} }
/* /* Validation of return values for ACPI-predefined methods and objects */
* Check if there is a return value that must be dealt with
*/ if ((status == AE_OK) || (status == AE_CTRL_RETURN_VALUE)) {
/*
* If this is the first evaluation, check the return value. This
* ensures that any warnings will only be emitted during the very
* first evaluation of the object.
*/
if (!(node->flags & ANOBJ_EVALUATED)) {
/*
* Check for a predefined ACPI name. If found, validate the
* returned object.
*
* Note: Ignore return status for now, emit warnings if there are
* problems with the returned object. May change later to abort
* the method on invalid return object.
*/
(void)acpi_ns_check_predefined_names(node,
info->
return_object);
}
/* Mark the node as having been evaluated */
node->flags |= ANOBJ_EVALUATED;
}
/* Check if there is a return value that must be dealt with */
if (status == AE_CTRL_RETURN_VALUE) { if (status == AE_CTRL_RETURN_VALUE) {
/* If caller does not want the return value, delete it */ /* If caller does not want the return value, delete it */
......
...@@ -115,7 +115,6 @@ acpi_ns_build_external_path(struct acpi_namespace_node *node, ...@@ -115,7 +115,6 @@ acpi_ns_build_external_path(struct acpi_namespace_node *node,
return (AE_OK); return (AE_OK);
} }
#ifdef ACPI_DEBUG_OUTPUT
/******************************************************************************* /*******************************************************************************
* *
* FUNCTION: acpi_ns_get_external_pathname * FUNCTION: acpi_ns_get_external_pathname
...@@ -142,7 +141,7 @@ char *acpi_ns_get_external_pathname(struct acpi_namespace_node *node) ...@@ -142,7 +141,7 @@ char *acpi_ns_get_external_pathname(struct acpi_namespace_node *node)
size = acpi_ns_get_pathname_length(node); size = acpi_ns_get_pathname_length(node);
if (!size) { if (!size) {
return (NULL); return_PTR(NULL);
} }
/* Allocate a buffer to be returned to caller */ /* Allocate a buffer to be returned to caller */
...@@ -157,12 +156,12 @@ char *acpi_ns_get_external_pathname(struct acpi_namespace_node *node) ...@@ -157,12 +156,12 @@ char *acpi_ns_get_external_pathname(struct acpi_namespace_node *node)
status = acpi_ns_build_external_path(node, size, name_buffer); status = acpi_ns_build_external_path(node, size, name_buffer);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
return (NULL); ACPI_FREE(name_buffer);
return_PTR(NULL);
} }
return_PTR(name_buffer); return_PTR(name_buffer);
} }
#endif
/******************************************************************************* /*******************************************************************************
* *
......
This diff is collapsed.
...@@ -331,7 +331,7 @@ acpi_ns_search_and_enter(u32 target_name, ...@@ -331,7 +331,7 @@ acpi_ns_search_and_enter(u32 target_name,
"Found bad character(s) in name, repaired: [%4.4s]\n", "Found bad character(s) in name, repaired: [%4.4s]\n",
ACPI_CAST_PTR(char, &target_name))); ACPI_CAST_PTR(char, &target_name)));
} else { } else {
ACPI_DEBUG_PRINT((ACPI_DB_WARN, ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Found bad character(s) in name, repaired: [%4.4s]\n", "Found bad character(s) in name, repaired: [%4.4s]\n",
ACPI_CAST_PTR(char, &target_name))); ACPI_CAST_PTR(char, &target_name)));
} }
......
...@@ -48,6 +48,10 @@ ...@@ -48,6 +48,10 @@
#define _COMPONENT ACPI_NAMESPACE #define _COMPONENT ACPI_NAMESPACE
ACPI_MODULE_NAME("nsxfeval") ACPI_MODULE_NAME("nsxfeval")
/* Local prototypes */
static void acpi_ns_resolve_references(struct acpi_evaluate_info *info);
#ifdef ACPI_FUTURE_USAGE #ifdef ACPI_FUTURE_USAGE
/******************************************************************************* /*******************************************************************************
* *
...@@ -69,6 +73,7 @@ ACPI_MODULE_NAME("nsxfeval") ...@@ -69,6 +73,7 @@ ACPI_MODULE_NAME("nsxfeval")
* be valid (non-null) * be valid (non-null)
* *
******************************************************************************/ ******************************************************************************/
acpi_status acpi_status
acpi_evaluate_object_typed(acpi_handle handle, acpi_evaluate_object_typed(acpi_handle handle,
acpi_string pathname, acpi_string pathname,
...@@ -283,6 +288,10 @@ acpi_evaluate_object(acpi_handle handle, ...@@ -283,6 +288,10 @@ acpi_evaluate_object(acpi_handle handle,
if (ACPI_SUCCESS(status)) { if (ACPI_SUCCESS(status)) {
/* Dereference Index and ref_of references */
acpi_ns_resolve_references(info);
/* Get the size of the returned object */ /* Get the size of the returned object */
status = status =
...@@ -350,6 +359,74 @@ acpi_evaluate_object(acpi_handle handle, ...@@ -350,6 +359,74 @@ acpi_evaluate_object(acpi_handle handle,
ACPI_EXPORT_SYMBOL(acpi_evaluate_object) ACPI_EXPORT_SYMBOL(acpi_evaluate_object)
/*******************************************************************************
*
* FUNCTION: acpi_ns_resolve_references
*
* PARAMETERS: Info - Evaluation info block
*
* RETURN: Info->return_object is replaced with the dereferenced object
*
* DESCRIPTION: Dereference certain reference objects. Called before an
* internal return object is converted to an external union acpi_object.
*
* Performs an automatic dereference of Index and ref_of reference objects.
* These reference objects are not supported by the union acpi_object, so this is a
* last resort effort to return something useful. Also, provides compatibility
* with other ACPI implementations.
*
* NOTE: does not handle references within returned package objects or nested
* references, but this support could be added later if found to be necessary.
*
******************************************************************************/
static void acpi_ns_resolve_references(struct acpi_evaluate_info *info)
{
union acpi_operand_object *obj_desc = NULL;
struct acpi_namespace_node *node;
/* We are interested in reference objects only */
if (ACPI_GET_OBJECT_TYPE(info->return_object) !=
ACPI_TYPE_LOCAL_REFERENCE) {
return;
}
/*
* Two types of references are supported - those created by Index and
* ref_of operators. A name reference (AML_NAMEPATH_OP) can be converted
* to an union acpi_object, so it is not dereferenced here. A ddb_handle
* (AML_LOAD_OP) cannot be dereferenced, nor can it be converted to
* an union acpi_object.
*/
switch (info->return_object->reference.class) {
case ACPI_REFCLASS_INDEX:
obj_desc = *(info->return_object->reference.where);
break;
case ACPI_REFCLASS_REFOF:
node = info->return_object->reference.object;
if (node) {
obj_desc = node->object;
}
break;
default:
return;
}
/* Replace the existing reference object */
if (obj_desc) {
acpi_ut_add_reference(obj_desc);
acpi_ut_remove_reference(info->return_object);
info->return_object = obj_desc;
}
return;
}
/******************************************************************************* /*******************************************************************************
* *
* FUNCTION: acpi_walk_namespace * FUNCTION: acpi_walk_namespace
...@@ -379,6 +456,7 @@ ACPI_EXPORT_SYMBOL(acpi_evaluate_object) ...@@ -379,6 +456,7 @@ ACPI_EXPORT_SYMBOL(acpi_evaluate_object)
* function, etc. * function, etc.
* *
******************************************************************************/ ******************************************************************************/
acpi_status acpi_status
acpi_walk_namespace(acpi_object_type type, acpi_walk_namespace(acpi_object_type type,
acpi_handle start_object, acpi_handle start_object,
......
...@@ -253,6 +253,7 @@ acpi_get_object_info(acpi_handle handle, struct acpi_buffer * buffer) ...@@ -253,6 +253,7 @@ acpi_get_object_info(acpi_handle handle, struct acpi_buffer * buffer)
node = acpi_ns_map_handle_to_node(handle); node = acpi_ns_map_handle_to_node(handle);
if (!node) { if (!node) {
(void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
status = AE_BAD_PARAMETER;
goto cleanup; goto cleanup;
} }
...@@ -264,6 +265,10 @@ acpi_get_object_info(acpi_handle handle, struct acpi_buffer * buffer) ...@@ -264,6 +265,10 @@ acpi_get_object_info(acpi_handle handle, struct acpi_buffer * buffer)
info->name = node->name.integer; info->name = node->name.integer;
info->valid = 0; info->valid = 0;
if (node->type == ACPI_TYPE_METHOD) {
info->param_count = node->object->method.param_count;
}
status = acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); status = acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
goto cleanup; goto cleanup;
......
...@@ -729,8 +729,8 @@ acpi_status acpi_os_execute(acpi_execute_type type, ...@@ -729,8 +729,8 @@ acpi_status acpi_os_execute(acpi_execute_type type,
INIT_WORK(&dpc->work, acpi_os_execute_deferred); INIT_WORK(&dpc->work, acpi_os_execute_deferred);
queue = (type == OSL_NOTIFY_HANDLER) ? kacpi_notify_wq : kacpid_wq; queue = (type == OSL_NOTIFY_HANDLER) ? kacpi_notify_wq : kacpid_wq;
if (!queue_work(queue, &dpc->work)) { if (!queue_work(queue, &dpc->work)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, printk(KERN_ERR PREFIX
"Call to queue_work() failed.\n")); "Call to queue_work() failed.\n");
status = AE_ERROR; status = AE_ERROR;
kfree(dpc); kfree(dpc);
} }
......
...@@ -719,6 +719,8 @@ acpi_ps_complete_op(struct acpi_walk_state *walk_state, ...@@ -719,6 +719,8 @@ acpi_ps_complete_op(struct acpi_walk_state *walk_state,
*op = NULL; *op = NULL;
} }
ACPI_PREEMPTION_POINT();
return_ACPI_STATUS(AE_OK); return_ACPI_STATUS(AE_OK);
} }
......
...@@ -137,6 +137,7 @@ acpi_ps_complete_this_op(struct acpi_walk_state * walk_state, ...@@ -137,6 +137,7 @@ acpi_ps_complete_this_op(struct acpi_walk_state * walk_state,
union acpi_parse_object *next; union acpi_parse_object *next;
const struct acpi_opcode_info *parent_info; const struct acpi_opcode_info *parent_info;
union acpi_parse_object *replacement_op = NULL; union acpi_parse_object *replacement_op = NULL;
acpi_status status = AE_OK;
ACPI_FUNCTION_TRACE_PTR(ps_complete_this_op, op); ACPI_FUNCTION_TRACE_PTR(ps_complete_this_op, op);
...@@ -186,7 +187,7 @@ acpi_ps_complete_this_op(struct acpi_walk_state * walk_state, ...@@ -186,7 +187,7 @@ acpi_ps_complete_this_op(struct acpi_walk_state * walk_state,
replacement_op = replacement_op =
acpi_ps_alloc_op(AML_INT_RETURN_VALUE_OP); acpi_ps_alloc_op(AML_INT_RETURN_VALUE_OP);
if (!replacement_op) { if (!replacement_op) {
goto allocate_error; status = AE_NO_MEMORY;
} }
break; break;
...@@ -211,7 +212,7 @@ acpi_ps_complete_this_op(struct acpi_walk_state * walk_state, ...@@ -211,7 +212,7 @@ acpi_ps_complete_this_op(struct acpi_walk_state * walk_state,
replacement_op = replacement_op =
acpi_ps_alloc_op(AML_INT_RETURN_VALUE_OP); acpi_ps_alloc_op(AML_INT_RETURN_VALUE_OP);
if (!replacement_op) { if (!replacement_op) {
goto allocate_error; status = AE_NO_MEMORY;
} }
} else } else
if ((op->common.parent->common.aml_opcode == if ((op->common.parent->common.aml_opcode ==
...@@ -226,13 +227,13 @@ acpi_ps_complete_this_op(struct acpi_walk_state * walk_state, ...@@ -226,13 +227,13 @@ acpi_ps_complete_this_op(struct acpi_walk_state * walk_state,
acpi_ps_alloc_op(op->common. acpi_ps_alloc_op(op->common.
aml_opcode); aml_opcode);
if (!replacement_op) { if (!replacement_op) {
goto allocate_error; status = AE_NO_MEMORY;
} else {
replacement_op->named.data =
op->named.data;
replacement_op->named.length =
op->named.length;
} }
replacement_op->named.data =
op->named.data;
replacement_op->named.length =
op->named.length;
} }
} }
break; break;
...@@ -242,7 +243,7 @@ acpi_ps_complete_this_op(struct acpi_walk_state * walk_state, ...@@ -242,7 +243,7 @@ acpi_ps_complete_this_op(struct acpi_walk_state * walk_state,
replacement_op = replacement_op =
acpi_ps_alloc_op(AML_INT_RETURN_VALUE_OP); acpi_ps_alloc_op(AML_INT_RETURN_VALUE_OP);
if (!replacement_op) { if (!replacement_op) {
goto allocate_error; status = AE_NO_MEMORY;
} }
} }
...@@ -302,14 +303,7 @@ acpi_ps_complete_this_op(struct acpi_walk_state * walk_state, ...@@ -302,14 +303,7 @@ acpi_ps_complete_this_op(struct acpi_walk_state * walk_state,
/* Now we can actually delete the subtree rooted at Op */ /* Now we can actually delete the subtree rooted at Op */
acpi_ps_delete_parse_tree(op); acpi_ps_delete_parse_tree(op);
return_ACPI_STATUS(AE_OK); return_ACPI_STATUS(status);
allocate_error:
/* Always delete the subtree, even on error */
acpi_ps_delete_parse_tree(op);
return_ACPI_STATUS(AE_NO_MEMORY);
} }
/******************************************************************************* /*******************************************************************************
...@@ -641,10 +635,12 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state) ...@@ -641,10 +635,12 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
ACPI_WALK_METHOD_RESTART; ACPI_WALK_METHOD_RESTART;
} }
} else { } else {
/* On error, delete any return object */ /* On error, delete any return object or implicit return */
acpi_ut_remove_reference(previous_walk_state-> acpi_ut_remove_reference(previous_walk_state->
return_desc); return_desc);
acpi_ds_clear_implicit_return
(previous_walk_state);
} }
} }
......
...@@ -536,13 +536,13 @@ static int acpi_processor_get_psd(struct acpi_processor *pr) ...@@ -536,13 +536,13 @@ static int acpi_processor_get_psd(struct acpi_processor *pr)
psd = buffer.pointer; psd = buffer.pointer;
if (!psd || (psd->type != ACPI_TYPE_PACKAGE)) { if (!psd || (psd->type != ACPI_TYPE_PACKAGE)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _PSD data\n")); printk(KERN_ERR PREFIX "Invalid _PSD data\n");
result = -EFAULT; result = -EFAULT;
goto end; goto end;
} }
if (psd->package.count != 1) { if (psd->package.count != 1) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _PSD data\n")); printk(KERN_ERR PREFIX "Invalid _PSD data\n");
result = -EFAULT; result = -EFAULT;
goto end; goto end;
} }
...@@ -555,19 +555,19 @@ static int acpi_processor_get_psd(struct acpi_processor *pr) ...@@ -555,19 +555,19 @@ static int acpi_processor_get_psd(struct acpi_processor *pr)
status = acpi_extract_package(&(psd->package.elements[0]), status = acpi_extract_package(&(psd->package.elements[0]),
&format, &state); &format, &state);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _PSD data\n")); printk(KERN_ERR PREFIX "Invalid _PSD data\n");
result = -EFAULT; result = -EFAULT;
goto end; goto end;
} }
if (pdomain->num_entries != ACPI_PSD_REV0_ENTRIES) { if (pdomain->num_entries != ACPI_PSD_REV0_ENTRIES) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Unknown _PSD:num_entries\n")); printk(KERN_ERR PREFIX "Unknown _PSD:num_entries\n");
result = -EFAULT; result = -EFAULT;
goto end; goto end;
} }
if (pdomain->revision != ACPI_PSD_REV0_REVISION) { if (pdomain->revision != ACPI_PSD_REV0_REVISION) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Unknown _PSD:revision\n")); printk(KERN_ERR PREFIX "Unknown _PSD:revision\n");
result = -EFAULT; result = -EFAULT;
goto end; goto end;
} }
......
...@@ -528,13 +528,13 @@ static int acpi_processor_get_tsd(struct acpi_processor *pr) ...@@ -528,13 +528,13 @@ static int acpi_processor_get_tsd(struct acpi_processor *pr)
tsd = buffer.pointer; tsd = buffer.pointer;
if (!tsd || (tsd->type != ACPI_TYPE_PACKAGE)) { if (!tsd || (tsd->type != ACPI_TYPE_PACKAGE)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _TSD data\n")); printk(KERN_ERR PREFIX "Invalid _TSD data\n");
result = -EFAULT; result = -EFAULT;
goto end; goto end;
} }
if (tsd->package.count != 1) { if (tsd->package.count != 1) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _TSD data\n")); printk(KERN_ERR PREFIX "Invalid _TSD data\n");
result = -EFAULT; result = -EFAULT;
goto end; goto end;
} }
...@@ -547,19 +547,19 @@ static int acpi_processor_get_tsd(struct acpi_processor *pr) ...@@ -547,19 +547,19 @@ static int acpi_processor_get_tsd(struct acpi_processor *pr)
status = acpi_extract_package(&(tsd->package.elements[0]), status = acpi_extract_package(&(tsd->package.elements[0]),
&format, &state); &format, &state);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _TSD data\n")); printk(KERN_ERR PREFIX "Invalid _TSD data\n");
result = -EFAULT; result = -EFAULT;
goto end; goto end;
} }
if (pdomain->num_entries != ACPI_TSD_REV0_ENTRIES) { if (pdomain->num_entries != ACPI_TSD_REV0_ENTRIES) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Unknown _TSD:num_entries\n")); printk(KERN_ERR PREFIX "Unknown _TSD:num_entries\n");
result = -EFAULT; result = -EFAULT;
goto end; goto end;
} }
if (pdomain->revision != ACPI_TSD_REV0_REVISION) { if (pdomain->revision != ACPI_TSD_REV0_REVISION) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Unknown _TSD:revision\n")); printk(KERN_ERR PREFIX "Unknown _TSD:revision\n");
result = -EFAULT; result = -EFAULT;
goto end; goto end;
} }
......
...@@ -43,7 +43,6 @@ ...@@ -43,7 +43,6 @@
#include <acpi/acpi.h> #include <acpi/acpi.h>
#include <acpi/acresrc.h> #include <acpi/acresrc.h>
#include <acpi/amlcode.h>
#include <acpi/acnamesp.h> #include <acpi/acnamesp.h>
#define _COMPONENT ACPI_RESOURCES #define _COMPONENT ACPI_RESOURCES
...@@ -560,8 +559,8 @@ acpi_rs_get_pci_routing_table_length(union acpi_operand_object *package_object, ...@@ -560,8 +559,8 @@ acpi_rs_get_pci_routing_table_length(union acpi_operand_object *package_object,
ACPI_GET_OBJECT_TYPE(*sub_object_list)) || ACPI_GET_OBJECT_TYPE(*sub_object_list)) ||
((ACPI_TYPE_LOCAL_REFERENCE == ((ACPI_TYPE_LOCAL_REFERENCE ==
ACPI_GET_OBJECT_TYPE(*sub_object_list)) && ACPI_GET_OBJECT_TYPE(*sub_object_list)) &&
((*sub_object_list)->reference.opcode == ((*sub_object_list)->reference.class ==
AML_INT_NAMEPATH_OP)))) { ACPI_REFCLASS_NAME)))) {
name_found = TRUE; name_found = TRUE;
} else { } else {
/* Look at the next element */ /* Look at the next element */
......
...@@ -43,7 +43,6 @@ ...@@ -43,7 +43,6 @@
#include <acpi/acpi.h> #include <acpi/acpi.h>
#include <acpi/acresrc.h> #include <acpi/acresrc.h>
#include <acpi/amlcode.h>
#include <acpi/acnamesp.h> #include <acpi/acnamesp.h>
#define _COMPONENT ACPI_RESOURCES #define _COMPONENT ACPI_RESOURCES
...@@ -310,13 +309,12 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object, ...@@ -310,13 +309,12 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
switch (ACPI_GET_OBJECT_TYPE(obj_desc)) { switch (ACPI_GET_OBJECT_TYPE(obj_desc)) {
case ACPI_TYPE_LOCAL_REFERENCE: case ACPI_TYPE_LOCAL_REFERENCE:
if (obj_desc->reference.opcode != if (obj_desc->reference.class !=
AML_INT_NAMEPATH_OP) { ACPI_REFCLASS_NAME) {
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
"(PRT[%X].Source) Need name, found reference op %X", "(PRT[%X].Source) Need name, found Reference Class %X",
index, index,
obj_desc->reference. obj_desc->reference.class));
opcode));
return_ACPI_STATUS(AE_BAD_DATA); return_ACPI_STATUS(AE_BAD_DATA);
} }
......
...@@ -113,16 +113,16 @@ static int acpi_bus_hot_remove_device(void *context) ...@@ -113,16 +113,16 @@ static int acpi_bus_hot_remove_device(void *context)
if (acpi_bus_trim(device, 1)) { if (acpi_bus_trim(device, 1)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, printk(KERN_ERR PREFIX
"Removing device failed\n")); "Removing device failed\n");
return -1; return -1;
} }
/* power off device */ /* power off device */
status = acpi_evaluate_object(handle, "_PS3", NULL, NULL); status = acpi_evaluate_object(handle, "_PS3", NULL, NULL);
if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) if (ACPI_FAILURE(status) && status != AE_NOT_FOUND)
ACPI_DEBUG_PRINT((ACPI_DB_WARN, printk(KERN_WARNING PREFIX
"Power-off device failed\n")); "Power-off device failed\n");
if (device->flags.lockable) { if (device->flags.lockable) {
arg_list.count = 1; arg_list.count = 1;
...@@ -484,7 +484,7 @@ static int acpi_device_register(struct acpi_device *device, ...@@ -484,7 +484,7 @@ static int acpi_device_register(struct acpi_device *device,
result = acpi_device_setup_files(device); result = acpi_device_setup_files(device);
if(result) if(result)
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error creating sysfs interface for device %s\n", device->dev.bus_id)); printk(KERN_ERR PREFIX "Error creating sysfs interface for device %s\n", device->dev.bus_id);
device->removal_type = ACPI_BUS_REMOVAL_NORMAL; device->removal_type = ACPI_BUS_REMOVAL_NORMAL;
return 0; return 0;
......
...@@ -387,8 +387,8 @@ static ssize_t counter_set(struct kobject *kobj, ...@@ -387,8 +387,8 @@ static ssize_t counter_set(struct kobject *kobj,
goto end; goto end;
if (!(all_counters[index].flags & ACPI_EVENT_VALID)) { if (!(all_counters[index].flags & ACPI_EVENT_VALID)) {
ACPI_DEBUG_PRINT((ACPI_DB_WARN, printk(KERN_WARNING PREFIX
"Can not change Invalid GPE/Fixed Event status\n")); "Can not change Invalid GPE/Fixed Event status\n");
return -EINVAL; return -EINVAL;
} }
......
...@@ -110,7 +110,6 @@ acpi_status ...@@ -110,7 +110,6 @@ acpi_status
acpi_tb_add_table(struct acpi_table_desc *table_desc, u32 *table_index) acpi_tb_add_table(struct acpi_table_desc *table_desc, u32 *table_index)
{ {
u32 i; u32 i;
u32 length;
acpi_status status = AE_OK; acpi_status status = AE_OK;
ACPI_FUNCTION_TRACE(tb_add_table); ACPI_FUNCTION_TRACE(tb_add_table);
...@@ -145,25 +144,64 @@ acpi_tb_add_table(struct acpi_table_desc *table_desc, u32 *table_index) ...@@ -145,25 +144,64 @@ acpi_tb_add_table(struct acpi_table_desc *table_desc, u32 *table_index)
} }
} }
length = ACPI_MIN(table_desc->length, /*
acpi_gbl_root_table_list.tables[i].length); * Check for a table match on the entire table length,
* not just the header.
*/
if (table_desc->length !=
acpi_gbl_root_table_list.tables[i].length) {
continue;
}
if (ACPI_MEMCMP(table_desc->pointer, if (ACPI_MEMCMP(table_desc->pointer,
acpi_gbl_root_table_list.tables[i].pointer, acpi_gbl_root_table_list.tables[i].pointer,
length)) { acpi_gbl_root_table_list.tables[i].length)) {
continue; continue;
} }
/* Table is already registered */ /*
* Note: the current mechanism does not unregister a table if it is
* dynamically unloaded. The related namespace entries are deleted,
* but the table remains in the root table list.
*
* The assumption here is that the number of different tables that
* will be loaded is actually small, and there is minimal overhead
* in just keeping the table in case it is needed again.
*
* If this assumption changes in the future (perhaps on large
* machines with many table load/unload operations), tables will
* need to be unregistered when they are unloaded, and slots in the
* root table list should be reused when empty.
*/
/*
* Table is already registered.
* We can delete the table that was passed as a parameter.
*/
acpi_tb_delete_table(table_desc); acpi_tb_delete_table(table_desc);
*table_index = i; *table_index = i;
status = AE_ALREADY_EXISTS;
goto release; if (acpi_gbl_root_table_list.tables[i].
flags & ACPI_TABLE_IS_LOADED) {
/* Table is still loaded, this is an error */
status = AE_ALREADY_EXISTS;
goto release;
} else {
/* Table was unloaded, allow it to be reloaded */
table_desc->pointer =
acpi_gbl_root_table_list.tables[i].pointer;
table_desc->address =
acpi_gbl_root_table_list.tables[i].address;
status = AE_OK;
goto print_header;
}
} }
/* /* Add the table to the global root table list */
* Add the table to the global table list
*/
status = acpi_tb_store_table(table_desc->address, table_desc->pointer, status = acpi_tb_store_table(table_desc->address, table_desc->pointer,
table_desc->length, table_desc->flags, table_desc->length, table_desc->flags,
table_index); table_index);
...@@ -171,6 +209,7 @@ acpi_tb_add_table(struct acpi_table_desc *table_desc, u32 *table_index) ...@@ -171,6 +209,7 @@ acpi_tb_add_table(struct acpi_table_desc *table_desc, u32 *table_index)
goto release; goto release;
} }
print_header:
acpi_tb_print_table_header(table_desc->address, table_desc->pointer); acpi_tb_print_table_header(table_desc->address, table_desc->pointer);
release: release:
......
...@@ -1213,8 +1213,8 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz) ...@@ -1213,8 +1213,8 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz)
acpi_bus_private_data_handler, acpi_bus_private_data_handler,
tz->thermal_zone); tz->thermal_zone);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, printk(KERN_ERR PREFIX
"Error attaching device data\n")); "Error attaching device data\n");
return -ENODEV; return -ENODEV;
} }
......
...@@ -232,7 +232,7 @@ acpi_status acpi_ut_validate_buffer(struct acpi_buffer * buffer) ...@@ -232,7 +232,7 @@ acpi_status acpi_ut_validate_buffer(struct acpi_buffer * buffer)
* RETURN: Status * RETURN: Status
* *
* DESCRIPTION: Validate that the buffer is of the required length or * DESCRIPTION: Validate that the buffer is of the required length or
* allocate a new buffer. Returned buffer is always zeroed. * allocate a new buffer. Returned buffer is always zeroed.
* *
******************************************************************************/ ******************************************************************************/
...@@ -240,7 +240,7 @@ acpi_status ...@@ -240,7 +240,7 @@ acpi_status
acpi_ut_initialize_buffer(struct acpi_buffer * buffer, acpi_ut_initialize_buffer(struct acpi_buffer * buffer,
acpi_size required_length) acpi_size required_length)
{ {
acpi_status status = AE_OK; acpi_size input_buffer_length;
/* Parameter validation */ /* Parameter validation */
...@@ -248,55 +248,58 @@ acpi_ut_initialize_buffer(struct acpi_buffer * buffer, ...@@ -248,55 +248,58 @@ acpi_ut_initialize_buffer(struct acpi_buffer * buffer,
return (AE_BAD_PARAMETER); return (AE_BAD_PARAMETER);
} }
switch (buffer->length) { /*
* Buffer->Length is used as both an input and output parameter. Get the
* input actual length and set the output required buffer length.
*/
input_buffer_length = buffer->length;
buffer->length = required_length;
/*
* The input buffer length contains the actual buffer length, or the type
* of buffer to be allocated by this routine.
*/
switch (input_buffer_length) {
case ACPI_NO_BUFFER: case ACPI_NO_BUFFER:
/* Set the exception and returned the required length */ /* Return the exception (and the required buffer length) */
status = AE_BUFFER_OVERFLOW; return (AE_BUFFER_OVERFLOW);
break;
case ACPI_ALLOCATE_BUFFER: case ACPI_ALLOCATE_BUFFER:
/* Allocate a new buffer */ /* Allocate a new buffer */
buffer->pointer = acpi_os_allocate(required_length); buffer->pointer = acpi_os_allocate(required_length);
if (!buffer->pointer) {
return (AE_NO_MEMORY);
}
/* Clear the buffer */
ACPI_MEMSET(buffer->pointer, 0, required_length);
break; break;
case ACPI_ALLOCATE_LOCAL_BUFFER: case ACPI_ALLOCATE_LOCAL_BUFFER:
/* Allocate a new buffer with local interface to allow tracking */ /* Allocate a new buffer with local interface to allow tracking */
buffer->pointer = ACPI_ALLOCATE_ZEROED(required_length); buffer->pointer = ACPI_ALLOCATE(required_length);
if (!buffer->pointer) {
return (AE_NO_MEMORY);
}
break; break;
default: default:
/* Existing buffer: Validate the size of the buffer */ /* Existing buffer: Validate the size of the buffer */
if (buffer->length < required_length) { if (input_buffer_length < required_length) {
status = AE_BUFFER_OVERFLOW; return (AE_BUFFER_OVERFLOW);
break;
} }
break;
}
/* Clear the buffer */ /* Validate allocation from above or input buffer pointer */
ACPI_MEMSET(buffer->pointer, 0, required_length); if (!buffer->pointer) {
break; return (AE_NO_MEMORY);
} }
buffer->length = required_length; /* Have a valid buffer, clear it */
return (status);
ACPI_MEMSET(buffer->pointer, 0, required_length);
return (AE_OK);
} }
#ifdef NOT_USED_BY_LINUX #ifdef NOT_USED_BY_LINUX
......
...@@ -42,7 +42,6 @@ ...@@ -42,7 +42,6 @@
*/ */
#include <acpi/acpi.h> #include <acpi/acpi.h>
#include <acpi/amlcode.h>
#include <acpi/acnamesp.h> #include <acpi/acnamesp.h>
...@@ -176,20 +175,24 @@ acpi_ut_copy_isimple_to_esimple(union acpi_operand_object *internal_object, ...@@ -176,20 +175,24 @@ acpi_ut_copy_isimple_to_esimple(union acpi_operand_object *internal_object,
/* This is an object reference. */ /* This is an object reference. */
switch (internal_object->reference.opcode) { switch (internal_object->reference.class) {
case AML_INT_NAMEPATH_OP: case ACPI_REFCLASS_NAME:
/* For namepath, return the object handle ("reference") */
default:
/* We are referring to the namespace node */
/*
* For namepath, return the object handle ("reference")
* We are referring to the namespace node
*/
external_object->reference.handle = external_object->reference.handle =
internal_object->reference.node; internal_object->reference.node;
external_object->reference.actual_type = external_object->reference.actual_type =
acpi_ns_get_type(internal_object->reference.node); acpi_ns_get_type(internal_object->reference.node);
break; break;
default:
/* All other reference types are unsupported */
return_ACPI_STATUS(AE_TYPE);
} }
break; break;
...@@ -533,7 +536,7 @@ acpi_ut_copy_esimple_to_isimple(union acpi_object *external_object, ...@@ -533,7 +536,7 @@ acpi_ut_copy_esimple_to_isimple(union acpi_object *external_object,
/* TBD: should validate incoming handle */ /* TBD: should validate incoming handle */
internal_object->reference.opcode = AML_INT_NAMEPATH_OP; internal_object->reference.class = ACPI_REFCLASS_NAME;
internal_object->reference.node = internal_object->reference.node =
external_object->reference.handle; external_object->reference.handle;
break; break;
...@@ -743,11 +746,11 @@ acpi_ut_copy_simple_object(union acpi_operand_object *source_desc, ...@@ -743,11 +746,11 @@ acpi_ut_copy_simple_object(union acpi_operand_object *source_desc,
* We copied the reference object, so we now must add a reference * We copied the reference object, so we now must add a reference
* to the object pointed to by the reference * to the object pointed to by the reference
* *
* DDBHandle reference (from Load/load_table is a special reference, * DDBHandle reference (from Load/load_table) is a special reference,
* it's Reference.Object is the table index, so does not need to * it does not have a Reference.Object, so does not need to
* increase the reference count * increase the reference count
*/ */
if (source_desc->reference.opcode == AML_LOAD_OP) { if (source_desc->reference.class == ACPI_REFCLASS_TABLE) {
break; break;
} }
......
...@@ -45,7 +45,6 @@ ...@@ -45,7 +45,6 @@
#include <acpi/acinterp.h> #include <acpi/acinterp.h>
#include <acpi/acnamesp.h> #include <acpi/acnamesp.h>
#include <acpi/acevents.h> #include <acpi/acevents.h>
#include <acpi/amlcode.h>
#define _COMPONENT ACPI_UTILITIES #define _COMPONENT ACPI_UTILITIES
ACPI_MODULE_NAME("utdelete") ACPI_MODULE_NAME("utdelete")
...@@ -548,8 +547,8 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action) ...@@ -548,8 +547,8 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action)
* reference must track changes to the ref count of the index or * reference must track changes to the ref count of the index or
* target object. * target object.
*/ */
if ((object->reference.opcode == AML_INDEX_OP) || if ((object->reference.class == ACPI_REFCLASS_INDEX) ||
(object->reference.opcode == AML_INT_NAMEPATH_OP)) { (object->reference.class == ACPI_REFCLASS_NAME)) {
next_object = object->reference.object; next_object = object->reference.object;
} }
break; break;
...@@ -586,6 +585,13 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action) ...@@ -586,6 +585,13 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action)
ACPI_EXCEPTION((AE_INFO, status, ACPI_EXCEPTION((AE_INFO, status,
"Could not update object reference count")); "Could not update object reference count"));
/* Free any stacked Update State objects */
while (state_list) {
state = acpi_ut_pop_generic_state(&state_list);
acpi_ut_delete_generic_state(state);
}
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
......
...@@ -281,7 +281,6 @@ struct acpi_bit_register_info acpi_gbl_bit_register_info[ACPI_NUM_BITREG] = { ...@@ -281,7 +281,6 @@ struct acpi_bit_register_info acpi_gbl_bit_register_info[ACPI_NUM_BITREG] = {
/* ACPI_BITREG_RT_CLOCK_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, /* ACPI_BITREG_RT_CLOCK_ENABLE */ {ACPI_REGISTER_PM1_ENABLE,
ACPI_BITPOSITION_RT_CLOCK_ENABLE, ACPI_BITPOSITION_RT_CLOCK_ENABLE,
ACPI_BITMASK_RT_CLOCK_ENABLE}, ACPI_BITMASK_RT_CLOCK_ENABLE},
/* ACPI_BITREG_WAKE_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, 0, 0},
/* ACPI_BITREG_PCIEXP_WAKE_DISABLE */ {ACPI_REGISTER_PM1_ENABLE, /* ACPI_BITREG_PCIEXP_WAKE_DISABLE */ {ACPI_REGISTER_PM1_ENABLE,
ACPI_BITPOSITION_PCIEXP_WAKE_DISABLE, ACPI_BITPOSITION_PCIEXP_WAKE_DISABLE,
ACPI_BITMASK_PCIEXP_WAKE_DISABLE}, ACPI_BITMASK_PCIEXP_WAKE_DISABLE},
...@@ -575,6 +574,47 @@ char *acpi_ut_get_descriptor_name(void *object) ...@@ -575,6 +574,47 @@ char *acpi_ut_get_descriptor_name(void *object)
} }
/*******************************************************************************
*
* FUNCTION: acpi_ut_get_reference_name
*
* PARAMETERS: Object - An ACPI reference object
*
* RETURN: Pointer to a string
*
* DESCRIPTION: Decode a reference object sub-type to a string.
*
******************************************************************************/
/* Printable names of reference object sub-types */
static const char *acpi_gbl_ref_class_names[] = {
/* 00 */ "Local",
/* 01 */ "Argument",
/* 02 */ "RefOf",
/* 03 */ "Index",
/* 04 */ "DdbHandle",
/* 05 */ "Named Object",
/* 06 */ "Debug"
};
const char *acpi_ut_get_reference_name(union acpi_operand_object *object)
{
if (!object)
return "NULL Object";
if (ACPI_GET_DESCRIPTOR_TYPE(object) != ACPI_DESC_TYPE_OPERAND)
return "Not an Operand object";
if (object->common.type != ACPI_TYPE_LOCAL_REFERENCE)
return "Not a Reference object";
if (object->reference.class > ACPI_REFCLASS_MAX)
return "Unknown Reference class";
return acpi_gbl_ref_class_names[object->reference.class];
}
#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
/* /*
* Strings and procedures used for debug only * Strings and procedures used for debug only
...@@ -677,14 +717,14 @@ u8 acpi_ut_valid_object_type(acpi_object_type type) ...@@ -677,14 +717,14 @@ u8 acpi_ut_valid_object_type(acpi_object_type type)
* *
* PARAMETERS: None * PARAMETERS: None
* *
* RETURN: None * RETURN: Status
* *
* DESCRIPTION: Init library globals. All globals that require specific * DESCRIPTION: Init library globals. All globals that require specific
* initialization should be initialized here! * initialization should be initialized here!
* *
******************************************************************************/ ******************************************************************************/
void acpi_ut_init_globals(void) acpi_status acpi_ut_init_globals(void)
{ {
acpi_status status; acpi_status status;
u32 i; u32 i;
...@@ -695,7 +735,7 @@ void acpi_ut_init_globals(void) ...@@ -695,7 +735,7 @@ void acpi_ut_init_globals(void)
status = acpi_ut_create_caches(); status = acpi_ut_create_caches();
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
return; return_ACPI_STATUS(status);
} }
/* Mutex locked flags */ /* Mutex locked flags */
...@@ -772,8 +812,8 @@ void acpi_ut_init_globals(void) ...@@ -772,8 +812,8 @@ void acpi_ut_init_globals(void)
acpi_gbl_display_final_mem_stats = FALSE; acpi_gbl_display_final_mem_stats = FALSE;
#endif #endif
return_VOID; return_ACPI_STATUS(AE_OK);
} }
ACPI_EXPORT_SYMBOL(acpi_dbg_level) ACPI_EXPORT_SYMBOL(acpi_dbg_level)
ACPI_EXPORT_SYMBOL(acpi_dbg_layer) ACPI_EXPORT_SYMBOL(acpi_dbg_layer)
...@@ -995,6 +995,15 @@ acpi_ut_walk_package_tree(union acpi_operand_object * source_object, ...@@ -995,6 +995,15 @@ acpi_ut_walk_package_tree(union acpi_operand_object * source_object,
state->pkg. state->pkg.
this_target_obj, 0); this_target_obj, 0);
if (!state) { if (!state) {
/* Free any stacked Update State objects */
while (state_list) {
state =
acpi_ut_pop_generic_state
(&state_list);
acpi_ut_delete_generic_state(state);
}
return_ACPI_STATUS(AE_NO_MEMORY); return_ACPI_STATUS(AE_NO_MEMORY);
} }
} }
......
...@@ -43,7 +43,6 @@ ...@@ -43,7 +43,6 @@
#include <acpi/acpi.h> #include <acpi/acpi.h>
#include <acpi/acnamesp.h> #include <acpi/acnamesp.h>
#include <acpi/amlcode.h>
#define _COMPONENT ACPI_UTILITIES #define _COMPONENT ACPI_UTILITIES
ACPI_MODULE_NAME("utobject") ACPI_MODULE_NAME("utobject")
...@@ -478,8 +477,8 @@ acpi_ut_get_simple_object_size(union acpi_operand_object *internal_object, ...@@ -478,8 +477,8 @@ acpi_ut_get_simple_object_size(union acpi_operand_object *internal_object,
case ACPI_TYPE_LOCAL_REFERENCE: case ACPI_TYPE_LOCAL_REFERENCE:
switch (internal_object->reference.opcode) { switch (internal_object->reference.class) {
case AML_INT_NAMEPATH_OP: case ACPI_REFCLASS_NAME:
/* /*
* Get the actual length of the full pathname to this object. * Get the actual length of the full pathname to this object.
...@@ -503,8 +502,10 @@ acpi_ut_get_simple_object_size(union acpi_operand_object *internal_object, ...@@ -503,8 +502,10 @@ acpi_ut_get_simple_object_size(union acpi_operand_object *internal_object,
* required eventually. * required eventually.
*/ */
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
"Unsupported Reference opcode=%X in object %p", "Cannot convert to external object - "
internal_object->reference.opcode, "unsupported Reference Class [%s] %X in object %p",
acpi_ut_get_reference_name(internal_object),
internal_object->reference.class,
internal_object)); internal_object));
status = AE_TYPE; status = AE_TYPE;
break; break;
...@@ -513,7 +514,9 @@ acpi_ut_get_simple_object_size(union acpi_operand_object *internal_object, ...@@ -513,7 +514,9 @@ acpi_ut_get_simple_object_size(union acpi_operand_object *internal_object,
default: default:
ACPI_ERROR((AE_INFO, "Unsupported type=%X in object %p", ACPI_ERROR((AE_INFO, "Cannot convert to external object - "
"unsupported type [%s] %X in object %p",
acpi_ut_get_object_type_name(internal_object),
ACPI_GET_OBJECT_TYPE(internal_object), ACPI_GET_OBJECT_TYPE(internal_object),
internal_object)); internal_object));
status = AE_TYPE; status = AE_TYPE;
......
...@@ -81,7 +81,12 @@ acpi_status __init acpi_initialize_subsystem(void) ...@@ -81,7 +81,12 @@ acpi_status __init acpi_initialize_subsystem(void)
/* Initialize all globals used by the subsystem */ /* Initialize all globals used by the subsystem */
acpi_ut_init_globals(); status = acpi_ut_init_globals();
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status,
"During initialization of globals"));
return_ACPI_STATUS(status);
}
/* Create the default mutex objects */ /* Create the default mutex objects */
......
...@@ -1530,8 +1530,8 @@ acpi_video_bus_get_one_device(struct acpi_device *device, ...@@ -1530,8 +1530,8 @@ acpi_video_bus_get_one_device(struct acpi_device *device,
acpi_video_device_notify, acpi_video_device_notify,
data); data);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, printk(KERN_ERR PREFIX
"Error installing notify handler\n")); "Error installing notify handler\n");
if(data->brightness) if(data->brightness)
kfree(data->brightness->levels); kfree(data->brightness->levels);
kfree(data->brightness); kfree(data->brightness);
...@@ -1745,8 +1745,8 @@ acpi_video_bus_get_devices(struct acpi_video_bus *video, ...@@ -1745,8 +1745,8 @@ acpi_video_bus_get_devices(struct acpi_video_bus *video,
status = acpi_video_bus_get_one_device(dev, video); status = acpi_video_bus_get_one_device(dev, video);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_WARN, printk(KERN_WARNING PREFIX
"Cant attach device")); "Cant attach device");
continue; continue;
} }
} }
...@@ -2003,8 +2003,8 @@ static int acpi_video_bus_add(struct acpi_device *device) ...@@ -2003,8 +2003,8 @@ static int acpi_video_bus_add(struct acpi_device *device)
ACPI_DEVICE_NOTIFY, ACPI_DEVICE_NOTIFY,
acpi_video_bus_notify, video); acpi_video_bus_notify, video);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, printk(KERN_ERR PREFIX
"Error installing notify handler\n")); "Error installing notify handler\n");
error = -ENODEV; error = -ENODEV;
goto err_stop_video; goto err_stop_video;
} }
......
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
/* Current ACPICA subsystem version in YYYYMMDD format */ /* Current ACPICA subsystem version in YYYYMMDD format */
#define ACPI_CA_VERSION 0x20080609 #define ACPI_CA_VERSION 0x20080926
/* /*
* OS name, used for the _OS object. The _OS object is essentially obsolete, * OS name, used for the _OS object. The _OS object is essentially obsolete,
......
...@@ -123,6 +123,10 @@ void acpi_db_check_integrity(void); ...@@ -123,6 +123,10 @@ void acpi_db_check_integrity(void);
void acpi_db_generate_gpe(char *gpe_arg, char *block_arg); void acpi_db_generate_gpe(char *gpe_arg, char *block_arg);
void acpi_db_check_predefined_names(void);
void acpi_db_batch_execute(void);
/* /*
* dbdisply - debug display commands * dbdisply - debug display commands
*/ */
...@@ -150,6 +154,10 @@ void ...@@ -150,6 +154,10 @@ void
acpi_db_display_argument_object(union acpi_operand_object *obj_desc, acpi_db_display_argument_object(union acpi_operand_object *obj_desc,
struct acpi_walk_state *walk_state); struct acpi_walk_state *walk_state);
void acpi_db_check_predefined_names(void);
void acpi_db_batch_execute(void);
/* /*
* dbexec - debugger control method execution * dbexec - debugger control method execution
*/ */
......
...@@ -186,6 +186,8 @@ extern struct acpi_dmtable_info acpi_dm_table_info_madt5[]; ...@@ -186,6 +186,8 @@ extern struct acpi_dmtable_info acpi_dm_table_info_madt5[];
extern struct acpi_dmtable_info acpi_dm_table_info_madt6[]; extern struct acpi_dmtable_info acpi_dm_table_info_madt6[];
extern struct acpi_dmtable_info acpi_dm_table_info_madt7[]; extern struct acpi_dmtable_info acpi_dm_table_info_madt7[];
extern struct acpi_dmtable_info acpi_dm_table_info_madt8[]; extern struct acpi_dmtable_info acpi_dm_table_info_madt8[];
extern struct acpi_dmtable_info acpi_dm_table_info_madt9[];
extern struct acpi_dmtable_info acpi_dm_table_info_madt10[];
extern struct acpi_dmtable_info acpi_dm_table_info_madt_hdr[]; extern struct acpi_dmtable_info acpi_dm_table_info_madt_hdr[];
extern struct acpi_dmtable_info acpi_dm_table_info_mcfg[]; extern struct acpi_dmtable_info acpi_dm_table_info_mcfg[];
extern struct acpi_dmtable_info acpi_dm_table_info_mcfg0[]; extern struct acpi_dmtable_info acpi_dm_table_info_mcfg0[];
...@@ -197,8 +199,10 @@ extern struct acpi_dmtable_info acpi_dm_table_info_slit[]; ...@@ -197,8 +199,10 @@ extern struct acpi_dmtable_info acpi_dm_table_info_slit[];
extern struct acpi_dmtable_info acpi_dm_table_info_spcr[]; extern struct acpi_dmtable_info acpi_dm_table_info_spcr[];
extern struct acpi_dmtable_info acpi_dm_table_info_spmi[]; extern struct acpi_dmtable_info acpi_dm_table_info_spmi[];
extern struct acpi_dmtable_info acpi_dm_table_info_srat[]; extern struct acpi_dmtable_info acpi_dm_table_info_srat[];
extern struct acpi_dmtable_info acpi_dm_table_info_srat_hdr[];
extern struct acpi_dmtable_info acpi_dm_table_info_srat0[]; extern struct acpi_dmtable_info acpi_dm_table_info_srat0[];
extern struct acpi_dmtable_info acpi_dm_table_info_srat1[]; extern struct acpi_dmtable_info acpi_dm_table_info_srat1[];
extern struct acpi_dmtable_info acpi_dm_table_info_srat2[];
extern struct acpi_dmtable_info acpi_dm_table_info_tcpa[]; extern struct acpi_dmtable_info acpi_dm_table_info_tcpa[];
extern struct acpi_dmtable_info acpi_dm_table_info_wdrt[]; extern struct acpi_dmtable_info acpi_dm_table_info_wdrt[];
......
...@@ -157,7 +157,7 @@ acpi_ds_init_callbacks(struct acpi_walk_state *walk_state, u32 pass_number); ...@@ -157,7 +157,7 @@ acpi_ds_init_callbacks(struct acpi_walk_state *walk_state, u32 pass_number);
* dsmthdat - method data (locals/args) * dsmthdat - method data (locals/args)
*/ */
acpi_status acpi_status
acpi_ds_store_object_to_local(u16 opcode, acpi_ds_store_object_to_local(u8 type,
u32 index, u32 index,
union acpi_operand_object *src_desc, union acpi_operand_object *src_desc,
struct acpi_walk_state *walk_state); struct acpi_walk_state *walk_state);
...@@ -173,7 +173,7 @@ void acpi_ds_method_data_delete_all(struct acpi_walk_state *walk_state); ...@@ -173,7 +173,7 @@ void acpi_ds_method_data_delete_all(struct acpi_walk_state *walk_state);
u8 acpi_ds_is_method_value(union acpi_operand_object *obj_desc); u8 acpi_ds_is_method_value(union acpi_operand_object *obj_desc);
acpi_status acpi_status
acpi_ds_method_data_get_value(u16 opcode, acpi_ds_method_data_get_value(u8 type,
u32 index, u32 index,
struct acpi_walk_state *walk_state, struct acpi_walk_state *walk_state,
union acpi_operand_object **dest_desc); union acpi_operand_object **dest_desc);
...@@ -184,7 +184,7 @@ acpi_ds_method_data_init_args(union acpi_operand_object **params, ...@@ -184,7 +184,7 @@ acpi_ds_method_data_init_args(union acpi_operand_object **params,
struct acpi_walk_state *walk_state); struct acpi_walk_state *walk_state);
acpi_status acpi_status
acpi_ds_method_data_get_node(u16 opcode, acpi_ds_method_data_get_node(u8 type,
u32 index, u32 index,
struct acpi_walk_state *walk_state, struct acpi_walk_state *walk_state,
struct acpi_namespace_node **node); struct acpi_namespace_node **node);
......
This diff is collapsed.
...@@ -208,6 +208,7 @@ struct acpi_namespace_node { ...@@ -208,6 +208,7 @@ struct acpi_namespace_node {
#define ANOBJ_METHOD_ARG 0x04 /* Node is a method argument */ #define ANOBJ_METHOD_ARG 0x04 /* Node is a method argument */
#define ANOBJ_METHOD_LOCAL 0x08 /* Node is a method local */ #define ANOBJ_METHOD_LOCAL 0x08 /* Node is a method local */
#define ANOBJ_SUBTREE_HAS_INI 0x10 /* Used to optimize device initialization */ #define ANOBJ_SUBTREE_HAS_INI 0x10 /* Used to optimize device initialization */
#define ANOBJ_EVALUATED 0x20 /* Set on first evaluation of node */
#define ANOBJ_IS_EXTERNAL 0x08 /* i_aSL only: This object created via External() */ #define ANOBJ_IS_EXTERNAL 0x08 /* i_aSL only: This object created via External() */
#define ANOBJ_METHOD_NO_RETVAL 0x10 /* i_aSL only: Method has no return value */ #define ANOBJ_METHOD_NO_RETVAL 0x10 /* i_aSL only: Method has no return value */
...@@ -340,6 +341,82 @@ acpi_status(*ACPI_INTERNAL_METHOD) (struct acpi_walk_state * walk_state); ...@@ -340,6 +341,82 @@ acpi_status(*ACPI_INTERNAL_METHOD) (struct acpi_walk_state * walk_state);
#define ACPI_BTYPE_OBJECTS_AND_REFS 0x0001FFFF /* ARG or LOCAL */ #define ACPI_BTYPE_OBJECTS_AND_REFS 0x0001FFFF /* ARG or LOCAL */
#define ACPI_BTYPE_ALL_OBJECTS 0x0000FFFF #define ACPI_BTYPE_ALL_OBJECTS 0x0000FFFF
/*
* Information structure for ACPI predefined names.
* Each entry in the table contains the following items:
*
* Name - The ACPI reserved name
* param_count - Number of arguments to the method
* expected_return_btypes - Allowed type(s) for the return value
*/
struct acpi_name_info {
char name[ACPI_NAME_SIZE];
u8 param_count;
u8 expected_btypes;
};
/*
* Secondary information structures for ACPI predefined objects that return
* package objects. This structure appears as the next entry in the table
* after the NAME_INFO structure above.
*
* The reason for this is to minimize the size of the predefined name table.
*/
/*
* Used for ACPI_PTYPE1_FIXED, ACPI_PTYPE1_VAR, ACPI_PTYPE2,
* ACPI_PTYPE2_MIN, ACPI_PTYPE2_PKG_COUNT, ACPI_PTYPE2_COUNT
*/
struct acpi_package_info {
u8 type;
u8 object_type1;
u8 count1;
u8 object_type2;
u8 count2;
u8 reserved;
};
/* Used for ACPI_PTYPE2_FIXED */
struct acpi_package_info2 {
u8 type;
u8 count;
u8 object_type[4];
};
/* Used for ACPI_PTYPE1_OPTION */
struct acpi_package_info3 {
u8 type;
u8 count;
u8 object_type[2];
u8 tail_object_type;
u8 reserved;
};
union acpi_predefined_info {
struct acpi_name_info info;
struct acpi_package_info ret_info;
struct acpi_package_info2 ret_info2;
struct acpi_package_info3 ret_info3;
};
/*
* Bitmapped return value types
* Note: the actual data types must be contiguous, a loop in nspredef.c
* depends on this.
*/
#define ACPI_RTYPE_ANY 0x00
#define ACPI_RTYPE_NONE 0x01
#define ACPI_RTYPE_INTEGER 0x02
#define ACPI_RTYPE_STRING 0x04
#define ACPI_RTYPE_BUFFER 0x08
#define ACPI_RTYPE_PACKAGE 0x10
#define ACPI_RTYPE_REFERENCE 0x20
#define ACPI_RTYPE_ALL 0x3F
#define ACPI_NUM_RTYPES 5 /* Number of actual object types */
/***************************************************************************** /*****************************************************************************
* *
* Event typedefs and structs * Event typedefs and structs
......
This diff is collapsed.
...@@ -177,6 +177,22 @@ acpi_ns_dump_objects(acpi_object_type type, ...@@ -177,6 +177,22 @@ acpi_ns_dump_objects(acpi_object_type type,
*/ */
acpi_status acpi_ns_evaluate(struct acpi_evaluate_info *info); acpi_status acpi_ns_evaluate(struct acpi_evaluate_info *info);
/*
* nspredef - Support for predefined/reserved names
*/
acpi_status
acpi_ns_check_predefined_names(struct acpi_namespace_node *node,
union acpi_operand_object *return_object);
const union acpi_predefined_info *acpi_ns_check_for_predefined_name(struct
acpi_namespace_node
*node);
void
acpi_ns_check_parameter_count(char *pathname,
struct acpi_namespace_node *node,
const union acpi_predefined_info *info);
/* /*
* nsnames - Name and Scope manipulation * nsnames - Name and Scope manipulation
*/ */
......
...@@ -308,18 +308,34 @@ struct acpi_object_addr_handler { ...@@ -308,18 +308,34 @@ struct acpi_object_addr_handler {
*****************************************************************************/ *****************************************************************************/
/* /*
* The Reference object type is used for these opcodes: * The Reference object is used for these opcodes:
* Arg[0-6], Local[0-7], index_op, name_op, zero_op, one_op, ones_op, debug_op * Arg[0-6], Local[0-7], index_op, name_op, ref_of_op, load_op, load_table_op, debug_op
* The Reference.Class differentiates these types.
*/ */
struct acpi_object_reference { struct acpi_object_reference {
ACPI_OBJECT_COMMON_HEADER u8 target_type; /* Used for index_op */ ACPI_OBJECT_COMMON_HEADER u8 class; /* Reference Class */
u16 opcode; u8 target_type; /* Used for Index Op */
u8 reserved;
void *object; /* name_op=>HANDLE to obj, index_op=>union acpi_operand_object */ void *object; /* name_op=>HANDLE to obj, index_op=>union acpi_operand_object */
struct acpi_namespace_node *node; struct acpi_namespace_node *node; /* ref_of or Namepath */
union acpi_operand_object **where; union acpi_operand_object **where; /* Target of Index */
u32 offset; /* Used for arg_op, local_op, and index_op */ u32 value; /* Used for Local/Arg/Index/ddb_handle */
}; };
/* Values for Reference.Class above */
typedef enum {
ACPI_REFCLASS_LOCAL = 0, /* Method local */
ACPI_REFCLASS_ARG = 1, /* Method argument */
ACPI_REFCLASS_REFOF = 2, /* Result of ref_of() TBD: Split to Ref/Node and Ref/operand_obj? */
ACPI_REFCLASS_INDEX = 3, /* Result of Index() */
ACPI_REFCLASS_TABLE = 4, /* ddb_handle - Load(), load_table() */
ACPI_REFCLASS_NAME = 5, /* Reference to a named object */
ACPI_REFCLASS_DEBUG = 6, /* Debug object */
ACPI_REFCLASS_MAX = 6
} ACPI_REFERENCE_CLASSES;
/* /*
* Extra object is used as additional storage for types that * Extra object is used as additional storage for types that
* have AML code in their declarations (term_args) that must be * have AML code in their declarations (term_args) that must be
...@@ -379,6 +395,13 @@ union acpi_operand_object { ...@@ -379,6 +395,13 @@ union acpi_operand_object {
struct acpi_object_extra extra; struct acpi_object_extra extra;
struct acpi_object_data data; struct acpi_object_data data;
struct acpi_object_cache_list cache; struct acpi_object_cache_list cache;
/*
* Add namespace node to union in order to simplify code that accepts both
* ACPI_OPERAND_OBJECTs and ACPI_NAMESPACE_NODEs. The structures share
* a common descriptor_type field in order to differentiate them.
*/
struct acpi_namespace_node node;
}; };
/****************************************************************************** /******************************************************************************
......
...@@ -80,12 +80,10 @@ ...@@ -80,12 +80,10 @@
/* /*
* Raw debug output levels, do not use these in the DEBUG_PRINT macros * Raw debug output levels, do not use these in the DEBUG_PRINT macros
*/ */
#define ACPI_LV_ERROR 0x00000001 #define ACPI_LV_INIT 0x00000001
#define ACPI_LV_WARN 0x00000002 #define ACPI_LV_DEBUG_OBJECT 0x00000002
#define ACPI_LV_INIT 0x00000004 #define ACPI_LV_INFO 0x00000004
#define ACPI_LV_DEBUG_OBJECT 0x00000008 #define ACPI_LV_ALL_EXCEPTIONS 0x00000007
#define ACPI_LV_INFO 0x00000010
#define ACPI_LV_ALL_EXCEPTIONS 0x0000001F
/* Trace verbosity level 1 [Standard Trace Level] */ /* Trace verbosity level 1 [Standard Trace Level] */
...@@ -127,7 +125,6 @@ ...@@ -127,7 +125,6 @@
#define ACPI_LV_VERBOSE_INFO 0x20000000 #define ACPI_LV_VERBOSE_INFO 0x20000000
#define ACPI_LV_FULL_TABLES 0x40000000 #define ACPI_LV_FULL_TABLES 0x40000000
#define ACPI_LV_EVENTS 0x80000000 #define ACPI_LV_EVENTS 0x80000000
#define ACPI_LV_VERBOSE 0xF0000000 #define ACPI_LV_VERBOSE 0xF0000000
/* /*
...@@ -135,21 +132,17 @@ ...@@ -135,21 +132,17 @@
*/ */
#define ACPI_DEBUG_LEVEL(dl) (u32) dl,ACPI_DEBUG_PARAMETERS #define ACPI_DEBUG_LEVEL(dl) (u32) dl,ACPI_DEBUG_PARAMETERS
/* Exception level -- used in the global "DebugLevel" */ /*
* Exception level -- used in the global "DebugLevel"
*
* Note: For errors, use the ACPI_ERROR or ACPI_EXCEPTION interfaces.
* For warnings, use ACPI_WARNING.
*/
#define ACPI_DB_INIT ACPI_DEBUG_LEVEL (ACPI_LV_INIT) #define ACPI_DB_INIT ACPI_DEBUG_LEVEL (ACPI_LV_INIT)
#define ACPI_DB_DEBUG_OBJECT ACPI_DEBUG_LEVEL (ACPI_LV_DEBUG_OBJECT) #define ACPI_DB_DEBUG_OBJECT ACPI_DEBUG_LEVEL (ACPI_LV_DEBUG_OBJECT)
#define ACPI_DB_INFO ACPI_DEBUG_LEVEL (ACPI_LV_INFO) #define ACPI_DB_INFO ACPI_DEBUG_LEVEL (ACPI_LV_INFO)
#define ACPI_DB_ALL_EXCEPTIONS ACPI_DEBUG_LEVEL (ACPI_LV_ALL_EXCEPTIONS) #define ACPI_DB_ALL_EXCEPTIONS ACPI_DEBUG_LEVEL (ACPI_LV_ALL_EXCEPTIONS)
/*
* These two levels are essentially obsolete, all instances in the
* ACPICA core code have been replaced by ACPI_ERROR and ACPI_WARNING
* (Kept here because some drivers may still use them)
*/
#define ACPI_DB_ERROR ACPI_DEBUG_LEVEL (ACPI_LV_ERROR)
#define ACPI_DB_WARN ACPI_DEBUG_LEVEL (ACPI_LV_WARN)
/* Trace level -- also used in the global "DebugLevel" */ /* Trace level -- also used in the global "DebugLevel" */
#define ACPI_DB_INIT_NAMES ACPI_DEBUG_LEVEL (ACPI_LV_INIT_NAMES) #define ACPI_DB_INIT_NAMES ACPI_DEBUG_LEVEL (ACPI_LV_INIT_NAMES)
...@@ -173,13 +166,14 @@ ...@@ -173,13 +166,14 @@
#define ACPI_DB_USER_REQUESTS ACPI_DEBUG_LEVEL (ACPI_LV_USER_REQUESTS) #define ACPI_DB_USER_REQUESTS ACPI_DEBUG_LEVEL (ACPI_LV_USER_REQUESTS)
#define ACPI_DB_PACKAGE ACPI_DEBUG_LEVEL (ACPI_LV_PACKAGE) #define ACPI_DB_PACKAGE ACPI_DEBUG_LEVEL (ACPI_LV_PACKAGE)
#define ACPI_DB_MUTEX ACPI_DEBUG_LEVEL (ACPI_LV_MUTEX) #define ACPI_DB_MUTEX ACPI_DEBUG_LEVEL (ACPI_LV_MUTEX)
#define ACPI_DB_EVENTS ACPI_DEBUG_LEVEL (ACPI_LV_EVENTS)
#define ACPI_DB_ALL ACPI_DEBUG_LEVEL (ACPI_LV_ALL) #define ACPI_DB_ALL ACPI_DEBUG_LEVEL (ACPI_LV_ALL)
/* Defaults for debug_level, debug and normal */ /* Defaults for debug_level, debug and normal */
#define ACPI_DEBUG_DEFAULT (ACPI_LV_INIT | ACPI_LV_WARN | ACPI_LV_ERROR) #define ACPI_DEBUG_DEFAULT (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT)
#define ACPI_NORMAL_DEFAULT (ACPI_LV_INIT | ACPI_LV_WARN | ACPI_LV_ERROR) #define ACPI_NORMAL_DEFAULT (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT)
#define ACPI_DEBUG_ALL (ACPI_LV_AML_DISASSEMBLE | ACPI_LV_ALL_EXCEPTIONS | ACPI_LV_ALL) #define ACPI_DEBUG_ALL (ACPI_LV_AML_DISASSEMBLE | ACPI_LV_ALL_EXCEPTIONS | ACPI_LV_ALL)
#endif /* __ACOUTPUT_H__ */ #endif /* __ACOUTPUT_H__ */
This diff is collapsed.
...@@ -908,7 +908,9 @@ enum acpi_madt_type { ...@@ -908,7 +908,9 @@ enum acpi_madt_type {
ACPI_MADT_TYPE_IO_SAPIC = 6, ACPI_MADT_TYPE_IO_SAPIC = 6,
ACPI_MADT_TYPE_LOCAL_SAPIC = 7, ACPI_MADT_TYPE_LOCAL_SAPIC = 7,
ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8, ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8,
ACPI_MADT_TYPE_RESERVED = 9 /* 9 and greater are reserved */ ACPI_MADT_TYPE_LOCAL_X2APIC = 9,
ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10,
ACPI_MADT_TYPE_RESERVED = 11 /* 11 and greater are reserved */
}; };
/* /*
...@@ -1009,6 +1011,26 @@ struct acpi_madt_interrupt_source { ...@@ -1009,6 +1011,26 @@ struct acpi_madt_interrupt_source {
#define ACPI_MADT_CPEI_OVERRIDE (1) #define ACPI_MADT_CPEI_OVERRIDE (1)
/* 9: Processor Local X2_APIC (07/2008) */
struct acpi_madt_local_x2apic {
struct acpi_subtable_header header;
u16 reserved; /* Reserved - must be zero */
u32 local_apic_id; /* Processor X2_APIC ID */
u32 lapic_flags;
u32 uid; /* Extended X2_APIC processor ID */
};
/* 10: Local X2APIC NMI (07/2008) */
struct acpi_madt_local_x2apic_nmi {
struct acpi_subtable_header header;
u16 inti_flags;
u32 uid; /* Processor X2_APIC ID */
u8 lint; /* LINTn to which NMI is connected */
u8 reserved[3];
};
/* /*
* Common flags fields for MADT subtables * Common flags fields for MADT subtables
*/ */
...@@ -1150,10 +1172,15 @@ struct acpi_table_srat { ...@@ -1150,10 +1172,15 @@ struct acpi_table_srat {
enum acpi_srat_type { enum acpi_srat_type {
ACPI_SRAT_TYPE_CPU_AFFINITY = 0, ACPI_SRAT_TYPE_CPU_AFFINITY = 0,
ACPI_SRAT_TYPE_MEMORY_AFFINITY = 1, ACPI_SRAT_TYPE_MEMORY_AFFINITY = 1,
ACPI_SRAT_TYPE_RESERVED = 2 ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY = 2,
ACPI_SRAT_TYPE_RESERVED = 3 /* 3 and greater are reserved */
}; };
/* SRAT sub-tables */ /*
* SRAT Sub-tables, correspond to Type in struct acpi_subtable_header
*/
/* 0: Processor Local APIC/SAPIC Affinity */
struct acpi_srat_cpu_affinity { struct acpi_srat_cpu_affinity {
struct acpi_subtable_header header; struct acpi_subtable_header header;
...@@ -1165,9 +1192,7 @@ struct acpi_srat_cpu_affinity { ...@@ -1165,9 +1192,7 @@ struct acpi_srat_cpu_affinity {
u32 reserved; /* Reserved, must be zero */ u32 reserved; /* Reserved, must be zero */
}; };
/* Flags */ /* 1: Memory Affinity */
#define ACPI_SRAT_CPU_ENABLED (1) /* 00: Use affinity structure */
struct acpi_srat_mem_affinity { struct acpi_srat_mem_affinity {
struct acpi_subtable_header header; struct acpi_subtable_header header;
...@@ -1186,6 +1211,20 @@ struct acpi_srat_mem_affinity { ...@@ -1186,6 +1211,20 @@ struct acpi_srat_mem_affinity {
#define ACPI_SRAT_MEM_HOT_PLUGGABLE (1<<1) /* 01: Memory region is hot pluggable */ #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 */ #define ACPI_SRAT_MEM_NON_VOLATILE (1<<2) /* 02: Memory region is non-volatile */
/* 2: Processor Local X2_APIC Affinity (07/2008) */
struct acpi_srat_x2apic_cpu_affinity {
struct acpi_subtable_header header;
u16 reserved; /* Reserved, must be zero */
u32 proximity_domain;
u32 apic_id;
u32 flags;
};
/* Flags for struct acpi_srat_cpu_affinity and struct acpi_srat_x2apic_cpu_affinity */
#define ACPI_SRAT_CPU_ENABLED (1) /* 00: Use affinity structure */
/******************************************************************************* /*******************************************************************************
* *
* TCPA - Trusted Computing Platform Alliance table * TCPA - Trusted Computing Platform Alliance table
......
...@@ -607,8 +607,15 @@ typedef u8 acpi_adr_space_type; ...@@ -607,8 +607,15 @@ typedef u8 acpi_adr_space_type;
/* /*
* bit_register IDs * bit_register IDs
* These are bitfields defined within the full ACPI registers *
* These values are intended to be used by the hardware interfaces
* and are mapped to individual bitfields defined within the ACPI
* registers. See the acpi_gbl_bit_register_info global table in utglobal.c
* for this mapping.
*/ */
/* PM1 Status register */
#define ACPI_BITREG_TIMER_STATUS 0x00 #define ACPI_BITREG_TIMER_STATUS 0x00
#define ACPI_BITREG_BUS_MASTER_STATUS 0x01 #define ACPI_BITREG_BUS_MASTER_STATUS 0x01
#define ACPI_BITREG_GLOBAL_LOCK_STATUS 0x02 #define ACPI_BITREG_GLOBAL_LOCK_STATUS 0x02
...@@ -618,24 +625,29 @@ typedef u8 acpi_adr_space_type; ...@@ -618,24 +625,29 @@ typedef u8 acpi_adr_space_type;
#define ACPI_BITREG_WAKE_STATUS 0x06 #define ACPI_BITREG_WAKE_STATUS 0x06
#define ACPI_BITREG_PCIEXP_WAKE_STATUS 0x07 #define ACPI_BITREG_PCIEXP_WAKE_STATUS 0x07
/* PM1 Enable register */
#define ACPI_BITREG_TIMER_ENABLE 0x08 #define ACPI_BITREG_TIMER_ENABLE 0x08
#define ACPI_BITREG_GLOBAL_LOCK_ENABLE 0x09 #define ACPI_BITREG_GLOBAL_LOCK_ENABLE 0x09
#define ACPI_BITREG_POWER_BUTTON_ENABLE 0x0A #define ACPI_BITREG_POWER_BUTTON_ENABLE 0x0A
#define ACPI_BITREG_SLEEP_BUTTON_ENABLE 0x0B #define ACPI_BITREG_SLEEP_BUTTON_ENABLE 0x0B
#define ACPI_BITREG_RT_CLOCK_ENABLE 0x0C #define ACPI_BITREG_RT_CLOCK_ENABLE 0x0C
#define ACPI_BITREG_WAKE_ENABLE 0x0D #define ACPI_BITREG_PCIEXP_WAKE_DISABLE 0x0D
#define ACPI_BITREG_PCIEXP_WAKE_DISABLE 0x0E
/* PM1 Control register */
#define ACPI_BITREG_SCI_ENABLE 0x0E
#define ACPI_BITREG_BUS_MASTER_RLD 0x0F
#define ACPI_BITREG_GLOBAL_LOCK_RELEASE 0x10
#define ACPI_BITREG_SLEEP_TYPE_A 0x11
#define ACPI_BITREG_SLEEP_TYPE_B 0x12
#define ACPI_BITREG_SLEEP_ENABLE 0x13
#define ACPI_BITREG_SCI_ENABLE 0x0F /* PM2 Control register */
#define ACPI_BITREG_BUS_MASTER_RLD 0x10
#define ACPI_BITREG_GLOBAL_LOCK_RELEASE 0x11
#define ACPI_BITREG_SLEEP_TYPE_A 0x12
#define ACPI_BITREG_SLEEP_TYPE_B 0x13
#define ACPI_BITREG_SLEEP_ENABLE 0x14
#define ACPI_BITREG_ARB_DISABLE 0x15 #define ACPI_BITREG_ARB_DISABLE 0x14
#define ACPI_BITREG_MAX 0x15 #define ACPI_BITREG_MAX 0x14
#define ACPI_NUM_BITREG ACPI_BITREG_MAX + 1 #define ACPI_NUM_BITREG ACPI_BITREG_MAX + 1
/* /*
...@@ -859,6 +871,7 @@ struct acpi_obj_info_header { ...@@ -859,6 +871,7 @@ struct acpi_obj_info_header {
struct acpi_device_info { struct acpi_device_info {
ACPI_COMMON_OBJ_INFO; ACPI_COMMON_OBJ_INFO;
u32 param_count; /* If a method, required parameter count */
u32 valid; /* Indicates which fields below are valid */ u32 valid; /* Indicates which fields below are valid */
u32 current_status; /* _STA value */ u32 current_status; /* _STA value */
acpi_integer address; /* _ADR value if any */ acpi_integer address; /* _ADR value if any */
...@@ -1225,8 +1238,8 @@ struct acpi_resource { ...@@ -1225,8 +1238,8 @@ struct acpi_resource {
#pragma pack() #pragma pack()
#define ACPI_RS_SIZE_MIN 12
#define ACPI_RS_SIZE_NO_DATA 8 /* Id + Length fields */ #define ACPI_RS_SIZE_NO_DATA 8 /* Id + Length fields */
#define ACPI_RS_SIZE_MIN (u32) ACPI_ROUND_UP_TO_NATIVE_WORD (12)
#define ACPI_RS_SIZE(type) (u32) (ACPI_RS_SIZE_NO_DATA + sizeof (type)) #define ACPI_RS_SIZE(type) (u32) (ACPI_RS_SIZE_NO_DATA + sizeof (type))
#define ACPI_NEXT_RESOURCE(res) (struct acpi_resource *)((u8 *) res + res->length) #define ACPI_NEXT_RESOURCE(res) (struct acpi_resource *)((u8 *) res + res->length)
......
...@@ -110,7 +110,7 @@ struct acpi_pkg_info { ...@@ -110,7 +110,7 @@ struct acpi_pkg_info {
/* /*
* utglobal - Global data structures and procedures * utglobal - Global data structures and procedures
*/ */
void acpi_ut_init_globals(void); acpi_status acpi_ut_init_globals(void);
#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
...@@ -126,6 +126,8 @@ char *acpi_ut_get_node_name(void *object); ...@@ -126,6 +126,8 @@ char *acpi_ut_get_node_name(void *object);
char *acpi_ut_get_descriptor_name(void *object); char *acpi_ut_get_descriptor_name(void *object);
const char *acpi_ut_get_reference_name(union acpi_operand_object *object);
char *acpi_ut_get_object_type_name(union acpi_operand_object *obj_desc); char *acpi_ut_get_object_type_name(union acpi_operand_object *obj_desc);
char *acpi_ut_get_region_name(u8 space_id); char *acpi_ut_get_region_name(u8 space_id);
......
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/ctype.h> #include <linux/ctype.h>
#include <linux/sched.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/atomic.h> #include <asm/atomic.h>
#include <asm/div64.h> #include <asm/div64.h>
...@@ -137,4 +138,9 @@ static inline void *acpi_os_acquire_object(acpi_cache_t * cache) ...@@ -137,4 +138,9 @@ static inline void *acpi_os_acquire_object(acpi_cache_t * cache)
#define ACPI_ALLOCATE_ZEROED(a) acpi_os_allocate_zeroed(a) #define ACPI_ALLOCATE_ZEROED(a) acpi_os_allocate_zeroed(a)
#define ACPI_FREE(a) kfree(a) #define ACPI_FREE(a) kfree(a)
/*
* We need to show where it is safe to preempt execution of ACPICA
*/
#define ACPI_PREEMPTION_POINT() cond_resched()
#endif /* __ACLINUX_H__ */ #endif /* __ACLINUX_H__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment