aboutsummaryrefslogtreecommitdiff
path: root/drivers/acpi/executer
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/executer')
-rw-r--r--drivers/acpi/executer/exconfig.c4
-rw-r--r--drivers/acpi/executer/exconvrt.c11
-rw-r--r--drivers/acpi/executer/excreate.c4
-rw-r--r--drivers/acpi/executer/exfield.c9
-rw-r--r--drivers/acpi/executer/exfldio.c65
-rw-r--r--drivers/acpi/executer/exmisc.c43
-rw-r--r--drivers/acpi/executer/exmutex.c26
-rw-r--r--drivers/acpi/executer/exnames.c13
-rw-r--r--drivers/acpi/executer/exoparg1.c57
-rw-r--r--drivers/acpi/executer/exoparg2.c30
-rw-r--r--drivers/acpi/executer/exoparg3.c8
-rw-r--r--drivers/acpi/executer/exoparg6.c11
-rw-r--r--drivers/acpi/executer/exprep.c25
-rw-r--r--drivers/acpi/executer/exregion.c9
-rw-r--r--drivers/acpi/executer/exresnte.c37
-rw-r--r--drivers/acpi/executer/exresolv.c37
-rw-r--r--drivers/acpi/executer/exresop.c96
-rw-r--r--drivers/acpi/executer/exstore.c18
-rw-r--r--drivers/acpi/executer/exstoren.c17
-rw-r--r--drivers/acpi/executer/exsystem.c4
-rw-r--r--drivers/acpi/executer/exutils.c10
21 files changed, 350 insertions, 184 deletions
diff --git a/drivers/acpi/executer/exconfig.c b/drivers/acpi/executer/exconfig.c
index 109d0255a5b..a29782fe3ec 100644
--- a/drivers/acpi/executer/exconfig.c
+++ b/drivers/acpi/executer/exconfig.c
@@ -413,7 +413,9 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
(!ACPI_STRNCMP(table_ptr->signature,
acpi_gbl_table_data[ACPI_TABLE_SSDT].signature,
acpi_gbl_table_data[ACPI_TABLE_SSDT].sig_length))) {
- ACPI_REPORT_ERROR(("Table has invalid signature [%4.4s], must be SSDT or PSDT\n", table_ptr->signature));
+ ACPI_ERROR((AE_INFO,
+ "Table has invalid signature [%4.4s], must be SSDT or PSDT",
+ table_ptr->signature));
status = AE_BAD_SIGNATURE;
goto cleanup;
}
diff --git a/drivers/acpi/executer/exconvrt.c b/drivers/acpi/executer/exconvrt.c
index e6f55cf8ad3..e6d52e12d77 100644
--- a/drivers/acpi/executer/exconvrt.c
+++ b/drivers/acpi/executer/exconvrt.c
@@ -641,7 +641,9 @@ acpi_ex_convert_to_target_type(acpi_object_type destination_type,
break;
default:
- ACPI_REPORT_ERROR(("Bad destination type during conversion: %X\n", destination_type));
+ ACPI_ERROR((AE_INFO,
+ "Bad destination type during conversion: %X",
+ destination_type));
status = AE_AML_INTERNAL;
break;
}
@@ -654,7 +656,12 @@ acpi_ex_convert_to_target_type(acpi_object_type destination_type,
break;
default:
- ACPI_REPORT_ERROR(("Unknown Target type ID 0x%X aml_opcode %X dest_type %s\n", GET_CURRENT_ARG_TYPE(walk_state->op_info->runtime_args), walk_state->opcode, acpi_ut_get_type_name(destination_type)));
+ ACPI_ERROR((AE_INFO,
+ "Unknown Target type ID 0x%X aml_opcode %X dest_type %s",
+ GET_CURRENT_ARG_TYPE(walk_state->op_info->
+ runtime_args),
+ walk_state->opcode,
+ acpi_ut_get_type_name(destination_type)));
status = AE_AML_INTERNAL;
}
diff --git a/drivers/acpi/executer/excreate.c b/drivers/acpi/executer/excreate.c
index da313dad576..68057540283 100644
--- a/drivers/acpi/executer/excreate.c
+++ b/drivers/acpi/executer/excreate.c
@@ -300,8 +300,8 @@ acpi_ex_create_region(u8 * aml_start,
*/
if ((region_space >= ACPI_NUM_PREDEFINED_REGIONS) &&
(region_space < ACPI_USER_REGION_BEGIN)) {
- ACPI_REPORT_ERROR(("Invalid address_space type %X\n",
- region_space));
+ ACPI_ERROR((AE_INFO, "Invalid address_space type %X",
+ region_space));
return_ACPI_STATUS(AE_AML_INVALID_SPACE_ID);
}
diff --git a/drivers/acpi/executer/exfield.c b/drivers/acpi/executer/exfield.c
index 78a76f91a1c..e259201ce9a 100644
--- a/drivers/acpi/executer/exfield.c
+++ b/drivers/acpi/executer/exfield.c
@@ -249,13 +249,18 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
* Source must be a buffer of sufficient size (ACPI_SMBUS_BUFFER_SIZE).
*/
if (ACPI_GET_OBJECT_TYPE(source_desc) != ACPI_TYPE_BUFFER) {
- ACPI_REPORT_ERROR(("SMBus write requires Buffer, found type %s\n", acpi_ut_get_object_type_name(source_desc)));
+ ACPI_ERROR((AE_INFO,
+ "SMBus write requires Buffer, found type %s",
+ acpi_ut_get_object_type_name(source_desc)));
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
}
if (source_desc->buffer.length < ACPI_SMBUS_BUFFER_SIZE) {
- ACPI_REPORT_ERROR(("SMBus write requires Buffer of length %X, found length %X\n", ACPI_SMBUS_BUFFER_SIZE, source_desc->buffer.length));
+ ACPI_ERROR((AE_INFO,
+ "SMBus write requires Buffer of length %X, found length %X",
+ ACPI_SMBUS_BUFFER_SIZE,
+ source_desc->buffer.length));
return_ACPI_STATUS(AE_AML_BUFFER_LIMIT);
}
diff --git a/drivers/acpi/executer/exfldio.c b/drivers/acpi/executer/exfldio.c
index 9fe27fd04a2..bd1af35f7fc 100644
--- a/drivers/acpi/executer/exfldio.c
+++ b/drivers/acpi/executer/exfldio.c
@@ -94,9 +94,9 @@ acpi_ex_setup_region(union acpi_operand_object *obj_desc,
/* We must have a valid region */
if (ACPI_GET_OBJECT_TYPE(rgn_desc) != ACPI_TYPE_REGION) {
- ACPI_REPORT_ERROR(("Needed Region, found type %X (%s)\n",
- ACPI_GET_OBJECT_TYPE(rgn_desc),
- acpi_ut_get_object_type_name(rgn_desc)));
+ ACPI_ERROR((AE_INFO, "Needed Region, found type %X (%s)",
+ ACPI_GET_OBJECT_TYPE(rgn_desc),
+ acpi_ut_get_object_type_name(rgn_desc)));
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
}
@@ -161,14 +161,28 @@ acpi_ex_setup_region(union acpi_operand_object *obj_desc,
* than the region itself. For example, a region of length one
* byte, and a field with Dword access specified.
*/
- ACPI_REPORT_ERROR(("Field [%4.4s] access width (%d bytes) too large for region [%4.4s] (length %X)\n", acpi_ut_get_node_name(obj_desc->common_field.node), obj_desc->common_field.access_byte_width, acpi_ut_get_node_name(rgn_desc->region.node), rgn_desc->region.length));
+ ACPI_ERROR((AE_INFO,
+ "Field [%4.4s] access width (%d bytes) too large for region [%4.4s] (length %X)",
+ acpi_ut_get_node_name(obj_desc->
+ common_field.node),
+ obj_desc->common_field.access_byte_width,
+ acpi_ut_get_node_name(rgn_desc->region.
+ node),
+ rgn_desc->region.length));
}
/*
* Offset rounded up to next multiple of field width
* exceeds region length, indicate an error
*/
- ACPI_REPORT_ERROR(("Field [%4.4s] Base+Offset+Width %X+%X+%X is beyond end of region [%4.4s] (length %X)\n", acpi_ut_get_node_name(obj_desc->common_field.node), obj_desc->common_field.base_byte_offset, field_datum_byte_offset, obj_desc->common_field.access_byte_width, acpi_ut_get_node_name(rgn_desc->region.node), rgn_desc->region.length));
+ ACPI_ERROR((AE_INFO,
+ "Field [%4.4s] Base+Offset+Width %X+%X+%X is beyond end of region [%4.4s] (length %X)",
+ acpi_ut_get_node_name(obj_desc->common_field.node),
+ obj_desc->common_field.base_byte_offset,
+ field_datum_byte_offset,
+ obj_desc->common_field.access_byte_width,
+ acpi_ut_get_node_name(rgn_desc->region.node),
+ rgn_desc->region.length));
return_ACPI_STATUS(AE_AML_REGION_LIMIT);
}
@@ -252,17 +266,17 @@ acpi_ex_access_region(union acpi_operand_object *obj_desc,
if (ACPI_FAILURE(status)) {
if (status == AE_NOT_IMPLEMENTED) {
- ACPI_REPORT_ERROR(("Region %s(%X) not implemented\n",
- acpi_ut_get_region_name(rgn_desc->
- region.
- space_id),
- rgn_desc->region.space_id));
+ ACPI_ERROR((AE_INFO,
+ "Region %s(%X) not implemented",
+ acpi_ut_get_region_name(rgn_desc->region.
+ space_id),
+ rgn_desc->region.space_id));
} else if (status == AE_NOT_EXIST) {
- ACPI_REPORT_ERROR(("Region %s(%X) has no handler\n",
- acpi_ut_get_region_name(rgn_desc->
- region.
- space_id),
- rgn_desc->region.space_id));
+ ACPI_ERROR((AE_INFO,
+ "Region %s(%X) has no handler",
+ acpi_ut_get_region_name(rgn_desc->region.
+ space_id),
+ rgn_desc->region.space_id));
}
}
@@ -495,8 +509,8 @@ acpi_ex_field_datum_io(union acpi_operand_object *obj_desc,
default:
- ACPI_REPORT_ERROR(("Wrong object type in field I/O %X\n",
- ACPI_GET_OBJECT_TYPE(obj_desc)));
+ ACPI_ERROR((AE_INFO, "Wrong object type in field I/O %X",
+ ACPI_GET_OBJECT_TYPE(obj_desc)));
status = AE_AML_INTERNAL;
break;
}
@@ -599,10 +613,11 @@ acpi_ex_write_with_update_rule(union acpi_operand_object *obj_desc,
default:
- ACPI_REPORT_ERROR(("Unknown update_rule value: %X\n",
- (obj_desc->common_field.
- field_flags &
- AML_FIELD_UPDATE_RULE_MASK)));
+ ACPI_ERROR((AE_INFO,
+ "Unknown update_rule value: %X",
+ (obj_desc->common_field.
+ field_flags &
+ AML_FIELD_UPDATE_RULE_MASK)));
return_ACPI_STATUS(AE_AML_OPERAND_VALUE);
}
}
@@ -657,7 +672,9 @@ acpi_ex_extract_from_field(union acpi_operand_object *obj_desc,
if (buffer_length <
ACPI_ROUND_BITS_UP_TO_BYTES(obj_desc->common_field.bit_length)) {
- ACPI_REPORT_ERROR(("Field size %X (bits) is too large for buffer (%X)\n", obj_desc->common_field.bit_length, buffer_length));
+ ACPI_ERROR((AE_INFO,
+ "Field size %X (bits) is too large for buffer (%X)",
+ obj_desc->common_field.bit_length, buffer_length));
return_ACPI_STATUS(AE_BUFFER_OVERFLOW);
}
@@ -769,7 +786,9 @@ acpi_ex_insert_into_field(union acpi_operand_object *obj_desc,
if (buffer_length <
ACPI_ROUND_BITS_UP_TO_BYTES(obj_desc->common_field.bit_length)) {
- ACPI_REPORT_ERROR(("Field size %X (bits) is too large for buffer (%X)\n", obj_desc->common_field.bit_length, buffer_length));
+ ACPI_ERROR((AE_INFO,
+ "Field size %X (bits) is too large for buffer (%X)",
+ obj_desc->common_field.bit_length, buffer_length));
return_ACPI_STATUS(AE_BUFFER_OVERFLOW);
}
diff --git a/drivers/acpi/executer/exmisc.c b/drivers/acpi/executer/exmisc.c
index 5ad34566738..48c18d29222 100644
--- a/drivers/acpi/executer/exmisc.c
+++ b/drivers/acpi/executer/exmisc.c
@@ -98,8 +98,8 @@ acpi_ex_get_object_reference(union acpi_operand_object *obj_desc,
default:
- ACPI_REPORT_ERROR(("Unknown Reference opcode %X\n",
- obj_desc->reference.opcode));
+ ACPI_ERROR((AE_INFO, "Unknown Reference opcode %X",
+ obj_desc->reference.opcode));
return_ACPI_STATUS(AE_AML_INTERNAL);
}
break;
@@ -114,8 +114,8 @@ acpi_ex_get_object_reference(union acpi_operand_object *obj_desc,
default:
- ACPI_REPORT_ERROR(("Invalid descriptor type %X\n",
- ACPI_GET_DESCRIPTOR_TYPE(obj_desc)));
+ ACPI_ERROR((AE_INFO, "Invalid descriptor type %X",
+ ACPI_GET_DESCRIPTOR_TYPE(obj_desc)));
return_ACPI_STATUS(AE_TYPE);
}
@@ -166,15 +166,18 @@ acpi_ex_concat_template(union acpi_operand_object *operand0,
u8 *end_tag;
acpi_size length0;
acpi_size length1;
+ acpi_size new_length;
ACPI_FUNCTION_TRACE("ex_concat_template");
/*
* Find the end_tag descriptor in each resource template.
- * Note: returned pointers point TO the end_tag, not past it.
- *
- * Compute the length of each resource template
+ * Note1: returned pointers point TO the end_tag, not past it.
+ * Note2: zero-length buffers are allowed; treated like one end_tag
*/
+
+ /* Get the length of the first resource template */
+
status = acpi_ut_get_resource_end_tag(operand0, &end_tag);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
@@ -182,19 +185,22 @@ acpi_ex_concat_template(union acpi_operand_object *operand0,
length0 = ACPI_PTR_DIFF(end_tag, operand0->buffer.pointer);
+ /* Get the length of the second resource template */
+
status = acpi_ut_get_resource_end_tag(operand1, &end_tag);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
- /* Include the end_tag in the second template length */
+ length1 = ACPI_PTR_DIFF(end_tag, operand1->buffer.pointer);
+
+ /* Combine both lengths, minimum size will be 2 for end_tag */
- length1 = ACPI_PTR_DIFF(end_tag, operand1->buffer.pointer) +
- sizeof(struct aml_resource_end_tag);
+ new_length = length0 + length1 + sizeof(struct aml_resource_end_tag);
- /* Create a new buffer object for the result */
+ /* Create a new buffer object for the result (with one end_tag) */
- return_desc = acpi_ut_create_buffer_object(length0 + length1);
+ return_desc = acpi_ut_create_buffer_object(new_length);
if (!return_desc) {
return_ACPI_STATUS(AE_NO_MEMORY);
}
@@ -207,9 +213,10 @@ acpi_ex_concat_template(union acpi_operand_object *operand0,
ACPI_MEMCPY(new_buf, operand0->buffer.pointer, length0);
ACPI_MEMCPY(new_buf + length0, operand1->buffer.pointer, length1);
- /* Set the end_tag checksum to zero, means "ignore checksum" */
+ /* Insert end_tag and set the checksum to zero, means "ignore checksum" */
- new_buf[return_desc->buffer.length - 1] = 0;
+ new_buf[new_length - 1] = 0;
+ new_buf[new_length - 2] = ACPI_RESOURCE_NAME_END_TAG | 1;
/* Return the completed resource template */
@@ -268,8 +275,8 @@ acpi_ex_do_concatenate(union acpi_operand_object *operand0,
break;
default:
- ACPI_REPORT_ERROR(("Invalid object type: %X\n",
- ACPI_GET_OBJECT_TYPE(operand0)));
+ ACPI_ERROR((AE_INFO, "Invalid object type: %X",
+ ACPI_GET_OBJECT_TYPE(operand0)));
status = AE_AML_INTERNAL;
}
@@ -370,8 +377,8 @@ acpi_ex_do_concatenate(union acpi_operand_object *operand0,
/* Invalid object type, should not happen here */
- ACPI_REPORT_ERROR(("Invalid object type: %X\n",
- ACPI_GET_OBJECT_TYPE(operand0)));
+ ACPI_ERROR((AE_INFO, "Invalid object type: %X",
+ ACPI_GET_OBJECT_TYPE(operand0)));
status = AE_AML_INTERNAL;
goto cleanup;
}
diff --git a/drivers/acpi/executer/exmutex.c b/drivers/acpi/executer/exmutex.c
index 89b8ab79410..f843b22e20b 100644
--- a/drivers/acpi/executer/exmutex.c
+++ b/drivers/acpi/executer/exmutex.c
@@ -153,7 +153,9 @@ acpi_ex_acquire_mutex(union acpi_operand_object *time_desc,
/* Sanity check -- we must have a valid thread ID */
if (!walk_state->thread) {
- ACPI_REPORT_ERROR(("Cannot acquire Mutex [%4.4s], null thread info\n", acpi_ut_get_node_name(obj_desc->mutex.node)));
+ ACPI_ERROR((AE_INFO,
+ "Cannot acquire Mutex [%4.4s], null thread info",
+ acpi_ut_get_node_name(obj_desc->mutex.node)));
return_ACPI_STATUS(AE_AML_INTERNAL);
}
@@ -162,7 +164,9 @@ acpi_ex_acquire_mutex(union acpi_operand_object *time_desc,
* mutex. This mechanism provides some deadlock prevention
*/
if (walk_state->thread->current_sync_level > obj_desc->mutex.sync_level) {
- ACPI_REPORT_ERROR(("Cannot acquire Mutex [%4.4s], incorrect sync_level\n", acpi_ut_get_node_name(obj_desc->mutex.node)));
+ ACPI_ERROR((AE_INFO,
+ "Cannot acquire Mutex [%4.4s], incorrect sync_level",
+ acpi_ut_get_node_name(obj_desc->mutex.node)));
return_ACPI_STATUS(AE_AML_MUTEX_ORDER);
}
@@ -237,14 +241,18 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
/* The mutex must have been previously acquired in order to release it */
if (!obj_desc->mutex.owner_thread) {
- ACPI_REPORT_ERROR(("Cannot release Mutex [%4.4s], not acquired\n", acpi_ut_get_node_name(obj_desc->mutex.node)));
+ ACPI_ERROR((AE_INFO,
+ "Cannot release Mutex [%4.4s], not acquired",
+ acpi_ut_get_node_name(obj_desc->mutex.node)));
return_ACPI_STATUS(AE_AML_MUTEX_NOT_ACQUIRED);
}
/* Sanity check -- we must have a valid thread ID */
if (!walk_state->thread) {
- ACPI_REPORT_ERROR(("Cannot release Mutex [%4.4s], null thread info\n", acpi_ut_get_node_name(obj_desc->mutex.node)));
+ ACPI_ERROR((AE_INFO,
+ "Cannot release Mutex [%4.4s], null thread info",
+ acpi_ut_get_node_name(obj_desc->mutex.node)));
return_ACPI_STATUS(AE_AML_INTERNAL);
}
@@ -255,7 +263,11 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
if ((obj_desc->mutex.owner_thread->thread_id !=
walk_state->thread->thread_id)
&& (obj_desc->mutex.semaphore != acpi_gbl_global_lock_semaphore)) {
- ACPI_REPORT_ERROR(("Thread %X cannot release Mutex [%4.4s] acquired by thread %X\n", walk_state->thread->thread_id, acpi_ut_get_node_name(obj_desc->mutex.node), obj_desc->mutex.owner_thread->thread_id));
+ ACPI_ERROR((AE_INFO,
+ "Thread %X cannot release Mutex [%4.4s] acquired by thread %X",
+ walk_state->thread->thread_id,
+ acpi_ut_get_node_name(obj_desc->mutex.node),
+ obj_desc->mutex.owner_thread->thread_id));
return_ACPI_STATUS(AE_AML_NOT_OWNER);
}
@@ -264,7 +276,9 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
* equal to the current sync level
*/
if (obj_desc->mutex.sync_level > walk_state->thread->current_sync_level) {
- ACPI_REPORT_ERROR(("Cannot release Mutex [%4.4s], incorrect sync_level\n", acpi_ut_get_node_name(obj_desc->mutex.node)));
+ ACPI_ERROR((AE_INFO,
+ "Cannot release Mutex [%4.4s], incorrect sync_level",
+ acpi_ut_get_node_name(obj_desc->mutex.node)));
return_ACPI_STATUS(AE_AML_MUTEX_ORDER);
}
diff --git a/drivers/acpi/executer/exnames.c b/drivers/acpi/executer/exnames.c
index de3216b6a4f..054fe5e1a31 100644
--- a/drivers/acpi/executer/exnames.c
+++ b/drivers/acpi/executer/exnames.c
@@ -99,8 +99,8 @@ static char *acpi_ex_allocate_name_string(u32 prefix_count, u32 num_name_segs)
*/
name_string = ACPI_MEM_ALLOCATE(size_needed);
if (!name_string) {
- ACPI_REPORT_ERROR(("Could not allocate size %d\n",
- size_needed));
+ ACPI_ERROR((AE_INFO,
+ "Could not allocate size %d", size_needed));
return_PTR(NULL);
}
@@ -168,7 +168,7 @@ static acpi_status acpi_ex_name_segment(u8 ** in_aml_address, char *name_string)
char_buf[0] = *aml_address;
if ('0' <= char_buf[0] && char_buf[0] <= '9') {
- ACPI_REPORT_ERROR(("Invalid leading digit: %c\n", char_buf[0]));
+ ACPI_ERROR((AE_INFO, "Invalid leading digit: %c", char_buf[0]));
return_ACPI_STATUS(AE_CTRL_PENDING);
}
@@ -211,8 +211,9 @@ static acpi_status acpi_ex_name_segment(u8 ** in_aml_address, char *name_string)
* the required 4
*/
status = AE_AML_BAD_NAME;
- ACPI_REPORT_ERROR(("Bad character %02x in name, at %p\n",
- *aml_address, aml_address));
+ ACPI_ERROR((AE_INFO,
+ "Bad character %02x in name, at %p",
+ *aml_address, aml_address));
}
*in_aml_address = ACPI_CAST_PTR(u8, aml_address);
@@ -411,7 +412,7 @@ acpi_ex_get_name_string(acpi_object_type data_type,
if (AE_CTRL_PENDING == status && has_prefix) {
/* Ran out of segments after processing a prefix */
- ACPI_REPORT_ERROR(("Malformed Name at %p\n", name_string));
+ ACPI_ERROR((AE_INFO, "Malformed Name at %p", name_string));
status = AE_AML_BAD_NAME;
}
diff --git a/drivers/acpi/executer/exoparg1.c b/drivers/acpi/executer/exoparg1.c
index bc8837ecb71..23d0823bcd5 100644
--- a/drivers/acpi/executer/exoparg1.c
+++ b/drivers/acpi/executer/exoparg1.c
@@ -111,8 +111,8 @@ acpi_status acpi_ex_opcode_0A_0T_1R(struct acpi_walk_state *walk_state)
default: /* Unknown opcode */
- ACPI_REPORT_ERROR(("Unknown AML opcode %X\n",
- walk_state->opcode));
+ ACPI_ERROR((AE_INFO, "Unknown AML opcode %X",
+ walk_state->opcode));
status = AE_AML_BAD_OPCODE;
break;
}
@@ -189,8 +189,8 @@ acpi_status acpi_ex_opcode_1A_0T_0R(struct acpi_walk_state *walk_state)
default: /* Unknown opcode */
- ACPI_REPORT_ERROR(("Unknown AML opcode %X\n",
- walk_state->opcode));
+ ACPI_ERROR((AE_INFO, "Unknown AML opcode %X",
+ walk_state->opcode));
status = AE_AML_BAD_OPCODE;
break;
}
@@ -229,8 +229,8 @@ acpi_status acpi_ex_opcode_1A_1T_0R(struct acpi_walk_state *walk_state)
default: /* Unknown opcode */
- ACPI_REPORT_ERROR(("Unknown AML opcode %X\n",
- walk_state->opcode));
+ ACPI_ERROR((AE_INFO, "Unknown AML opcode %X",
+ walk_state->opcode));
status = AE_AML_BAD_OPCODE;
goto cleanup;
}
@@ -349,7 +349,9 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state)
/* Check the range of the digit */
if (temp32 > 9) {
- ACPI_REPORT_ERROR(("BCD digit too large (not decimal): 0x%X\n", temp32));
+ ACPI_ERROR((AE_INFO,
+ "BCD digit too large (not decimal): 0x%X",
+ temp32));
status = AE_AML_NUMERIC_OVERFLOW;
goto cleanup;
@@ -394,7 +396,10 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state)
/* Overflow if there is any data left in Digit */
if (digit > 0) {
- ACPI_REPORT_ERROR(("Integer too large to convert to BCD: %8.8X%8.8X\n", ACPI_FORMAT_UINT64(operand[0]->integer.value)));
+ ACPI_ERROR((AE_INFO,
+ "Integer too large to convert to BCD: %8.8X%8.8X",
+ ACPI_FORMAT_UINT64(operand[0]->
+ integer.value)));
status = AE_AML_NUMERIC_OVERFLOW;
goto cleanup;
}
@@ -521,16 +526,16 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state)
/* These are two obsolete opcodes */
- ACPI_REPORT_ERROR(("%s is obsolete and not implemented\n",
- acpi_ps_get_opcode_name(walk_state->
- opcode)));
+ ACPI_ERROR((AE_INFO,
+ "%s is obsolete and not implemented",
+ acpi_ps_get_opcode_name(walk_state->opcode)));
status = AE_SUPPORT;
goto cleanup;
default: /* Unknown opcode */
- ACPI_REPORT_ERROR(("Unknown AML opcode %X\n",
- walk_state->opcode));
+ ACPI_ERROR((AE_INFO, "Unknown AML opcode %X",
+ walk_state->opcode));
status = AE_AML_BAD_OPCODE;
goto cleanup;
}
@@ -636,10 +641,10 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
acpi_ex_resolve_operands(AML_LNOT_OP, &temp_desc,
walk_state);
if (ACPI_FAILURE(status)) {
- ACPI_REPORT_ERROR(("%s: bad operand(s) %s\n",
- acpi_ps_get_opcode_name(walk_state->
- opcode),
- acpi_format_exception(status)));
+ ACPI_EXCEPTION((AE_INFO, status,
+ "While resolving operands for [%s]",
+ acpi_ps_get_opcode_name(walk_state->
+ opcode)));
goto cleanup;
}
@@ -738,7 +743,9 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
break;
default:
- ACPI_REPORT_ERROR(("Operand is not Buf/Int/Str/Pkg - found type %s\n", acpi_ut_get_type_name(type)));
+ ACPI_ERROR((AE_INFO,
+ "Operand is not Buf/Int/Str/Pkg - found type %s",
+ acpi_ut_get_type_name(type)));
status = AE_AML_OPERAND_TYPE;
goto cleanup;
}
@@ -935,7 +942,10 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
default:
- ACPI_REPORT_ERROR(("Unknown Index target_type %X in obj %p\n", operand[0]->reference.target_type, operand[0]));
+ ACPI_ERROR((AE_INFO,
+ "Unknown Index target_type %X in obj %p",
+ operand[0]->reference.
+ target_type, operand[0]));
status = AE_AML_OPERAND_TYPE;
goto cleanup;
}
@@ -961,7 +971,10 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
break;
default:
- ACPI_REPORT_ERROR(("Unknown opcode in ref(%p) - %X\n", operand[0], operand[0]->reference.opcode));
+ ACPI_ERROR((AE_INFO,
+ "Unknown opcode in ref(%p) - %X",
+ operand[0],
+ operand[0]->reference.opcode));
status = AE_TYPE;
goto cleanup;
@@ -971,8 +984,8 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
default:
- ACPI_REPORT_ERROR(("Unknown AML opcode %X\n",
- walk_state->opcode));
+ ACPI_ERROR((AE_INFO, "Unknown AML opcode %X",
+ walk_state->opcode));
status = AE_AML_BAD_OPCODE;
goto cleanup;
}
diff --git a/drivers/acpi/executer/exoparg2.c b/drivers/acpi/executer/exoparg2.c
index 7c59dda4094..e263a5ddd40 100644
--- a/drivers/acpi/executer/exoparg2.c
+++ b/drivers/acpi/executer/exoparg2.c
@@ -111,7 +111,9 @@ acpi_status acpi_ex_opcode_2A_0T_0R(struct acpi_walk_state *walk_state)
/* Are notifies allowed on this object? */
if (!acpi_ev_is_notify_object(node)) {
- ACPI_REPORT_ERROR(("Unexpected notify object type [%s]\n", acpi_ut_get_type_name(node->type)));
+ ACPI_ERROR((AE_INFO,
+ "Unexpected notify object type [%s]",
+ acpi_ut_get_type_name(node->type)));
status = AE_AML_OPERAND_TYPE;
break;
@@ -155,8 +157,8 @@ acpi_status acpi_ex_opcode_2A_0T_0R(struct acpi_walk_state *walk_state)
default:
- ACPI_REPORT_ERROR(("Unknown AML opcode %X\n",
- walk_state->opcode));
+ ACPI_ERROR((AE_INFO, "Unknown AML opcode %X",
+ walk_state->opcode));
status = AE_AML_BAD_OPCODE;
}
@@ -220,8 +222,8 @@ acpi_status acpi_ex_opcode_2A_2T_1R(struct acpi_walk_state *walk_state)
default:
- ACPI_REPORT_ERROR(("Unknown AML opcode %X\n",
- walk_state->opcode));
+ ACPI_ERROR((AE_INFO, "Unknown AML opcode %X",
+ walk_state->opcode));
status = AE_AML_BAD_OPCODE;
goto cleanup;
}
@@ -389,7 +391,10 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state)
/* Object to be indexed is a Package */
if (index >= operand[0]->package.count) {
- ACPI_REPORT_ERROR(("Index value (%X%8.8X) beyond package end (%X)\n", ACPI_FORMAT_UINT64(index), operand[0]->package.count));
+ ACPI_ERROR((AE_INFO,
+ "Index value (%X%8.8X) beyond package end (%X)",
+ ACPI_FORMAT_UINT64(index),
+ operand[0]->package.count));
status = AE_AML_PACKAGE_LIMIT;
goto cleanup;
}
@@ -402,7 +407,10 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state)
/* Object to be indexed is a Buffer/String */
if (index >= operand[0]->buffer.length) {
- ACPI_REPORT_ERROR(("Index value (%X%8.8X) beyond end of buffer (%X)\n", ACPI_FORMAT_UINT64(index), operand[0]->buffer.length));
+ ACPI_ERROR((AE_INFO,
+ "Index value (%X%8.8X) beyond end of buffer (%X)",
+ ACPI_FORMAT_UINT64(index),
+ operand[0]->buffer.length));
status = AE_AML_BUFFER_LIMIT;
goto cleanup;
}
@@ -434,8 +442,8 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state)
default:
- ACPI_REPORT_ERROR(("Unknown AML opcode %X\n",
- walk_state->opcode));
+ ACPI_ERROR((AE_INFO, "Unknown AML opcode %X",
+ walk_state->opcode));
status = AE_AML_BAD_OPCODE;
break;
}
@@ -539,8 +547,8 @@ acpi_status acpi_ex_opcode_2A_0T_1R(struct acpi_walk_state *walk_state)
default:
- ACPI_REPORT_ERROR(("Unknown AML opcode %X\n",
- walk_state->opcode));
+ ACPI_ERROR((AE_INFO, "Unknown AML opcode %X",
+ walk_state->opcode));
status = AE_AML_BAD_OPCODE;
goto cleanup;
}
diff --git a/drivers/acpi/executer/exoparg3.c b/drivers/acpi/executer/exoparg3.c
index a979b338a49..6a3a883cb8a 100644
--- a/drivers/acpi/executer/exoparg3.c
+++ b/drivers/acpi/executer/exoparg3.c
@@ -119,8 +119,8 @@ acpi_status acpi_ex_opcode_3A_0T_0R(struct acpi_walk_state *walk_state)
default:
- ACPI_REPORT_ERROR(("Unknown AML opcode %X\n",
- walk_state->opcode));
+ ACPI_ERROR((AE_INFO, "Unknown AML opcode %X",
+ walk_state->opcode));
status = AE_AML_BAD_OPCODE;
goto cleanup;
}
@@ -243,8 +243,8 @@ acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state)
default:
- ACPI_REPORT_ERROR(("Unknown AML opcode %X\n",
- walk_state->opcode));
+ ACPI_ERROR((AE_INFO, "Unknown AML opcode %X",
+ walk_state->opcode));
status = AE_AML_BAD_OPCODE;
goto cleanup;
}
diff --git a/drivers/acpi/executer/exoparg6.c b/drivers/acpi/executer/exoparg6.c
index 05e7f9b67f2..e043d924444 100644
--- a/drivers/acpi/executer/exoparg6.c
+++ b/drivers/acpi/executer/exoparg6.c
@@ -234,7 +234,7 @@ acpi_status acpi_ex_opcode_6A_0T_1R(struct acpi_walk_state * walk_state)
if ((operand[1]->integer.value > MAX_MATCH_OPERATOR) ||
(operand[3]->integer.value > MAX_MATCH_OPERATOR)) {
- ACPI_REPORT_ERROR(("Match operator out of range\n"));
+ ACPI_ERROR((AE_INFO, "Match operator out of range"));
status = AE_AML_OPERAND_VALUE;
goto cleanup;
}
@@ -243,7 +243,10 @@ acpi_status acpi_ex_opcode_6A_0T_1R(struct acpi_walk_state * walk_state)
index = operand[5]->integer.value;
if (index >= operand[0]->package.count) {
- ACPI_REPORT_ERROR(("Index (%X%8.8X) beyond package end (%X)\n", ACPI_FORMAT_UINT64(index), operand[0]->package.count));
+ ACPI_ERROR((AE_INFO,
+ "Index (%X%8.8X) beyond package end (%X)",
+ ACPI_FORMAT_UINT64(index),
+ operand[0]->package.count));
status = AE_AML_PACKAGE_LIMIT;
goto cleanup;
}
@@ -312,8 +315,8 @@ acpi_status acpi_ex_opcode_6A_0T_1R(struct acpi_walk_state * walk_state)
default:
- ACPI_REPORT_ERROR(("Unknown AML opcode %X\n",
- walk_state->opcode));
+ ACPI_ERROR((AE_INFO, "Unknown AML opcode %X",
+ walk_state->opcode));
status = AE_AML_BAD_OPCODE;
goto cleanup;
}
diff --git a/drivers/acpi/executer/exprep.c b/drivers/acpi/executer/exprep.c
index 3bde780c94c..7719ae5d4f1 100644
--- a/drivers/acpi/executer/exprep.c
+++ b/drivers/acpi/executer/exprep.c
@@ -274,7 +274,7 @@ acpi_ex_decode_field_access(union acpi_operand_object *obj_desc,
default:
/* Invalid field access type */
- ACPI_REPORT_ERROR(("Unknown field access type %X\n", access));
+ ACPI_ERROR((AE_INFO, "Unknown field access type %X", access));
return_UINT32(0);
}
@@ -421,13 +421,15 @@ acpi_status acpi_ex_prep_field_value(struct acpi_create_field_info *info)
if (info->field_type != ACPI_TYPE_LOCAL_INDEX_FIELD) {
if (!info->region_node) {
- ACPI_REPORT_ERROR(("Null region_node\n"));
+ ACPI_ERROR((AE_INFO, "Null region_node"));
return_ACPI_STATUS(AE_AML_NO_OPERAND);
}
type = acpi_ns_get_type(info->region_node);
if (type != ACPI_TYPE_REGION) {
- ACPI_REPORT_ERROR(("Needed Region, found type %X (%s)\n", type, acpi_ut_get_type_name(type)));
+ ACPI_ERROR((AE_INFO,
+ "Needed Region, found type %X (%s)",
+ type, acpi_ut_get_type_name(type)));
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
}
@@ -496,17 +498,17 @@ acpi_status acpi_ex_prep_field_value(struct acpi_create_field_info *info)
case ACPI_TYPE_LOCAL_INDEX_FIELD:
+ /* Get the Index and Data registers */
+
obj_desc->index_field.index_obj =
acpi_ns_get_attached_object(info->register_node);
obj_desc->index_field.data_obj =
acpi_ns_get_attached_object(info->data_register_node);
- obj_desc->index_field.value = (u32)
- (info->field_bit_position /
- ACPI_MUL_8(obj_desc->field.access_byte_width));
if (!obj_desc->index_field.data_obj
|| !obj_desc->index_field.index_obj) {
- ACPI_REPORT_ERROR(("Null Index Object during field prep\n"));
+ ACPI_ERROR((AE_INFO,
+ "Null Index Object during field prep"));
acpi_ut_delete_object_desc(obj_desc);
return_ACPI_STATUS(AE_AML_INTERNAL);
}
@@ -516,6 +518,15 @@ acpi_status acpi_ex_prep_field_value(struct acpi_create_field_info *info)
acpi_ut_add_reference(obj_desc->index_field.data_obj);
acpi_ut_add_reference(obj_desc->index_field.index_obj);
+ /*
+ * The value written to the Index register is the byte offset of the
+ * target field
+ * Note: may change code to: ACPI_DIV_8 (Info->field_bit_position)
+ */
+ obj_desc->index_field.value = (u32)
+ (info->field_bit_position /
+ ACPI_MUL_8(obj_desc->field.access_byte_width));
+
ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
"index_field: bit_off %X, Off %X, Value %X, Gran %X, Index %p, Data %p\n",
obj_desc->index_field.start_field_bit_offset,
diff --git a/drivers/acpi/executer/exregion.c b/drivers/acpi/executer/exregion.c
index 82983575cca..6a4cfdff606 100644
--- a/drivers/acpi/executer/exregion.c
+++ b/drivers/acpi/executer/exregion.c
@@ -103,8 +103,8 @@ acpi_ex_system_memory_space_handler(u32 function,
break;
default:
- ACPI_REPORT_ERROR(("Invalid system_memory width %d\n",
- bit_width));
+ ACPI_ERROR((AE_INFO, "Invalid system_memory width %d",
+ bit_width));
return_ACPI_STATUS(AE_AML_OPERAND_VALUE);
}
@@ -158,7 +158,10 @@ acpi_ex_system_memory_space_handler(u32 function,
(void **)&mem_info->
mapped_logical_address);
if (ACPI_FAILURE(status)) {
- ACPI_REPORT_ERROR(("Could not map memory at %8.8X%8.8X, size %X\n", ACPI_FORMAT_UINT64(address), (u32) window_size));
+ ACPI_ERROR((AE_INFO,
+ "Could not map memory at %8.8X%8.8X, size %X",
+ ACPI_FORMAT_UINT64(address),
+ (u32) window_size));
mem_info->mapped_length = 0;
return_ACPI_STATUS(status);
}
diff --git a/drivers/acpi/executer/exresnte.c b/drivers/acpi/executer/exresnte.c
index a5cca7eda21..01b26c80d22 100644
--- a/drivers/acpi/executer/exresnte.c
+++ b/drivers/acpi/executer/exresnte.c
@@ -122,7 +122,7 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr,
}
if (!source_desc) {
- ACPI_REPORT_ERROR(("No object attached to node %p\n", node));
+ ACPI_ERROR((AE_INFO, "No object attached to node %p", node));
return_ACPI_STATUS(AE_AML_NO_OPERAND);
}
@@ -134,9 +134,8 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr,
case ACPI_TYPE_PACKAGE:
if (ACPI_GET_OBJECT_TYPE(source_desc) != ACPI_TYPE_PACKAGE) {
- ACPI_REPORT_ERROR(("Object not a Package, type %s\n",
- acpi_ut_get_object_type_name
- (source_desc)));
+ ACPI_ERROR((AE_INFO, "Object not a Package, type %s",
+ acpi_ut_get_object_type_name(source_desc)));
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
}
@@ -152,9 +151,8 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr,
case ACPI_TYPE_BUFFER:
if (ACPI_GET_OBJECT_TYPE(source_desc) != ACPI_TYPE_BUFFER) {
- ACPI_REPORT_ERROR(("Object not a Buffer, type %s\n",
- acpi_ut_get_object_type_name
- (source_desc)));
+ ACPI_ERROR((AE_INFO, "Object not a Buffer, type %s",
+ acpi_ut_get_object_type_name(source_desc)));
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
}
@@ -170,9 +168,8 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr,
case ACPI_TYPE_STRING:
if (ACPI_GET_OBJECT_TYPE(source_desc) != ACPI_TYPE_STRING) {
- ACPI_REPORT_ERROR(("Object not a String, type %s\n",
- acpi_ut_get_object_type_name
- (source_desc)));
+ ACPI_ERROR((AE_INFO, "Object not a String, type %s",
+ acpi_ut_get_object_type_name(source_desc)));
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
}
@@ -185,9 +182,8 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr,
case ACPI_TYPE_INTEGER:
if (ACPI_GET_OBJECT_TYPE(source_desc) != ACPI_TYPE_INTEGER) {
- ACPI_REPORT_ERROR(("Object not a Integer, type %s\n",
- acpi_ut_get_object_type_name
- (source_desc)));
+ ACPI_ERROR((AE_INFO, "Object not a Integer, type %s",
+ acpi_ut_get_object_type_name(source_desc)));
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
}
@@ -231,8 +227,8 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr,
case ACPI_TYPE_ANY:
- ACPI_REPORT_ERROR(("Untyped entry %p, no attached object!\n",
- node));
+ ACPI_ERROR((AE_INFO,
+ "Untyped entry %p, no attached object!", node));
return_ACPI_STATUS(AE_AML_OPERAND_TYPE); /* Cannot be AE_TYPE */
@@ -251,7 +247,11 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr,
default:
/* No named references are allowed here */
- ACPI_REPORT_ERROR(("Unsupported Reference opcode %X (%s)\n", source_desc->reference.opcode, acpi_ps_get_opcode_name(source_desc->reference.opcode)));
+ ACPI_ERROR((AE_INFO,
+ "Unsupported Reference opcode %X (%s)",
+ source_desc->reference.opcode,
+ acpi_ps_get_opcode_name(source_desc->
+ reference.opcode)));
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
}
@@ -261,8 +261,9 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr,
/* Default case is for unknown types */
- ACPI_REPORT_ERROR(("Node %p - Unknown object type %X\n",
- node, entry_type));
+ ACPI_ERROR((AE_INFO,
+ "Node %p - Unknown object type %X",
+ node, entry_type));
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
diff --git a/drivers/acpi/executer/exresolv.c b/drivers/acpi/executer/exresolv.c
index ae2d2da0084..1deed492fe8 100644
--- a/drivers/acpi/executer/exresolv.c
+++ b/drivers/acpi/executer/exresolv.c
@@ -81,7 +81,7 @@ acpi_ex_resolve_to_value(union acpi_operand_object **stack_ptr,
ACPI_FUNCTION_TRACE_PTR("ex_resolve_to_value", stack_ptr);
if (!stack_ptr || !*stack_ptr) {
- ACPI_REPORT_ERROR(("Internal - null pointer\n"));
+ ACPI_ERROR((AE_INFO, "Internal - null pointer"));
return_ACPI_STATUS(AE_AML_NO_OPERAND);
}
@@ -97,7 +97,7 @@ acpi_ex_resolve_to_value(union acpi_operand_object **stack_ptr,
}
if (!*stack_ptr) {
- ACPI_REPORT_ERROR(("Internal - null pointer\n"));
+ ACPI_ERROR((AE_INFO, "Internal - null pointer"));
return_ACPI_STATUS(AE_AML_NO_OPERAND);
}
}
@@ -227,7 +227,9 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
* A NULL object descriptor means an unitialized element of
* the package, can't dereference it
*/
- ACPI_REPORT_ERROR(("Attempt to deref an Index to NULL pkg element Idx=%p\n", stack_desc));
+ ACPI_ERROR((AE_INFO,
+ "Attempt to deref an Index to NULL pkg element Idx=%p",
+ stack_desc));
status = AE_AML_UNINITIALIZED_ELEMENT;
}
break;
@@ -236,7 +238,10 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
/* Invalid reference object */
- ACPI_REPORT_ERROR(("Unknown target_type %X in Index/Reference obj %p\n", stack_desc->reference.target_type, stack_desc));
+ ACPI_ERROR((AE_INFO,
+ "Unknown target_type %X in Index/Reference obj %p",
+ stack_desc->reference.target_type,
+ stack_desc));
status = AE_AML_INTERNAL;
break;
}
@@ -261,7 +266,10 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
default:
- ACPI_REPORT_ERROR(("Unknown Reference opcode %X (%s) in %p\n", opcode, acpi_ps_get_opcode_name(opcode), stack_desc));
+ ACPI_ERROR((AE_INFO,
+ "Unknown Reference opcode %X (%s) in %p",
+ opcode, acpi_ps_get_opcode_name(opcode),
+ stack_desc));
status = AE_AML_INTERNAL;
break;
}
@@ -383,10 +391,9 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
if (ACPI_GET_DESCRIPTOR_TYPE(node) !=
ACPI_DESC_TYPE_NAMED) {
- ACPI_REPORT_ERROR(("Not a NS node %p [%s]\n",
- node,
- acpi_ut_get_descriptor_name
- (node)));
+ ACPI_ERROR((AE_INFO, "Not a NS node %p [%s]",
+ node,
+ acpi_ut_get_descriptor_name(node)));
return_ACPI_STATUS(AE_AML_INTERNAL);
}
@@ -442,10 +449,9 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
if (ACPI_GET_DESCRIPTOR_TYPE(node) !=
ACPI_DESC_TYPE_NAMED) {
- ACPI_REPORT_ERROR(("Not a NS node %p [%s]\n",
- node,
- acpi_ut_get_descriptor_name
- (node)));
+ ACPI_ERROR((AE_INFO, "Not a NS node %p [%s]",
+ node,
+ acpi_ut_get_descriptor_name(node)));
return_ACPI_STATUS(AE_AML_INTERNAL);
}
@@ -514,8 +520,9 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
default:
- ACPI_REPORT_ERROR(("Unknown Reference subtype %X\n",
- obj_desc->reference.opcode));
+ ACPI_ERROR((AE_INFO,
+ "Unknown Reference subtype %X",
+ obj_desc->reference.opcode));
return_ACPI_STATUS(AE_AML_INTERNAL);
}
}
diff --git a/drivers/acpi/executer/exresop.c b/drivers/acpi/executer/exresop.c
index 804faebf825..a1c000f5a41 100644
--- a/drivers/acpi/executer/exresop.c
+++ b/drivers/acpi/executer/exresop.c
@@ -46,6 +46,7 @@
#include <acpi/amlcode.h>
#include <acpi/acparser.h>
#include <acpi/acinterp.h>
+#include <acpi/acnamesp.h>
#define _COMPONENT ACPI_EXECUTER
ACPI_MODULE_NAME("exresop")
@@ -95,9 +96,10 @@ acpi_ex_check_object_type(acpi_object_type type_needed,
}
if (type_needed != this_type) {
- ACPI_REPORT_ERROR(("Needed type [%s], found [%s] %p\n",
- acpi_ut_get_type_name(type_needed),
- acpi_ut_get_type_name(this_type), object));
+ ACPI_ERROR((AE_INFO,
+ "Needed type [%s], found [%s] %p",
+ acpi_ut_get_type_name(type_needed),
+ acpi_ut_get_type_name(this_type), object));
return (AE_AML_OPERAND_TYPE);
}
@@ -150,7 +152,7 @@ acpi_ex_resolve_operands(u16 opcode,
arg_types = op_info->runtime_args;
if (arg_types == ARGI_INVALID_OPCODE) {
- ACPI_REPORT_ERROR(("Unknown AML opcode %X\n", opcode));
+ ACPI_ERROR((AE_INFO, "Unknown AML opcode %X", opcode));
return_ACPI_STATUS(AE_AML_INTERNAL);
}
@@ -168,8 +170,8 @@ acpi_ex_resolve_operands(u16 opcode,
*/
while (GET_CURRENT_ARG_TYPE(arg_types)) {
if (!stack_ptr || !*stack_ptr) {
- ACPI_REPORT_ERROR(("Null stack entry at %p\n",
- stack_ptr));
+ ACPI_ERROR((AE_INFO, "Null stack entry at %p",
+ stack_ptr));
return_ACPI_STATUS(AE_AML_INTERNAL);
}
@@ -187,6 +189,22 @@ acpi_ex_resolve_operands(u16 opcode,
object_type =
((struct acpi_namespace_node *)obj_desc)->type;
+
+ /*
+ * Resolve an alias object. The construction of these objects
+ * guarantees that there is only one level of alias indirection;
+ * thus, the attached object is always the aliased namespace node
+ */
+ if (object_type == ACPI_TYPE_LOCAL_ALIAS) {
+ obj_desc =
+ acpi_ns_get_attached_object((struct
+ acpi_namespace_node
+ *)obj_desc);
+ *stack_ptr = obj_desc;
+ object_type =
+ ((struct acpi_namespace_node *)obj_desc)->
+ type;
+ }
break;
case ACPI_DESC_TYPE_OPERAND:
@@ -198,7 +216,9 @@ acpi_ex_resolve_operands(u16 opcode,
/* Check for bad acpi_object_type */
if (!acpi_ut_valid_object_type(object_type)) {
- ACPI_REPORT_ERROR(("Bad operand object type [%X]\n", object_type));
+ ACPI_ERROR((AE_INFO,
+ "Bad operand object type [%X]",
+ object_type));
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
}
@@ -236,7 +256,10 @@ acpi_ex_resolve_operands(u16 opcode,
break;
default:
- ACPI_REPORT_ERROR(("Operand is a Reference, Unknown Reference Opcode: %X\n", obj_desc->reference.opcode));
+ ACPI_ERROR((AE_INFO,
+ "Operand is a Reference, Unknown Reference Opcode: %X",
+ obj_desc->reference.
+ opcode));
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
}
@@ -247,10 +270,10 @@ acpi_ex_resolve_operands(u16 opcode,
/* Invalid descriptor */
- ACPI_REPORT_ERROR(("Invalid descriptor %p [%s]\n",
- obj_desc,
- acpi_ut_get_descriptor_name
- (obj_desc)));
+ ACPI_ERROR((AE_INFO,
+ "Invalid descriptor %p [%s]",
+ obj_desc,
+ acpi_ut_get_descriptor_name(obj_desc)));
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
}
@@ -408,7 +431,10 @@ acpi_ex_resolve_operands(u16 opcode,
acpi_ex_convert_to_integer(obj_desc, stack_ptr, 16);
if (ACPI_FAILURE(status)) {
if (status == AE_TYPE) {
- ACPI_REPORT_ERROR(("Needed [Integer/String/Buffer], found [%s] %p\n", acpi_ut_get_object_type_name(obj_desc), obj_desc));
+ ACPI_ERROR((AE_INFO,
+ "Needed [Integer/String/Buffer], found [%s] %p",
+ acpi_ut_get_object_type_name
+ (obj_desc), obj_desc));
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
}
@@ -431,7 +457,10 @@ acpi_ex_resolve_operands(u16 opcode,
status = acpi_ex_convert_to_buffer(obj_desc, stack_ptr);
if (ACPI_FAILURE(status)) {
if (status == AE_TYPE) {
- ACPI_REPORT_ERROR(("Needed [Integer/String/Buffer], found [%s] %p\n", acpi_ut_get_object_type_name(obj_desc), obj_desc));
+ ACPI_ERROR((AE_INFO,
+ "Needed [Integer/String/Buffer], found [%s] %p",
+ acpi_ut_get_object_type_name
+ (obj_desc), obj_desc));
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
}
@@ -455,7 +484,10 @@ acpi_ex_resolve_operands(u16 opcode,
ACPI_IMPLICIT_CONVERT_HEX);
if (ACPI_FAILURE(status)) {
if (status == AE_TYPE) {
- ACPI_REPORT_ERROR(("Needed [Integer/String/Buffer], found [%s] %p\n", acpi_ut_get_object_type_name(obj_desc), obj_desc));
+ ACPI_ERROR((AE_INFO,
+ "Needed [Integer/String/Buffer], found [%s] %p",
+ acpi_ut_get_object_type_name
+ (obj_desc), obj_desc));
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
}
@@ -481,7 +513,10 @@ acpi_ex_resolve_operands(u16 opcode,
break;
default:
- ACPI_REPORT_ERROR(("Needed [Integer/String/Buffer], found [%s] %p\n", acpi_ut_get_object_type_name(obj_desc), obj_desc));
+ ACPI_ERROR((AE_INFO,
+ "Needed [Integer/String/Buffer], found [%s] %p",
+ acpi_ut_get_object_type_name
+ (obj_desc), obj_desc));
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
}
@@ -515,7 +550,10 @@ acpi_ex_resolve_operands(u16 opcode,
break;
default:
- ACPI_REPORT_ERROR(("Needed [Integer/String/Buffer], found [%s] %p\n", acpi_ut_get_object_type_name(obj_desc), obj_desc));
+ ACPI_ERROR((AE_INFO,
+ "Needed [Integer/String/Buffer], found [%s] %p",
+ acpi_ut_get_object_type_name
+ (obj_desc), obj_desc));
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
}
@@ -539,7 +577,10 @@ acpi_ex_resolve_operands(u16 opcode,
break;
default:
- ACPI_REPORT_ERROR(("Needed [Buffer/String/Package/Reference], found [%s] %p\n", acpi_ut_get_object_type_name(obj_desc), obj_desc));
+ ACPI_ERROR((AE_INFO,
+ "Needed [Buffer/String/Package/Reference], found [%s] %p",
+ acpi_ut_get_object_type_name
+ (obj_desc), obj_desc));
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
}
@@ -558,7 +599,10 @@ acpi_ex_resolve_operands(u16 opcode,
break;
default:
- ACPI_REPORT_ERROR(("Needed [Buffer/String/Package], found [%s] %p\n", acpi_ut_get_object_type_name(obj_desc), obj_desc));
+ ACPI_ERROR((AE_INFO,
+ "Needed [Buffer/String/Package], found [%s] %p",
+ acpi_ut_get_object_type_name
+ (obj_desc), obj_desc));
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
}
@@ -578,7 +622,10 @@ acpi_ex_resolve_operands(u16 opcode,
break;
default:
- ACPI_REPORT_ERROR(("Needed [Region/region_field], found [%s] %p\n", acpi_ut_get_object_type_name(obj_desc), obj_desc));
+ ACPI_ERROR((AE_INFO,
+ "Needed [Region/region_field], found [%s] %p",
+ acpi_ut_get_object_type_name
+ (obj_desc), obj_desc));
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
}
@@ -620,7 +667,10 @@ acpi_ex_resolve_operands(u16 opcode,
break;
}
- ACPI_REPORT_ERROR(("Needed Integer/Buffer/String/Package/Ref/Ddb], found [%s] %p\n", acpi_ut_get_object_type_name(obj_desc), obj_desc));
+ ACPI_ERROR((AE_INFO,
+ "Needed Integer/Buffer/String/Package/Ref/Ddb], found [%s] %p",
+ acpi_ut_get_object_type_name
+ (obj_desc), obj_desc));
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
}
@@ -630,7 +680,9 @@ acpi_ex_resolve_operands(u16 opcode,
/* Unknown type */
- ACPI_REPORT_ERROR(("Internal - Unknown ARGI (required operand) type %X\n", this_arg_type));
+ ACPI_ERROR((AE_INFO,
+ "Internal - Unknown ARGI (required operand) type %X",
+ this_arg_type));
return_ACPI_STATUS(AE_BAD_PARAMETER);
}
diff --git a/drivers/acpi/executer/exstore.c b/drivers/acpi/executer/exstore.c
index 202ebe1eb95..3f020c0e2b9 100644
--- a/drivers/acpi/executer/exstore.c
+++ b/drivers/acpi/executer/exstore.c
@@ -250,7 +250,7 @@ acpi_ex_store(union acpi_operand_object *source_desc,
/* Validate parameters */
if (!source_desc || !dest_desc) {
- ACPI_REPORT_ERROR(("Null parameter\n"));
+ ACPI_ERROR((AE_INFO, "Null parameter"));
return_ACPI_STATUS(AE_AML_NO_OPERAND);
}
@@ -290,7 +290,10 @@ acpi_ex_store(union acpi_operand_object *source_desc,
/* Destination is not a Reference object */
- ACPI_REPORT_ERROR(("Target is not a Reference or Constant object - %s [%p]\n", acpi_ut_get_object_type_name(dest_desc), dest_desc));
+ ACPI_ERROR((AE_INFO,
+ "Target is not a Reference or Constant object - %s [%p]",
+ acpi_ut_get_object_type_name(dest_desc),
+ dest_desc));
ACPI_DUMP_STACK_ENTRY(source_desc);
ACPI_DUMP_STACK_ENTRY(dest_desc);
@@ -357,8 +360,8 @@ acpi_ex_store(union acpi_operand_object *source_desc,
default:
- ACPI_REPORT_ERROR(("Unknown Reference opcode %X\n",
- ref_desc->reference.opcode));
+ ACPI_ERROR((AE_INFO, "Unknown Reference opcode %X",
+ ref_desc->reference.opcode));
ACPI_DUMP_ENTRY(ref_desc, ACPI_LV_ERROR);
status = AE_AML_INTERNAL;
@@ -487,7 +490,9 @@ acpi_ex_store_object_to_index(union acpi_operand_object *source_desc,
/* All other types are invalid */
- ACPI_REPORT_ERROR(("Source must be Integer/Buffer/String type, not %s\n", acpi_ut_get_object_type_name(source_desc)));
+ ACPI_ERROR((AE_INFO,
+ "Source must be Integer/Buffer/String type, not %s",
+ acpi_ut_get_object_type_name(source_desc)));
return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
}
@@ -497,7 +502,8 @@ acpi_ex_store_object_to_index(union acpi_operand_object *source_desc,
break;
default:
- ACPI_REPORT_ERROR(("Target is not a Package or buffer_field\n"));
+ ACPI_ERROR((AE_INFO,
+ "Target is not a Package or buffer_field"));
status = AE_AML_OPERAND_TYPE;
break;
}
diff --git a/drivers/acpi/executer/exstoren.c b/drivers/acpi/executer/exstoren.c
index 25bbc1d7854..42967baf760 100644
--- a/drivers/acpi/executer/exstoren.c
+++ b/drivers/acpi/executer/exstoren.c
@@ -123,7 +123,10 @@ acpi_ex_resolve_object(union acpi_operand_object **source_desc_ptr,
&& (source_desc->reference.opcode == AML_LOAD_OP))) {
/* Conversion successful but still not a valid type */
- ACPI_REPORT_ERROR(("Cannot assign type %s to %s (must be type Int/Str/Buf)\n", acpi_ut_get_object_type_name(source_desc), acpi_ut_get_type_name(target_type)));
+ ACPI_ERROR((AE_INFO,
+ "Cannot assign type %s to %s (must be type Int/Str/Buf)",
+ acpi_ut_get_object_type_name(source_desc),
+ acpi_ut_get_type_name(target_type)));
status = AE_AML_OPERAND_TYPE;
}
break;
@@ -131,9 +134,11 @@ acpi_ex_resolve_object(union acpi_operand_object **source_desc_ptr,
case ACPI_TYPE_LOCAL_ALIAS:
case ACPI_TYPE_LOCAL_METHOD_ALIAS:
- /* Aliases are resolved by acpi_ex_prep_operands */
-
- ACPI_REPORT_ERROR(("Store into Alias - should never happen\n"));
+ /*
+ * All aliases should have been resolved earlier, during the
+ * operand resolution phase.
+ */
+ ACPI_ERROR((AE_INFO, "Store into an unresolved Alias object"));
status = AE_AML_INTERNAL;
break;
@@ -276,8 +281,8 @@ acpi_ex_store_object_to_object(union acpi_operand_object *source_desc,
/*
* All other types come here.
*/
- ACPI_REPORT_WARNING(("Store into type %s not implemented\n",
- acpi_ut_get_object_type_name(dest_desc)));
+ ACPI_WARNING((AE_INFO, "Store into type %s not implemented",
+ acpi_ut_get_object_type_name(dest_desc)));
status = AE_NOT_IMPLEMENTED;
break;
diff --git a/drivers/acpi/executer/exsystem.c b/drivers/acpi/executer/exsystem.c
index 9a3684d3cf8..ea9144f42e1 100644
--- a/drivers/acpi/executer/exsystem.c
+++ b/drivers/acpi/executer/exsystem.c
@@ -129,8 +129,8 @@ acpi_status acpi_ex_system_do_stall(u32 how_long)
* (ACPI specifies 100 usec as max, but this gives some slack in
* order to support existing BIOSs)
*/
- ACPI_REPORT_ERROR(("Time parameter is too large (%d)\n",
- how_long));
+ ACPI_ERROR((AE_INFO, "Time parameter is too large (%d)",
+ how_long));
status = AE_AML_OPERAND_VALUE;
} else {
acpi_os_stall(how_long);
diff --git a/drivers/acpi/executer/exutils.c b/drivers/acpi/executer/exutils.c
index 990c40e0c04..f73a61aeb7e 100644
--- a/drivers/acpi/executer/exutils.c
+++ b/drivers/acpi/executer/exutils.c
@@ -91,7 +91,7 @@ acpi_status acpi_ex_enter_interpreter(void)
status = acpi_ut_acquire_mutex(ACPI_MTX_EXECUTE);
if (ACPI_FAILURE(status)) {
- ACPI_REPORT_ERROR(("Could not acquire interpreter mutex\n"));
+ ACPI_ERROR((AE_INFO, "Could not acquire interpreter mutex"));
}
return_ACPI_STATUS(status);
@@ -127,7 +127,7 @@ void acpi_ex_exit_interpreter(void)
status = acpi_ut_release_mutex(ACPI_MTX_EXECUTE);
if (ACPI_FAILURE(status)) {
- ACPI_REPORT_ERROR(("Could not release interpreter mutex\n"));
+ ACPI_ERROR((AE_INFO, "Could not release interpreter mutex"));
}
return_VOID;
@@ -200,7 +200,8 @@ u8 acpi_ex_acquire_global_lock(u32 field_flags)
if (ACPI_SUCCESS(status)) {
locked = TRUE;
} else {
- ACPI_REPORT_ERROR(("Could not acquire Global Lock, %s\n", acpi_format_exception(status)));
+ ACPI_EXCEPTION((AE_INFO, status,
+ "Could not acquire Global Lock"));
}
}
@@ -235,7 +236,8 @@ void acpi_ex_release_global_lock(u8 locked_by_me)
if (ACPI_FAILURE(status)) {
/* Report the error, but there isn't much else we can do */
- ACPI_REPORT_ERROR(("Could not release ACPI Global Lock, %s\n", acpi_format_exception(status)));
+ ACPI_EXCEPTION((AE_INFO, status,
+ "Could not release ACPI Global Lock"));
}
}