Commit 1fad8738 authored by Bob Moore's avatar Bob Moore Committed by Rafael J. Wysocki

ACPICA: Core: Major update for code formatting, no functional changes

ACPICA commit dfa394471f6c01b2ee9433dbc143ec70cb9bca72

Mostly indentation inconsistencies across the code. Split
some long lines, etc.

Link: https://github.com/acpica/acpica/commit/dfa39447Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent cd162b35
...@@ -382,6 +382,7 @@ acpi_status acpi_db_display_statistics(char *type_arg) ...@@ -382,6 +382,7 @@ acpi_status acpi_db_display_statistics(char *type_arg)
acpi_gbl_node_type_count[i], acpi_gbl_node_type_count[i],
acpi_gbl_obj_type_count[i]); acpi_gbl_obj_type_count[i]);
} }
acpi_os_printf("%16.16s % 10ld% 10ld\n", "Misc/Unknown", acpi_os_printf("%16.16s % 10ld% 10ld\n", "Misc/Unknown",
acpi_gbl_node_type_count_misc, acpi_gbl_node_type_count_misc,
acpi_gbl_obj_type_count_misc); acpi_gbl_obj_type_count_misc);
......
...@@ -173,6 +173,7 @@ void acpi_db_dump_external_object(union acpi_object *obj_desc, u32 level) ...@@ -173,6 +173,7 @@ void acpi_db_dump_external_object(union acpi_object *obj_desc, u32 level)
if (obj_desc->buffer.length > 16) { if (obj_desc->buffer.length > 16) {
acpi_os_printf("\n"); acpi_os_printf("\n");
} }
acpi_ut_debug_dump_buffer(ACPI_CAST_PTR acpi_ut_debug_dump_buffer(ACPI_CAST_PTR
(u8, (u8,
obj_desc->buffer.pointer), obj_desc->buffer.pointer),
......
...@@ -194,8 +194,8 @@ acpi_ds_get_buffer_field_arguments(union acpi_operand_object *obj_desc) ...@@ -194,8 +194,8 @@ acpi_ds_get_buffer_field_arguments(union acpi_operand_object *obj_desc)
extra_desc = acpi_ns_get_secondary_object(obj_desc); extra_desc = acpi_ns_get_secondary_object(obj_desc);
node = obj_desc->buffer_field.node; node = obj_desc->buffer_field.node;
ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname(ACPI_TYPE_BUFFER_FIELD, ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname
node, NULL)); (ACPI_TYPE_BUFFER_FIELD, node, NULL));
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "[%4.4s] BufferField Arg Init\n", ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "[%4.4s] BufferField Arg Init\n",
acpi_ut_get_node_name(node))); acpi_ut_get_node_name(node)));
...@@ -385,7 +385,8 @@ acpi_status acpi_ds_get_region_arguments(union acpi_operand_object *obj_desc) ...@@ -385,7 +385,8 @@ acpi_status acpi_ds_get_region_arguments(union acpi_operand_object *obj_desc)
ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname
(ACPI_TYPE_REGION, node, NULL)); (ACPI_TYPE_REGION, node, NULL));
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "[%4.4s] OpRegion Arg Init at AML %p\n", ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
"[%4.4s] OpRegion Arg Init at AML %p\n",
acpi_ut_get_node_name(node), acpi_ut_get_node_name(node),
extra_desc->extra.aml_start)); extra_desc->extra.aml_start));
......
...@@ -161,6 +161,7 @@ acpi_ds_dump_method_stack(acpi_status status, ...@@ -161,6 +161,7 @@ acpi_ds_dump_method_stack(acpi_status status,
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
"\n**** Exception %s during execution of method ", "\n**** Exception %s during execution of method ",
acpi_format_exception(status))); acpi_format_exception(status)));
acpi_ds_print_node_pathname(walk_state->method_node, NULL); acpi_ds_print_node_pathname(walk_state->method_node, NULL);
/* Display stack of executing methods */ /* Display stack of executing methods */
...@@ -203,8 +204,8 @@ acpi_ds_dump_method_stack(acpi_status status, ...@@ -203,8 +204,8 @@ acpi_ds_dump_method_stack(acpi_status status,
} else { } else {
/* /*
* This method has called another method * This method has called another method
* NOTE: the method call parse subtree is already deleted at this * NOTE: the method call parse subtree is already deleted at
* point, so we cannot disassemble the method invocation. * this point, so we cannot disassemble the method invocation.
*/ */
ACPI_DEBUG_PRINT_RAW((ACPI_DB_DISPATCH, ACPI_DEBUG_PRINT_RAW((ACPI_DB_DISPATCH,
"Call to method ")); "Call to method "));
......
...@@ -106,6 +106,7 @@ acpi_ds_create_external_region(acpi_status lookup_status, ...@@ -106,6 +106,7 @@ acpi_ds_create_external_region(acpi_status lookup_status,
* insert the name into the namespace. * insert the name into the namespace.
*/ */
acpi_dm_add_op_to_external_list(op, path, ACPI_TYPE_REGION, 0, 0); acpi_dm_add_op_to_external_list(op, path, ACPI_TYPE_REGION, 0, 0);
status = acpi_ns_lookup(walk_state->scope_info, path, ACPI_TYPE_REGION, status = acpi_ns_lookup(walk_state->scope_info, path, ACPI_TYPE_REGION,
ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT, ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT,
walk_state, node); walk_state, node);
...@@ -202,11 +203,10 @@ acpi_ds_create_buffer_field(union acpi_parse_object *op, ...@@ -202,11 +203,10 @@ acpi_ds_create_buffer_field(union acpi_parse_object *op,
/* Enter the name_string into the namespace */ /* Enter the name_string into the namespace */
status = status = acpi_ns_lookup(walk_state->scope_info,
acpi_ns_lookup(walk_state->scope_info, arg->common.value.string, ACPI_TYPE_ANY,
arg->common.value.string, ACPI_TYPE_ANY, ACPI_IMODE_LOAD_PASS1, flags,
ACPI_IMODE_LOAD_PASS1, flags, walk_state, walk_state, &node);
&node);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
ACPI_ERROR_NAMESPACE(arg->common.value.string, status); ACPI_ERROR_NAMESPACE(arg->common.value.string, status);
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
...@@ -244,8 +244,8 @@ acpi_ds_create_buffer_field(union acpi_parse_object *op, ...@@ -244,8 +244,8 @@ acpi_ds_create_buffer_field(union acpi_parse_object *op,
} }
/* /*
* Remember location in AML stream of the field unit opcode and operands -- * Remember location in AML stream of the field unit opcode and operands
* since the buffer and index operands must be evaluated. * -- since the buffer and index operands must be evaluated.
*/ */
second_desc = obj_desc->common.next_object; second_desc = obj_desc->common.next_object;
second_desc->extra.aml_start = op->named.data; second_desc->extra.aml_start = op->named.data;
...@@ -310,8 +310,8 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info, ...@@ -310,8 +310,8 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info,
switch (arg->common.aml_opcode) { switch (arg->common.aml_opcode) {
case AML_INT_RESERVEDFIELD_OP: case AML_INT_RESERVEDFIELD_OP:
position = (u64)info->field_bit_position position = (u64)info->field_bit_position +
+ (u64)arg->common.value.size; (u64)arg->common.value.size;
if (position > ACPI_UINT32_MAX) { if (position > ACPI_UINT32_MAX) {
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
...@@ -344,13 +344,13 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info, ...@@ -344,13 +344,13 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info,
/* access_attribute (attrib_quick, attrib_byte, etc.) */ /* access_attribute (attrib_quick, attrib_byte, etc.) */
info->attribute = info->attribute = (u8)
(u8)((arg->common.value.integer >> 8) & 0xFF); ((arg->common.value.integer >> 8) & 0xFF);
/* access_length (for serial/buffer protocols) */ /* access_length (for serial/buffer protocols) */
info->access_length = info->access_length = (u8)
(u8)((arg->common.value.integer >> 16) & 0xFF); ((arg->common.value.integer >> 16) & 0xFF);
break; break;
case AML_INT_CONNECTION_OP: case AML_INT_CONNECTION_OP:
...@@ -425,8 +425,8 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info, ...@@ -425,8 +425,8 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info,
/* Keep track of bit position for the next field */ /* Keep track of bit position for the next field */
position = (u64)info->field_bit_position position = (u64)info->field_bit_position +
+ (u64)arg->common.value.size; (u64)arg->common.value.size;
if (position > ACPI_UINT32_MAX) { if (position > ACPI_UINT32_MAX) {
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
...@@ -716,11 +716,12 @@ acpi_ds_create_bank_field(union acpi_parse_object *op, ...@@ -716,11 +716,12 @@ acpi_ds_create_bank_field(union acpi_parse_object *op,
/* /*
* Use Info.data_register_node to store bank_field Op * Use Info.data_register_node to store bank_field Op
* It's safe because data_register_node will never be used when create bank field * It's safe because data_register_node will never be used when create
* We store aml_start and aml_length in the bank_field Op for late evaluation * bank field \we store aml_start and aml_length in the bank_field Op for
* Used in acpi_ex_prep_field_value(Info) * late evaluation. Used in acpi_ex_prep_field_value(Info)
* *
* TBD: Or, should we add a field in struct acpi_create_field_info, like "void *ParentOp"? * TBD: Or, should we add a field in struct acpi_create_field_info, like
* "void *ParentOp"?
*/ */
info.data_register_node = (struct acpi_namespace_node *)op; info.data_register_node = (struct acpi_namespace_node *)op;
......
...@@ -247,7 +247,7 @@ acpi_ds_initialize_objects(u32 table_index, ...@@ -247,7 +247,7 @@ acpi_ds_initialize_objects(u32 table_index,
/* Summary of objects initialized */ /* Summary of objects initialized */
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT, ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
"Table [%4.4s:%8.8s] (id %.2X) - %4u Objects with %3u Devices, " "Table [%4.4s: %-8.8s] (id %.2X) - %4u Objects with %3u Devices, "
"%3u Regions, %4u Methods (%u/%u/%u Serial/Non/Cvt)\n", "%3u Regions, %4u Methods (%u/%u/%u Serial/Non/Cvt)\n",
table->signature, table->oem_table_id, owner_id, table->signature, table->oem_table_id, owner_id,
info.object_count, info.device_count, info.object_count, info.device_count,
......
...@@ -118,10 +118,9 @@ acpi_ds_auto_serialize_method(struct acpi_namespace_node *node, ...@@ -118,10 +118,9 @@ acpi_ds_auto_serialize_method(struct acpi_namespace_node *node,
return_ACPI_STATUS(AE_NO_MEMORY); return_ACPI_STATUS(AE_NO_MEMORY);
} }
status = status = acpi_ds_init_aml_walk(walk_state, op, node,
acpi_ds_init_aml_walk(walk_state, op, node, obj_desc->method.aml_start,
obj_desc->method.aml_start, obj_desc->method.aml_length, NULL, 0);
obj_desc->method.aml_length, NULL, 0);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
acpi_ds_delete_walk_state(walk_state); acpi_ds_delete_walk_state(walk_state);
acpi_ps_free_op(op); acpi_ps_free_op(op);
...@@ -375,7 +374,8 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node, ...@@ -375,7 +374,8 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node,
&& (walk_state->thread->current_sync_level > && (walk_state->thread->current_sync_level >
obj_desc->method.mutex->mutex.sync_level)) { obj_desc->method.mutex->mutex.sync_level)) {
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
"Cannot acquire Mutex for method [%4.4s], current SyncLevel is too large (%u)", "Cannot acquire Mutex for method [%4.4s]"
", current SyncLevel is too large (%u)",
acpi_ut_get_node_name(method_node), acpi_ut_get_node_name(method_node),
walk_state->thread->current_sync_level)); walk_state->thread->current_sync_level));
...@@ -512,16 +512,18 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread, ...@@ -512,16 +512,18 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread,
/* Init for new method, possibly wait on method mutex */ /* Init for new method, possibly wait on method mutex */
status = acpi_ds_begin_method_execution(method_node, obj_desc, status =
this_walk_state); acpi_ds_begin_method_execution(method_node, obj_desc,
this_walk_state);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
/* Begin method parse/execution. Create a new walk state */ /* Begin method parse/execution. Create a new walk state */
next_walk_state = acpi_ds_create_walk_state(obj_desc->method.owner_id, next_walk_state =
NULL, obj_desc, thread); acpi_ds_create_walk_state(obj_desc->method.owner_id, NULL, obj_desc,
thread);
if (!next_walk_state) { if (!next_walk_state) {
status = AE_NO_MEMORY; status = AE_NO_MEMORY;
goto cleanup; goto cleanup;
...@@ -808,7 +810,8 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc, ...@@ -808,7 +810,8 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
info_flags & ACPI_METHOD_SERIALIZED_PENDING) { info_flags & ACPI_METHOD_SERIALIZED_PENDING) {
if (walk_state) { if (walk_state) {
ACPI_INFO((AE_INFO, ACPI_INFO((AE_INFO,
"Marking method %4.4s as Serialized because of AE_ALREADY_EXISTS error", "Marking method %4.4s as Serialized "
"because of AE_ALREADY_EXISTS error",
walk_state->method_node->name. walk_state->method_node->name.
ascii)); ascii));
} }
...@@ -826,6 +829,7 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc, ...@@ -826,6 +829,7 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
*/ */
method_desc->method.info_flags &= method_desc->method.info_flags &=
~ACPI_METHOD_SERIALIZED_PENDING; ~ACPI_METHOD_SERIALIZED_PENDING;
method_desc->method.info_flags |= method_desc->method.info_flags |=
(ACPI_METHOD_SERIALIZED | (ACPI_METHOD_SERIALIZED |
ACPI_METHOD_IGNORE_SYNC_LEVEL); ACPI_METHOD_IGNORE_SYNC_LEVEL);
......
...@@ -99,6 +99,7 @@ void acpi_ds_method_data_init(struct acpi_walk_state *walk_state) ...@@ -99,6 +99,7 @@ void acpi_ds_method_data_init(struct acpi_walk_state *walk_state)
for (i = 0; i < ACPI_METHOD_NUM_ARGS; i++) { for (i = 0; i < ACPI_METHOD_NUM_ARGS; i++) {
ACPI_MOVE_32_TO_32(&walk_state->arguments[i].name, ACPI_MOVE_32_TO_32(&walk_state->arguments[i].name,
NAMEOF_ARG_NTE); NAMEOF_ARG_NTE);
walk_state->arguments[i].name.integer |= (i << 24); walk_state->arguments[i].name.integer |= (i << 24);
walk_state->arguments[i].descriptor_type = ACPI_DESC_TYPE_NAMED; walk_state->arguments[i].descriptor_type = ACPI_DESC_TYPE_NAMED;
walk_state->arguments[i].type = ACPI_TYPE_ANY; walk_state->arguments[i].type = ACPI_TYPE_ANY;
...@@ -201,7 +202,7 @@ acpi_ds_method_data_init_args(union acpi_operand_object **params, ...@@ -201,7 +202,7 @@ acpi_ds_method_data_init_args(union acpi_operand_object **params,
if (!params) { if (!params) {
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
"No param list passed to method\n")); "No parameter list passed to method\n"));
return_ACPI_STATUS(AE_OK); return_ACPI_STATUS(AE_OK);
} }
...@@ -214,9 +215,9 @@ acpi_ds_method_data_init_args(union acpi_operand_object **params, ...@@ -214,9 +215,9 @@ acpi_ds_method_data_init_args(union acpi_operand_object **params,
* Store the argument in the method/walk descriptor. * Store the argument in the method/walk descriptor.
* Do not copy the arg in order to implement call by reference * Do not copy the arg in order to implement call by reference
*/ */
status = acpi_ds_method_data_set_value(ACPI_REFCLASS_ARG, index, status =
params[index], acpi_ds_method_data_set_value(ACPI_REFCLASS_ARG, index,
walk_state); params[index], walk_state);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
...@@ -610,11 +611,11 @@ acpi_ds_store_object_to_local(u8 type, ...@@ -610,11 +611,11 @@ acpi_ds_store_object_to_local(u8 type,
* do the indirect store * do the indirect store
*/ */
if ((ACPI_GET_DESCRIPTOR_TYPE(current_obj_desc) == if ((ACPI_GET_DESCRIPTOR_TYPE(current_obj_desc) ==
ACPI_DESC_TYPE_OPERAND) ACPI_DESC_TYPE_OPERAND) &&
&& (current_obj_desc->common.type == (current_obj_desc->common.type ==
ACPI_TYPE_LOCAL_REFERENCE) ACPI_TYPE_LOCAL_REFERENCE) &&
&& (current_obj_desc->reference.class == (current_obj_desc->reference.class ==
ACPI_REFCLASS_REFOF)) { ACPI_REFCLASS_REFOF)) {
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
"Arg (%p) is an ObjRef(Node), storing in node %p\n", "Arg (%p) is an ObjRef(Node), storing in node %p\n",
new_obj_desc, new_obj_desc,
...@@ -638,6 +639,7 @@ acpi_ds_store_object_to_local(u8 type, ...@@ -638,6 +639,7 @@ acpi_ds_store_object_to_local(u8 type,
if (new_obj_desc != obj_desc) { if (new_obj_desc != obj_desc) {
acpi_ut_remove_reference(new_obj_desc); acpi_ut_remove_reference(new_obj_desc);
} }
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
} }
......
...@@ -463,10 +463,10 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state, ...@@ -463,10 +463,10 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,
arg->common.node); arg->common.node);
} }
} else { } else {
status = acpi_ds_build_internal_object(walk_state, arg, status =
&obj_desc-> acpi_ds_build_internal_object(walk_state, arg,
package. &obj_desc->package.
elements[i]); elements[i]);
} }
if (*obj_desc_ptr) { if (*obj_desc_ptr) {
...@@ -525,7 +525,8 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state, ...@@ -525,7 +525,8 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,
} }
ACPI_INFO((AE_INFO, ACPI_INFO((AE_INFO,
"Actual Package length (%u) is larger than NumElements field (%u), truncated", "Actual Package length (%u) is larger than "
"NumElements field (%u), truncated",
i, element_count)); i, element_count));
} else if (i < element_count) { } else if (i < element_count) {
/* /*
...@@ -533,7 +534,8 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state, ...@@ -533,7 +534,8 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,
* Note: this is not an error, the package is padded out with NULLs. * Note: this is not an error, the package is padded out with NULLs.
*/ */
ACPI_DEBUG_PRINT((ACPI_DB_INFO, ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Package List length (%u) smaller than NumElements count (%u), padded with null elements\n", "Package List length (%u) smaller than NumElements "
"count (%u), padded with null elements\n",
i, element_count)); i, element_count));
} }
...@@ -584,8 +586,9 @@ acpi_ds_create_node(struct acpi_walk_state *walk_state, ...@@ -584,8 +586,9 @@ acpi_ds_create_node(struct acpi_walk_state *walk_state,
/* Build an internal object for the argument(s) */ /* Build an internal object for the argument(s) */
status = acpi_ds_build_internal_object(walk_state, op->common.value.arg, status =
&obj_desc); acpi_ds_build_internal_object(walk_state, op->common.value.arg,
&obj_desc);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
......
...@@ -243,8 +243,9 @@ acpi_ds_init_buffer_field(u16 aml_opcode, ...@@ -243,8 +243,9 @@ acpi_ds_init_buffer_field(u16 aml_opcode,
* For field_flags, use LOCK_RULE = 0 (NO_LOCK), * For field_flags, use LOCK_RULE = 0 (NO_LOCK),
* UPDATE_RULE = 0 (UPDATE_PRESERVE) * UPDATE_RULE = 0 (UPDATE_PRESERVE)
*/ */
status = acpi_ex_prep_common_field_object(obj_desc, field_flags, 0, status =
bit_offset, bit_count); acpi_ex_prep_common_field_object(obj_desc, field_flags, 0,
bit_offset, bit_count);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
goto cleanup; goto cleanup;
} }
...@@ -330,8 +331,9 @@ acpi_ds_eval_buffer_field_operands(struct acpi_walk_state *walk_state, ...@@ -330,8 +331,9 @@ acpi_ds_eval_buffer_field_operands(struct acpi_walk_state *walk_state,
/* Resolve the operands */ /* Resolve the operands */
status = acpi_ex_resolve_operands(op->common.aml_opcode, status =
ACPI_WALK_OPERANDS, walk_state); acpi_ex_resolve_operands(op->common.aml_opcode, ACPI_WALK_OPERANDS,
walk_state);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
ACPI_ERROR((AE_INFO, "(%s) bad operand(s), status 0x%X", ACPI_ERROR((AE_INFO, "(%s) bad operand(s), status 0x%X",
acpi_ps_get_opcode_name(op->common.aml_opcode), acpi_ps_get_opcode_name(op->common.aml_opcode),
...@@ -414,8 +416,9 @@ acpi_ds_eval_region_operands(struct acpi_walk_state *walk_state, ...@@ -414,8 +416,9 @@ acpi_ds_eval_region_operands(struct acpi_walk_state *walk_state,
/* Resolve the length and address operands to numbers */ /* Resolve the length and address operands to numbers */
status = acpi_ex_resolve_operands(op->common.aml_opcode, status =
ACPI_WALK_OPERANDS, walk_state); acpi_ex_resolve_operands(op->common.aml_opcode, ACPI_WALK_OPERANDS,
walk_state);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
...@@ -452,7 +455,6 @@ acpi_ds_eval_region_operands(struct acpi_walk_state *walk_state, ...@@ -452,7 +455,6 @@ acpi_ds_eval_region_operands(struct acpi_walk_state *walk_state,
/* Now the address and length are valid for this opregion */ /* Now the address and length are valid for this opregion */
obj_desc->region.flags |= AOPOBJ_DATA_VALID; obj_desc->region.flags |= AOPOBJ_DATA_VALID;
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
...@@ -510,8 +512,9 @@ acpi_ds_eval_table_region_operands(struct acpi_walk_state *walk_state, ...@@ -510,8 +512,9 @@ acpi_ds_eval_table_region_operands(struct acpi_walk_state *walk_state,
* Resolve the Signature string, oem_id string, * Resolve the Signature string, oem_id string,
* and oem_table_id string operands * and oem_table_id string operands
*/ */
status = acpi_ex_resolve_operands(op->common.aml_opcode, status =
ACPI_WALK_OPERANDS, walk_state); acpi_ex_resolve_operands(op->common.aml_opcode, ACPI_WALK_OPERANDS,
walk_state);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
goto cleanup; goto cleanup;
} }
......
...@@ -245,9 +245,9 @@ acpi_ds_is_result_used(union acpi_parse_object * op, ...@@ -245,9 +245,9 @@ acpi_ds_is_result_used(union acpi_parse_object * op,
* we will use the return value * we will use the return value
*/ */
if ((walk_state->control_state->common.state == if ((walk_state->control_state->common.state ==
ACPI_CONTROL_PREDICATE_EXECUTING) ACPI_CONTROL_PREDICATE_EXECUTING) &&
&& (walk_state->control_state->control. (walk_state->control_state->control.predicate_op ==
predicate_op == op)) { op)) {
goto result_used; goto result_used;
} }
break; break;
...@@ -481,10 +481,9 @@ acpi_ds_create_operand(struct acpi_walk_state *walk_state, ...@@ -481,10 +481,9 @@ acpi_ds_create_operand(struct acpi_walk_state *walk_state,
/* Get the entire name string from the AML stream */ /* Get the entire name string from the AML stream */
status = status = acpi_ex_get_name_string(ACPI_TYPE_ANY,
acpi_ex_get_name_string(ACPI_TYPE_ANY, arg->common.value.buffer,
arg->common.value.buffer, &name_string, &name_length);
&name_string, &name_length);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
...@@ -503,9 +502,8 @@ acpi_ds_create_operand(struct acpi_walk_state *walk_state, ...@@ -503,9 +502,8 @@ acpi_ds_create_operand(struct acpi_walk_state *walk_state,
*/ */
if ((walk_state->deferred_node) && if ((walk_state->deferred_node) &&
(walk_state->deferred_node->type == ACPI_TYPE_BUFFER_FIELD) (walk_state->deferred_node->type == ACPI_TYPE_BUFFER_FIELD)
&& (arg_index == && (arg_index == (u32)
(u32)((walk_state->opcode == ((walk_state->opcode == AML_CREATE_FIELD_OP) ? 3 : 2))) {
AML_CREATE_FIELD_OP) ? 3 : 2))) {
obj_desc = obj_desc =
ACPI_CAST_PTR(union acpi_operand_object, ACPI_CAST_PTR(union acpi_operand_object,
walk_state->deferred_node); walk_state->deferred_node);
...@@ -522,9 +520,10 @@ acpi_ds_create_operand(struct acpi_walk_state *walk_state, ...@@ -522,9 +520,10 @@ acpi_ds_create_operand(struct acpi_walk_state *walk_state,
op_info = op_info =
acpi_ps_get_opcode_info(parent_op->common. acpi_ps_get_opcode_info(parent_op->common.
aml_opcode); aml_opcode);
if ((op_info->flags & AML_NSNODE)
&& (parent_op->common.aml_opcode != if ((op_info->flags & AML_NSNODE) &&
AML_INT_METHODCALL_OP) (parent_op->common.aml_opcode !=
AML_INT_METHODCALL_OP)
&& (parent_op->common.aml_opcode != AML_REGION_OP) && (parent_op->common.aml_opcode != AML_REGION_OP)
&& (parent_op->common.aml_opcode != && (parent_op->common.aml_opcode !=
AML_INT_NAMEPATH_OP)) { AML_INT_NAMEPATH_OP)) {
...@@ -633,8 +632,8 @@ acpi_ds_create_operand(struct acpi_walk_state *walk_state, ...@@ -633,8 +632,8 @@ acpi_ds_create_operand(struct acpi_walk_state *walk_state,
return_ACPI_STATUS(AE_NOT_IMPLEMENTED); return_ACPI_STATUS(AE_NOT_IMPLEMENTED);
} }
if ((op_info->flags & AML_HAS_RETVAL) if ((op_info->flags & AML_HAS_RETVAL) ||
|| (arg->common.flags & ACPI_PARSEOP_IN_STACK)) { (arg->common.flags & ACPI_PARSEOP_IN_STACK)) {
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
"Argument previously created, already stacked\n")); "Argument previously created, already stacked\n"));
......
...@@ -172,7 +172,8 @@ acpi_ds_get_predicate_value(struct acpi_walk_state *walk_state, ...@@ -172,7 +172,8 @@ acpi_ds_get_predicate_value(struct acpi_walk_state *walk_state,
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",
walk_state->control_state->common.value, walk_state->control_state->common.value,
walk_state->op)); walk_state->op));
...@@ -263,8 +264,8 @@ acpi_ds_exec_begin_op(struct acpi_walk_state *walk_state, ...@@ -263,8 +264,8 @@ acpi_ds_exec_begin_op(struct acpi_walk_state *walk_state,
(walk_state->control_state->common.state == (walk_state->control_state->common.state ==
ACPI_CONTROL_CONDITIONAL_EXECUTING)) { ACPI_CONTROL_CONDITIONAL_EXECUTING)) {
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
"Exec predicate Op=%p State=%p\n", op, "Exec predicate Op=%p State=%p\n",
walk_state)); op, walk_state));
walk_state->control_state->common.state = walk_state->control_state->common.state =
ACPI_CONTROL_PREDICATE_EXECUTING; ACPI_CONTROL_PREDICATE_EXECUTING;
...@@ -500,9 +501,8 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state) ...@@ -500,9 +501,8 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
"Method Reference in a Package, Op=%p\n", "Method Reference in a Package, Op=%p\n",
op)); op));
op->common.node = op->common.node = (struct acpi_namespace_node *)
(struct acpi_namespace_node *)op->asl.value. op->asl.value.arg->asl.node;
arg->asl.node;
acpi_ut_add_reference(op->asl.value.arg->asl. acpi_ut_add_reference(op->asl.value.arg->asl.
node->object); node->object);
return_ACPI_STATUS(AE_OK); return_ACPI_STATUS(AE_OK);
...@@ -584,8 +584,8 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state) ...@@ -584,8 +584,8 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
* Put the Node on the object stack (Contains the ACPI Name * Put the Node on the object stack (Contains the ACPI Name
* of this object) * of this object)
*/ */
walk_state->operands[0] = walk_state->operands[0] = (void *)
(void *)op->common.parent->common.node; op->common.parent->common.node;
walk_state->num_operands = 1; walk_state->num_operands = 1;
status = acpi_ds_create_node(walk_state, status = acpi_ds_create_node(walk_state,
...@@ -690,7 +690,8 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state) ...@@ -690,7 +690,8 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
default: default:
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
"Unimplemented opcode, class=0x%X type=0x%X Opcode=0x%X Op=%p", "Unimplemented opcode, class=0x%X "
"type=0x%X Opcode=0x%X Op=%p",
op_class, op_type, op->common.aml_opcode, op_class, op_type, op->common.aml_opcode,
op)); op));
......
...@@ -476,13 +476,9 @@ acpi_status acpi_ds_load1_end_op(struct acpi_walk_state *walk_state) ...@@ -476,13 +476,9 @@ acpi_status acpi_ds_load1_end_op(struct acpi_walk_state *walk_state)
status = status =
acpi_ex_create_region(op->named.data, acpi_ex_create_region(op->named.data,
op->named.length, op->named.length,
(acpi_adr_space_type) ((op-> (acpi_adr_space_type)
common. ((op->common.value.arg)->
value. common.value.integer),
arg)->
common.
value.
integer),
walk_state); walk_state);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
......
...@@ -598,11 +598,10 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state) ...@@ -598,11 +598,10 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
* Executing a method: initialize the region and unlock * Executing a method: initialize the region and unlock
* the interpreter * the interpreter
*/ */
status = status = acpi_ex_create_region(op->named.data,
acpi_ex_create_region(op->named.data, op->named.length,
op->named.length, region_space,
region_space, walk_state);
walk_state);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
...@@ -664,6 +663,7 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state) ...@@ -664,6 +663,7 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
length, length,
walk_state); walk_state);
} }
walk_state->operands[0] = NULL; walk_state->operands[0] = NULL;
walk_state->num_operands = 0; walk_state->num_operands = 0;
......
...@@ -77,6 +77,7 @@ void acpi_ds_scope_stack_clear(struct acpi_walk_state *walk_state) ...@@ -77,6 +77,7 @@ void acpi_ds_scope_stack_clear(struct acpi_walk_state *walk_state)
"Popped object type (%s)\n", "Popped object type (%s)\n",
acpi_ut_get_type_name(scope_info->common. acpi_ut_get_type_name(scope_info->common.
value))); value)));
acpi_ut_delete_generic_state(scope_info); acpi_ut_delete_generic_state(scope_info);
} }
} }
......
...@@ -92,8 +92,8 @@ acpi_ev_update_gpe_enable_mask(struct acpi_gpe_event_info *gpe_event_info) ...@@ -92,8 +92,8 @@ acpi_ev_update_gpe_enable_mask(struct acpi_gpe_event_info *gpe_event_info)
ACPI_SET_BIT(gpe_register_info->enable_for_run, ACPI_SET_BIT(gpe_register_info->enable_for_run,
(u8)register_bit); (u8)register_bit);
} }
gpe_register_info->enable_mask = gpe_register_info->enable_for_run;
gpe_register_info->enable_mask = gpe_register_info->enable_for_run;
return_ACPI_STATUS(AE_OK); return_ACPI_STATUS(AE_OK);
} }
......
...@@ -167,6 +167,7 @@ acpi_status acpi_ev_delete_gpe_block(struct acpi_gpe_block_info *gpe_block) ...@@ -167,6 +167,7 @@ acpi_status acpi_ev_delete_gpe_block(struct acpi_gpe_block_info *gpe_block)
if (gpe_block->next) { if (gpe_block->next) {
gpe_block->next->previous = gpe_block->previous; gpe_block->next->previous = gpe_block->previous;
} }
acpi_os_release_lock(acpi_gbl_gpe_lock, flags); acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
} }
......
...@@ -346,6 +346,7 @@ acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info, ...@@ -346,6 +346,7 @@ acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
ACPI_FREE(notify); ACPI_FREE(notify);
notify = next; notify = next;
} }
gpe_event_info->dispatch.notify_list = NULL; gpe_event_info->dispatch.notify_list = NULL;
gpe_event_info->flags &= gpe_event_info->flags &=
~ACPI_GPE_DISPATCH_MASK; ~ACPI_GPE_DISPATCH_MASK;
......
...@@ -68,6 +68,7 @@ static void ACPI_SYSTEM_XFACE acpi_ev_notify_dispatch(void *context); ...@@ -68,6 +68,7 @@ static void ACPI_SYSTEM_XFACE acpi_ev_notify_dispatch(void *context);
u8 acpi_ev_is_notify_object(struct acpi_namespace_node *node) u8 acpi_ev_is_notify_object(struct acpi_namespace_node *node)
{ {
switch (node->type) { switch (node->type) {
case ACPI_TYPE_DEVICE: case ACPI_TYPE_DEVICE:
case ACPI_TYPE_PROCESSOR: case ACPI_TYPE_PROCESSOR:
...@@ -170,8 +171,8 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node, ...@@ -170,8 +171,8 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node,
acpi_ut_get_notify_name(notify_value, ACPI_TYPE_ANY), acpi_ut_get_notify_name(notify_value, ACPI_TYPE_ANY),
node)); node));
status = acpi_os_execute(OSL_NOTIFY_HANDLER, acpi_ev_notify_dispatch, status = acpi_os_execute(OSL_NOTIFY_HANDLER,
info); acpi_ev_notify_dispatch, info);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
acpi_ut_delete_generic_state(info); acpi_ut_delete_generic_state(info);
} }
......
...@@ -879,9 +879,8 @@ acpi_install_gpe_handler(acpi_handle gpe_device, ...@@ -879,9 +879,8 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
ACPI_FUNCTION_TRACE(acpi_install_gpe_handler); ACPI_FUNCTION_TRACE(acpi_install_gpe_handler);
status = status = acpi_ev_install_gpe_handler(gpe_device, gpe_number, type,
acpi_ev_install_gpe_handler(gpe_device, gpe_number, type, FALSE, FALSE, address, context);
address, context);
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
...@@ -914,8 +913,8 @@ acpi_install_gpe_raw_handler(acpi_handle gpe_device, ...@@ -914,8 +913,8 @@ acpi_install_gpe_raw_handler(acpi_handle gpe_device,
ACPI_FUNCTION_TRACE(acpi_install_gpe_raw_handler); ACPI_FUNCTION_TRACE(acpi_install_gpe_raw_handler);
status = acpi_ev_install_gpe_handler(gpe_device, gpe_number, type, TRUE, status = acpi_ev_install_gpe_handler(gpe_device, gpe_number, type,
address, context); TRUE, address, context);
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
......
...@@ -135,6 +135,7 @@ acpi_install_address_space_handler(acpi_handle device, ...@@ -135,6 +135,7 @@ acpi_install_address_space_handler(acpi_handle device,
if (!acpi_gbl_reg_methods_executed) { if (!acpi_gbl_reg_methods_executed) {
/* We will defer execution of the _REG methods for this space */ /* We will defer execution of the _REG methods for this space */
goto unlock_and_exit; goto unlock_and_exit;
} }
break; break;
......
...@@ -358,8 +358,8 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc, ...@@ -358,8 +358,8 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
} }
/* /*
* If the Region Address and Length have not been previously evaluated, * If the Region Address and Length have not been previously
* evaluate them now and save the results. * evaluated, evaluate them now and save the results.
*/ */
if (!(obj_desc->common.flags & AOPOBJ_DATA_VALID)) { if (!(obj_desc->common.flags & AOPOBJ_DATA_VALID)) {
status = acpi_ds_get_region_arguments(obj_desc); status = acpi_ds_get_region_arguments(obj_desc);
...@@ -454,8 +454,8 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc, ...@@ -454,8 +454,8 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
} }
/* /*
* Copy the table from the buffer because the buffer could be modified * Copy the table from the buffer because the buffer could be
* or even deleted in the future * modified or even deleted in the future
*/ */
table = ACPI_ALLOCATE(length); table = ACPI_ALLOCATE(length);
if (!table) { if (!table) {
......
...@@ -227,8 +227,8 @@ acpi_ex_convert_to_buffer(union acpi_operand_object *obj_desc, ...@@ -227,8 +227,8 @@ acpi_ex_convert_to_buffer(union acpi_operand_object *obj_desc,
/* Copy the integer to the buffer, LSB first */ /* Copy the integer to the buffer, LSB first */
new_buf = return_desc->buffer.pointer; new_buf = return_desc->buffer.pointer;
memcpy(new_buf, memcpy(new_buf, &obj_desc->integer.value,
&obj_desc->integer.value, acpi_gbl_integer_byte_width); acpi_gbl_integer_byte_width);
break; break;
case ACPI_TYPE_STRING: case ACPI_TYPE_STRING:
...@@ -354,9 +354,8 @@ acpi_ex_convert_to_ascii(u64 integer, u16 base, u8 *string, u8 data_width) ...@@ -354,9 +354,8 @@ acpi_ex_convert_to_ascii(u64 integer, u16 base, u8 *string, u8 data_width)
/* Get one hex digit, most significant digits first */ /* Get one hex digit, most significant digits first */
string[k] = string[k] = (u8)
(u8)acpi_ut_hex_to_ascii_char(integer, acpi_ut_hex_to_ascii_char(integer, ACPI_MUL_4(j));
ACPI_MUL_4(j));
k++; k++;
} }
break; break;
......
...@@ -189,9 +189,9 @@ acpi_status acpi_ex_create_event(struct acpi_walk_state *walk_state) ...@@ -189,9 +189,9 @@ acpi_status acpi_ex_create_event(struct acpi_walk_state *walk_state)
/* Attach object to the Node */ /* Attach object to the Node */
status = status = acpi_ns_attach_object((struct acpi_namespace_node *)
acpi_ns_attach_object((struct acpi_namespace_node *)walk_state-> walk_state->operands[0], obj_desc,
operands[0], obj_desc, ACPI_TYPE_EVENT); ACPI_TYPE_EVENT);
cleanup: cleanup:
/* /*
...@@ -493,8 +493,8 @@ acpi_ex_create_method(u8 * aml_start, ...@@ -493,8 +493,8 @@ acpi_ex_create_method(u8 * aml_start,
* flag, and sync_level for efficiency. * flag, and sync_level for efficiency.
*/ */
method_flags = (u8)operand[1]->integer.value; method_flags = (u8)operand[1]->integer.value;
obj_desc->method.param_count = obj_desc->method.param_count = (u8)
(u8)(method_flags & AML_METHOD_ARG_COUNT); (method_flags & AML_METHOD_ARG_COUNT);
/* /*
* Get the sync_level. If method is serialized, a mutex will be * Get the sync_level. If method is serialized, a mutex will be
......
...@@ -491,6 +491,7 @@ acpi_ex_start_trace_method(struct acpi_namespace_node *method_node, ...@@ -491,6 +491,7 @@ acpi_ex_start_trace_method(struct acpi_namespace_node *method_node,
acpi_dbg_layer = acpi_gbl_trace_dbg_layer; acpi_dbg_layer = acpi_gbl_trace_dbg_layer;
} }
} }
(void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
exit: exit:
......
...@@ -167,10 +167,11 @@ acpi_ex_read_data_from_field(struct acpi_walk_state * walk_state, ...@@ -167,10 +167,11 @@ acpi_ex_read_data_from_field(struct acpi_walk_state * walk_state,
|| obj_desc->field.region_obj->region.space_id == || obj_desc->field.region_obj->region.space_id ==
ACPI_ADR_SPACE_IPMI)) { ACPI_ADR_SPACE_IPMI)) {
/* /*
* This is an SMBus, GSBus or IPMI read. We must create a buffer to hold * This is an SMBus, GSBus or IPMI read. We must create a buffer to
* the data and then directly access the region handler. * hold the data and then directly access the region handler.
* *
* Note: SMBus and GSBus protocol value is passed in upper 16-bits of Function * Note: SMBus and GSBus protocol value is passed in upper 16-bits
* of Function
*/ */
if (obj_desc->field.region_obj->region.space_id == if (obj_desc->field.region_obj->region.space_id ==
ACPI_ADR_SPACE_SMBUS) { ACPI_ADR_SPACE_SMBUS) {
...@@ -180,17 +181,17 @@ acpi_ex_read_data_from_field(struct acpi_walk_state * walk_state, ...@@ -180,17 +181,17 @@ acpi_ex_read_data_from_field(struct acpi_walk_state * walk_state,
} else if (obj_desc->field.region_obj->region.space_id == } else if (obj_desc->field.region_obj->region.space_id ==
ACPI_ADR_SPACE_GSBUS) { ACPI_ADR_SPACE_GSBUS) {
accessor_type = obj_desc->field.attribute; accessor_type = obj_desc->field.attribute;
length = acpi_ex_get_serial_access_length(accessor_type, length =
obj_desc-> acpi_ex_get_serial_access_length(accessor_type,
field. obj_desc->field.
access_length); access_length);
/* /*
* Add additional 2 bytes for the generic_serial_bus data buffer: * Add additional 2 bytes for the generic_serial_bus data buffer:
* *
* Status; (Byte 0 of the data buffer) * Status; (Byte 0 of the data buffer)
* Length; (Byte 1 of the data buffer) * Length; (Byte 1 of the data buffer)
* Data[x-1]; (Bytes 2-x of the arbitrary length data buffer) * Data[x-1]: (Bytes 2-x of the arbitrary length data buffer)
*/ */
length += 2; length += 2;
function = ACPI_READ | (accessor_type << 16); function = ACPI_READ | (accessor_type << 16);
...@@ -216,6 +217,7 @@ acpi_ex_read_data_from_field(struct acpi_walk_state * walk_state, ...@@ -216,6 +217,7 @@ acpi_ex_read_data_from_field(struct acpi_walk_state * walk_state,
buffer_desc-> buffer_desc->
buffer.pointer), buffer.pointer),
function); function);
acpi_ex_release_global_lock(obj_desc->common_field.field_flags); acpi_ex_release_global_lock(obj_desc->common_field.field_flags);
goto exit; goto exit;
} }
...@@ -232,6 +234,7 @@ acpi_ex_read_data_from_field(struct acpi_walk_state * walk_state, ...@@ -232,6 +234,7 @@ acpi_ex_read_data_from_field(struct acpi_walk_state * walk_state,
*/ */
length = length =
(acpi_size) ACPI_ROUND_BITS_UP_TO_BYTES(obj_desc->field.bit_length); (acpi_size) ACPI_ROUND_BITS_UP_TO_BYTES(obj_desc->field.bit_length);
if (length > acpi_gbl_integer_byte_width) { if (length > acpi_gbl_integer_byte_width) {
/* Field is too large for an Integer, create a Buffer instead */ /* Field is too large for an Integer, create a Buffer instead */
...@@ -273,8 +276,10 @@ acpi_ex_read_data_from_field(struct acpi_walk_state * walk_state, ...@@ -273,8 +276,10 @@ acpi_ex_read_data_from_field(struct acpi_walk_state * walk_state,
/* Perform the write */ /* Perform the write */
status = acpi_ex_access_region(obj_desc, 0, status =
(u64 *)buffer, ACPI_READ); acpi_ex_access_region(obj_desc, 0, (u64 *)buffer,
ACPI_READ);
acpi_ex_release_global_lock(obj_desc->common_field.field_flags); acpi_ex_release_global_lock(obj_desc->common_field.field_flags);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
acpi_ut_remove_reference(buffer_desc); acpi_ut_remove_reference(buffer_desc);
...@@ -366,19 +371,22 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc, ...@@ -366,19 +371,22 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
|| obj_desc->field.region_obj->region.space_id == || obj_desc->field.region_obj->region.space_id ==
ACPI_ADR_SPACE_IPMI)) { ACPI_ADR_SPACE_IPMI)) {
/* /*
* This is an SMBus, GSBus or IPMI write. We will bypass the entire field * This is an SMBus, GSBus or IPMI write. We will bypass the entire
* mechanism and handoff the buffer directly to the handler. For * field mechanism and handoff the buffer directly to the handler.
* these address spaces, the buffer is bi-directional; on a write, * For these address spaces, the buffer is bi-directional; on a
* return data is returned in the same buffer. * write, return data is returned in the same buffer.
* *
* Source must be a buffer of sufficient size: * Source must be a buffer of sufficient size:
* ACPI_SMBUS_BUFFER_SIZE, ACPI_GSBUS_BUFFER_SIZE, or ACPI_IPMI_BUFFER_SIZE. * ACPI_SMBUS_BUFFER_SIZE, ACPI_GSBUS_BUFFER_SIZE, or
* ACPI_IPMI_BUFFER_SIZE.
* *
* Note: SMBus and GSBus protocol type is passed in upper 16-bits of Function * Note: SMBus and GSBus protocol type is passed in upper 16-bits
* of Function
*/ */
if (source_desc->common.type != ACPI_TYPE_BUFFER) { if (source_desc->common.type != ACPI_TYPE_BUFFER) {
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
"SMBus/IPMI/GenericSerialBus write requires Buffer, found type %s", "SMBus/IPMI/GenericSerialBus write requires "
"Buffer, found type %s",
acpi_ut_get_object_type_name(source_desc))); acpi_ut_get_object_type_name(source_desc)));
return_ACPI_STATUS(AE_AML_OPERAND_TYPE); return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
...@@ -392,17 +400,17 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc, ...@@ -392,17 +400,17 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
} else if (obj_desc->field.region_obj->region.space_id == } else if (obj_desc->field.region_obj->region.space_id ==
ACPI_ADR_SPACE_GSBUS) { ACPI_ADR_SPACE_GSBUS) {
accessor_type = obj_desc->field.attribute; accessor_type = obj_desc->field.attribute;
length = acpi_ex_get_serial_access_length(accessor_type, length =
obj_desc-> acpi_ex_get_serial_access_length(accessor_type,
field. obj_desc->field.
access_length); access_length);
/* /*
* Add additional 2 bytes for the generic_serial_bus data buffer: * Add additional 2 bytes for the generic_serial_bus data buffer:
* *
* Status; (Byte 0 of the data buffer) * Status; (Byte 0 of the data buffer)
* Length; (Byte 1 of the data buffer) * Length; (Byte 1 of the data buffer)
* Data[x-1]; (Bytes 2-x of the arbitrary length data buffer) * Data[x-1]: (Bytes 2-x of the arbitrary length data buffer)
*/ */
length += 2; length += 2;
function = ACPI_WRITE | (accessor_type << 16); function = ACPI_WRITE | (accessor_type << 16);
...@@ -414,7 +422,8 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc, ...@@ -414,7 +422,8 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
if (source_desc->buffer.length < length) { if (source_desc->buffer.length < length) {
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
"SMBus/IPMI/GenericSerialBus write requires Buffer of length %u, found length %u", "SMBus/IPMI/GenericSerialBus write requires "
"Buffer of length %u, found length %u",
length, source_desc->buffer.length)); length, source_desc->buffer.length));
return_ACPI_STATUS(AE_AML_BUFFER_LIMIT); return_ACPI_STATUS(AE_AML_BUFFER_LIMIT);
...@@ -438,8 +447,8 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc, ...@@ -438,8 +447,8 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
* Perform the write (returns status and perhaps data in the * Perform the write (returns status and perhaps data in the
* same buffer) * same buffer)
*/ */
status = acpi_ex_access_region(obj_desc, 0, status =
(u64 *)buffer, function); acpi_ex_access_region(obj_desc, 0, (u64 *)buffer, function);
acpi_ex_release_global_lock(obj_desc->common_field.field_flags); acpi_ex_release_global_lock(obj_desc->common_field.field_flags);
*result_desc = buffer_desc; *result_desc = buffer_desc;
...@@ -460,7 +469,7 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc, ...@@ -460,7 +469,7 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
} }
ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
"GPIO FieldWrite [FROM]: (%s:%X), Val %.8X [TO]: Pin %u Bits %u\n", "GPIO FieldWrite [FROM]: (%s:%X), Val %.8X [TO]: Pin %u Bits %u\n",
acpi_ut_get_type_name(source_desc->common. acpi_ut_get_type_name(source_desc->common.
type), type),
source_desc->common.type, source_desc->common.type,
...@@ -476,8 +485,9 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc, ...@@ -476,8 +485,9 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
/* Perform the write */ /* Perform the write */
status = acpi_ex_access_region(obj_desc, 0, status =
(u64 *)buffer, ACPI_WRITE); acpi_ex_access_region(obj_desc, 0, (u64 *)buffer,
ACPI_WRITE);
acpi_ex_release_global_lock(obj_desc->common_field.field_flags); acpi_ex_release_global_lock(obj_desc->common_field.field_flags);
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
......
...@@ -180,7 +180,8 @@ acpi_ex_setup_region(union acpi_operand_object *obj_desc, ...@@ -180,7 +180,8 @@ acpi_ex_setup_region(union acpi_operand_object *obj_desc,
* byte, and a field with Dword access specified. * byte, and a field with Dword access specified.
*/ */
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
"Field [%4.4s] access width (%u bytes) too large for region [%4.4s] (length %u)", "Field [%4.4s] access width (%u bytes) "
"too large for region [%4.4s] (length %u)",
acpi_ut_get_node_name(obj_desc-> acpi_ut_get_node_name(obj_desc->
common_field.node), common_field.node),
obj_desc->common_field.access_byte_width, obj_desc->common_field.access_byte_width,
...@@ -194,7 +195,8 @@ acpi_ex_setup_region(union acpi_operand_object *obj_desc, ...@@ -194,7 +195,8 @@ acpi_ex_setup_region(union acpi_operand_object *obj_desc,
* exceeds region length, indicate an error * exceeds region length, indicate an error
*/ */
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
"Field [%4.4s] Base+Offset+Width %u+%u+%u is beyond end of region [%4.4s] (length %u)", "Field [%4.4s] Base+Offset+Width %u+%u+%u "
"is beyond end of region [%4.4s] (length %u)",
acpi_ut_get_node_name(obj_desc->common_field.node), acpi_ut_get_node_name(obj_desc->common_field.node),
obj_desc->common_field.base_byte_offset, obj_desc->common_field.base_byte_offset,
field_datum_byte_offset, field_datum_byte_offset,
...@@ -638,15 +640,15 @@ acpi_ex_write_with_update_rule(union acpi_operand_object *obj_desc, ...@@ -638,15 +640,15 @@ acpi_ex_write_with_update_rule(union acpi_operand_object *obj_desc,
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
"Unknown UpdateRule value: 0x%X", "Unknown UpdateRule value: 0x%X",
(obj_desc->common_field. (obj_desc->common_field.field_flags &
field_flags &
AML_FIELD_UPDATE_RULE_MASK))); AML_FIELD_UPDATE_RULE_MASK)));
return_ACPI_STATUS(AE_AML_OPERAND_VALUE); return_ACPI_STATUS(AE_AML_OPERAND_VALUE);
} }
} }
ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
"Mask %8.8X%8.8X, DatumOffset %X, Width %X, Value %8.8X%8.8X, MergedValue %8.8X%8.8X\n", "Mask %8.8X%8.8X, DatumOffset %X, Width %X, "
"Value %8.8X%8.8X, MergedValue %8.8X%8.8X\n",
ACPI_FORMAT_UINT64(mask), ACPI_FORMAT_UINT64(mask),
field_datum_byte_offset, field_datum_byte_offset,
obj_desc->common_field.access_byte_width, obj_desc->common_field.access_byte_width,
...@@ -655,8 +657,9 @@ acpi_ex_write_with_update_rule(union acpi_operand_object *obj_desc, ...@@ -655,8 +657,9 @@ acpi_ex_write_with_update_rule(union acpi_operand_object *obj_desc,
/* Write the merged value */ /* Write the merged value */
status = acpi_ex_field_datum_io(obj_desc, field_datum_byte_offset, status =
&merged_value, ACPI_WRITE); acpi_ex_field_datum_io(obj_desc, field_datum_byte_offset,
&merged_value, ACPI_WRITE);
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
...@@ -764,8 +767,9 @@ acpi_ex_extract_from_field(union acpi_operand_object *obj_desc, ...@@ -764,8 +767,9 @@ acpi_ex_extract_from_field(union acpi_operand_object *obj_desc,
/* Get next input datum from the field */ /* Get next input datum from the field */
field_offset += obj_desc->common_field.access_byte_width; field_offset += obj_desc->common_field.access_byte_width;
status = acpi_ex_field_datum_io(obj_desc, field_offset, status =
&raw_datum, ACPI_READ); acpi_ex_field_datum_io(obj_desc, field_offset, &raw_datum,
ACPI_READ);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
...@@ -858,6 +862,7 @@ acpi_ex_insert_into_field(union acpi_operand_object *obj_desc, ...@@ -858,6 +862,7 @@ acpi_ex_insert_into_field(union acpi_operand_object *obj_desc,
new_buffer = NULL; new_buffer = NULL;
required_length = required_length =
ACPI_ROUND_BITS_UP_TO_BYTES(obj_desc->common_field.bit_length); ACPI_ROUND_BITS_UP_TO_BYTES(obj_desc->common_field.bit_length);
/* /*
* We must have a buffer that is at least as long as the field * We must have a buffer that is at least as long as the field
* we are writing to. This is because individual fields are * we are writing to. This is because individual fields are
...@@ -932,9 +937,9 @@ acpi_ex_insert_into_field(union acpi_operand_object *obj_desc, ...@@ -932,9 +937,9 @@ acpi_ex_insert_into_field(union acpi_operand_object *obj_desc,
/* Write merged datum to the target field */ /* Write merged datum to the target field */
merged_datum &= mask; merged_datum &= mask;
status = acpi_ex_write_with_update_rule(obj_desc, mask, status =
merged_datum, acpi_ex_write_with_update_rule(obj_desc, mask, merged_datum,
field_offset); field_offset);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
goto exit; goto exit;
} }
...@@ -990,9 +995,9 @@ acpi_ex_insert_into_field(union acpi_operand_object *obj_desc, ...@@ -990,9 +995,9 @@ acpi_ex_insert_into_field(union acpi_operand_object *obj_desc,
/* Write the last datum to the field */ /* Write the last datum to the field */
merged_datum &= mask; merged_datum &= mask;
status = acpi_ex_write_with_update_rule(obj_desc, status =
mask, merged_datum, acpi_ex_write_with_update_rule(obj_desc, mask, merged_datum,
field_offset); field_offset);
exit: exit:
/* Free temporary buffer if we used one */ /* Free temporary buffer if we used one */
......
...@@ -267,8 +267,9 @@ acpi_ex_do_concatenate(union acpi_operand_object *operand0, ...@@ -267,8 +267,9 @@ acpi_ex_do_concatenate(union acpi_operand_object *operand0,
case ACPI_TYPE_STRING: case ACPI_TYPE_STRING:
status = acpi_ex_convert_to_string(operand1, &local_operand1, status =
ACPI_IMPLICIT_CONVERT_HEX); acpi_ex_convert_to_string(operand1, &local_operand1,
ACPI_IMPLICIT_CONVERT_HEX);
break; break;
case ACPI_TYPE_BUFFER: case ACPI_TYPE_BUFFER:
...@@ -591,8 +592,9 @@ acpi_ex_do_logical_op(u16 opcode, ...@@ -591,8 +592,9 @@ acpi_ex_do_logical_op(u16 opcode,
case ACPI_TYPE_STRING: case ACPI_TYPE_STRING:
status = acpi_ex_convert_to_string(operand1, &local_operand1, status =
ACPI_IMPLICIT_CONVERT_HEX); acpi_ex_convert_to_string(operand1, &local_operand1,
ACPI_IMPLICIT_CONVERT_HEX);
break; break;
case ACPI_TYPE_BUFFER: case ACPI_TYPE_BUFFER:
......
...@@ -164,8 +164,8 @@ static acpi_status acpi_ex_name_segment(u8 ** in_aml_address, char *name_string) ...@@ -164,8 +164,8 @@ static acpi_status acpi_ex_name_segment(u8 ** in_aml_address, char *name_string)
ACPI_FUNCTION_TRACE(ex_name_segment); ACPI_FUNCTION_TRACE(ex_name_segment);
/* /*
* If first character is a digit, then we know that we aren't looking at a * If first character is a digit, then we know that we aren't looking
* valid name segment * at a valid name segment
*/ */
char_buf[0] = *aml_address; char_buf[0] = *aml_address;
......
...@@ -484,22 +484,26 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state) ...@@ -484,22 +484,26 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state)
case AML_TO_DECSTRING_OP: /* to_decimal_string (Data, Result) */ case AML_TO_DECSTRING_OP: /* to_decimal_string (Data, Result) */
status = acpi_ex_convert_to_string(operand[0], &return_desc, status =
ACPI_EXPLICIT_CONVERT_DECIMAL); acpi_ex_convert_to_string(operand[0], &return_desc,
ACPI_EXPLICIT_CONVERT_DECIMAL);
if (return_desc == operand[0]) { if (return_desc == operand[0]) {
/* No conversion performed, add ref to handle return value */ /* No conversion performed, add ref to handle return value */
acpi_ut_add_reference(return_desc); acpi_ut_add_reference(return_desc);
} }
break; break;
case AML_TO_HEXSTRING_OP: /* to_hex_string (Data, Result) */ case AML_TO_HEXSTRING_OP: /* to_hex_string (Data, Result) */
status = acpi_ex_convert_to_string(operand[0], &return_desc, status =
ACPI_EXPLICIT_CONVERT_HEX); acpi_ex_convert_to_string(operand[0], &return_desc,
ACPI_EXPLICIT_CONVERT_HEX);
if (return_desc == operand[0]) { if (return_desc == operand[0]) {
/* No conversion performed, add ref to handle return value */ /* No conversion performed, add ref to handle return value */
acpi_ut_add_reference(return_desc); acpi_ut_add_reference(return_desc);
} }
break; break;
...@@ -510,17 +514,20 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state) ...@@ -510,17 +514,20 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state)
if (return_desc == operand[0]) { if (return_desc == operand[0]) {
/* No conversion performed, add ref to handle return value */ /* No conversion performed, add ref to handle return value */
acpi_ut_add_reference(return_desc); acpi_ut_add_reference(return_desc);
} }
break; break;
case AML_TO_INTEGER_OP: /* to_integer (Data, Result) */ case AML_TO_INTEGER_OP: /* to_integer (Data, Result) */
status = acpi_ex_convert_to_integer(operand[0], &return_desc, status =
ACPI_ANY_BASE); acpi_ex_convert_to_integer(operand[0], &return_desc,
ACPI_ANY_BASE);
if (return_desc == operand[0]) { if (return_desc == operand[0]) {
/* No conversion performed, add ref to handle return value */ /* No conversion performed, add ref to handle return value */
acpi_ut_add_reference(return_desc); acpi_ut_add_reference(return_desc);
} }
break; break;
...@@ -713,9 +720,9 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state) ...@@ -713,9 +720,9 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
/* Get the base object */ /* Get the base object */
status = acpi_ex_resolve_multiple(walk_state, status =
operand[0], &type, acpi_ex_resolve_multiple(walk_state, operand[0], &type,
&temp_desc); &temp_desc);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
goto cleanup; goto cleanup;
} }
...@@ -759,8 +766,10 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state) ...@@ -759,8 +766,10 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
default: default:
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
"Operand must be Buffer/Integer/String/Package - found type %s", "Operand must be Buffer/Integer/String/Package"
" - found type %s",
acpi_ut_get_type_name(type))); acpi_ut_get_type_name(type)));
status = AE_AML_OPERAND_TYPE; status = AE_AML_OPERAND_TYPE;
goto cleanup; goto cleanup;
} }
...@@ -981,6 +990,7 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state) ...@@ -981,6 +990,7 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
"Unknown Index TargetType 0x%X in reference object %p", "Unknown Index TargetType 0x%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;
goto cleanup; goto cleanup;
} }
...@@ -1050,6 +1060,7 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state) ...@@ -1050,6 +1060,7 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
ACPI_ERROR((AE_INFO, "Unknown AML opcode 0x%X", ACPI_ERROR((AE_INFO, "Unknown AML opcode 0x%X",
walk_state->opcode)); walk_state->opcode));
status = AE_AML_BAD_OPCODE; status = AE_AML_BAD_OPCODE;
goto cleanup; goto cleanup;
} }
......
...@@ -199,6 +199,7 @@ acpi_status acpi_ex_opcode_2A_2T_1R(struct acpi_walk_state *walk_state) ...@@ -199,6 +199,7 @@ acpi_status acpi_ex_opcode_2A_2T_1R(struct acpi_walk_state *walk_state)
ACPI_ERROR((AE_INFO, "Unknown AML opcode 0x%X", ACPI_ERROR((AE_INFO, "Unknown AML opcode 0x%X",
walk_state->opcode)); walk_state->opcode));
status = AE_AML_BAD_OPCODE; status = AE_AML_BAD_OPCODE;
goto cleanup; goto cleanup;
} }
...@@ -299,8 +300,9 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state) ...@@ -299,8 +300,9 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state)
case AML_CONCAT_OP: /* Concatenate (Data1, Data2, Result) */ case AML_CONCAT_OP: /* Concatenate (Data1, Data2, Result) */
status = acpi_ex_do_concatenate(operand[0], operand[1], status =
&return_desc, walk_state); acpi_ex_do_concatenate(operand[0], operand[1], &return_desc,
walk_state);
break; break;
case AML_TO_STRING_OP: /* to_string (Buffer, Length, Result) (ACPI 2.0) */ case AML_TO_STRING_OP: /* to_string (Buffer, Length, Result) (ACPI 2.0) */
...@@ -345,8 +347,9 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state) ...@@ -345,8 +347,9 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state)
/* concatenate_res_template (Buffer, Buffer, Result) (ACPI 2.0) */ /* concatenate_res_template (Buffer, Buffer, Result) (ACPI 2.0) */
status = acpi_ex_concat_template(operand[0], operand[1], status =
&return_desc, walk_state); acpi_ex_concat_template(operand[0], operand[1],
&return_desc, walk_state);
break; break;
case AML_INDEX_OP: /* Index (Source Index Result) */ case AML_INDEX_OP: /* Index (Source Index Result) */
...@@ -553,6 +556,7 @@ acpi_status acpi_ex_opcode_2A_0T_1R(struct acpi_walk_state *walk_state) ...@@ -553,6 +556,7 @@ acpi_status acpi_ex_opcode_2A_0T_1R(struct acpi_walk_state *walk_state)
ACPI_ERROR((AE_INFO, "Unknown AML opcode 0x%X", ACPI_ERROR((AE_INFO, "Unknown AML opcode 0x%X",
walk_state->opcode)); walk_state->opcode));
status = AE_AML_BAD_OPCODE; status = AE_AML_BAD_OPCODE;
goto cleanup; goto cleanup;
} }
......
...@@ -95,7 +95,8 @@ acpi_status acpi_ex_opcode_3A_0T_0R(struct acpi_walk_state *walk_state) ...@@ -95,7 +95,8 @@ acpi_status acpi_ex_opcode_3A_0T_0R(struct acpi_walk_state *walk_state)
case AML_FATAL_OP: /* Fatal (fatal_type fatal_code fatal_arg) */ case AML_FATAL_OP: /* Fatal (fatal_type fatal_code fatal_arg) */
ACPI_DEBUG_PRINT((ACPI_DB_INFO, ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"FatalOp: Type %X Code %X Arg %X <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n", "FatalOp: Type %X Code %X Arg %X "
"<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n",
(u32)operand[0]->integer.value, (u32)operand[0]->integer.value,
(u32)operand[1]->integer.value, (u32)operand[1]->integer.value,
(u32)operand[2]->integer.value)); (u32)operand[2]->integer.value));
...@@ -131,6 +132,7 @@ acpi_status acpi_ex_opcode_3A_0T_0R(struct acpi_walk_state *walk_state) ...@@ -131,6 +132,7 @@ acpi_status acpi_ex_opcode_3A_0T_0R(struct acpi_walk_state *walk_state)
ACPI_ERROR((AE_INFO, "Unknown AML opcode 0x%X", ACPI_ERROR((AE_INFO, "Unknown AML opcode 0x%X",
walk_state->opcode)); walk_state->opcode));
status = AE_AML_BAD_OPCODE; status = AE_AML_BAD_OPCODE;
goto cleanup; goto cleanup;
} }
...@@ -193,7 +195,8 @@ acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state) ...@@ -193,7 +195,8 @@ acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state)
/* Truncate request if larger than the actual String/Buffer */ /* Truncate request if larger than the actual String/Buffer */
else if ((index + length) > operand[0]->string.length) { else if ((index + length) > operand[0]->string.length) {
length = (acpi_size) operand[0]->string.length - length =
(acpi_size) operand[0]->string.length -
(acpi_size) index; (acpi_size) index;
} }
...@@ -237,8 +240,8 @@ acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state) ...@@ -237,8 +240,8 @@ acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state)
/* We have a buffer, copy the portion requested */ /* We have a buffer, copy the portion requested */
memcpy(buffer, operand[0]->string.pointer + index, memcpy(buffer,
length); operand[0]->string.pointer + index, length);
} }
/* Set the length of the new String/Buffer */ /* Set the length of the new String/Buffer */
...@@ -255,6 +258,7 @@ acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state) ...@@ -255,6 +258,7 @@ acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state)
ACPI_ERROR((AE_INFO, "Unknown AML opcode 0x%X", ACPI_ERROR((AE_INFO, "Unknown AML opcode 0x%X",
walk_state->opcode)); walk_state->opcode));
status = AE_AML_BAD_OPCODE; status = AE_AML_BAD_OPCODE;
goto cleanup; goto cleanup;
} }
...@@ -270,12 +274,11 @@ acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state) ...@@ -270,12 +274,11 @@ acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state)
if (ACPI_FAILURE(status) || walk_state->result_obj) { if (ACPI_FAILURE(status) || walk_state->result_obj) {
acpi_ut_remove_reference(return_desc); acpi_ut_remove_reference(return_desc);
walk_state->result_obj = NULL; walk_state->result_obj = NULL;
} } else {
/* Set the return object and exit */
/* Set the return object and exit */
else {
walk_state->result_obj = return_desc; walk_state->result_obj = return_desc;
} }
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
...@@ -310,6 +310,7 @@ acpi_status acpi_ex_opcode_6A_0T_1R(struct acpi_walk_state * walk_state) ...@@ -310,6 +310,7 @@ acpi_status acpi_ex_opcode_6A_0T_1R(struct acpi_walk_state * walk_state)
ACPI_ERROR((AE_INFO, "Unknown AML opcode 0x%X", ACPI_ERROR((AE_INFO, "Unknown AML opcode 0x%X",
walk_state->opcode)); walk_state->opcode));
status = AE_AML_BAD_OPCODE; status = AE_AML_BAD_OPCODE;
goto cleanup; goto cleanup;
} }
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: exprep - ACPI AML (p-code) execution - field prep utilities * Module Name: exprep - ACPI AML field prep utilities
* *
*****************************************************************************/ *****************************************************************************/
...@@ -103,8 +103,10 @@ acpi_ex_generate_access(u32 field_bit_offset, ...@@ -103,8 +103,10 @@ acpi_ex_generate_access(u32 field_bit_offset,
/* Round Field start offset and length to "minimal" byte boundaries */ /* Round Field start offset and length to "minimal" byte boundaries */
field_byte_offset = ACPI_DIV_8(ACPI_ROUND_DOWN(field_bit_offset, 8)); field_byte_offset = ACPI_DIV_8(ACPI_ROUND_DOWN(field_bit_offset, 8));
field_byte_end_offset = ACPI_DIV_8(ACPI_ROUND_UP(field_bit_length +
field_bit_offset, 8)); field_byte_end_offset =
ACPI_DIV_8(ACPI_ROUND_UP(field_bit_length + field_bit_offset, 8));
field_byte_length = field_byte_end_offset - field_byte_offset; field_byte_length = field_byte_end_offset - field_byte_offset;
ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
...@@ -159,7 +161,8 @@ acpi_ex_generate_access(u32 field_bit_offset, ...@@ -159,7 +161,8 @@ acpi_ex_generate_access(u32 field_bit_offset,
if (accesses <= 1) { if (accesses <= 1) {
ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
"Entire field can be accessed with one operation of size %u\n", "Entire field can be accessed "
"with one operation of size %u\n",
access_byte_width)); access_byte_width));
return_VALUE(access_byte_width); return_VALUE(access_byte_width);
} }
...@@ -202,6 +205,7 @@ acpi_ex_generate_access(u32 field_bit_offset, ...@@ -202,6 +205,7 @@ acpi_ex_generate_access(u32 field_bit_offset,
*/ */
ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
"Cannot access field in one operation, using width 8\n")); "Cannot access field in one operation, using width 8\n"));
return_VALUE(8); return_VALUE(8);
} }
#endif /* ACPI_UNDER_DEVELOPMENT */ #endif /* ACPI_UNDER_DEVELOPMENT */
...@@ -281,6 +285,7 @@ acpi_ex_decode_field_access(union acpi_operand_object *obj_desc, ...@@ -281,6 +285,7 @@ acpi_ex_decode_field_access(union acpi_operand_object *obj_desc,
/* Invalid field access type */ /* Invalid field access type */
ACPI_ERROR((AE_INFO, "Unknown field access type 0x%X", access)); ACPI_ERROR((AE_INFO, "Unknown field access type 0x%X", access));
return_UINT32(0); return_UINT32(0);
} }
...@@ -354,8 +359,8 @@ acpi_ex_prep_common_field_object(union acpi_operand_object *obj_desc, ...@@ -354,8 +359,8 @@ acpi_ex_prep_common_field_object(union acpi_operand_object *obj_desc,
* For all other access types (Byte, Word, Dword, Qword), the Bitwidth is * For all other access types (Byte, Word, Dword, Qword), the Bitwidth is
* the same (equivalent) as the byte_alignment. * the same (equivalent) as the byte_alignment.
*/ */
access_bit_width = acpi_ex_decode_field_access(obj_desc, field_flags, access_bit_width =
&byte_alignment); acpi_ex_decode_field_access(obj_desc, field_flags, &byte_alignment);
if (!access_bit_width) { if (!access_bit_width) {
return_ACPI_STATUS(AE_AML_OPERAND_VALUE); return_ACPI_STATUS(AE_AML_OPERAND_VALUE);
} }
...@@ -595,7 +600,8 @@ acpi_status acpi_ex_prep_field_value(struct acpi_create_field_info *info) ...@@ -595,7 +600,8 @@ acpi_status acpi_ex_prep_field_value(struct acpi_create_field_info *info)
access_byte_width); access_byte_width);
ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
"IndexField: BitOff %X, Off %X, Value %X, Gran %X, Index %p, Data %p\n", "IndexField: BitOff %X, Off %X, Value %X, "
"Gran %X, Index %p, Data %p\n",
obj_desc->index_field.start_field_bit_offset, obj_desc->index_field.start_field_bit_offset,
obj_desc->index_field.base_byte_offset, obj_desc->index_field.base_byte_offset,
obj_desc->index_field.value, obj_desc->index_field.value,
...@@ -615,8 +621,9 @@ acpi_status acpi_ex_prep_field_value(struct acpi_create_field_info *info) ...@@ -615,8 +621,9 @@ acpi_status acpi_ex_prep_field_value(struct acpi_create_field_info *info)
* Store the constructed descriptor (obj_desc) into the parent Node, * Store the constructed descriptor (obj_desc) into the parent Node,
* preserving the current type of that named_obj. * preserving the current type of that named_obj.
*/ */
status = acpi_ns_attach_object(info->field_node, obj_desc, status =
acpi_ns_get_type(info->field_node)); acpi_ns_attach_object(info->field_node, obj_desc,
acpi_ns_get_type(info->field_node));
ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
"Set NamedObj %p [%4.4s], ObjDesc %p\n", "Set NamedObj %p [%4.4s], ObjDesc %p\n",
......
...@@ -392,7 +392,8 @@ acpi_ex_pci_config_space_handler(u32 function, ...@@ -392,7 +392,8 @@ acpi_ex_pci_config_space_handler(u32 function,
pci_register = (u16) (u32) address; pci_register = (u16) (u32) address;
ACPI_DEBUG_PRINT((ACPI_DB_INFO, ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Pci-Config %u (%u) Seg(%04x) Bus(%04x) Dev(%04x) Func(%04x) Reg(%04x)\n", "Pci-Config %u (%u) Seg(%04x) Bus(%04x) "
"Dev(%04x) Func(%04x) Reg(%04x)\n",
function, bit_width, pci_id->segment, pci_id->bus, function, bit_width, pci_id->segment, pci_id->bus,
pci_id->device, pci_id->function, pci_register)); pci_id->device, pci_id->function, pci_register));
...@@ -400,14 +401,16 @@ acpi_ex_pci_config_space_handler(u32 function, ...@@ -400,14 +401,16 @@ acpi_ex_pci_config_space_handler(u32 function,
case ACPI_READ: case ACPI_READ:
*value = 0; *value = 0;
status = acpi_os_read_pci_configuration(pci_id, pci_register, status =
value, bit_width); acpi_os_read_pci_configuration(pci_id, pci_register, value,
bit_width);
break; break;
case ACPI_WRITE: case ACPI_WRITE:
status = acpi_os_write_pci_configuration(pci_id, pci_register, status =
*value, bit_width); acpi_os_write_pci_configuration(pci_id, pci_register,
*value, bit_width);
break; break;
default: default:
......
...@@ -112,7 +112,7 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr, ...@@ -112,7 +112,7 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr,
/* /*
* Several object types require no further processing: * Several object types require no further processing:
* 1) Device/Thermal objects don't have a "real" subobject, return the Node * 1) Device/Thermal objects don't have a "real" subobject, return Node
* 2) Method locals and arguments have a pseudo-Node * 2) Method locals and arguments have a pseudo-Node
* 3) 10/2007: Added method type to assist with Package construction. * 3) 10/2007: Added method type to assist with Package construction.
*/ */
......
...@@ -217,7 +217,8 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr, ...@@ -217,7 +217,8 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr,
* the package, can't dereference it * the package, can't dereference it
*/ */
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
"Attempt to dereference an Index to NULL package element Idx=%p", "Attempt to dereference an Index to "
"NULL package element Idx=%p",
stack_desc)); stack_desc));
status = AE_AML_UNINITIALIZED_ELEMENT; status = AE_AML_UNINITIALIZED_ELEMENT;
} }
...@@ -361,10 +362,9 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state, ...@@ -361,10 +362,9 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
if (type == ACPI_TYPE_LOCAL_ALIAS) { if (type == ACPI_TYPE_LOCAL_ALIAS) {
type = ((struct acpi_namespace_node *)obj_desc)->type; type = ((struct acpi_namespace_node *)obj_desc)->type;
obj_desc = obj_desc = acpi_ns_get_attached_object((struct
acpi_ns_get_attached_object((struct acpi_namespace_node
acpi_namespace_node *) *)obj_desc);
obj_desc);
} }
if (!obj_desc) { if (!obj_desc) {
......
...@@ -90,8 +90,8 @@ acpi_ex_check_object_type(acpi_object_type type_needed, ...@@ -90,8 +90,8 @@ acpi_ex_check_object_type(acpi_object_type type_needed,
* specification, a store to a constant is a noop.) * specification, a store to a constant is a noop.)
*/ */
if ((this_type == ACPI_TYPE_INTEGER) && if ((this_type == ACPI_TYPE_INTEGER) &&
(((union acpi_operand_object *)object)->common. (((union acpi_operand_object *)object)->common.flags &
flags & AOPOBJ_AML_CONSTANT)) { AOPOBJ_AML_CONSTANT)) {
return (AE_OK); return (AE_OK);
} }
} }
...@@ -196,10 +196,10 @@ acpi_ex_resolve_operands(u16 opcode, ...@@ -196,10 +196,10 @@ acpi_ex_resolve_operands(u16 opcode,
* thus, the attached object is always the aliased namespace node * thus, the attached object is always the aliased namespace node
*/ */
if (object_type == ACPI_TYPE_LOCAL_ALIAS) { if (object_type == ACPI_TYPE_LOCAL_ALIAS) {
obj_desc = obj_desc = acpi_ns_get_attached_object((struct
acpi_ns_get_attached_object((struct acpi_namespace_node
acpi_namespace_node *)
*)obj_desc); obj_desc);
*stack_ptr = obj_desc; *stack_ptr = obj_desc;
object_type = object_type =
((struct acpi_namespace_node *)obj_desc)-> ((struct acpi_namespace_node *)obj_desc)->
...@@ -285,8 +285,8 @@ acpi_ex_resolve_operands(u16 opcode, ...@@ -285,8 +285,8 @@ acpi_ex_resolve_operands(u16 opcode,
case ARGI_REF_OR_STRING: /* Can be a String or Reference */ case ARGI_REF_OR_STRING: /* Can be a String or Reference */
if ((ACPI_GET_DESCRIPTOR_TYPE(obj_desc) == if ((ACPI_GET_DESCRIPTOR_TYPE(obj_desc) ==
ACPI_DESC_TYPE_OPERAND) ACPI_DESC_TYPE_OPERAND) &&
&& (obj_desc->common.type == ACPI_TYPE_STRING)) { (obj_desc->common.type == ACPI_TYPE_STRING)) {
/* /*
* String found - the string references a named object and * String found - the string references a named object and
* must be resolved to a node * must be resolved to a node
...@@ -465,8 +465,9 @@ acpi_ex_resolve_operands(u16 opcode, ...@@ -465,8 +465,9 @@ acpi_ex_resolve_operands(u16 opcode,
* But we can implicitly convert from a BUFFER or INTEGER * But we can implicitly convert from a BUFFER or INTEGER
* aka - "Implicit Source Operand Conversion" * aka - "Implicit Source Operand Conversion"
*/ */
status = acpi_ex_convert_to_string(obj_desc, stack_ptr, status =
ACPI_IMPLICIT_CONVERT_HEX); acpi_ex_convert_to_string(obj_desc, stack_ptr,
ACPI_IMPLICIT_CONVERT_HEX);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
if (status == AE_TYPE) { if (status == AE_TYPE) {
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
...@@ -597,8 +598,10 @@ acpi_ex_resolve_operands(u16 opcode, ...@@ -597,8 +598,10 @@ acpi_ex_resolve_operands(u16 opcode,
case ARGI_REGION_OR_BUFFER: /* Used by Load() only */ case ARGI_REGION_OR_BUFFER: /* Used by Load() only */
/* Need an operand of type REGION or a BUFFER (which could be a resolved region field) */ /*
* Need an operand of type REGION or a BUFFER
* (which could be a resolved region field)
*/
switch (obj_desc->common.type) { switch (obj_desc->common.type) {
case ACPI_TYPE_BUFFER: case ACPI_TYPE_BUFFER:
case ACPI_TYPE_REGION: case ACPI_TYPE_REGION:
...@@ -640,9 +643,9 @@ acpi_ex_resolve_operands(u16 opcode, ...@@ -640,9 +643,9 @@ acpi_ex_resolve_operands(u16 opcode,
if (acpi_gbl_enable_interpreter_slack) { if (acpi_gbl_enable_interpreter_slack) {
/* /*
* Enable original behavior of Store(), allowing any and all * Enable original behavior of Store(), allowing any
* objects as the source operand. The ACPI spec does not * and all objects as the source operand. The ACPI
* allow this, however. * spec does not allow this, however.
*/ */
break; break;
} }
...@@ -655,7 +658,8 @@ acpi_ex_resolve_operands(u16 opcode, ...@@ -655,7 +658,8 @@ acpi_ex_resolve_operands(u16 opcode,
} }
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
"Needed Integer/Buffer/String/Package/Ref/Ddb], found [%s] %p", "Needed Integer/Buffer/String/Package/Ref/Ddb]"
", found [%s] %p",
acpi_ut_get_object_type_name acpi_ut_get_object_type_name
(obj_desc), obj_desc)); (obj_desc), obj_desc));
...@@ -678,9 +682,10 @@ acpi_ex_resolve_operands(u16 opcode, ...@@ -678,9 +682,10 @@ acpi_ex_resolve_operands(u16 opcode,
* Make sure that the original object was resolved to the * Make sure that the original object was resolved to the
* required object type (Simple cases only). * required object type (Simple cases only).
*/ */
status = acpi_ex_check_object_type(type_needed, status =
(*stack_ptr)->common.type, acpi_ex_check_object_type(type_needed,
*stack_ptr); (*stack_ptr)->common.type,
*stack_ptr);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
......
...@@ -467,7 +467,8 @@ acpi_ex_store_object_to_node(union acpi_operand_object *source_desc, ...@@ -467,7 +467,8 @@ acpi_ex_store_object_to_node(union acpi_operand_object *source_desc,
case ACPI_TYPE_THERMAL: case ACPI_TYPE_THERMAL:
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
"Target must be [Buffer/Integer/String/Reference], found [%s] (%4.4s)", "Target must be [Buffer/Integer/String/Reference]"
", found [%s] (%4.4s)",
acpi_ut_get_type_name(node->type), acpi_ut_get_type_name(node->type),
node->name.ascii)); node->name.ascii));
...@@ -504,8 +505,9 @@ acpi_ex_store_object_to_node(union acpi_operand_object *source_desc, ...@@ -504,8 +505,9 @@ acpi_ex_store_object_to_node(union acpi_operand_object *source_desc,
* an implicit conversion, as per the ACPI specification. * an implicit conversion, as per the ACPI specification.
* A direct store is performed instead. * A direct store is performed instead.
*/ */
status = acpi_ex_store_direct_to_node(source_desc, node, status =
walk_state); acpi_ex_store_direct_to_node(source_desc, node,
walk_state);
break; break;
} }
...@@ -528,8 +530,9 @@ acpi_ex_store_object_to_node(union acpi_operand_object *source_desc, ...@@ -528,8 +530,9 @@ acpi_ex_store_object_to_node(union acpi_operand_object *source_desc,
* store has been performed such that the node/object type * store has been performed such that the node/object type
* has been changed. * has been changed.
*/ */
status = acpi_ns_attach_object(node, new_desc, status =
new_desc->common.type); acpi_ns_attach_object(node, new_desc,
new_desc->common.type);
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
"Store type [%s] into [%s] via Convert/Attach\n", "Store type [%s] into [%s] via Convert/Attach\n",
...@@ -563,8 +566,8 @@ acpi_ex_store_object_to_node(union acpi_operand_object *source_desc, ...@@ -563,8 +566,8 @@ acpi_ex_store_object_to_node(union acpi_operand_object *source_desc,
* operator. (Note, for this default case, all normal * operator. (Note, for this default case, all normal
* Store/Target operations exited above with an error). * Store/Target operations exited above with an error).
*/ */
status = acpi_ex_store_direct_to_node(source_desc, node, status =
walk_state); acpi_ex_store_direct_to_node(source_desc, node, walk_state);
break; break;
} }
......
/****************************************************************************** /******************************************************************************
* *
* Module Name: exstorob - AML Interpreter object store support, store to object * Module Name: exstorob - AML object store support, store to object
* *
*****************************************************************************/ *****************************************************************************/
...@@ -203,8 +203,9 @@ acpi_ex_store_string_to_string(union acpi_operand_object *source_desc, ...@@ -203,8 +203,9 @@ acpi_ex_store_string_to_string(union acpi_operand_object *source_desc,
ACPI_FREE(target_desc->string.pointer); ACPI_FREE(target_desc->string.pointer);
} }
target_desc->string.pointer = ACPI_ALLOCATE_ZEROED((acpi_size) target_desc->string.pointer =
length + 1); ACPI_ALLOCATE_ZEROED((acpi_size) length + 1);
if (!target_desc->string.pointer) { if (!target_desc->string.pointer) {
return_ACPI_STATUS(AE_NO_MEMORY); return_ACPI_STATUS(AE_NO_MEMORY);
} }
......
...@@ -78,7 +78,6 @@ acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout) ...@@ -78,7 +78,6 @@ acpi_status acpi_ex_system_wait_semaphore(acpi_semaphore semaphore, u16 timeout)
/* We must wait, so unlock the interpreter */ /* We must wait, so unlock the interpreter */
acpi_ex_exit_interpreter(); acpi_ex_exit_interpreter();
status = acpi_os_wait_semaphore(semaphore, 1, timeout); status = acpi_os_wait_semaphore(semaphore, 1, timeout);
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
...@@ -124,7 +123,6 @@ acpi_status acpi_ex_system_wait_mutex(acpi_mutex mutex, u16 timeout) ...@@ -124,7 +123,6 @@ acpi_status acpi_ex_system_wait_mutex(acpi_mutex mutex, u16 timeout)
/* We must wait, so unlock the interpreter */ /* We must wait, so unlock the interpreter */
acpi_ex_exit_interpreter(); acpi_ex_exit_interpreter();
status = acpi_os_acquire_mutex(mutex, timeout); status = acpi_os_acquire_mutex(mutex, timeout);
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
...@@ -169,8 +167,8 @@ acpi_status acpi_ex_system_do_stall(u32 how_long) ...@@ -169,8 +167,8 @@ acpi_status acpi_ex_system_do_stall(u32 how_long)
* (ACPI specifies 100 usec as max, but this gives some slack in * (ACPI specifies 100 usec as max, but this gives some slack in
* order to support existing BIOSs) * order to support existing BIOSs)
*/ */
ACPI_ERROR((AE_INFO, "Time parameter is too large (%u)", ACPI_ERROR((AE_INFO,
how_long)); "Time parameter is too large (%u)", how_long));
status = AE_AML_OPERAND_VALUE; status = AE_AML_OPERAND_VALUE;
} else { } else {
acpi_os_stall(how_long); acpi_os_stall(how_long);
......
...@@ -167,8 +167,8 @@ u8 acpi_ex_truncate_for32bit_table(union acpi_operand_object *obj_desc) ...@@ -167,8 +167,8 @@ u8 acpi_ex_truncate_for32bit_table(union acpi_operand_object *obj_desc)
if ((acpi_gbl_integer_byte_width == 4) && if ((acpi_gbl_integer_byte_width == 4) &&
(obj_desc->integer.value > (u64)ACPI_UINT32_MAX)) { (obj_desc->integer.value > (u64)ACPI_UINT32_MAX)) {
/* /*
* We are executing in a 32-bit ACPI table. * We are executing in a 32-bit ACPI table. Truncate
* Truncate the value to 32 bits by zeroing out the upper 32-bit field * the value to 32 bits by zeroing out the upper 32-bit field
*/ */
obj_desc->integer.value &= (u64)ACPI_UINT32_MAX; obj_desc->integer.value &= (u64)ACPI_UINT32_MAX;
return (TRUE); return (TRUE);
...@@ -323,7 +323,8 @@ void acpi_ex_eisa_id_to_string(char *out_string, u64 compressed_id) ...@@ -323,7 +323,8 @@ void acpi_ex_eisa_id_to_string(char *out_string, u64 compressed_id)
if (compressed_id > ACPI_UINT32_MAX) { if (compressed_id > ACPI_UINT32_MAX) {
ACPI_WARNING((AE_INFO, ACPI_WARNING((AE_INFO,
"Expected EISAID is larger than 32 bits: 0x%8.8X%8.8X, truncating", "Expected EISAID is larger than 32 bits: "
"0x%8.8X%8.8X, truncating",
ACPI_FORMAT_UINT64(compressed_id))); ACPI_FORMAT_UINT64(compressed_id)));
} }
......
...@@ -117,8 +117,8 @@ acpi_status acpi_hw_extended_sleep(u8 sleep_state) ...@@ -117,8 +117,8 @@ acpi_status acpi_hw_extended_sleep(u8 sleep_state)
/* Clear wake status (WAK_STS) */ /* Clear wake status (WAK_STS) */
status = status = acpi_write((u64)ACPI_X_WAKE_STATUS,
acpi_write((u64)ACPI_X_WAKE_STATUS, &acpi_gbl_FADT.sleep_status); &acpi_gbl_FADT.sleep_status);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
......
...@@ -187,9 +187,8 @@ acpi_status acpi_hw_clear_gpe(struct acpi_gpe_event_info * gpe_event_info) ...@@ -187,9 +187,8 @@ acpi_status acpi_hw_clear_gpe(struct acpi_gpe_event_info * gpe_event_info)
*/ */
register_bit = acpi_hw_get_gpe_register_bit(gpe_event_info); register_bit = acpi_hw_get_gpe_register_bit(gpe_event_info);
status = acpi_hw_write(register_bit, status =
&gpe_register_info->status_address); acpi_hw_write(register_bit, &gpe_register_info->status_address);
return (status); return (status);
} }
...@@ -297,8 +296,8 @@ acpi_hw_gpe_enable_write(u8 enable_mask, ...@@ -297,8 +296,8 @@ acpi_hw_gpe_enable_write(u8 enable_mask,
acpi_status status; acpi_status status;
gpe_register_info->enable_mask = enable_mask; gpe_register_info->enable_mask = enable_mask;
status = acpi_hw_write(enable_mask, &gpe_register_info->enable_address);
status = acpi_hw_write(enable_mask, &gpe_register_info->enable_address);
return (status); return (status);
} }
......
...@@ -80,8 +80,8 @@ acpi_status acpi_hw_legacy_sleep(u8 sleep_state) ...@@ -80,8 +80,8 @@ acpi_status acpi_hw_legacy_sleep(u8 sleep_state)
/* Clear wake status */ /* Clear wake status */
status = status = acpi_write_bit_register(ACPI_BITREG_WAKE_STATUS,
acpi_write_bit_register(ACPI_BITREG_WAKE_STATUS, ACPI_CLEAR_STATUS); ACPI_CLEAR_STATUS);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
......
...@@ -286,6 +286,7 @@ acpi_status acpi_enter_sleep_state_s4bios(void) ...@@ -286,6 +286,7 @@ acpi_status acpi_enter_sleep_state_s4bios(void)
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
} while (!in_value); } while (!in_value);
return_ACPI_STATUS(AE_OK); return_ACPI_STATUS(AE_OK);
......
...@@ -96,9 +96,9 @@ acpi_ns_convert_to_integer(union acpi_operand_object *original_object, ...@@ -96,9 +96,9 @@ acpi_ns_convert_to_integer(union acpi_operand_object *original_object,
/* Extract each buffer byte to create the integer */ /* Extract each buffer byte to create the integer */
for (i = 0; i < original_object->buffer.length; i++) { for (i = 0; i < original_object->buffer.length; i++) {
value |= value |= ((u64)
((u64)original_object->buffer. original_object->buffer.pointer[i] << (i *
pointer[i] << (i * 8)); 8));
} }
break; break;
...@@ -153,10 +153,9 @@ acpi_ns_convert_to_string(union acpi_operand_object *original_object, ...@@ -153,10 +153,9 @@ acpi_ns_convert_to_string(union acpi_operand_object *original_object,
return (AE_NO_MEMORY); return (AE_NO_MEMORY);
} }
} else { } else {
status = status = acpi_ex_convert_to_string(original_object,
acpi_ex_convert_to_string(original_object, &new_object,
&new_object, ACPI_IMPLICIT_CONVERT_HEX);
ACPI_IMPLICIT_CONVERT_HEX);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
return (status); return (status);
} }
...@@ -244,9 +243,8 @@ acpi_ns_convert_to_buffer(union acpi_operand_object *original_object, ...@@ -244,9 +243,8 @@ acpi_ns_convert_to_buffer(union acpi_operand_object *original_object,
/* String-to-Buffer conversion. Simple data copy */ /* String-to-Buffer conversion. Simple data copy */
new_object = new_object = acpi_ut_create_buffer_object
acpi_ut_create_buffer_object(original_object->string. (original_object->string.length);
length);
if (!new_object) { if (!new_object) {
return (AE_NO_MEMORY); return (AE_NO_MEMORY);
} }
......
...@@ -539,11 +539,13 @@ acpi_ns_dump_one_object(acpi_handle obj_handle, ...@@ -539,11 +539,13 @@ acpi_ns_dump_one_object(acpi_handle obj_handle,
acpi_os_printf acpi_os_printf
("(Pointer to ACPI Object type %.2X [UNKNOWN])\n", ("(Pointer to ACPI Object type %.2X [UNKNOWN])\n",
obj_type); obj_type);
bytes_to_dump = 32; bytes_to_dump = 32;
} else { } else {
acpi_os_printf acpi_os_printf
("(Pointer to ACPI Object type %.2X [%s])\n", ("(Pointer to ACPI Object type %.2X [%s])\n",
obj_type, acpi_ut_get_type_name(obj_type)); obj_type, acpi_ut_get_type_name(obj_type));
bytes_to_dump = bytes_to_dump =
sizeof(union acpi_operand_object); sizeof(union acpi_operand_object);
} }
...@@ -573,6 +575,7 @@ acpi_ns_dump_one_object(acpi_handle obj_handle, ...@@ -573,6 +575,7 @@ acpi_ns_dump_one_object(acpi_handle obj_handle,
*/ */
bytes_to_dump = obj_desc->string.length; bytes_to_dump = obj_desc->string.length;
obj_desc = (void *)obj_desc->string.pointer; obj_desc = (void *)obj_desc->string.pointer;
acpi_os_printf("(Buffer/String pointer %p length %X)\n", acpi_os_printf("(Buffer/String pointer %p length %X)\n",
obj_desc, bytes_to_dump); obj_desc, bytes_to_dump);
ACPI_DUMP_BUFFER(obj_desc, bytes_to_dump); ACPI_DUMP_BUFFER(obj_desc, bytes_to_dump);
......
...@@ -321,7 +321,6 @@ acpi_status acpi_ns_unload_namespace(acpi_handle handle) ...@@ -321,7 +321,6 @@ acpi_status acpi_ns_unload_namespace(acpi_handle handle)
/* This function does the real work */ /* This function does the real work */
status = acpi_ns_delete_subtree(handle); status = acpi_ns_delete_subtree(handle);
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
#endif #endif
......
...@@ -70,7 +70,6 @@ char *acpi_ns_get_external_pathname(struct acpi_namespace_node *node) ...@@ -70,7 +70,6 @@ char *acpi_ns_get_external_pathname(struct acpi_namespace_node *node)
ACPI_FUNCTION_TRACE_PTR(ns_get_external_pathname, node); ACPI_FUNCTION_TRACE_PTR(ns_get_external_pathname, node);
name_buffer = acpi_ns_get_normalized_pathname(node, FALSE); name_buffer = acpi_ns_get_normalized_pathname(node, FALSE);
return_PTR(name_buffer); return_PTR(name_buffer);
} }
...@@ -93,7 +92,6 @@ acpi_size acpi_ns_get_pathname_length(struct acpi_namespace_node *node) ...@@ -93,7 +92,6 @@ acpi_size acpi_ns_get_pathname_length(struct acpi_namespace_node *node)
ACPI_FUNCTION_ENTRY(); ACPI_FUNCTION_ENTRY();
size = acpi_ns_build_normalized_path(node, NULL, 0, FALSE); size = acpi_ns_build_normalized_path(node, NULL, 0, FALSE);
return (size); return (size);
} }
...@@ -217,6 +215,7 @@ acpi_ns_build_normalized_path(struct acpi_namespace_node *node, ...@@ -217,6 +215,7 @@ acpi_ns_build_normalized_path(struct acpi_namespace_node *node,
ACPI_PATH_PUT8(full_path, path_size, ACPI_PATH_PUT8(full_path, path_size,
AML_DUAL_NAME_PREFIX, length); AML_DUAL_NAME_PREFIX, length);
} }
ACPI_MOVE_32_TO_32(name, &next_node->name); ACPI_MOVE_32_TO_32(name, &next_node->name);
do_no_trailing = no_trailing; do_no_trailing = no_trailing;
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
...@@ -228,8 +227,10 @@ acpi_ns_build_normalized_path(struct acpi_namespace_node *node, ...@@ -228,8 +227,10 @@ acpi_ns_build_normalized_path(struct acpi_namespace_node *node,
ACPI_PATH_PUT8(full_path, path_size, c, length); ACPI_PATH_PUT8(full_path, path_size, c, length);
} }
} }
next_node = next_node->parent; next_node = next_node->parent;
} }
ACPI_PATH_PUT8(full_path, path_size, AML_ROOT_PREFIX, length); ACPI_PATH_PUT8(full_path, path_size, AML_ROOT_PREFIX, length);
/* Reverse the path string */ /* Reverse the path string */
...@@ -237,6 +238,7 @@ acpi_ns_build_normalized_path(struct acpi_namespace_node *node, ...@@ -237,6 +238,7 @@ acpi_ns_build_normalized_path(struct acpi_namespace_node *node,
if (length <= path_size) { if (length <= path_size) {
left = full_path; left = full_path;
right = full_path + length - 1; right = full_path + length - 1;
while (left < right) { while (left < right) {
c = *left; c = *left;
*left++ = *right; *left++ = *right;
......
...@@ -141,8 +141,8 @@ acpi_ns_one_complete_parse(u32 pass_number, ...@@ -141,8 +141,8 @@ acpi_ns_one_complete_parse(u32 pass_number,
/* Parse the AML */ /* Parse the AML */
ACPI_DEBUG_PRINT((ACPI_DB_PARSE, "*PARSE* pass %u parse\n", ACPI_DEBUG_PRINT((ACPI_DB_PARSE,
pass_number)); "*PARSE* pass %u parse\n", pass_number));
status = acpi_ps_parse_aml(walk_state); status = acpi_ps_parse_aml(walk_state);
cleanup: cleanup:
...@@ -181,6 +181,7 @@ acpi_ns_parse_table(u32 table_index, struct acpi_namespace_node *start_node) ...@@ -181,6 +181,7 @@ acpi_ns_parse_table(u32 table_index, struct acpi_namespace_node *start_node)
* performs another complete parse of the AML. * performs another complete parse of the AML.
*/ */
ACPI_DEBUG_PRINT((ACPI_DB_PARSE, "**** Start pass 1\n")); ACPI_DEBUG_PRINT((ACPI_DB_PARSE, "**** Start pass 1\n"));
status = acpi_ns_one_complete_parse(ACPI_IMODE_LOAD_PASS1, status = acpi_ns_one_complete_parse(ACPI_IMODE_LOAD_PASS1,
table_index, start_node); table_index, start_node);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
......
...@@ -233,8 +233,9 @@ acpi_ns_check_package(struct acpi_evaluate_info *info, ...@@ -233,8 +233,9 @@ acpi_ns_check_package(struct acpi_evaluate_info *info,
/* First element is the (Integer) revision */ /* First element is the (Integer) revision */
status = acpi_ns_check_object_type(info, elements, status =
ACPI_RTYPE_INTEGER, 0); acpi_ns_check_object_type(info, elements,
ACPI_RTYPE_INTEGER, 0);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
return (status); return (status);
} }
...@@ -252,8 +253,9 @@ acpi_ns_check_package(struct acpi_evaluate_info *info, ...@@ -252,8 +253,9 @@ acpi_ns_check_package(struct acpi_evaluate_info *info,
/* First element is the (Integer) count of subpackages to follow */ /* First element is the (Integer) count of subpackages to follow */
status = acpi_ns_check_object_type(info, elements, status =
ACPI_RTYPE_INTEGER, 0); acpi_ns_check_object_type(info, elements,
ACPI_RTYPE_INTEGER, 0);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
return (status); return (status);
} }
......
...@@ -366,6 +366,7 @@ static const struct acpi_simple_repair_info *acpi_ns_match_simple_repair(struct ...@@ -366,6 +366,7 @@ static const struct acpi_simple_repair_info *acpi_ns_match_simple_repair(struct
return (NULL); return (NULL);
} }
this_name++; this_name++;
} }
...@@ -521,6 +522,7 @@ acpi_ns_remove_null_elements(struct acpi_evaluate_info *info, ...@@ -521,6 +522,7 @@ acpi_ns_remove_null_elements(struct acpi_evaluate_info *info,
*dest = *source; *dest = *source;
dest++; dest++;
} }
source++; source++;
} }
...@@ -572,8 +574,8 @@ acpi_ns_wrap_with_package(struct acpi_evaluate_info *info, ...@@ -572,8 +574,8 @@ acpi_ns_wrap_with_package(struct acpi_evaluate_info *info,
ACPI_FUNCTION_NAME(ns_wrap_with_package); ACPI_FUNCTION_NAME(ns_wrap_with_package);
/* /*
* Create the new outer package and populate it. The new package will * Create the new outer package and populate it. The new
* have a single element, the lone sub-object. * package will have a single element, the lone sub-object.
*/ */
pkg_obj_desc = acpi_ut_create_package_object(1); pkg_obj_desc = acpi_ut_create_package_object(1);
if (!pkg_obj_desc) { if (!pkg_obj_desc) {
......
...@@ -225,6 +225,7 @@ static const struct acpi_repair_info *acpi_ns_match_complex_repair(struct ...@@ -225,6 +225,7 @@ static const struct acpi_repair_info *acpi_ns_match_complex_repair(struct
if (ACPI_COMPARE_NAME(node->name.ascii, this_name->name)) { if (ACPI_COMPARE_NAME(node->name.ascii, this_name->name)) {
return (this_name); return (this_name);
} }
this_name++; this_name++;
} }
...@@ -301,7 +302,8 @@ acpi_ns_repair_FDE(struct acpi_evaluate_info *info, ...@@ -301,7 +302,8 @@ acpi_ns_repair_FDE(struct acpi_evaluate_info *info,
/* We can only repair if we have exactly 5 BYTEs */ /* We can only repair if we have exactly 5 BYTEs */
if (return_object->buffer.length != ACPI_FDE_BYTE_BUFFER_SIZE) { if (return_object->buffer.length != ACPI_FDE_BYTE_BUFFER_SIZE) {
ACPI_WARN_PREDEFINED((AE_INFO, info->full_pathname, ACPI_WARN_PREDEFINED((AE_INFO,
info->full_pathname,
info->node_flags, info->node_flags,
"Incorrect return buffer length %u, expected %u", "Incorrect return buffer length %u, expected %u",
return_object->buffer.length, return_object->buffer.length,
...@@ -321,8 +323,8 @@ acpi_ns_repair_FDE(struct acpi_evaluate_info *info, ...@@ -321,8 +323,8 @@ acpi_ns_repair_FDE(struct acpi_evaluate_info *info,
/* Expand each byte to a DWORD */ /* Expand each byte to a DWORD */
byte_buffer = return_object->buffer.pointer; byte_buffer = return_object->buffer.pointer;
dword_buffer = dword_buffer = ACPI_CAST_PTR(u32,
ACPI_CAST_PTR(u32, buffer_object->buffer.pointer); buffer_object->buffer.pointer);
for (i = 0; i < ACPI_FDE_FIELD_COUNT; i++) { for (i = 0; i < ACPI_FDE_FIELD_COUNT; i++) {
*dword_buffer = (u32) *byte_buffer; *dword_buffer = (u32) *byte_buffer;
...@@ -461,7 +463,8 @@ acpi_ns_repair_CST(struct acpi_evaluate_info *info, ...@@ -461,7 +463,8 @@ acpi_ns_repair_CST(struct acpi_evaluate_info *info,
removing = FALSE; removing = FALSE;
if ((*outer_elements)->package.count == 0) { if ((*outer_elements)->package.count == 0) {
ACPI_WARN_PREDEFINED((AE_INFO, info->full_pathname, ACPI_WARN_PREDEFINED((AE_INFO,
info->full_pathname,
info->node_flags, info->node_flags,
"SubPackage[%u] - removing entry due to zero count", "SubPackage[%u] - removing entry due to zero count",
i)); i));
...@@ -471,7 +474,8 @@ acpi_ns_repair_CST(struct acpi_evaluate_info *info, ...@@ -471,7 +474,8 @@ acpi_ns_repair_CST(struct acpi_evaluate_info *info,
obj_desc = (*outer_elements)->package.elements[1]; /* Index1 = Type */ obj_desc = (*outer_elements)->package.elements[1]; /* Index1 = Type */
if ((u32)obj_desc->integer.value == 0) { if ((u32)obj_desc->integer.value == 0) {
ACPI_WARN_PREDEFINED((AE_INFO, info->full_pathname, ACPI_WARN_PREDEFINED((AE_INFO,
info->full_pathname,
info->node_flags, info->node_flags,
"SubPackage[%u] - removing entry due to invalid Type(0)", "SubPackage[%u] - removing entry due to invalid Type(0)",
i)); i));
...@@ -538,8 +542,8 @@ acpi_ns_repair_HID(struct acpi_evaluate_info *info, ...@@ -538,8 +542,8 @@ acpi_ns_repair_HID(struct acpi_evaluate_info *info,
} }
if (return_object->string.length == 0) { if (return_object->string.length == 0) {
ACPI_WARN_PREDEFINED((AE_INFO, info->full_pathname, ACPI_WARN_PREDEFINED((AE_INFO,
info->node_flags, info->full_pathname, info->node_flags,
"Invalid zero-length _HID or _CID string")); "Invalid zero-length _HID or _CID string"));
/* Return AE_OK anyway, let driver handle it */ /* Return AE_OK anyway, let driver handle it */
...@@ -711,7 +715,8 @@ acpi_ns_repair_PSS(struct acpi_evaluate_info *info, ...@@ -711,7 +715,8 @@ acpi_ns_repair_PSS(struct acpi_evaluate_info *info,
obj_desc = elements[1]; /* Index1 = power_dissipation */ obj_desc = elements[1]; /* Index1 = power_dissipation */
if ((u32)obj_desc->integer.value > previous_value) { if ((u32)obj_desc->integer.value > previous_value) {
ACPI_WARN_PREDEFINED((AE_INFO, info->full_pathname, ACPI_WARN_PREDEFINED((AE_INFO,
info->full_pathname,
info->node_flags, info->node_flags,
"SubPackage[%u,%u] - suspicious power dissipation values", "SubPackage[%u,%u] - suspicious power dissipation values",
i - 1, i)); i - 1, i));
...@@ -969,6 +974,7 @@ acpi_ns_remove_element(union acpi_operand_object *obj_desc, u32 index) ...@@ -969,6 +974,7 @@ acpi_ns_remove_element(union acpi_operand_object *obj_desc, u32 index)
*dest = *source; *dest = *source;
dest++; dest++;
} }
source++; source++;
} }
......
...@@ -173,9 +173,10 @@ void acpi_ns_get_internal_name_length(struct acpi_namestring_info *info) ...@@ -173,9 +173,10 @@ void acpi_ns_get_internal_name_length(struct acpi_namestring_info *info)
info->fully_qualified = FALSE; info->fully_qualified = FALSE;
/* /*
* For the internal name, the required length is 4 bytes per segment, plus * For the internal name, the required length is 4 bytes per segment,
* 1 each for root_prefix, multi_name_prefix_op, segment count, trailing null * plus 1 each for root_prefix, multi_name_prefix_op, segment count,
* (which is not really needed, but no there's harm in putting it there) * trailing null (which is not really needed, but no there's harm in
* putting it there)
* *
* strlen() + 1 covers the first name_seg, which has no path separator * strlen() + 1 covers the first name_seg, which has no path separator
*/ */
...@@ -699,6 +700,7 @@ acpi_ns_get_node(struct acpi_namespace_node *prefix_node, ...@@ -699,6 +700,7 @@ acpi_ns_get_node(struct acpi_namespace_node *prefix_node,
if (!prefix_node) { if (!prefix_node) {
*return_node = acpi_gbl_root_node; *return_node = acpi_gbl_root_node;
} }
return_ACPI_STATUS(AE_OK); return_ACPI_STATUS(AE_OK);
} }
......
...@@ -750,8 +750,8 @@ acpi_ns_get_device_callback(acpi_handle obj_handle, ...@@ -750,8 +750,8 @@ acpi_ns_get_device_callback(acpi_handle obj_handle,
/* We have a valid device, invoke the user function */ /* We have a valid device, invoke the user function */
status = info->user_function(obj_handle, nesting_level, info->context, status = info->user_function(obj_handle, nesting_level,
return_value); info->context, return_value);
return (status); return (status);
} }
......
...@@ -591,6 +591,7 @@ acpi_status acpi_install_method(u8 *buffer) ...@@ -591,6 +591,7 @@ acpi_status acpi_install_method(u8 *buffer)
parser_state.aml += acpi_ps_get_opcode_size(opcode); parser_state.aml += acpi_ps_get_opcode_size(opcode);
parser_state.pkg_end = acpi_ps_get_next_package_end(&parser_state); parser_state.pkg_end = acpi_ps_get_next_package_end(&parser_state);
path = acpi_ps_get_next_namestring(&parser_state); path = acpi_ps_get_next_namestring(&parser_state);
method_flags = *parser_state.aml++; method_flags = *parser_state.aml++;
aml_start = parser_state.aml; aml_start = parser_state.aml;
aml_length = ACPI_PTR_DIFF(parser_state.pkg_end, aml_start); aml_length = ACPI_PTR_DIFF(parser_state.pkg_end, aml_start);
......
...@@ -74,10 +74,8 @@ acpi_status acpi_get_type(acpi_handle handle, acpi_object_type * ret_type) ...@@ -74,10 +74,8 @@ acpi_status acpi_get_type(acpi_handle handle, acpi_object_type * ret_type)
return (AE_BAD_PARAMETER); return (AE_BAD_PARAMETER);
} }
/* /* Special case for the predefined Root Node (return type ANY) */
* Special case for the predefined Root Node
* (return type ANY)
*/
if (handle == ACPI_ROOT_OBJECT) { if (handle == ACPI_ROOT_OBJECT) {
*ret_type = ACPI_TYPE_ANY; *ret_type = ACPI_TYPE_ANY;
return (AE_OK); return (AE_OK);
......
...@@ -733,6 +733,7 @@ acpi_ps_get_next_arg(struct acpi_walk_state *walk_state, ...@@ -733,6 +733,7 @@ acpi_ps_get_next_arg(struct acpi_walk_state *walk_state,
if (!arg) { if (!arg) {
return_ACPI_STATUS(AE_NO_MEMORY); return_ACPI_STATUS(AE_NO_MEMORY);
} }
acpi_ps_get_next_simple_arg(parser_state, arg_type, arg); acpi_ps_get_next_simple_arg(parser_state, arg_type, arg);
break; break;
......
...@@ -124,8 +124,8 @@ acpi_ps_get_arguments(struct acpi_walk_state *walk_state, ...@@ -124,8 +124,8 @@ acpi_ps_get_arguments(struct acpi_walk_state *walk_state,
/* /*
* Op is not a constant or string, append each argument to the Op * Op is not a constant or string, append each argument to the Op
*/ */
while (GET_CURRENT_ARG_TYPE(walk_state->arg_types) while (GET_CURRENT_ARG_TYPE(walk_state->arg_types) &&
&& !walk_state->arg_count) { !walk_state->arg_count) {
walk_state->aml = walk_state->parser_state.aml; walk_state->aml = walk_state->parser_state.aml;
status = status =
......
...@@ -526,8 +526,8 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state) ...@@ -526,8 +526,8 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
} }
/* /*
* If the transfer to the new method method call worked, a new walk * If the transfer to the new method method call worked
* state was created -- get it *, a new walk state was created -- get it
*/ */
walk_state = acpi_ds_get_current_walk_state(thread); walk_state = acpi_ds_get_current_walk_state(thread);
continue; continue;
...@@ -544,8 +544,8 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state) ...@@ -544,8 +544,8 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
/* Check for possible multi-thread reentrancy problem */ /* Check for possible multi-thread reentrancy problem */
if ((status == AE_ALREADY_EXISTS) && if ((status == AE_ALREADY_EXISTS) &&
(!(walk_state->method_desc->method. (!(walk_state->method_desc->method.info_flags &
info_flags & ACPI_METHOD_SERIALIZED))) { ACPI_METHOD_SERIALIZED))) {
/* /*
* Method is not serialized and tried to create an object * Method is not serialized and tried to create an object
* twice. The probable cause is that the method cannot * twice. The probable cause is that the method cannot
......
...@@ -175,8 +175,8 @@ void acpi_ps_free_op(union acpi_parse_object *op) ...@@ -175,8 +175,8 @@ void acpi_ps_free_op(union acpi_parse_object *op)
ACPI_FUNCTION_NAME(ps_free_op); ACPI_FUNCTION_NAME(ps_free_op);
if (op->common.aml_opcode == AML_INT_RETURN_VALUE_OP) { if (op->common.aml_opcode == AML_INT_RETURN_VALUE_OP) {
ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, "Free retval op: %p\n", ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS,
op)); "Free retval op: %p\n", op));
} }
if (op->common.flags & ACPI_PARSEOP_GENERIC) { if (op->common.flags & ACPI_PARSEOP_GENERIC) {
......
...@@ -99,6 +99,7 @@ void acpi_ps_delete_parse_tree(union acpi_parse_object *subtree_root) ...@@ -99,6 +99,7 @@ void acpi_ps_delete_parse_tree(union acpi_parse_object *subtree_root)
if (op == subtree_root) { if (op == subtree_root) {
return_VOID; return_VOID;
} }
if (next) { if (next) {
op = next; op = next;
} else { } else {
......
...@@ -312,8 +312,8 @@ acpi_rs_get_address_common(struct acpi_resource *resource, ...@@ -312,8 +312,8 @@ acpi_rs_get_address_common(struct acpi_resource *resource,
/* Validate the Resource Type */ /* Validate the Resource Type */
if ((aml->address.resource_type > 2) if ((aml->address.resource_type > 2) &&
&& (aml->address.resource_type < 0xC0)) { (aml->address.resource_type < 0xC0)) {
return (FALSE); return (FALSE);
} }
......
...@@ -143,16 +143,17 @@ acpi_rs_stream_option_length(u32 resource_length, ...@@ -143,16 +143,17 @@ acpi_rs_stream_option_length(u32 resource_length,
ACPI_FUNCTION_ENTRY(); ACPI_FUNCTION_ENTRY();
/* /*
* The resource_source_index and resource_source are optional elements of some * The resource_source_index and resource_source are optional elements of
* Large-type resource descriptors. * some Large-type resource descriptors.
*/ */
/* /*
* If the length of the actual resource descriptor is greater than the ACPI * If the length of the actual resource descriptor is greater than the
* spec-defined minimum length, it means that a resource_source_index exists * ACPI spec-defined minimum length, it means that a resource_source_index
* and is followed by a (required) null terminated string. The string length * exists and is followed by a (required) null terminated string. The
* (including the null terminator) is the resource length minus the minimum * string length (including the null terminator) is the resource length
* length, minus one byte for the resource_source_index itself. * minus the minimum length, minus one byte for the resource_source_index
* itself.
*/ */
if (resource_length > minimum_aml_resource_length) { if (resource_length > minimum_aml_resource_length) {
...@@ -277,11 +278,11 @@ acpi_rs_get_aml_length(struct acpi_resource *resource, ...@@ -277,11 +278,11 @@ acpi_rs_get_aml_length(struct acpi_resource *resource,
* 16-Bit Address Resource: * 16-Bit Address Resource:
* Add the size of the optional resource_source info * Add the size of the optional resource_source info
*/ */
total_size = (acpi_rs_length) total_size = (acpi_rs_length) (total_size +
(total_size + acpi_rs_struct_option_length
acpi_rs_struct_option_length(&resource->data. (&resource->data.
address16. address16.
resource_source)); resource_source));
break; break;
case ACPI_RESOURCE_TYPE_ADDRESS32: case ACPI_RESOURCE_TYPE_ADDRESS32:
...@@ -289,11 +290,11 @@ acpi_rs_get_aml_length(struct acpi_resource *resource, ...@@ -289,11 +290,11 @@ acpi_rs_get_aml_length(struct acpi_resource *resource,
* 32-Bit Address Resource: * 32-Bit Address Resource:
* Add the size of the optional resource_source info * Add the size of the optional resource_source info
*/ */
total_size = (acpi_rs_length) total_size = (acpi_rs_length) (total_size +
(total_size + acpi_rs_struct_option_length
acpi_rs_struct_option_length(&resource->data. (&resource->data.
address32. address32.
resource_source)); resource_source));
break; break;
case ACPI_RESOURCE_TYPE_ADDRESS64: case ACPI_RESOURCE_TYPE_ADDRESS64:
...@@ -301,11 +302,11 @@ acpi_rs_get_aml_length(struct acpi_resource *resource, ...@@ -301,11 +302,11 @@ acpi_rs_get_aml_length(struct acpi_resource *resource,
* 64-Bit Address Resource: * 64-Bit Address Resource:
* Add the size of the optional resource_source info * Add the size of the optional resource_source info
*/ */
total_size = (acpi_rs_length) total_size = (acpi_rs_length) (total_size +
(total_size + acpi_rs_struct_option_length
acpi_rs_struct_option_length(&resource->data. (&resource->data.
address64. address64.
resource_source)); resource_source));
break; break;
case ACPI_RESOURCE_TYPE_EXTENDED_IRQ: case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
...@@ -314,26 +315,28 @@ acpi_rs_get_aml_length(struct acpi_resource *resource, ...@@ -314,26 +315,28 @@ acpi_rs_get_aml_length(struct acpi_resource *resource,
* Add the size of each additional optional interrupt beyond the * Add the size of each additional optional interrupt beyond the
* required 1 (4 bytes for each u32 interrupt number) * required 1 (4 bytes for each u32 interrupt number)
*/ */
total_size = (acpi_rs_length) total_size = (acpi_rs_length) (total_size +
(total_size + ((resource->data.
((resource->data.extended_irq.interrupt_count - extended_irq.
1) * 4) + interrupt_count -
/* Add the size of the optional resource_source info */ 1) * 4) +
acpi_rs_struct_option_length(&resource->data. /* Add the size of the optional resource_source info */
extended_irq. acpi_rs_struct_option_length
resource_source)); (&resource->data.
extended_irq.
resource_source));
break; break;
case ACPI_RESOURCE_TYPE_GPIO: case ACPI_RESOURCE_TYPE_GPIO:
total_size = total_size = (acpi_rs_length) (total_size +
(acpi_rs_length) (total_size + (resource->data.gpio.
(resource->data.gpio. pin_table_length * 2) +
pin_table_length * 2) + resource->data.gpio.
resource->data.gpio. resource_source.
resource_source.string_length + string_length +
resource->data.gpio. resource->data.gpio.
vendor_length); vendor_length);
break; break;
...@@ -566,8 +569,8 @@ acpi_rs_get_list_length(u8 * aml_buffer, ...@@ -566,8 +569,8 @@ acpi_rs_get_list_length(u8 * aml_buffer,
acpi_gbl_resource_struct_sizes[resource_index] + acpi_gbl_resource_struct_sizes[resource_index] +
extra_struct_bytes; extra_struct_bytes;
} }
buffer_size = (u32)ACPI_ROUND_UP_TO_NATIVE_WORD(buffer_size);
buffer_size = (u32)ACPI_ROUND_UP_TO_NATIVE_WORD(buffer_size);
*size_needed += buffer_size; *size_needed += buffer_size;
ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES,
......
...@@ -81,8 +81,9 @@ acpi_buffer_to_resource(u8 *aml_buffer, ...@@ -81,8 +81,9 @@ acpi_buffer_to_resource(u8 *aml_buffer,
/* Get the required length for the converted resource */ /* Get the required length for the converted resource */
status = acpi_rs_get_list_length(aml_buffer, aml_buffer_length, status =
&list_size_needed); acpi_rs_get_list_length(aml_buffer, aml_buffer_length,
&list_size_needed);
if (status == AE_AML_NO_RESOURCE_END_TAG) { if (status == AE_AML_NO_RESOURCE_END_TAG) {
status = AE_OK; status = AE_OK;
} }
...@@ -232,8 +233,9 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object, ...@@ -232,8 +233,9 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
/* Get the required buffer length */ /* Get the required buffer length */
status = acpi_rs_get_pci_routing_table_length(package_object, status =
&buffer_size_needed); acpi_rs_get_pci_routing_table_length(package_object,
&buffer_size_needed);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
...@@ -270,9 +272,9 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object, ...@@ -270,9 +272,9 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
user_prt = ACPI_CAST_PTR(struct acpi_pci_routing_table, buffer); user_prt = ACPI_CAST_PTR(struct acpi_pci_routing_table, buffer);
/* /*
* Fill in the Length field with the information we have at this point. * Fill in the Length field with the information we have at this
* The minus four is to subtract the size of the u8 Source[4] member * point. The minus four is to subtract the size of the u8
* because it is added below. * Source[4] member because it is added below.
*/ */
user_prt->length = (sizeof(struct acpi_pci_routing_table) - 4); user_prt->length = (sizeof(struct acpi_pci_routing_table) - 4);
...@@ -345,11 +347,7 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object, ...@@ -345,11 +347,7 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
(u8 *) output_buffer->pointer); (u8 *) output_buffer->pointer);
path_buffer.pointer = user_prt->source; path_buffer.pointer = user_prt->source;
status = status = acpi_ns_handle_to_pathname((acpi_handle) node, &path_buffer, FALSE);
acpi_ns_handle_to_pathname((acpi_handle)
node,
&path_buffer,
FALSE);
/* +1 to include null terminator */ /* +1 to include null terminator */
...@@ -371,8 +369,8 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object, ...@@ -371,8 +369,8 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object,
case ACPI_TYPE_INTEGER: case ACPI_TYPE_INTEGER:
/* /*
* If this is a number, then the Source Name is NULL, since the * If this is a number, then the Source Name is NULL, since
* entire buffer was zeroed out, we can leave this alone. * the entire buffer was zeroed out, we can leave this alone.
* *
* Add to the Length field the length of the u32 NULL * Add to the Length field the length of the u32 NULL
*/ */
...@@ -451,9 +449,9 @@ acpi_rs_create_aml_resources(struct acpi_buffer *resource_list, ...@@ -451,9 +449,9 @@ acpi_rs_create_aml_resources(struct acpi_buffer *resource_list,
/* Get the buffer size needed for the AML byte stream */ /* Get the buffer size needed for the AML byte stream */
status = acpi_rs_get_aml_length(resource_list->pointer, status =
resource_list->length, acpi_rs_get_aml_length(resource_list->pointer,
&aml_size_needed); resource_list->length, &aml_size_needed);
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "AmlSizeNeeded=%X, %s\n", ACPI_DEBUG_PRINT((ACPI_DB_INFO, "AmlSizeNeeded=%X, %s\n",
(u32)aml_size_needed, acpi_format_exception(status))); (u32)aml_size_needed, acpi_format_exception(status)));
......
...@@ -483,6 +483,7 @@ static void acpi_rs_dump_address_common(union acpi_resource_data *resource) ...@@ -483,6 +483,7 @@ static void acpi_rs_dump_address_common(union acpi_resource_data *resource)
static void acpi_rs_out_string(char *title, char *value) static void acpi_rs_out_string(char *title, char *value)
{ {
acpi_os_printf("%27s : %s", title, value); acpi_os_printf("%27s : %s", title, value);
if (!*value) { if (!*value) {
acpi_os_printf("[NULL NAMESTRING]"); acpi_os_printf("[NULL NAMESTRING]");
...@@ -497,21 +498,25 @@ static void acpi_rs_out_integer8(char *title, u8 value) ...@@ -497,21 +498,25 @@ static void acpi_rs_out_integer8(char *title, u8 value)
static void acpi_rs_out_integer16(char *title, u16 value) static void acpi_rs_out_integer16(char *title, u16 value)
{ {
acpi_os_printf("%27s : %4.4X\n", title, value); acpi_os_printf("%27s : %4.4X\n", title, value);
} }
static void acpi_rs_out_integer32(char *title, u32 value) static void acpi_rs_out_integer32(char *title, u32 value)
{ {
acpi_os_printf("%27s : %8.8X\n", title, value); acpi_os_printf("%27s : %8.8X\n", title, value);
} }
static void acpi_rs_out_integer64(char *title, u64 value) static void acpi_rs_out_integer64(char *title, u64 value)
{ {
acpi_os_printf("%27s : %8.8X%8.8X\n", title, ACPI_FORMAT_UINT64(value)); acpi_os_printf("%27s : %8.8X%8.8X\n", title, ACPI_FORMAT_UINT64(value));
} }
static void acpi_rs_out_title(char *title) static void acpi_rs_out_title(char *title)
{ {
acpi_os_printf("%27s : ", title); acpi_os_printf("%27s : ", title);
} }
...@@ -544,6 +549,7 @@ static void acpi_rs_dump_short_byte_list(u8 length, u8 * data) ...@@ -544,6 +549,7 @@ static void acpi_rs_dump_short_byte_list(u8 length, u8 * data)
for (i = 0; i < length; i++) { for (i = 0; i < length; i++) {
acpi_os_printf("%X ", data[i]); acpi_os_printf("%X ", data[i]);
} }
acpi_os_printf("\n"); acpi_os_printf("\n");
} }
......
...@@ -89,6 +89,7 @@ acpi_rs_convert_aml_to_resources(u8 * aml, ...@@ -89,6 +89,7 @@ acpi_rs_convert_aml_to_resources(u8 * aml,
/* Get the appropriate conversion info table */ /* Get the appropriate conversion info table */
aml_resource = ACPI_CAST_PTR(union aml_resource, aml); aml_resource = ACPI_CAST_PTR(union aml_resource, aml);
if (acpi_ut_get_resource_type(aml) == ACPI_RESOURCE_NAME_SERIAL_BUS) { if (acpi_ut_get_resource_type(aml) == ACPI_RESOURCE_NAME_SERIAL_BUS) {
if (aml_resource->common_serial_bus.type > if (aml_resource->common_serial_bus.type >
AML_RESOURCE_MAX_SERIALBUSTYPE) { AML_RESOURCE_MAX_SERIALBUSTYPE) {
...@@ -225,10 +226,10 @@ acpi_rs_convert_resources_to_aml(struct acpi_resource *resource, ...@@ -225,10 +226,10 @@ acpi_rs_convert_resources_to_aml(struct acpi_resource *resource,
/* Perform final sanity check on the new AML resource descriptor */ /* Perform final sanity check on the new AML resource descriptor */
status = acpi_ut_validate_resource(NULL, status =
ACPI_CAST_PTR(union acpi_ut_validate_resource(NULL,
aml_resource, ACPI_CAST_PTR(union aml_resource,
aml), NULL); aml), NULL);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
......
...@@ -189,8 +189,8 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource, ...@@ -189,8 +189,8 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
item_count = ACPI_GET8(source); item_count = ACPI_GET8(source);
ACPI_SET8(destination, item_count); ACPI_SET8(destination, item_count);
resource->length = resource->length + resource->length =
(info->value * item_count); resource->length + (info->value * item_count);
break; break;
case ACPI_RSC_COUNT_GPIO_RES: case ACPI_RSC_COUNT_GPIO_RES:
...@@ -445,8 +445,8 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource, ...@@ -445,8 +445,8 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
/* Round the resource struct length up to the next boundary (32 or 64) */ /* Round the resource struct length up to the next boundary (32 or 64) */
resource->length = resource->length = (u32)
(u32)ACPI_ROUND_UP_TO_NATIVE_WORD(resource->length); ACPI_ROUND_UP_TO_NATIVE_WORD(resource->length);
} }
return_ACPI_STATUS(AE_OK); return_ACPI_STATUS(AE_OK);
} }
...@@ -550,9 +550,8 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource, ...@@ -550,9 +550,8 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource,
item_count = ACPI_GET8(source); item_count = ACPI_GET8(source);
ACPI_SET8(destination, item_count); ACPI_SET8(destination, item_count);
aml_length = aml_length = (u16)
(u16)(aml_length + (aml_length + (info->value * (item_count - 1)));
(info->value * (item_count - 1)));
break; break;
case ACPI_RSC_COUNT16: case ACPI_RSC_COUNT16:
...@@ -723,11 +722,10 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource, ...@@ -723,11 +722,10 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource,
/* /*
* 16-bit encoded bitmask (IRQ macro) * 16-bit encoded bitmask (IRQ macro)
*/ */
temp16 = acpi_rs_encode_bitmask(source, temp16 =
*ACPI_ADD_PTR(u8, acpi_rs_encode_bitmask(source,
resource, *ACPI_ADD_PTR(u8, resource,
info-> info->value));
value));
ACPI_MOVE_16_TO_16(destination, &temp16); ACPI_MOVE_16_TO_16(destination, &temp16);
break; break;
......
...@@ -221,14 +221,13 @@ acpi_rs_set_resource_length(acpi_rsdesc_size total_length, ...@@ -221,14 +221,13 @@ acpi_rs_set_resource_length(acpi_rsdesc_size total_length,
ACPI_MOVE_16_TO_16(&aml->large_header.resource_length, ACPI_MOVE_16_TO_16(&aml->large_header.resource_length,
&resource_length); &resource_length);
} else { } else {
/* Small descriptor -- bits 2:0 of byte 0 contain the length */ /*
* Small descriptor -- bits 2:0 of byte 0 contain the length
* Clear any existing length, preserving descriptor type bits
*/
aml->small_header.descriptor_type = (u8) aml->small_header.descriptor_type = (u8)
((aml->small_header.descriptor_type &
/* Clear any existing length, preserving descriptor type bits */ ~ACPI_RESOURCE_NAME_SMALL_LENGTH_MASK)
((aml->small_header.
descriptor_type & ~ACPI_RESOURCE_NAME_SMALL_LENGTH_MASK)
| resource_length); | resource_length);
} }
} }
...@@ -333,8 +332,8 @@ acpi_rs_get_resource_source(acpi_rs_length resource_length, ...@@ -333,8 +332,8 @@ acpi_rs_get_resource_source(acpi_rs_length resource_length,
aml_resource_source = ACPI_ADD_PTR(u8, aml, minimum_length); aml_resource_source = ACPI_ADD_PTR(u8, aml, minimum_length);
/* /*
* resource_source is present if the length of the descriptor is longer than * resource_source is present if the length of the descriptor is longer
* the minimum length. * than the minimum length.
* *
* Note: Some resource descriptors will have an additional null, so * Note: Some resource descriptors will have an additional null, so
* we add 1 to the minimum length. * we add 1 to the minimum length.
...@@ -366,6 +365,7 @@ acpi_rs_get_resource_source(acpi_rs_length resource_length, ...@@ -366,6 +365,7 @@ acpi_rs_get_resource_source(acpi_rs_length resource_length,
total_length = total_length =
(u32)strlen(ACPI_CAST_PTR(char, &aml_resource_source[1])) + (u32)strlen(ACPI_CAST_PTR(char, &aml_resource_source[1])) +
1; 1;
total_length = (u32)ACPI_ROUND_UP_TO_NATIVE_WORD(total_length); total_length = (u32)ACPI_ROUND_UP_TO_NATIVE_WORD(total_length);
memset(resource_source->string_ptr, 0, total_length); memset(resource_source->string_ptr, 0, total_length);
...@@ -438,8 +438,8 @@ acpi_rs_set_resource_source(union aml_resource * aml, ...@@ -438,8 +438,8 @@ acpi_rs_set_resource_source(union aml_resource * aml,
* Add the length of the string (+ 1 for null terminator) to the * Add the length of the string (+ 1 for null terminator) to the
* final descriptor length * final descriptor length
*/ */
descriptor_length += descriptor_length += ((acpi_rsdesc_size)
((acpi_rsdesc_size) resource_source->string_length + 1); resource_source->string_length + 1);
} }
/* Return the new total length of the AML descriptor */ /* Return the new total length of the AML descriptor */
...@@ -478,8 +478,9 @@ acpi_rs_get_prt_method_data(struct acpi_namespace_node * node, ...@@ -478,8 +478,9 @@ acpi_rs_get_prt_method_data(struct acpi_namespace_node * node,
/* Execute the method, no parameters */ /* Execute the method, no parameters */
status = acpi_ut_evaluate_object(node, METHOD_NAME__PRT, status =
ACPI_BTYPE_PACKAGE, &obj_desc); acpi_ut_evaluate_object(node, METHOD_NAME__PRT, ACPI_BTYPE_PACKAGE,
&obj_desc);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
...@@ -527,8 +528,9 @@ acpi_rs_get_crs_method_data(struct acpi_namespace_node *node, ...@@ -527,8 +528,9 @@ acpi_rs_get_crs_method_data(struct acpi_namespace_node *node,
/* Execute the method, no parameters */ /* Execute the method, no parameters */
status = acpi_ut_evaluate_object(node, METHOD_NAME__CRS, status =
ACPI_BTYPE_BUFFER, &obj_desc); acpi_ut_evaluate_object(node, METHOD_NAME__CRS, ACPI_BTYPE_BUFFER,
&obj_desc);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
...@@ -577,8 +579,9 @@ acpi_rs_get_prs_method_data(struct acpi_namespace_node *node, ...@@ -577,8 +579,9 @@ acpi_rs_get_prs_method_data(struct acpi_namespace_node *node,
/* Execute the method, no parameters */ /* Execute the method, no parameters */
status = acpi_ut_evaluate_object(node, METHOD_NAME__PRS, status =
ACPI_BTYPE_BUFFER, &obj_desc); acpi_ut_evaluate_object(node, METHOD_NAME__PRS, ACPI_BTYPE_BUFFER,
&obj_desc);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
...@@ -627,8 +630,9 @@ acpi_rs_get_aei_method_data(struct acpi_namespace_node *node, ...@@ -627,8 +630,9 @@ acpi_rs_get_aei_method_data(struct acpi_namespace_node *node,
/* Execute the method, no parameters */ /* Execute the method, no parameters */
status = acpi_ut_evaluate_object(node, METHOD_NAME__AEI, status =
ACPI_BTYPE_BUFFER, &obj_desc); acpi_ut_evaluate_object(node, METHOD_NAME__AEI, ACPI_BTYPE_BUFFER,
&obj_desc);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
......
...@@ -53,7 +53,7 @@ ACPI_MODULE_NAME("rsxface") ...@@ -53,7 +53,7 @@ ACPI_MODULE_NAME("rsxface")
/* Local macros for 16,32-bit to 64-bit conversion */ /* Local macros for 16,32-bit to 64-bit conversion */
#define ACPI_COPY_FIELD(out, in, field) ((out)->field = (in)->field) #define ACPI_COPY_FIELD(out, in, field) ((out)->field = (in)->field)
#define ACPI_COPY_ADDRESS(out, in) \ #define ACPI_COPY_ADDRESS(out, in) \
ACPI_COPY_FIELD(out, in, resource_type); \ ACPI_COPY_FIELD(out, in, resource_type); \
ACPI_COPY_FIELD(out, in, producer_consumer); \ ACPI_COPY_FIELD(out, in, producer_consumer); \
ACPI_COPY_FIELD(out, in, decode); \ ACPI_COPY_FIELD(out, in, decode); \
......
...@@ -407,6 +407,7 @@ acpi_tb_verify_temp_table(struct acpi_table_desc * table_desc, char *signature) ...@@ -407,6 +407,7 @@ acpi_tb_verify_temp_table(struct acpi_table_desc * table_desc, char *signature)
table_desc->signature.ascii : "????", table_desc->signature.ascii : "????",
ACPI_FORMAT_UINT64(table_desc-> ACPI_FORMAT_UINT64(table_desc->
address))); address)));
goto invalidate_and_exit; goto invalidate_and_exit;
} }
} }
......
...@@ -337,8 +337,8 @@ acpi_tb_install_standard_table(acpi_physical_address address, ...@@ -337,8 +337,8 @@ acpi_tb_install_standard_table(acpi_physical_address address,
* need to be unregistered when they are unloaded, and slots in the * need to be unregistered when they are unloaded, and slots in the
* root table list should be reused when empty. * root table list should be reused when empty.
*/ */
if (acpi_gbl_root_table_list.tables[i]. if (acpi_gbl_root_table_list.tables[i].flags &
flags & ACPI_TABLE_IS_LOADED) { ACPI_TABLE_IS_LOADED) {
/* Table is still loaded, this is an error */ /* Table is still loaded, this is an error */
......
...@@ -76,6 +76,7 @@ static void acpi_tb_fix_string(char *string, acpi_size length) ...@@ -76,6 +76,7 @@ static void acpi_tb_fix_string(char *string, acpi_size length)
if (!isprint((int)*string)) { if (!isprint((int)*string)) {
*string = '?'; *string = '?';
} }
string++; string++;
length--; length--;
} }
......
...@@ -121,6 +121,7 @@ void acpi_tb_check_dsdt_header(void) ...@@ -121,6 +121,7 @@ void acpi_tb_check_dsdt_header(void)
ACPI_BIOS_ERROR((AE_INFO, ACPI_BIOS_ERROR((AE_INFO,
"The DSDT has been corrupted or replaced - " "The DSDT has been corrupted or replaced - "
"old, new headers below")); "old, new headers below"));
acpi_tb_print_table_header(0, &acpi_gbl_original_dsdt_header); acpi_tb_print_table_header(0, &acpi_gbl_original_dsdt_header);
acpi_tb_print_table_header(0, acpi_gbl_DSDT); acpi_tb_print_table_header(0, acpi_gbl_DSDT);
...@@ -379,7 +380,6 @@ acpi_status __init acpi_tb_parse_root_table(acpi_physical_address rsdp_address) ...@@ -379,7 +380,6 @@ acpi_status __init acpi_tb_parse_root_table(acpi_physical_address rsdp_address)
} }
acpi_os_unmap_memory(table, length); acpi_os_unmap_memory(table, length);
return_ACPI_STATUS(AE_OK); return_ACPI_STATUS(AE_OK);
} }
......
...@@ -191,6 +191,7 @@ acpi_status acpi_tb_load_namespace(void) ...@@ -191,6 +191,7 @@ acpi_status acpi_tb_load_namespace(void)
"(%4.4s:%8.8s) while loading table", "(%4.4s:%8.8s) while loading table",
table->signature.ascii, table->signature.ascii,
table->pointer->oem_table_id)); table->pointer->oem_table_id));
tables_failed++; tables_failed++;
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT, ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
......
...@@ -257,9 +257,9 @@ acpi_ut_copy_ielement_to_eelement(u8 object_type, ...@@ -257,9 +257,9 @@ acpi_ut_copy_ielement_to_eelement(u8 object_type,
ACPI_FUNCTION_ENTRY(); ACPI_FUNCTION_ENTRY();
this_index = state->pkg.index; this_index = state->pkg.index;
target_object = (union acpi_object *) target_object = (union acpi_object *)&((union acpi_object *)
&((union acpi_object *)(state->pkg.dest_object))->package. (state->pkg.dest_object))->
elements[this_index]; package.elements[this_index];
switch (object_type) { switch (object_type) {
case ACPI_COPY_TYPE_SIMPLE: case ACPI_COPY_TYPE_SIMPLE:
...@@ -348,15 +348,15 @@ acpi_ut_copy_ipackage_to_epackage(union acpi_operand_object *internal_object, ...@@ -348,15 +348,15 @@ acpi_ut_copy_ipackage_to_epackage(union acpi_operand_object *internal_object,
* Free space begins right after the first package * Free space begins right after the first package
*/ */
info.length = ACPI_ROUND_UP_TO_NATIVE_WORD(sizeof(union acpi_object)); info.length = ACPI_ROUND_UP_TO_NATIVE_WORD(sizeof(union acpi_object));
info.free_space = info.free_space = buffer +
buffer + ACPI_ROUND_UP_TO_NATIVE_WORD(sizeof(union acpi_object)); ACPI_ROUND_UP_TO_NATIVE_WORD(sizeof(union acpi_object));
info.object_space = 0; info.object_space = 0;
info.num_packages = 1; info.num_packages = 1;
external_object->type = internal_object->common.type; external_object->type = internal_object->common.type;
external_object->package.count = internal_object->package.count; external_object->package.count = internal_object->package.count;
external_object->package.elements = ACPI_CAST_PTR(union acpi_object, external_object->package.elements =
info.free_space); ACPI_CAST_PTR(union acpi_object, info.free_space);
/* /*
* Leave room for an array of ACPI_OBJECTS in the buffer * Leave room for an array of ACPI_OBJECTS in the buffer
...@@ -593,8 +593,8 @@ acpi_ut_copy_epackage_to_ipackage(union acpi_object *external_object, ...@@ -593,8 +593,8 @@ acpi_ut_copy_epackage_to_ipackage(union acpi_object *external_object,
package_elements = package_object->package.elements; package_elements = package_object->package.elements;
/* /*
* Recursive implementation. Probably ok, since nested external packages * Recursive implementation. Probably ok, since nested external
* as parameters should be very rare. * packages as parameters should be very rare.
*/ */
for (i = 0; i < external_object->package.count; i++) { for (i = 0; i < external_object->package.count; i++) {
status = status =
...@@ -649,9 +649,8 @@ acpi_ut_copy_eobject_to_iobject(union acpi_object *external_object, ...@@ -649,9 +649,8 @@ acpi_ut_copy_eobject_to_iobject(union acpi_object *external_object,
/* /*
* Build a simple object (no nested objects) * Build a simple object (no nested objects)
*/ */
status = status = acpi_ut_copy_esimple_to_isimple(external_object,
acpi_ut_copy_esimple_to_isimple(external_object, internal_object);
internal_object);
} }
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
......
...@@ -180,7 +180,8 @@ const char *acpi_ut_get_event_name(u32 event_id) ...@@ -180,7 +180,8 @@ const char *acpi_ut_get_event_name(u32 event_id)
* *
* The type ACPI_TYPE_ANY (Untyped) is used as a "don't care" when searching; * The type ACPI_TYPE_ANY (Untyped) is used as a "don't care" when searching;
* when stored in a table it really means that we have thus far seen no * when stored in a table it really means that we have thus far seen no
* evidence to indicate what type is actually going to be stored for this entry. * evidence to indicate what type is actually going to be stored for this
& entry.
*/ */
static const char acpi_gbl_bad_type[] = "UNDEFINED"; static const char acpi_gbl_bad_type[] = "UNDEFINED";
......
...@@ -209,6 +209,7 @@ static void acpi_ut_delete_internal_obj(union acpi_operand_object *object) ...@@ -209,6 +209,7 @@ static void acpi_ut_delete_internal_obj(union acpi_operand_object *object)
acpi_ut_delete_object_desc(object->method.mutex); acpi_ut_delete_object_desc(object->method.mutex);
object->method.mutex = NULL; object->method.mutex = NULL;
} }
if (object->method.node) { if (object->method.node) {
object->method.node = NULL; object->method.node = NULL;
} }
...@@ -515,8 +516,8 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action) ...@@ -515,8 +516,8 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action)
} }
/* /*
* All sub-objects must have their reference count incremented also. * All sub-objects must have their reference count incremented
* Different object types have different subobjects. * also. Different object types have different subobjects.
*/ */
switch (object->common.type) { switch (object->common.type) {
case ACPI_TYPE_DEVICE: case ACPI_TYPE_DEVICE:
......
...@@ -217,8 +217,9 @@ acpi_ut_namespace_error(const char *module_name, ...@@ -217,8 +217,9 @@ acpi_ut_namespace_error(const char *module_name,
} else { } else {
/* Convert path to external format */ /* Convert path to external format */
status = acpi_ns_externalize_name(ACPI_UINT32_MAX, status =
internal_name, NULL, &name); acpi_ns_externalize_name(ACPI_UINT32_MAX, internal_name,
NULL, &name);
/* Print target name */ /* Print target name */
...@@ -271,9 +272,8 @@ acpi_ut_method_error(const char *module_name, ...@@ -271,9 +272,8 @@ acpi_ut_method_error(const char *module_name,
acpi_os_printf(ACPI_MSG_ERROR); acpi_os_printf(ACPI_MSG_ERROR);
if (path) { if (path) {
status = status = acpi_ns_get_node(prefix_node, path,
acpi_ns_get_node(prefix_node, path, ACPI_NS_NO_UPSEARCH, ACPI_NS_NO_UPSEARCH, &node);
&node);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
acpi_os_printf("[Could not get node by pathname]"); acpi_os_printf("[Could not get node by pathname]");
} }
......
...@@ -106,6 +106,7 @@ acpi_ut_check_text_mode_corruption(u8 *table, u32 table_length, u32 file_length) ...@@ -106,6 +106,7 @@ acpi_ut_check_text_mode_corruption(u8 *table, u32 table_length, u32 file_length)
pairs++; pairs++;
} }
i++; i++;
} }
} }
...@@ -125,6 +126,7 @@ acpi_ut_check_text_mode_corruption(u8 *table, u32 table_length, u32 file_length) ...@@ -125,6 +126,7 @@ acpi_ut_check_text_mode_corruption(u8 *table, u32 table_length, u32 file_length)
acpi_os_printf("Table has been corrupted by text mode conversion\n"); acpi_os_printf("Table has been corrupted by text mode conversion\n");
acpi_os_printf("All LFs (%u) were changed to CR/LF pairs\n", pairs); acpi_os_printf("All LFs (%u) were changed to CR/LF pairs\n", pairs);
acpi_os_printf("Table cannot be repaired!\n"); acpi_os_printf("Table cannot be repaired!\n");
return (AE_BAD_VALUE); return (AE_BAD_VALUE);
} }
......
...@@ -111,6 +111,7 @@ acpi_ut_short_divide(u64 dividend, ...@@ -111,6 +111,7 @@ acpi_ut_short_divide(u64 dividend,
*/ */
ACPI_DIV_64_BY_32(0, dividend_ovl.part.hi, divisor, ACPI_DIV_64_BY_32(0, dividend_ovl.part.hi, divisor,
quotient.part.hi, remainder32); quotient.part.hi, remainder32);
ACPI_DIV_64_BY_32(remainder32, dividend_ovl.part.lo, divisor, ACPI_DIV_64_BY_32(remainder32, dividend_ovl.part.lo, divisor,
quotient.part.lo, remainder32); quotient.part.lo, remainder32);
...@@ -179,6 +180,7 @@ acpi_ut_divide(u64 in_dividend, ...@@ -179,6 +180,7 @@ acpi_ut_divide(u64 in_dividend,
*/ */
ACPI_DIV_64_BY_32(0, dividend.part.hi, divisor.part.lo, ACPI_DIV_64_BY_32(0, dividend.part.hi, divisor.part.lo,
quotient.part.hi, partial1); quotient.part.hi, partial1);
ACPI_DIV_64_BY_32(partial1, dividend.part.lo, divisor.part.lo, ACPI_DIV_64_BY_32(partial1, dividend.part.lo, divisor.part.lo,
quotient.part.lo, remainder.part.lo); quotient.part.lo, remainder.part.lo);
} }
...@@ -206,12 +208,12 @@ acpi_ut_divide(u64 in_dividend, ...@@ -206,12 +208,12 @@ acpi_ut_divide(u64 in_dividend,
ACPI_DIV_64_BY_32(normalized_dividend.part.hi, ACPI_DIV_64_BY_32(normalized_dividend.part.hi,
normalized_dividend.part.lo, normalized_dividend.part.lo,
normalized_divisor.part.lo, normalized_divisor.part.lo, quotient.part.lo,
quotient.part.lo, partial1); partial1);
/* /*
* The quotient is always 32 bits, and simply requires adjustment. * The quotient is always 32 bits, and simply requires
* The 64-bit remainder must be generated. * adjustment. The 64-bit remainder must be generated.
*/ */
partial1 = quotient.part.lo * divisor.part.hi; partial1 = quotient.part.lo * divisor.part.hi;
partial2.full = (u64) quotient.part.lo * divisor.part.lo; partial2.full = (u64) quotient.part.lo * divisor.part.lo;
......
...@@ -264,8 +264,8 @@ acpi_ut_walk_package_tree(union acpi_operand_object *source_object, ...@@ -264,8 +264,8 @@ acpi_ut_walk_package_tree(union acpi_operand_object *source_object,
*/ */
if ((!this_source_obj) || if ((!this_source_obj) ||
(ACPI_GET_DESCRIPTOR_TYPE(this_source_obj) != (ACPI_GET_DESCRIPTOR_TYPE(this_source_obj) !=
ACPI_DESC_TYPE_OPERAND) ACPI_DESC_TYPE_OPERAND) ||
|| (this_source_obj->common.type != ACPI_TYPE_PACKAGE)) { (this_source_obj->common.type != ACPI_TYPE_PACKAGE)) {
status = status =
walk_callback(ACPI_COPY_TYPE_SIMPLE, walk_callback(ACPI_COPY_TYPE_SIMPLE,
this_source_obj, state, context); this_source_obj, state, context);
...@@ -318,9 +318,10 @@ acpi_ut_walk_package_tree(union acpi_operand_object *source_object, ...@@ -318,9 +318,10 @@ acpi_ut_walk_package_tree(union acpi_operand_object *source_object,
* The callback above returned a new target package object. * The callback above returned a new target package object.
*/ */
acpi_ut_push_generic_state(&state_list, state); acpi_ut_push_generic_state(&state_list, state);
state = acpi_ut_create_pkg_state(this_source_obj, state =
state->pkg. acpi_ut_create_pkg_state(this_source_obj,
this_target_obj, 0); state->pkg.this_target_obj,
0);
if (!state) { if (!state) {
/* Free any stacked Update State objects */ /* Free any stacked Update State objects */
......
...@@ -273,8 +273,9 @@ acpi_status acpi_ut_acquire_mutex(acpi_mutex_handle mutex_id) ...@@ -273,8 +273,9 @@ acpi_status acpi_ut_acquire_mutex(acpi_mutex_handle mutex_id)
(u32)this_thread_id, (u32)this_thread_id,
acpi_ut_get_mutex_name(mutex_id))); acpi_ut_get_mutex_name(mutex_id)));
status = acpi_os_acquire_mutex(acpi_gbl_mutex_info[mutex_id].mutex, status =
ACPI_WAIT_FOREVER); acpi_os_acquire_mutex(acpi_gbl_mutex_info[mutex_id].mutex,
ACPI_WAIT_FOREVER);
if (ACPI_SUCCESS(status)) { if (ACPI_SUCCESS(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, ACPI_DEBUG_PRINT((ACPI_DB_MUTEX,
"Thread %u acquired Mutex [%s]\n", "Thread %u acquired Mutex [%s]\n",
......
...@@ -282,8 +282,8 @@ acpi_status acpi_ut_strtoul64(char *string, u32 base, u64 *ret_integer) ...@@ -282,8 +282,8 @@ acpi_status acpi_ut_strtoul64(char *string, u32 base, u64 *ret_integer)
/* Divide the digit into the correct position */ /* Divide the digit into the correct position */
(void)acpi_ut_short_divide((dividend - (u64)this_digit), (void)acpi_ut_short_divide((dividend - (u64)this_digit), base,
base, &quotient, NULL); &quotient, NULL);
if (return_value > quotient) { if (return_value > quotient) {
if (to_integer_op) { if (to_integer_op) {
......
...@@ -112,9 +112,9 @@ union acpi_operand_object *acpi_ut_create_internal_object_dbg(const char ...@@ -112,9 +112,9 @@ union acpi_operand_object *acpi_ut_create_internal_object_dbg(const char
/* These types require a secondary object */ /* These types require a secondary object */
second_object = acpi_ut_allocate_object_desc_dbg(module_name, second_object =
line_number, acpi_ut_allocate_object_desc_dbg(module_name, line_number,
component_id); component_id);
if (!second_object) { if (!second_object) {
acpi_ut_delete_object_desc(object); acpi_ut_delete_object_desc(object);
return_PTR(NULL); return_PTR(NULL);
...@@ -254,6 +254,7 @@ union acpi_operand_object *acpi_ut_create_buffer_object(acpi_size buffer_size) ...@@ -254,6 +254,7 @@ union acpi_operand_object *acpi_ut_create_buffer_object(acpi_size buffer_size)
if (!buffer) { if (!buffer) {
ACPI_ERROR((AE_INFO, "Could not allocate size %u", ACPI_ERROR((AE_INFO, "Could not allocate size %u",
(u32)buffer_size)); (u32)buffer_size));
acpi_ut_remove_reference(buffer_desc); acpi_ut_remove_reference(buffer_desc);
return_PTR(NULL); return_PTR(NULL);
} }
...@@ -306,6 +307,7 @@ union acpi_operand_object *acpi_ut_create_string_object(acpi_size string_size) ...@@ -306,6 +307,7 @@ union acpi_operand_object *acpi_ut_create_string_object(acpi_size string_size)
if (!string) { if (!string) {
ACPI_ERROR((AE_INFO, "Could not allocate size %u", ACPI_ERROR((AE_INFO, "Could not allocate size %u",
(u32)string_size)); (u32)string_size));
acpi_ut_remove_reference(string_desc); acpi_ut_remove_reference(string_desc);
return_PTR(NULL); return_PTR(NULL);
} }
...@@ -649,8 +651,9 @@ acpi_ut_get_package_object_size(union acpi_operand_object *internal_object, ...@@ -649,8 +651,9 @@ acpi_ut_get_package_object_size(union acpi_operand_object *internal_object,
info.object_space = 0; info.object_space = 0;
info.num_packages = 1; info.num_packages = 1;
status = acpi_ut_walk_package_tree(internal_object, NULL, status =
acpi_ut_get_element_length, &info); acpi_ut_walk_package_tree(internal_object, NULL,
acpi_ut_get_element_length, &info);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
...@@ -660,7 +663,8 @@ acpi_ut_get_package_object_size(union acpi_operand_object *internal_object, ...@@ -660,7 +663,8 @@ acpi_ut_get_package_object_size(union acpi_operand_object *internal_object,
* just add the length of the package objects themselves. * just add the length of the package objects themselves.
* Round up to the next machine word. * Round up to the next machine word.
*/ */
info.length += ACPI_ROUND_UP_TO_NATIVE_WORD(sizeof(union acpi_object)) * info.length +=
ACPI_ROUND_UP_TO_NATIVE_WORD(sizeof(union acpi_object)) *
(acpi_size) info.num_packages; (acpi_size) info.num_packages;
/* Return the total package length */ /* Return the total package length */
...@@ -692,8 +696,8 @@ acpi_ut_get_object_size(union acpi_operand_object *internal_object, ...@@ -692,8 +696,8 @@ acpi_ut_get_object_size(union acpi_operand_object *internal_object,
ACPI_FUNCTION_ENTRY(); ACPI_FUNCTION_ENTRY();
if ((ACPI_GET_DESCRIPTOR_TYPE(internal_object) == if ((ACPI_GET_DESCRIPTOR_TYPE(internal_object) ==
ACPI_DESC_TYPE_OPERAND) ACPI_DESC_TYPE_OPERAND) &&
&& (internal_object->common.type == ACPI_TYPE_PACKAGE)) { (internal_object->common.type == ACPI_TYPE_PACKAGE)) {
status = status =
acpi_ut_get_package_object_size(internal_object, acpi_ut_get_package_object_size(internal_object,
obj_length); obj_length);
......
...@@ -269,9 +269,10 @@ acpi_status acpi_ut_remove_interface(acpi_string interface_name) ...@@ -269,9 +269,10 @@ acpi_status acpi_ut_remove_interface(acpi_string interface_name)
previous_interface = next_interface = acpi_gbl_supported_interfaces; previous_interface = next_interface = acpi_gbl_supported_interfaces;
while (next_interface) { while (next_interface) {
if (!strcmp(interface_name, next_interface->name)) { if (!strcmp(interface_name, next_interface->name)) {
/*
/* Found: name is in either the static list or was added at runtime */ * Found: name is in either the static list
* or was added at runtime
*/
if (next_interface->flags & ACPI_OSI_DYNAMIC) { if (next_interface->flags & ACPI_OSI_DYNAMIC) {
/* Interface was added dynamically, remove and free it */ /* Interface was added dynamically, remove and free it */
...@@ -288,8 +289,8 @@ acpi_status acpi_ut_remove_interface(acpi_string interface_name) ...@@ -288,8 +289,8 @@ acpi_status acpi_ut_remove_interface(acpi_string interface_name)
ACPI_FREE(next_interface); ACPI_FREE(next_interface);
} else { } else {
/* /*
* Interface is in static list. If marked invalid, then it * Interface is in static list. If marked invalid, then
* does not actually exist. Else, mark it invalid. * it does not actually exist. Else, mark it invalid.
*/ */
if (next_interface->flags & ACPI_OSI_INVALID) { if (next_interface->flags & ACPI_OSI_INVALID) {
return (AE_NOT_EXIST); return (AE_NOT_EXIST);
......
...@@ -73,8 +73,8 @@ acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id) ...@@ -73,8 +73,8 @@ acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id)
/* Guard against multiple allocations of ID to the same location */ /* Guard against multiple allocations of ID to the same location */
if (*owner_id) { if (*owner_id) {
ACPI_ERROR((AE_INFO, "Owner ID [0x%2.2X] already exists", ACPI_ERROR((AE_INFO,
*owner_id)); "Owner ID [0x%2.2X] already exists", *owner_id));
return_ACPI_STATUS(AE_ALREADY_EXISTS); return_ACPI_STATUS(AE_ALREADY_EXISTS);
} }
...@@ -87,8 +87,8 @@ acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id) ...@@ -87,8 +87,8 @@ acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id)
/* /*
* Find a free owner ID, cycle through all possible IDs on repeated * Find a free owner ID, cycle through all possible IDs on repeated
* allocations. (ACPI_NUM_OWNERID_MASKS + 1) because first index may have * allocations. (ACPI_NUM_OWNERID_MASKS + 1) because first index
* to be scanned twice. * may have to be scanned twice.
*/ */
for (i = 0, j = acpi_gbl_last_owner_id_index; for (i = 0, j = acpi_gbl_last_owner_id_index;
i < (ACPI_NUM_OWNERID_MASKS + 1); i++, j++) { i < (ACPI_NUM_OWNERID_MASKS + 1); i++, j++) {
...@@ -141,8 +141,8 @@ acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id) ...@@ -141,8 +141,8 @@ acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id)
* they are released when a table is unloaded or a method completes * they are released when a table is unloaded or a method completes
* execution. * execution.
* *
* If this error happens, there may be very deep nesting of invoked control * If this error happens, there may be very deep nesting of invoked
* methods, or there may be a bug where the IDs are not released. * control methods, or there may be a bug where the IDs are not released.
*/ */
status = AE_OWNER_ID_LIMIT; status = AE_OWNER_ID_LIMIT;
ACPI_ERROR((AE_INFO, ACPI_ERROR((AE_INFO,
......
...@@ -225,8 +225,10 @@ const union acpi_predefined_info *acpi_ut_match_resource_name(char *name) ...@@ -225,8 +225,10 @@ const union acpi_predefined_info *acpi_ut_match_resource_name(char *name)
{ {
const union acpi_predefined_info *this_name; const union acpi_predefined_info *this_name;
/* Quick check for a predefined name, first character must be underscore */ /*
* Quick check for a predefined name, first character must
* be underscore
*/
if (name[0] != '_') { if (name[0] != '_') {
return (NULL); return (NULL);
} }
......
...@@ -314,8 +314,9 @@ static char *acpi_ut_format_number(char *string, ...@@ -314,8 +314,9 @@ static char *acpi_ut_format_number(char *string,
if (need_prefix) { if (need_prefix) {
string = acpi_ut_bound_string_output(string, end, '0'); string = acpi_ut_bound_string_output(string, end, '0');
if (base == 16) { if (base == 16) {
string = acpi_ut_bound_string_output(string, end, string =
upper ? 'X' : 'x'); acpi_ut_bound_string_output(string, end,
upper ? 'X' : 'x');
} }
} }
if (!(type & ACPI_FORMAT_LEFT)) { if (!(type & ACPI_FORMAT_LEFT)) {
...@@ -400,6 +401,7 @@ acpi_ut_vsnprintf(char *string, ...@@ -400,6 +401,7 @@ acpi_ut_vsnprintf(char *string,
} else { } else {
break; break;
} }
} while (1); } while (1);
/* Process width */ /* Process width */
...@@ -429,6 +431,7 @@ acpi_ut_vsnprintf(char *string, ...@@ -429,6 +431,7 @@ acpi_ut_vsnprintf(char *string,
++format; ++format;
precision = va_arg(args, int); precision = va_arg(args, int);
} }
if (precision < 0) { if (precision < 0) {
precision = 0; precision = 0;
} }
...@@ -488,10 +491,12 @@ acpi_ut_vsnprintf(char *string, ...@@ -488,10 +491,12 @@ acpi_ut_vsnprintf(char *string,
' '); ' ');
} }
} }
for (i = 0; i < length; ++i) { for (i = 0; i < length; ++i) {
pos = acpi_ut_bound_string_output(pos, end, *s); pos = acpi_ut_bound_string_output(pos, end, *s);
++s; ++s;
} }
while (length < width--) { while (length < width--) {
pos = pos =
acpi_ut_bound_string_output(pos, end, ' '); acpi_ut_bound_string_output(pos, end, ' ');
...@@ -529,9 +534,9 @@ acpi_ut_vsnprintf(char *string, ...@@ -529,9 +534,9 @@ acpi_ut_vsnprintf(char *string,
} }
p = va_arg(args, void *); p = va_arg(args, void *);
pos = acpi_ut_format_number(pos, end, pos =
ACPI_TO_INTEGER(p), 16, acpi_ut_format_number(pos, end, ACPI_TO_INTEGER(p),
width, precision, type); 16, width, precision, type);
continue; continue;
default: default:
......
...@@ -441,8 +441,8 @@ acpi_ut_walk_aml_resources(struct acpi_walk_state *walk_state, ...@@ -441,8 +441,8 @@ acpi_ut_walk_aml_resources(struct acpi_walk_state *walk_state,
acpi_ut_validate_resource(walk_state, aml, &resource_index); acpi_ut_validate_resource(walk_state, aml, &resource_index);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
/* /*
* Exit on failure. Cannot continue because the descriptor length * Exit on failure. Cannot continue because the descriptor
* may be bogus also. * length may be bogus also.
*/ */
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
...@@ -568,8 +568,8 @@ acpi_ut_validate_resource(struct acpi_walk_state *walk_state, ...@@ -568,8 +568,8 @@ acpi_ut_validate_resource(struct acpi_walk_state *walk_state,
} }
/* /*
* Check validity of the resource type, via acpi_gbl_resource_types. Zero * Check validity of the resource type, via acpi_gbl_resource_types.
* indicates an invalid resource. * Zero indicates an invalid resource.
*/ */
if (!acpi_gbl_resource_types[resource_index]) { if (!acpi_gbl_resource_types[resource_index]) {
goto invalid_resource; goto invalid_resource;
......
...@@ -246,6 +246,7 @@ union acpi_generic_state *acpi_ut_create_pkg_state(void *internal_object, ...@@ -246,6 +246,7 @@ union acpi_generic_state *acpi_ut_create_pkg_state(void *internal_object,
state->pkg.dest_object = external_object; state->pkg.dest_object = external_object;
state->pkg.index = index; state->pkg.index = index;
state->pkg.num_packages = 1; state->pkg.num_packages = 1;
return (state); return (state);
} }
...@@ -279,6 +280,7 @@ union acpi_generic_state *acpi_ut_create_control_state(void) ...@@ -279,6 +280,7 @@ union acpi_generic_state *acpi_ut_create_control_state(void)
state->common.descriptor_type = ACPI_DESC_TYPE_STATE_CONTROL; state->common.descriptor_type = ACPI_DESC_TYPE_STATE_CONTROL;
state->common.state = ACPI_CONTROL_CONDITIONAL_EXECUTING; state->common.state = ACPI_CONTROL_CONDITIONAL_EXECUTING;
return (state); return (state);
} }
...@@ -304,5 +306,6 @@ void acpi_ut_delete_generic_state(union acpi_generic_state *state) ...@@ -304,5 +306,6 @@ void acpi_ut_delete_generic_state(union acpi_generic_state *state)
if (state) { if (state) {
(void)acpi_os_release_object(acpi_gbl_state_cache, state); (void)acpi_os_release_object(acpi_gbl_state_cache, state);
} }
return; return;
} }
...@@ -135,6 +135,7 @@ void acpi_ut_print_string(char *string, u16 max_length) ...@@ -135,6 +135,7 @@ void acpi_ut_print_string(char *string, u16 max_length)
break; break;
} }
} }
acpi_os_printf("\""); acpi_os_printf("\"");
if (i == max_length && string[i]) { if (i == max_length && string[i]) {
......
...@@ -150,9 +150,9 @@ void *acpi_ut_allocate_and_track(acpi_size size, ...@@ -150,9 +150,9 @@ void *acpi_ut_allocate_and_track(acpi_size size,
return (NULL); return (NULL);
} }
status = acpi_ut_track_allocation(allocation, size, status =
ACPI_MEM_MALLOC, component, module, acpi_ut_track_allocation(allocation, size, ACPI_MEM_MALLOC,
line); component, module, line);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
acpi_os_free(allocation); acpi_os_free(allocation);
return (NULL); return (NULL);
...@@ -161,6 +161,7 @@ void *acpi_ut_allocate_and_track(acpi_size size, ...@@ -161,6 +161,7 @@ void *acpi_ut_allocate_and_track(acpi_size size,
acpi_gbl_global_list->total_allocated++; acpi_gbl_global_list->total_allocated++;
acpi_gbl_global_list->total_size += (u32)size; acpi_gbl_global_list->total_size += (u32)size;
acpi_gbl_global_list->current_total_size += (u32)size; acpi_gbl_global_list->current_total_size += (u32)size;
if (acpi_gbl_global_list->current_total_size > if (acpi_gbl_global_list->current_total_size >
acpi_gbl_global_list->max_occupied) { acpi_gbl_global_list->max_occupied) {
acpi_gbl_global_list->max_occupied = acpi_gbl_global_list->max_occupied =
...@@ -223,6 +224,7 @@ void *acpi_ut_allocate_zeroed_and_track(acpi_size size, ...@@ -223,6 +224,7 @@ void *acpi_ut_allocate_zeroed_and_track(acpi_size size,
acpi_gbl_global_list->total_allocated++; acpi_gbl_global_list->total_allocated++;
acpi_gbl_global_list->total_size += (u32)size; acpi_gbl_global_list->total_size += (u32)size;
acpi_gbl_global_list->current_total_size += (u32)size; acpi_gbl_global_list->current_total_size += (u32)size;
if (acpi_gbl_global_list->current_total_size > if (acpi_gbl_global_list->current_total_size >
acpi_gbl_global_list->max_occupied) { acpi_gbl_global_list->max_occupied) {
acpi_gbl_global_list->max_occupied = acpi_gbl_global_list->max_occupied =
...@@ -269,8 +271,8 @@ acpi_ut_free_and_track(void *allocation, ...@@ -269,8 +271,8 @@ acpi_ut_free_and_track(void *allocation,
acpi_gbl_global_list->total_freed++; acpi_gbl_global_list->total_freed++;
acpi_gbl_global_list->current_total_size -= debug_block->size; acpi_gbl_global_list->current_total_size -= debug_block->size;
status = acpi_ut_remove_allocation(debug_block, status =
component, module, line); acpi_ut_remove_allocation(debug_block, component, module, line);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "Could not free memory")); ACPI_EXCEPTION((AE_INFO, status, "Could not free memory"));
} }
...@@ -525,35 +527,35 @@ void acpi_ut_dump_allocation_info(void) ...@@ -525,35 +527,35 @@ void acpi_ut_dump_allocation_info(void)
/* /*
ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES, ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
("%30s: %4d (%3d Kb)\n", "Current allocations", ("%30s: %4d (%3d Kb)\n", "Current allocations",
mem_list->current_count, mem_list->current_count,
ROUND_UP_TO_1K (mem_list->current_size))); ROUND_UP_TO_1K (mem_list->current_size)));
ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES, ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
("%30s: %4d (%3d Kb)\n", "Max concurrent allocations", ("%30s: %4d (%3d Kb)\n", "Max concurrent allocations",
mem_list->max_concurrent_count, mem_list->max_concurrent_count,
ROUND_UP_TO_1K (mem_list->max_concurrent_size))); ROUND_UP_TO_1K (mem_list->max_concurrent_size)));
ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES, ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
("%30s: %4d (%3d Kb)\n", "Total (all) internal objects", ("%30s: %4d (%3d Kb)\n", "Total (all) internal objects",
running_object_count, running_object_count,
ROUND_UP_TO_1K (running_object_size))); ROUND_UP_TO_1K (running_object_size)));
ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES, ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
("%30s: %4d (%3d Kb)\n", "Total (all) allocations", ("%30s: %4d (%3d Kb)\n", "Total (all) allocations",
running_alloc_count, running_alloc_count,
ROUND_UP_TO_1K (running_alloc_size))); ROUND_UP_TO_1K (running_alloc_size)));
ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES, ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
("%30s: %4d (%3d Kb)\n", "Current Nodes", ("%30s: %4d (%3d Kb)\n", "Current Nodes",
acpi_gbl_current_node_count, acpi_gbl_current_node_count,
ROUND_UP_TO_1K (acpi_gbl_current_node_size))); ROUND_UP_TO_1K (acpi_gbl_current_node_size)));
ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES, ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
("%30s: %4d (%3d Kb)\n", "Max Nodes", ("%30s: %4d (%3d Kb)\n", "Max Nodes",
acpi_gbl_max_concurrent_node_count, acpi_gbl_max_concurrent_node_count,
ROUND_UP_TO_1K ((acpi_gbl_max_concurrent_node_count * ROUND_UP_TO_1K ((acpi_gbl_max_concurrent_node_count *
sizeof (struct acpi_namespace_node))))); sizeof (struct acpi_namespace_node)))));
*/ */
return_VOID; return_VOID;
} }
......
...@@ -154,7 +154,6 @@ acpi_status acpi_get_system_info(struct acpi_buffer * out_buffer) ...@@ -154,7 +154,6 @@ acpi_status acpi_get_system_info(struct acpi_buffer * out_buffer)
* Populate the return buffer * Populate the return buffer
*/ */
info_ptr = (struct acpi_system_info *)out_buffer->pointer; info_ptr = (struct acpi_system_info *)out_buffer->pointer;
info_ptr->acpi_ca_version = ACPI_CA_VERSION; info_ptr->acpi_ca_version = ACPI_CA_VERSION;
/* System flags (ACPI capabilities) */ /* System flags (ACPI capabilities) */
...@@ -216,7 +215,6 @@ acpi_status acpi_get_statistics(struct acpi_statistics *stats) ...@@ -216,7 +215,6 @@ acpi_status acpi_get_statistics(struct acpi_statistics *stats)
/* Other counters */ /* Other counters */
stats->method_count = acpi_method_count; stats->method_count = acpi_method_count;
return_ACPI_STATUS(AE_OK); return_ACPI_STATUS(AE_OK);
} }
......
...@@ -117,6 +117,7 @@ acpi_exception(const char *module_name, ...@@ -117,6 +117,7 @@ acpi_exception(const char *module_name,
acpi_os_printf(ACPI_MSG_EXCEPTION "%s, ", acpi_os_printf(ACPI_MSG_EXCEPTION "%s, ",
acpi_format_exception(status)); acpi_format_exception(status));
} }
va_start(arg_list, format); va_start(arg_list, format);
acpi_os_vprintf(format, arg_list); acpi_os_vprintf(format, arg_list);
ACPI_MSG_SUFFIX; ACPI_MSG_SUFFIX;
......
...@@ -89,9 +89,9 @@ acpi_ut_get_mutex_object(acpi_handle handle, ...@@ -89,9 +89,9 @@ acpi_ut_get_mutex_object(acpi_handle handle,
mutex_node = handle; mutex_node = handle;
if (pathname != NULL) { if (pathname != NULL) {
status = acpi_get_handle(handle, pathname, status =
ACPI_CAST_PTR(acpi_handle, acpi_get_handle(handle, pathname,
&mutex_node)); ACPI_CAST_PTR(acpi_handle, &mutex_node));
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
return (status); return (status);
} }
......
...@@ -85,6 +85,7 @@ static int current_char_ptr = 1; ...@@ -85,6 +85,7 @@ static int current_char_ptr = 1;
int acpi_getopt_argument(int argc, char **argv) int acpi_getopt_argument(int argc, char **argv)
{ {
acpi_gbl_optind--; acpi_gbl_optind--;
current_char_ptr++; current_char_ptr++;
......
...@@ -73,6 +73,7 @@ ACPI_FILE acpi_os_open_file(const char *path, u8 modes) ...@@ -73,6 +73,7 @@ ACPI_FILE acpi_os_open_file(const char *path, u8 modes)
if (modes & ACPI_FILE_WRITING) { if (modes & ACPI_FILE_WRITING) {
modes_str[i++] = 'w'; modes_str[i++] = 'w';
} }
if (modes & ACPI_FILE_BINARY) { if (modes & ACPI_FILE_BINARY) {
modes_str[i++] = 'b'; modes_str[i++] = 'b';
} }
...@@ -101,6 +102,7 @@ ACPI_FILE acpi_os_open_file(const char *path, u8 modes) ...@@ -101,6 +102,7 @@ ACPI_FILE acpi_os_open_file(const char *path, u8 modes)
void acpi_os_close_file(ACPI_FILE file) void acpi_os_close_file(ACPI_FILE file)
{ {
fclose(file); fclose(file);
} }
...@@ -202,6 +204,7 @@ acpi_status acpi_os_set_file_offset(ACPI_FILE file, long offset, u8 from) ...@@ -202,6 +204,7 @@ acpi_status acpi_os_set_file_offset(ACPI_FILE file, long offset, u8 from)
if (from == ACPI_FILE_BEGIN) { if (from == ACPI_FILE_BEGIN) {
ret = fseek(file, offset, SEEK_SET); ret = fseek(file, offset, SEEK_SET);
} }
if (from == ACPI_FILE_END) { if (from == ACPI_FILE_END) {
ret = fseek(file, offset, SEEK_END); ret = fseek(file, offset, SEEK_END);
} }
......
...@@ -48,6 +48,18 @@ ...@@ -48,6 +48,18 @@
static int ap_is_existing_file(char *pathname); static int ap_is_existing_file(char *pathname);
/******************************************************************************
*
* FUNCTION: ap_is_existing_file
*
* PARAMETERS: pathname - Output filename
*
* RETURN: 0 on success
*
* DESCRIPTION: Query for file overwrite if it already exists.
*
******************************************************************************/
static int ap_is_existing_file(char *pathname) static int ap_is_existing_file(char *pathname)
{ {
#ifndef _GNU_EFI #ifndef _GNU_EFI
...@@ -136,6 +148,7 @@ int ap_write_to_binary_file(struct acpi_table_header *table, u32 instance) ...@@ -136,6 +148,7 @@ int ap_write_to_binary_file(struct acpi_table_header *table, u32 instance)
} else { } else {
ACPI_MOVE_NAME(filename, table->signature); ACPI_MOVE_NAME(filename, table->signature);
} }
filename[0] = (char)tolower((int)filename[0]); filename[0] = (char)tolower((int)filename[0]);
filename[1] = (char)tolower((int)filename[1]); filename[1] = (char)tolower((int)filename[1]);
filename[2] = (char)tolower((int)filename[2]); filename[2] = (char)tolower((int)filename[2]);
......
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