# This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1303 -> 1.1305 # include/acpi/acglobal.h 1.22 -> 1.23 # drivers/acpi/executer/exoparg3.c 1.8 -> 1.9 # drivers/acpi/hardware/hwacpi.c 1.17 -> 1.18 # include/acpi/acutils.h 1.22 -> 1.23 # drivers/acpi/pci_root.c 1.5 -> 1.6 # drivers/acpi/dispatcher/dswload.c 1.19 -> 1.20 # drivers/acpi/utilities/uteval.c 1.15 -> 1.16 # drivers/acpi/hardware/hwsleep.c 1.22 -> 1.23 # drivers/acpi/events/evrgnini.c 1.16 -> 1.18 # drivers/acpi/executer/exdump.c 1.15 -> 1.17 # drivers/acpi/utilities/utglobal.c 1.22 -> 1.24 # include/acpi/acobject.h 1.16 -> 1.18 # drivers/acpi/utilities/utalloc.c 1.15 -> 1.16 # drivers/acpi/executer/exregion.c 1.14 -> 1.15 # include/acpi/acpi_drivers.h 1.6 -> 1.7 # drivers/acpi/events/evxfregn.c 1.15 -> 1.17 # drivers/acpi/parser/psparse.c 1.18 -> 1.19 # drivers/acpi/tables.c 1.11 -> 1.12 # drivers/acpi/events/evgpeblk.c 1.7 -> 1.9 # drivers/acpi/executer/exprep.c 1.15 -> 1.16 # include/acpi/acconfig.h 1.39 -> 1.41 # drivers/acpi/namespace/nsxfname.c 1.14 -> 1.15 # drivers/acpi/namespace/nsdumpdv.c 1.9 -> 1.10 # drivers/acpi/parser/psargs.c 1.16 -> 1.17 # arch/i386/kernel/mpparse.c 1.42 -> 1.43 # drivers/acpi/executer/exfldio.c 1.21 -> 1.22 # drivers/acpi/resources/rscreate.c 1.14 -> 1.15 # drivers/acpi/namespace/nsinit.c 1.18 -> 1.19 # drivers/acpi/dispatcher/dsmthdat.c 1.18 -> 1.20 # drivers/acpi/executer/exresolv.c 1.16 -> 1.17 # drivers/acpi/namespace/nsobject.c 1.14 -> 1.15 # drivers/acpi/executer/exstore.c 1.21 -> 1.22 # drivers/acpi/resources/rsirq.c 1.13 -> 1.14 # arch/i386/kernel/smpboot.c 1.18 -> 1.19 # drivers/acpi/utilities/utdelete.c 1.17 -> 1.18 # drivers/acpi/dispatcher/dsmethod.c 1.14 -> 1.15 # drivers/acpi/namespace/nsutils.c 1.22 -> 1.23 # drivers/acpi/processor.c 1.13 -> 1.14 # drivers/acpi/namespace/nsalloc.c 1.15 -> 1.16 # drivers/acpi/tables/tbrsdt.c 1.10 -> 1.11 # drivers/acpi/tables/tbgetall.c 1.11 -> 1.12 # drivers/acpi/resources/rscalc.c 1.15 -> 1.16 # drivers/acpi/dispatcher/dsinit.c 1.10 -> 1.11 # include/acpi/acmacros.h 1.17 -> 1.18 # drivers/acpi/bus.c 1.19 -> 1.20 # drivers/acpi/resources/rsdump.c 1.13 -> 1.14 # include/acpi/acevents.h 1.16 -> 1.17 # drivers/acpi/events/evmisc.c 1.20 -> 1.21 # drivers/acpi/thermal.c 1.9 -> 1.10 # drivers/acpi/utilities/utdebug.c 1.16 -> 1.17 # drivers/acpi/tables/tbget.c 1.17 -> 1.19 # drivers/acpi/utilities/utobject.c 1.16 -> 1.17 # drivers/acpi/events/evregion.c 1.18 -> 1.20 # drivers/acpi/executer/exsystem.c 1.13 -> 1.14 # drivers/acpi/events/evgpe.c 1.15 -> 1.17 # drivers/acpi/tables/tbxfroot.c 1.15 -> 1.16 # drivers/acpi/executer/exmutex.c 1.10 -> 1.11 # drivers/acpi/parser/psxface.c 1.14 -> 1.15 # arch/i386/kernel/acpi.c 1.19 -> 1.20 # drivers/acpi/dispatcher/dsopcode.c 1.19 -> 1.21 # drivers/acpi/executer/exmisc.c 1.17 -> 1.18 # drivers/acpi/hardware/hwregs.c 1.21 -> 1.22 # drivers/acpi/Config.in 1.15 -> 1.16 # drivers/acpi/executer/exresop.c 1.17 -> 1.18 # drivers/acpi/tables/tbxface.c 1.14 -> 1.15 # drivers/acpi/executer/exoparg1.c 1.18 -> 1.19 # drivers/acpi/namespace/nsdump.c 1.17 -> 1.18 # arch/x86_64/kernel/acpi.c 1.10 -> 1.11 # drivers/acpi/namespace/nssearch.c 1.17 -> 1.18 # drivers/acpi/namespace/nsaccess.c 1.18 -> 1.19 # drivers/acpi/dispatcher/dswexec.c 1.18 -> 1.19 # drivers/acpi/dispatcher/dswscope.c 1.14 -> 1.15 # drivers/acpi/resources/rslist.c 1.11 -> 1.12 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/12/18 len.brown@intel.com 1.1304 # Merge intel.com:/home/lenb/bk/linux-2.4.24 # into intel.com:/home/lenb/bk/linux-acpi-test-2.4.24 # -------------------------------------------- # 03/12/18 len.brown@intel.com 1.1303.1.1 # Merge intel.com:/home/lenb/bk/linux-2.4.24 # into intel.com:/home/lenb/src/linux-acpi-test-2.4.24 # -------------------------------------------- # 03/12/18 len.brown@intel.com 1.1305 # Merge intel.com:/home/lenb/bk/linux-acpi-test-2.4.24 # into intel.com:/home/lenb/src/linux-acpi-test-2.4.24 # -------------------------------------------- # diff -Nru a/arch/i386/kernel/acpi.c b/arch/i386/kernel/acpi.c --- a/arch/i386/kernel/acpi.c Thu Dec 18 04:49:01 2003 +++ b/arch/i386/kernel/acpi.c Thu Dec 18 04:49:01 2003 @@ -333,8 +333,10 @@ * Initialize the ACPI boot-time table parser. */ result = acpi_table_init(); - if (result) + if (result) { + acpi_disabled = 1; return result; + } result = acpi_blacklisted(); if (result) { diff -Nru a/arch/i386/kernel/mpparse.c b/arch/i386/kernel/mpparse.c --- a/arch/i386/kernel/mpparse.c Thu Dec 18 04:49:01 2003 +++ b/arch/i386/kernel/mpparse.c Thu Dec 18 04:49:01 2003 @@ -1280,8 +1280,14 @@ ioapic_pin = irq - mp_ioapic_routing[ioapic].irq_start; + /* + * MPS INTI flags: + * trigger: 0=default, 1=edge, 3=level + * polarity: 0=default, 1=high, 3=low + * Per ACPI spec, default for SCI means level/low. + */ io_apic_set_pci_routing(ioapic, ioapic_pin, irq, - (flags.trigger >> 1) , (flags.polarity >> 1)); + (flags.trigger == 1 ? 0 : 1), (flags.polarity == 1 ? 0 : 1)); } diff -Nru a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c --- a/arch/i386/kernel/smpboot.c Thu Dec 18 04:49:01 2003 +++ b/arch/i386/kernel/smpboot.c Thu Dec 18 04:49:01 2003 @@ -1106,7 +1106,7 @@ */ Dprintk("CPU present map: %lx\n", phys_cpu_present_map); - for (bit = 0; bit < BITS_PER_LONG; bit++) { + for (bit = 0; bit < MAX_APICS; bit++) { apicid = cpu_present_to_apicid(bit); /* don't try to boot BAD_APICID */ diff -Nru a/arch/x86_64/kernel/acpi.c b/arch/x86_64/kernel/acpi.c --- a/arch/x86_64/kernel/acpi.c Thu Dec 18 04:49:01 2003 +++ b/arch/x86_64/kernel/acpi.c Thu Dec 18 04:49:01 2003 @@ -411,8 +411,10 @@ * Initialize the ACPI boot-time table parser. */ result = acpi_table_init(); - if (result) + if (result) { + acpi_disabled = 1; return result; + } #ifdef CONFIG_X86_LOCAL_APIC diff -Nru a/drivers/acpi/Config.in b/drivers/acpi/Config.in --- a/drivers/acpi/Config.in Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/Config.in Thu Dec 18 04:49:01 2003 @@ -32,7 +32,7 @@ tristate ' Toshiba Laptop Extras' CONFIG_ACPI_TOSHIBA bool ' Debug Statements' CONFIG_ACPI_DEBUG bool ' Relaxed AML Checking' CONFIG_ACPI_RELAXED_AML - else + else if [ "$CONFIG_SMP" = "y" ]; then define_bool CONFIG_ACPI_BOOT y fi diff -Nru a/drivers/acpi/bus.c b/drivers/acpi/bus.c --- a/drivers/acpi/bus.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/bus.c Thu Dec 18 04:49:01 2003 @@ -2047,8 +2047,10 @@ #endif result = acpi_bus_init(); - if (result) + if (result) { + acpi_disabled = 1; return_VALUE(result); + } #ifdef CONFIG_PM pm_active = 1; diff -Nru a/drivers/acpi/dispatcher/dsinit.c b/drivers/acpi/dispatcher/dsinit.c --- a/drivers/acpi/dispatcher/dsinit.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/dispatcher/dsinit.c Thu Dec 18 04:49:01 2003 @@ -106,7 +106,7 @@ status = acpi_ds_initialize_region (obj_handle); if (ACPI_FAILURE (status)) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Region %p [%4.4s] - Init failure, %s\n", - obj_handle, ((struct acpi_namespace_node *) obj_handle)->name.ascii, + obj_handle, acpi_ut_get_node_name (obj_handle), acpi_format_exception (status))); } @@ -141,7 +141,7 @@ status = acpi_ds_parse_method (obj_handle); if (ACPI_FAILURE (status)) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Method %p [%4.4s] - parse failure, %s\n", - obj_handle, ((struct acpi_namespace_node *) obj_handle)->name.ascii, + obj_handle, acpi_ut_get_node_name (obj_handle), acpi_format_exception (status))); /* This parse failed, but we will continue parsing more methods */ diff -Nru a/drivers/acpi/dispatcher/dsmethod.c b/drivers/acpi/dispatcher/dsmethod.c --- a/drivers/acpi/dispatcher/dsmethod.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/dispatcher/dsmethod.c Thu Dec 18 04:49:01 2003 @@ -94,7 +94,7 @@ } ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "**** Parsing [%4.4s] **** named_obj=%p\n", - ((struct acpi_namespace_node *) obj_handle)->name.ascii, obj_handle)); + acpi_ut_get_node_name (obj_handle), obj_handle)); /* Extract the method object from the method Node */ @@ -169,7 +169,7 @@ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "**** [%4.4s] Parsed **** named_obj=%p Op=%p\n", - ((struct acpi_namespace_node *) obj_handle)->name.ascii, obj_handle, op)); + acpi_ut_get_node_name (obj_handle), obj_handle, op)); acpi_ps_delete_parse_tree (op); return_ACPI_STATUS (status); diff -Nru a/drivers/acpi/dispatcher/dsmthdat.c b/drivers/acpi/dispatcher/dsmthdat.c --- a/drivers/acpi/dispatcher/dsmthdat.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/dispatcher/dsmthdat.c Thu Dec 18 04:49:01 2003 @@ -567,13 +567,13 @@ acpi_status status; struct acpi_namespace_node *node; union acpi_operand_object *current_obj_desc; + union acpi_operand_object *new_obj_desc; ACPI_FUNCTION_TRACE ("ds_store_object_to_local"); ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Opcode=%d Idx=%d Obj=%p\n", opcode, index, obj_desc)); - /* Parameter validation */ if (!obj_desc) { @@ -595,6 +595,19 @@ } /* + * If the reference count on the object is more than one, we must + * take a copy of the object before we store. + */ + new_obj_desc = obj_desc; + if (obj_desc->common.reference_count > 1) { + status = acpi_ut_copy_iobject_to_iobject (obj_desc, &new_obj_desc, walk_state); + new_obj_desc; + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } + } + + /* * If there is an object already in this slot, we either * have to delete it, or if this is an argument and there * is an object reference stored there, we have to do @@ -624,8 +637,8 @@ * operand objects of type Reference. */ if (ACPI_GET_DESCRIPTOR_TYPE (current_obj_desc) != ACPI_DESC_TYPE_OPERAND) { - ACPI_REPORT_ERROR (("Invalid descriptor type while storing to method arg: %X\n", - current_obj_desc->common.type)); + ACPI_REPORT_ERROR (("Invalid descriptor type while storing to method arg: [%s]\n", + acpi_ut_get_descriptor_name (current_obj_desc))); return_ACPI_STATUS (AE_AML_INTERNAL); } @@ -636,15 +649,21 @@ if ((current_obj_desc->common.type == ACPI_TYPE_LOCAL_REFERENCE) && (current_obj_desc->reference.opcode == AML_REF_OF_OP)) { ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, - "Arg (%p) is an obj_ref(Node), storing in node %p\n", - obj_desc, current_obj_desc)); + "Arg (%p) is an obj_ref(Node), storing in node %p\n", + new_obj_desc, current_obj_desc)); /* * Store this object to the Node * (perform the indirect store) */ - status = acpi_ex_store_object_to_node (obj_desc, + status = acpi_ex_store_object_to_node (new_obj_desc, current_obj_desc->reference.object, walk_state); + + /* Remove local reference if we copied the object above */ + + if (new_obj_desc != obj_desc) { + acpi_ut_remove_reference (new_obj_desc); + } return_ACPI_STATUS (status); } } @@ -657,12 +676,18 @@ } /* - * Install the obj_stack descriptor (*obj_desc) into + * Install the Obj descriptor (*new_obj_desc) into * the descriptor for the Arg or Local. - * Install the new object in the stack entry * (increments the object reference count by one) */ - status = acpi_ds_method_data_set_value (opcode, index, obj_desc, walk_state); + status = acpi_ds_method_data_set_value (opcode, index, new_obj_desc, walk_state); + + /* Remove local reference if we copied the object above */ + + if (new_obj_desc != obj_desc) { + acpi_ut_remove_reference (new_obj_desc); + } + return_ACPI_STATUS (status); } diff -Nru a/drivers/acpi/dispatcher/dsopcode.c b/drivers/acpi/dispatcher/dsopcode.c --- a/drivers/acpi/dispatcher/dsopcode.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/dispatcher/dsopcode.c Thu Dec 18 04:49:01 2003 @@ -201,7 +201,7 @@ ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname (ACPI_TYPE_BUFFER_FIELD, node, NULL)); ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] buffer_field Arg Init\n", - node->name.ascii)); + acpi_ut_get_node_name (node))); /* Execute the AML code for the term_arg arguments */ @@ -346,7 +346,7 @@ ACPI_DEBUG_EXEC (acpi_ut_display_init_pathname (ACPI_TYPE_REGION, node, NULL)); ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] op_region Arg Init at AML %p\n", - node->name.ascii, extra_desc->extra.aml_start)); + acpi_ut_get_node_name (node), extra_desc->extra.aml_start)); /* Execute the argument AML */ @@ -438,8 +438,8 @@ * after resolution in acpi_ex_resolve_operands(). */ if (ACPI_GET_DESCRIPTOR_TYPE (result_desc) != ACPI_DESC_TYPE_NAMED) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "(%s) destination must be a NS Node\n", - acpi_ps_get_opcode_name (aml_opcode))); + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "(%s) destination not a NS Node [%s]\n", + acpi_ps_get_opcode_name (aml_opcode), acpi_ut_get_descriptor_name (result_desc))); status = AE_AML_OPERAND_TYPE; goto cleanup; @@ -514,14 +514,16 @@ goto cleanup; } - /* Entire field must fit within the current length of the buffer */ if ((bit_offset + bit_count) > (8 * (u32) buffer_desc->buffer.length)) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Field size %d exceeds Buffer size %d (bits)\n", - bit_offset + bit_count, 8 * (u32) buffer_desc->buffer.length)); + "Field [%4.4s] size %d exceeds Buffer [%4.4s] size %d (bits)\n", + acpi_ut_get_node_name (result_desc), + bit_offset + bit_count, + acpi_ut_get_node_name (buffer_desc->buffer.node), + 8 * (u32) buffer_desc->buffer.length)); status = AE_AML_BUFFER_LIMIT; goto cleanup; } @@ -742,7 +744,7 @@ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "rgn_obj %p Addr %8.8X%8.8X Len %X\n", obj_desc, - ACPI_HIDWORD (obj_desc->region.address), ACPI_LODWORD (obj_desc->region.address), + ACPI_FORMAT_UINT64 (obj_desc->region.address), obj_desc->region.length)); /* Now the address and length are valid for this opregion */ diff -Nru a/drivers/acpi/dispatcher/dswexec.c b/drivers/acpi/dispatcher/dswexec.c --- a/drivers/acpi/dispatcher/dswexec.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/dispatcher/dswexec.c Thu Dec 18 04:49:01 2003 @@ -416,10 +416,24 @@ status = acpi_gbl_op_type_dispatch [op_type] (walk_state); } else { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "[%s]: Could not resolve operands, %s\n", - acpi_ps_get_opcode_name (walk_state->opcode), - acpi_format_exception (status))); + /* + * Treat constructs of the form "Store(local_x,local_x)" as noops when the + * Local is uninitialized. + */ + if ((status == AE_AML_UNINITIALIZED_LOCAL) && + (walk_state->opcode == AML_STORE_OP) && + (walk_state->operands[0]->common.type == ACPI_TYPE_LOCAL_REFERENCE) && + (walk_state->operands[1]->common.type == ACPI_TYPE_LOCAL_REFERENCE) && + (walk_state->operands[0]->reference.opcode == + walk_state->operands[1]->reference.opcode)) { + status = AE_OK; + } + else { + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "[%s]: Could not resolve operands, %s\n", + acpi_ps_get_opcode_name (walk_state->opcode), + acpi_format_exception (status))); + } } /* Always delete the argument objects and clear the operand stack */ diff -Nru a/drivers/acpi/dispatcher/dswload.c b/drivers/acpi/dispatcher/dswload.c --- a/drivers/acpi/dispatcher/dswload.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/dispatcher/dswload.c Thu Dec 18 04:49:01 2003 @@ -167,7 +167,7 @@ object_type = walk_state->op_info->object_type; ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "State=%p Op=%p [%s] ", walk_state, op, acpi_ut_get_type_name (object_type))); + "State=%p Op=%p [%s]\n", walk_state, op, acpi_ut_get_type_name (object_type))); switch (walk_state->opcode) { case AML_SCOPE_OP: @@ -260,10 +260,12 @@ if ((walk_state->opcode != AML_SCOPE_OP) && (!(walk_state->parse_flags & ACPI_PARSE_DEFERRED_OP))) { flags |= ACPI_NS_ERROR_IF_FOUND; - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DISPATCH, "Cannot already exist\n")); + ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "[%s] Cannot already exist\n", + acpi_ut_get_type_name (object_type))); } else { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DISPATCH, "Both Find or Create allowed\n")); + ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "[%s] Both Find or Create allowed\n", + acpi_ut_get_type_name (object_type))); } /* diff -Nru a/drivers/acpi/dispatcher/dswscope.c b/drivers/acpi/dispatcher/dswscope.c --- a/drivers/acpi/dispatcher/dswscope.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/dispatcher/dswscope.c Thu Dec 18 04:49:01 2003 @@ -146,7 +146,7 @@ if (old_scope_info) { ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, "[%4.4s] (%s)", - old_scope_info->scope.node->name.ascii, + acpi_ut_get_node_name (old_scope_info->scope.node), acpi_ut_get_type_name (old_scope_info->common.value))); } else { @@ -156,7 +156,7 @@ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, ", New scope -> [%4.4s] (%s)\n", - scope_info->scope.node->name.ascii, + acpi_ut_get_node_name (scope_info->scope.node), acpi_ut_get_type_name (scope_info->common.value))); /* Push new scope object onto stack */ @@ -207,14 +207,14 @@ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%.2d] Popped scope [%4.4s] (%s), New scope -> ", (u32) walk_state->scope_depth, - scope_info->scope.node->name.ascii, + acpi_ut_get_node_name (scope_info->scope.node), acpi_ut_get_type_name (scope_info->common.value))); new_scope_info = walk_state->scope_info; if (new_scope_info) { ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, "[%4.4s] (%s)\n", - new_scope_info->scope.node->name.ascii, + acpi_ut_get_node_name (new_scope_info->scope.node), acpi_ut_get_type_name (new_scope_info->common.value))); } else { diff -Nru a/drivers/acpi/events/evgpe.c b/drivers/acpi/events/evgpe.c --- a/drivers/acpi/events/evgpe.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/events/evgpe.c Thu Dec 18 04:49:01 2003 @@ -139,12 +139,10 @@ { u32 int_status = ACPI_INTERRUPT_NOT_HANDLED; u8 enabled_status_byte; - u8 bit_mask; struct acpi_gpe_register_info *gpe_register_info; u32 in_value; acpi_status status; struct acpi_gpe_block_info *gpe_block; - u32 gpe_number; u32 i; u32 j; @@ -187,11 +185,9 @@ ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS, "GPE pair: Status %8.8X%8.8X = %02X, Enable %8.8X%8.8X = %02X\n", - ACPI_HIDWORD (gpe_register_info->status_address.address), - ACPI_LODWORD (gpe_register_info->status_address.address), + ACPI_FORMAT_UINT64 (gpe_register_info->status_address.address), gpe_register_info->status, - ACPI_HIDWORD (gpe_register_info->enable_address.address), - ACPI_LODWORD (gpe_register_info->enable_address.address), + ACPI_FORMAT_UINT64 (gpe_register_info->enable_address.address), gpe_register_info->enable)); /* First check if there is anything active at all in this register */ @@ -206,18 +202,16 @@ /* Now look at the individual GPEs in this byte register */ - for (j = 0, bit_mask = 1; j < ACPI_GPE_REGISTER_WIDTH; j++, bit_mask <<= 1) { + for (j = 0; j < ACPI_GPE_REGISTER_WIDTH; j++) { /* Examine one GPE bit */ - if (enabled_status_byte & bit_mask) { + if (enabled_status_byte & acpi_gbl_decode_to8bit[j]) { /* * Found an active GPE. Dispatch the event to a handler * or method. */ - gpe_number = (i * ACPI_GPE_REGISTER_WIDTH) + j; - int_status |= acpi_ev_gpe_dispatch ( - &gpe_block->event_info[gpe_number], + &gpe_block->event_info[(i * ACPI_GPE_REGISTER_WIDTH) + j], j + gpe_register_info->base_gpe_number); } } @@ -294,7 +288,7 @@ if (ACPI_FAILURE (status)) { ACPI_REPORT_ERROR (("%s while evaluating method [%4.4s] for GPE[%2X]\n", acpi_format_exception (status), - local_gpe_event_info.method_node->name.ascii, gpe_number)); + acpi_ut_get_node_name (local_gpe_event_info.method_node), gpe_number)); } } @@ -367,6 +361,18 @@ /* Invoke the installed handler (at interrupt level) */ gpe_event_info->handler (gpe_event_info->context); + + /* It is now safe to clear level-triggered events. */ + + if (gpe_event_info->flags & ACPI_EVENT_LEVEL_TRIGGERED) { + status = acpi_hw_clear_gpe (gpe_event_info); + if (ACPI_FAILURE (status)) { + ACPI_REPORT_ERROR (( + "acpi_ev_gpe_dispatch: Unable to clear GPE[%2X]\n", + gpe_number)); + return_VALUE (ACPI_INTERRUPT_NOT_HANDLED); + } + } } else if (gpe_event_info->method_node) { /* @@ -375,13 +381,16 @@ */ status = acpi_hw_disable_gpe (gpe_event_info); if (ACPI_FAILURE (status)) { - ACPI_REPORT_ERROR (("acpi_ev_gpe_dispatch: Unable to disable GPE[%2X]\n", + ACPI_REPORT_ERROR (( + "acpi_ev_gpe_dispatch: Unable to disable GPE[%2X]\n", gpe_number)); return_VALUE (ACPI_INTERRUPT_NOT_HANDLED); } - /* Execute the method associated with the GPE. */ - + /* + * Execute the method associated with the GPE + * NOTE: Level-triggered GPEs are cleared after the method completes. + */ if (ACPI_FAILURE (acpi_os_queue_for_execution (OSD_PRIORITY_GPE, acpi_ev_asynch_execute_gpe_method, gpe_event_info))) { @@ -399,22 +408,12 @@ /* * Disable the GPE. The GPE will remain disabled until the ACPI - * Core Subsystem is restarted, or the handler is reinstalled. + * Core Subsystem is restarted, or a handler is installed. */ status = acpi_hw_disable_gpe (gpe_event_info); if (ACPI_FAILURE (status)) { - ACPI_REPORT_ERROR (("acpi_ev_gpe_dispatch: Unable to disable GPE[%2X]\n", - gpe_number)); - return_VALUE (ACPI_INTERRUPT_NOT_HANDLED); - } - } - - /* It is now safe to clear level-triggered events. */ - - if (gpe_event_info->flags & ACPI_EVENT_LEVEL_TRIGGERED) { - status = acpi_hw_clear_gpe (gpe_event_info); - if (ACPI_FAILURE (status)) { - ACPI_REPORT_ERROR (("acpi_ev_gpe_dispatch: Unable to clear GPE[%2X]\n", + ACPI_REPORT_ERROR (( + "acpi_ev_gpe_dispatch: Unable to disable GPE[%2X]\n", gpe_number)); return_VALUE (ACPI_INTERRUPT_NOT_HANDLED); } diff -Nru a/drivers/acpi/events/evgpeblk.c b/drivers/acpi/events/evgpeblk.c --- a/drivers/acpi/events/evgpeblk.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/events/evgpeblk.c Thu Dec 18 04:49:01 2003 @@ -477,7 +477,7 @@ * * RETURN: Status * - * DESCRIPTION: Install new GPE block with mutex support + * DESCRIPTION: Remove a GPE block * ******************************************************************************/ @@ -743,8 +743,7 @@ ((gpe_block->register_count * ACPI_GPE_REGISTER_WIDTH) -1)), gpe_device->name.ascii, gpe_block->register_count, - ACPI_HIDWORD (gpe_block->block_address.address), - ACPI_LODWORD (gpe_block->block_address.address), + ACPI_FORMAT_UINT64 (gpe_block->block_address.address), interrupt_level)); /* Find all GPE methods (_Lxx, _Exx) for this block */ diff -Nru a/drivers/acpi/events/evmisc.c b/drivers/acpi/events/evmisc.c --- a/drivers/acpi/events/evmisc.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/events/evmisc.c Thu Dec 18 04:49:01 2003 @@ -195,7 +195,8 @@ /* There is no per-device notify handler for this device */ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "No notify handler for [%4.4s] node %p\n", node->name.ascii, node)); + "No notify handler for [%4.4s] node %p\n", + acpi_ut_get_node_name (node), node)); } return (status); diff -Nru a/drivers/acpi/events/evregion.c b/drivers/acpi/events/evregion.c --- a/drivers/acpi/events/evregion.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/events/evregion.c Thu Dec 18 04:49:01 2003 @@ -136,7 +136,7 @@ * ******************************************************************************/ -static acpi_status +acpi_status acpi_ev_execute_reg_method ( union acpi_operand_object *region_obj, u32 function) @@ -202,7 +202,7 @@ * * FUNCTION: acpi_ev_address_space_dispatch * - * PARAMETERS: region_obj - internal region object + * PARAMETERS: region_obj - Internal region object * space_id - ID of the address space (0-255) * Function - Read or Write operation * Address - Where in the space to read or write @@ -243,9 +243,11 @@ /* Ensure that there is a handler associated with this region */ - handler_desc = region_obj->region.address_space; + handler_desc = region_obj->region.handler; if (!handler_desc) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "no handler for region(%p) [%s]\n", + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "No handler for Region [%4.4s] (%p) [%s]\n", + acpi_ut_get_node_name (region_obj->region.node), region_obj, acpi_ut_get_region_name (region_obj->region.space_id))); return_ACPI_STATUS (AE_NOT_EXIST); @@ -320,8 +322,8 @@ ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION, "Handler %p (@%p) Address %8.8X%8.8X [%s]\n", - ®ion_obj->region.address_space->address_space, handler, - ACPI_HIDWORD (address), ACPI_LODWORD (address), + ®ion_obj->region.handler->address_space, handler, + ACPI_FORMAT_UINT64 (address), acpi_ut_get_region_name (region_obj->region.space_id))); if (!(handler_desc->address_space.flags & ACPI_ADDR_HANDLER_DEFAULT_INSTALLED)) { @@ -359,6 +361,7 @@ return_ACPI_STATUS (status); } + /******************************************************************************* * * FUNCTION: acpi_ev_detach_region @@ -398,7 +401,7 @@ /* Get the address handler from the region object */ - handler_obj = region_obj->region.address_space; + handler_obj = region_obj->region.handler; if (!handler_obj) { /* This region has no handler, all done */ @@ -472,7 +475,7 @@ * If the region is on the handler's list * this better be the region's handler */ - region_obj->region.address_space = NULL; + region_obj->region.handler = NULL; acpi_ut_remove_reference (handler_obj); return_VOID; @@ -515,17 +518,15 @@ union acpi_operand_object *region_obj, u8 acpi_ns_is_locked) { - acpi_status status; - acpi_status status2; - ACPI_FUNCTION_TRACE ("ev_attach_region"); ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION, - "Adding Region %p to address handler %p [%s]\n", - region_obj, handler_obj, acpi_ut_get_region_name (region_obj->region.space_id))); - + "Adding Region [%4.4s] %p to address handler %p [%s]\n", + acpi_ut_get_node_name (region_obj->region.node), + region_obj, handler_obj, + acpi_ut_get_region_name (region_obj->region.space_id))); /* Link this region to the front of the handler's list */ @@ -534,34 +535,14 @@ /* Install the region's handler */ - if (region_obj->region.address_space) { + if (region_obj->region.handler) { return_ACPI_STATUS (AE_ALREADY_EXISTS); } - region_obj->region.address_space = handler_obj; + region_obj->region.handler = handler_obj; acpi_ut_add_reference (handler_obj); - /* - * Tell all users that this region is usable by running the _REG - * method - */ - if (acpi_ns_is_locked) { - status2 = acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); - if (ACPI_FAILURE (status2)) { - return_ACPI_STATUS (status2); - } - } - - status = acpi_ev_execute_reg_method (region_obj, 1); - - if (acpi_ns_is_locked) { - status2 = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); - if (ACPI_FAILURE (status2)) { - return_ACPI_STATUS (status2); - } - } - - return_ACPI_STATUS (status); + return_ACPI_STATUS (AE_OK); } @@ -569,9 +550,7 @@ * * FUNCTION: acpi_ev_install_handler * - * PARAMETERS: Handle - Node to be dumped - * Level - Nesting level of the handle - * Context - Passed into acpi_ns_walk_namespace + * PARAMETERS: walk_namespace callback * * DESCRIPTION: This routine installs an address handler into objects that are * of type Region or Device. @@ -640,7 +619,7 @@ if (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_DEVICE) { /* Check if this Device already has a handler for this address space */ - next_handler_obj = obj_desc->device.address_space; + next_handler_obj = obj_desc->device.handler; while (next_handler_obj) { /* Found a handler, is it for the same address space? */ @@ -697,4 +676,77 @@ return (status); } +/******************************************************************************* + * + * FUNCTION: acpi_ev_reg_run + * + * PARAMETERS: walk_namespace callback + * + * DESCRIPTION: Run _REg method for region objects of the requested space_iD + * + ******************************************************************************/ + +acpi_status +acpi_ev_reg_run ( + acpi_handle obj_handle, + u32 level, + void *context, + void **return_value) +{ + union acpi_operand_object *handler_obj; + union acpi_operand_object *obj_desc; + struct acpi_namespace_node *node; + acpi_status status; + + + ACPI_FUNCTION_NAME ("ev_reg_run"); + + + handler_obj = (union acpi_operand_object *) context; + + /* Parameter validation */ + + if (!handler_obj) { + return (AE_OK); + } + + /* Convert and validate the device handle */ + + node = acpi_ns_map_handle_to_node (obj_handle); + if (!node) { + return (AE_BAD_PARAMETER); + } + + /* + * We only care about regions.and objects + * that are allowed to have address space handlers + */ + if ((node->type != ACPI_TYPE_REGION) && + (node != acpi_gbl_root_node)) { + return (AE_OK); + } + + /* Check for an existing internal object */ + + obj_desc = acpi_ns_get_attached_object (node); + if (!obj_desc) { + /* No object, just exit */ + + return (AE_OK); + } + + + /* Object is a Region */ + + if (obj_desc->region.space_id != handler_obj->address_space.space_id) { + /* + * This region is for a different address space + * -- just ignore it + */ + return (AE_OK); + } + + status = acpi_ev_execute_reg_method (obj_desc, 1); + return (status); +} diff -Nru a/drivers/acpi/events/evrgnini.c b/drivers/acpi/events/evrgnini.c --- a/drivers/acpi/events/evrgnini.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/events/evrgnini.c Thu Dec 18 04:49:01 2003 @@ -177,7 +177,7 @@ ACPI_FUNCTION_TRACE ("ev_pci_config_region_setup"); - handler_obj = region_obj->region.address_space; + handler_obj = region_obj->region.handler; if (!handler_obj) { /* * No installed handler. This shouldn't happen because the dispatch @@ -239,7 +239,7 @@ else { ACPI_REPORT_ERROR (( "Could not install pci_config handler for Root Bridge %4.4s, %s\n", - pci_root_node->name.ascii, acpi_format_exception (status))); + acpi_ut_get_node_name (pci_root_node), acpi_format_exception (status))); } } break; @@ -469,7 +469,7 @@ /* Setup defaults */ - region_obj->region.address_space = NULL; + region_obj->region.handler = NULL; region_obj2->extra.method_REG = NULL; region_obj->common.flags &= ~(AOPOBJ_SETUP_COMPLETE); region_obj->common.flags |= AOPOBJ_OBJECT_INITIALIZED; @@ -502,17 +502,17 @@ switch (node->type) { case ACPI_TYPE_DEVICE: - handler_obj = obj_desc->device.address_space; + handler_obj = obj_desc->device.handler; break; case ACPI_TYPE_PROCESSOR: - handler_obj = obj_desc->processor.address_space; + handler_obj = obj_desc->processor.handler; break; case ACPI_TYPE_THERMAL: - handler_obj = obj_desc->thermal_zone.address_space; + handler_obj = obj_desc->thermal_zone.handler; break; default: @@ -532,6 +532,26 @@ status = acpi_ev_attach_region (handler_obj, region_obj, acpi_ns_locked); + + /* + * Tell all users that this region is usable by running the _REG + * method + */ + if (acpi_ns_locked) { + status = acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } + } + + status = acpi_ev_execute_reg_method (region_obj, 1); + + if (acpi_ns_locked) { + status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } + } return_ACPI_STATUS (AE_OK); } diff -Nru a/drivers/acpi/events/evxfregn.c b/drivers/acpi/events/evxfregn.c --- a/drivers/acpi/events/evxfregn.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/events/evxfregn.c Thu Dec 18 04:49:01 2003 @@ -173,7 +173,7 @@ * The attached device object already exists. * Make sure the handler is not already installed. */ - handler_obj = obj_desc->device.address_space; + handler_obj = obj_desc->device.handler; /* Walk the handler list for this device */ @@ -240,7 +240,8 @@ ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION, "Installing address handler for region %s(%X) on Device %4.4s %p(%p)\n", - acpi_ut_get_region_name (space_id), space_id, node->name.ascii, node, obj_desc)); + acpi_ut_get_region_name (space_id), space_id, + acpi_ut_get_node_name (node), node, obj_desc)); /* * Install the handler @@ -267,13 +268,13 @@ /* Install at head of Device.address_space list */ - handler_obj->address_space.next = obj_desc->device.address_space; + handler_obj->address_space.next = obj_desc->device.handler; /* * The Device object is the first reference on the handler_obj. * Each region that uses the handler adds a reference. */ - obj_desc->device.address_space = handler_obj; + obj_desc->device.handler = handler_obj; /* * Walk the namespace finding all of the regions this @@ -291,6 +292,17 @@ ACPI_NS_WALK_UNLOCK, acpi_ev_install_handler, handler_obj, NULL); + /* + * Now we can run the _REG methods for all Regions for this + * space ID. This is a separate walk in order to handle any + * interdependencies between regions and _REG methods. (i.e. handlers + * must be installed for all regions of this Space ID before we + * can run any _REG methods. + */ + status = acpi_ns_walk_namespace (ACPI_TYPE_ANY, device, ACPI_UINT32_MAX, + ACPI_NS_WALK_UNLOCK, acpi_ev_reg_run, + handler_obj, NULL); + unlock_and_exit: (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); return_ACPI_STATUS (status); @@ -357,8 +369,8 @@ /* Find the address handler the user requested */ - handler_obj = obj_desc->device.address_space; - last_obj_ptr = &obj_desc->device.address_space; + handler_obj = obj_desc->device.handler; + last_obj_ptr = &obj_desc->device.handler; while (handler_obj) { /* We have a handler, see if user requested this one */ diff -Nru a/drivers/acpi/executer/exdump.c b/drivers/acpi/executer/exdump.c --- a/drivers/acpi/executer/exdump.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/executer/exdump.c Thu Dec 18 04:49:01 2003 @@ -89,27 +89,27 @@ if (!obj_desc) { /* - * This usually indicates that something serious is wrong -- - * since most (if not all) - * code that dumps the stack expects something to be there! + * This usually indicates that something serious is wrong */ - acpi_os_printf ("Null stack entry ptr\n"); + acpi_os_printf ("Null Object Descriptor\n"); return; } if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) == ACPI_DESC_TYPE_NAMED) { - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p NS Node: ", obj_desc)); + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p is a NS Node: ", obj_desc)); ACPI_DUMP_ENTRY (obj_desc, ACPI_LV_EXEC); return; } if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) != ACPI_DESC_TYPE_OPERAND) { - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p is not a local object\n", obj_desc)); + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, + "%p is not a node or operand object: [%s]\n", + obj_desc, acpi_ut_get_descriptor_name (obj_desc))); ACPI_DUMP_BUFFER (obj_desc, sizeof (union acpi_operand_object)); return; } - /* obj_desc is a valid object */ + /* obj_desc is a valid object */ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p ", obj_desc)); @@ -151,11 +151,10 @@ obj_desc->reference.offset); if (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_INTEGER) { - /* Value is a Number */ + /* Value is an Integer */ acpi_os_printf (" value is [%8.8X%8.8x]", - ACPI_HIDWORD(obj_desc->integer.value), - ACPI_LODWORD(obj_desc->integer.value)); + ACPI_FORMAT_UINT64 (obj_desc->integer.value)); } acpi_os_printf ("\n"); @@ -169,11 +168,10 @@ if (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_INTEGER) { - /* Value is a Number */ + /* Value is an Integer */ acpi_os_printf (" value is [%8.8X%8.8x]", - ACPI_HIDWORD(obj_desc->integer.value), - ACPI_LODWORD(obj_desc->integer.value)); + ACPI_FORMAT_UINT64 (obj_desc->integer.value)); } acpi_os_printf ("\n"); @@ -189,7 +187,7 @@ default: - /* unknown opcode */ + /* Unknown opcode */ acpi_os_printf ("Unknown Reference opcode=%X\n", obj_desc->reference.opcode); @@ -229,8 +227,7 @@ case ACPI_TYPE_INTEGER: acpi_os_printf ("Integer %8.8X%8.8X\n", - ACPI_HIDWORD (obj_desc->integer.value), - ACPI_LODWORD (obj_desc->integer.value)); + ACPI_FORMAT_UINT64 (obj_desc->integer.value)); break; @@ -271,8 +268,7 @@ } else { acpi_os_printf (" base %8.8X%8.8X Length %X\n", - ACPI_HIDWORD (obj_desc->region.address), - ACPI_LODWORD (obj_desc->region.address), + ACPI_FORMAT_UINT64 (obj_desc->region.address), obj_desc->region.length); } break; @@ -494,7 +490,7 @@ acpi_os_printf ("%20s : %p\n", title, value); #else acpi_os_printf ("%20s : %8.8X%8.8X\n", title, - ACPI_HIDWORD (value), ACPI_LODWORD (value)); + ACPI_FORMAT_UINT64 (value)); #endif } @@ -525,7 +521,7 @@ } } - acpi_os_printf ("%20s : %4.4s\n", "Name", node->name.ascii); + acpi_os_printf ("%20s : %4.4s\n", "Name", acpi_ut_get_node_name (node)); acpi_ex_out_string ("Type", acpi_ut_get_type_name (node->type)); acpi_ex_out_integer ("Flags", node->flags); acpi_ex_out_integer ("Owner Id", node->owner_id); @@ -573,7 +569,8 @@ } if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) != ACPI_DESC_TYPE_OPERAND) { - acpi_os_printf ("ex_dump_object_descriptor: %p is not a valid ACPI object\n", obj_desc); + acpi_os_printf ("ex_dump_object_descriptor: %p is not an ACPI operand object: [%s]\n", + obj_desc, acpi_ut_get_descriptor_name (obj_desc)); return_VOID; } @@ -589,8 +586,7 @@ case ACPI_TYPE_INTEGER: acpi_os_printf ("%20s : %8.8X%8.8X\n", "Value", - ACPI_HIDWORD (obj_desc->integer.value), - ACPI_LODWORD (obj_desc->integer.value)); + ACPI_FORMAT_UINT64 (obj_desc->integer.value)); break; @@ -635,7 +631,7 @@ case ACPI_TYPE_DEVICE: - acpi_ex_out_pointer ("address_space", obj_desc->device.address_space); + acpi_ex_out_pointer ("Handler", obj_desc->device.handler); acpi_ex_out_pointer ("system_notify", obj_desc->device.system_notify); acpi_ex_out_pointer ("device_notify", obj_desc->device.device_notify); break; @@ -673,7 +669,7 @@ acpi_ex_out_integer ("Flags", obj_desc->region.flags); acpi_ex_out_address ("Address", obj_desc->region.address); acpi_ex_out_integer ("Length", obj_desc->region.length); - acpi_ex_out_pointer ("address_space", obj_desc->region.address_space); + acpi_ex_out_pointer ("Handler", obj_desc->region.handler); acpi_ex_out_pointer ("Next", obj_desc->region.next); break; @@ -694,7 +690,7 @@ acpi_ex_out_address ("Address", (acpi_physical_address) obj_desc->processor.address); acpi_ex_out_pointer ("system_notify", obj_desc->processor.system_notify); acpi_ex_out_pointer ("device_notify", obj_desc->processor.device_notify); - acpi_ex_out_pointer ("address_space", obj_desc->processor.address_space); + acpi_ex_out_pointer ("Handler", obj_desc->processor.handler); break; @@ -702,7 +698,7 @@ acpi_ex_out_pointer ("system_notify", obj_desc->thermal_zone.system_notify); acpi_ex_out_pointer ("device_notify", obj_desc->thermal_zone.device_notify); - acpi_ex_out_pointer ("address_space", obj_desc->thermal_zone.address_space); + acpi_ex_out_pointer ("Handler", obj_desc->thermal_zone.handler); break; diff -Nru a/drivers/acpi/executer/exfldio.c b/drivers/acpi/executer/exfldio.c --- a/drivers/acpi/executer/exfldio.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/executer/exfldio.c Thu Dec 18 04:49:01 2003 @@ -138,8 +138,9 @@ */ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Field [%4.4s] access width (%d bytes) too large for region [%4.4s] (length %X)\n", - obj_desc->common_field.node->name.ascii, obj_desc->common_field.access_byte_width, - rgn_desc->region.node->name.ascii, rgn_desc->region.length)); + acpi_ut_get_node_name (obj_desc->common_field.node), + obj_desc->common_field.access_byte_width, + acpi_ut_get_node_name (rgn_desc->region.node), rgn_desc->region.length)); } /* @@ -148,9 +149,10 @@ */ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Field [%4.4s] Base+Offset+Width %X+%X+%X is beyond end of region [%4.4s] (length %X)\n", - obj_desc->common_field.node->name.ascii, obj_desc->common_field.base_byte_offset, + acpi_ut_get_node_name (obj_desc->common_field.node), + obj_desc->common_field.base_byte_offset, field_datum_byte_offset, obj_desc->common_field.access_byte_width, - rgn_desc->region.node->name.ascii, rgn_desc->region.length)); + acpi_ut_get_node_name (rgn_desc->region.node), rgn_desc->region.length)); #ifdef CONFIG_ACPI_RELAXED_AML { @@ -261,7 +263,7 @@ obj_desc->common_field.access_byte_width, obj_desc->common_field.base_byte_offset, field_datum_byte_offset, - ACPI_HIDWORD (address), ACPI_LODWORD (address))); + ACPI_FORMAT_UINT64 (address))); /* Invoke the appropriate address_space/op_region handler */ @@ -514,12 +516,12 @@ if (ACPI_SUCCESS (status)) { if (read_write == ACPI_READ) { ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Value Read %8.8X%8.8X, Width %d\n", - ACPI_HIDWORD (*value), ACPI_LODWORD (*value), + ACPI_FORMAT_UINT64 (*value), obj_desc->common_field.access_byte_width)); } else { ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Value Written %8.8X%8.8X, Width %d\n", - ACPI_HIDWORD (*value), ACPI_LODWORD (*value), + ACPI_FORMAT_UINT64 (*value), obj_desc->common_field.access_byte_width)); } } @@ -612,11 +614,11 @@ ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Mask %8.8X%8.8X, datum_offset %X, Width %X, Value %8.8X%8.8X, merged_value %8.8X%8.8X\n", - ACPI_HIDWORD (mask), ACPI_LODWORD (mask), + ACPI_FORMAT_UINT64 (mask), field_datum_byte_offset, obj_desc->common_field.access_byte_width, - ACPI_HIDWORD (field_value), ACPI_LODWORD (field_value), - ACPI_HIDWORD (merged_value),ACPI_LODWORD (merged_value))); + ACPI_FORMAT_UINT64 (field_value), + ACPI_FORMAT_UINT64 (merged_value))); /* Write the merged value */ @@ -784,12 +786,13 @@ { acpi_status status; u32 field_datum_byte_offset; - u32 datum_offset; - acpi_integer previous_raw_datum; + u32 buffer_datum_offset; + acpi_integer previous_raw_datum = 0; acpi_integer this_raw_datum = 0; acpi_integer merged_datum = 0; u32 byte_field_length; u32 datum_count; + u32 i; ACPI_FUNCTION_TRACE ("ex_extract_from_field"); @@ -812,77 +815,74 @@ datum_count = ACPI_ROUND_UP_TO (byte_field_length, obj_desc->common_field.access_byte_width); + /* + * If the field is not aligned on a datum boundary and does not + * fit within a single datum, we must read an extra datum. + * + * We could just split the aligned and non-aligned cases since the + * aligned case is so very simple, but this would require more code. + */ + if ((obj_desc->common_field.end_field_valid_bits != 0) && + (!(obj_desc->common_field.flags & AOPOBJ_SINGLE_DATUM))) { + datum_count++; + } + ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "byte_len %X, datum_len %X, byte_gran %X\n", byte_field_length, datum_count,obj_desc->common_field.access_byte_width)); /* * Clear the caller's buffer (the whole buffer length as given) - * This is very important, especially in the cases where a byte is read, - * but the buffer is really a u32 (4 bytes). + * This is very important, especially in the cases where the buffer + * is longer than the size of the field. */ ACPI_MEMSET (buffer, 0, buffer_length); - /* Read the first raw datum to prime the loop */ - field_datum_byte_offset = 0; - datum_offset= 0; - - status = acpi_ex_field_datum_io (obj_desc, field_datum_byte_offset, - &previous_raw_datum, ACPI_READ); - if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); - } - + buffer_datum_offset= 0; - /* We might actually be done if the request fits in one datum */ + /* Read the entire field */ - if ((datum_count == 1) && - (obj_desc->common_field.flags & AOPOBJ_SINGLE_DATUM)) { - /* 1) Shift the valid data bits down to start at bit 0 */ + for (i = 0; i < datum_count; i++) { + status = acpi_ex_field_datum_io (obj_desc, field_datum_byte_offset, + &this_raw_datum, ACPI_READ); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } - merged_datum = (previous_raw_datum >> obj_desc->common_field.start_field_bit_offset); + /* We might actually be done if the request fits in one datum */ - /* 2) Mask off any upper unused bits (bits not part of the field) */ + if ((datum_count == 1) && + (obj_desc->common_field.flags & AOPOBJ_SINGLE_DATUM)) { + /* 1) Shift the valid data bits down to start at bit 0 */ - if (obj_desc->common_field.end_buffer_valid_bits) { - merged_datum &= ACPI_MASK_BITS_ABOVE (obj_desc->common_field.end_buffer_valid_bits); - } + merged_datum = (this_raw_datum >> obj_desc->common_field.start_field_bit_offset); - /* Store the datum to the caller buffer */ + /* 2) Mask off any upper unused bits (bits not part of the field) */ - acpi_ex_set_buffer_datum (merged_datum, buffer, buffer_length, - obj_desc->common_field.access_byte_width, datum_offset); + if (obj_desc->common_field.end_buffer_valid_bits) { + merged_datum &= ACPI_MASK_BITS_ABOVE (obj_desc->common_field.end_buffer_valid_bits); + } - return_ACPI_STATUS (AE_OK); - } + /* Store the datum to the caller buffer */ + acpi_ex_set_buffer_datum (merged_datum, buffer, buffer_length, + obj_desc->common_field.access_byte_width, buffer_datum_offset); - /* We need to get more raw data to complete one or more field data */ + return_ACPI_STATUS (AE_OK); + } - while (datum_offset < datum_count) { - field_datum_byte_offset += obj_desc->common_field.access_byte_width; + /* Special handling for the last datum to ignore extra bits */ - /* - * If the field is aligned on a byte boundary, we don't want - * to perform a final read, since this would potentially read - * past the end of the region. - * - * We could just split the aligned and non-aligned cases since the - * aligned case is so very simple, but this would require more code. - */ - if ((obj_desc->common_field.start_field_bit_offset != 0) || - ((obj_desc->common_field.start_field_bit_offset == 0) && - (datum_offset < (datum_count -1)))) { + if ((i >= (datum_count -1)) && + (obj_desc->common_field.end_field_valid_bits)) { /* - * Get the next raw datum, it contains some or all bits - * of the current field datum + * This is the last iteration of the loop. We need to clear + * any unused bits (bits that are not part of this field) before + * we store the final merged datum into the caller buffer. */ - status = acpi_ex_field_datum_io (obj_desc, field_datum_byte_offset, - &this_raw_datum, ACPI_READ); - if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); - } + this_raw_datum &= + ACPI_MASK_BITS_ABOVE (obj_desc->common_field.end_field_valid_bits); } /* @@ -891,48 +891,48 @@ if (obj_desc->common_field.start_field_bit_offset == 0) { /* Field is not skewed and we can just copy the datum */ - merged_datum = previous_raw_datum; + acpi_ex_set_buffer_datum (this_raw_datum, buffer, buffer_length, + obj_desc->common_field.access_byte_width, buffer_datum_offset); + buffer_datum_offset++; } else { - /* - * Put together the appropriate bits of the two raw data to make a - * single complete field datum - * - * 1) Normalize the first datum down to bit 0 - */ - merged_datum = (previous_raw_datum >> obj_desc->common_field.start_field_bit_offset); - - /* 2) Insert the second datum "above" the first datum */ - - merged_datum |= (this_raw_datum << obj_desc->common_field.datum_valid_bits); + /* Not aligned -- on the first iteration, just save the datum */ - if ((datum_offset >= (datum_count -1))) { + if (i != 0) { /* - * This is the last iteration of the loop. We need to clear - * any unused bits (bits that are not part of this field) that - * came from the last raw datum before we store the final - * merged datum into the caller buffer. + * Put together the appropriate bits of the two raw data to make a + * single complete field datum + * + * 1) Normalize the first datum down to bit 0 */ - if (obj_desc->common_field.end_buffer_valid_bits) { - merged_datum &= - ACPI_MASK_BITS_ABOVE (obj_desc->common_field.end_buffer_valid_bits); - } + merged_datum = (previous_raw_datum >> obj_desc->common_field.start_field_bit_offset); + + /* 2) Insert the second datum "above" the first datum */ + + merged_datum |= (this_raw_datum << obj_desc->common_field.datum_valid_bits); + + acpi_ex_set_buffer_datum (merged_datum, buffer, buffer_length, + obj_desc->common_field.access_byte_width, buffer_datum_offset); + buffer_datum_offset++; } + + /* + * Save the raw datum that was just acquired since it may contain bits + * of the *next* field datum + */ + previous_raw_datum = this_raw_datum; } - /* - * Store the merged field datum in the caller's buffer, according to - * the granularity of the field (size of each datum). - */ - acpi_ex_set_buffer_datum (merged_datum, buffer, buffer_length, - obj_desc->common_field.access_byte_width, datum_offset); + field_datum_byte_offset += obj_desc->common_field.access_byte_width; + } - /* - * Save the raw datum that was just acquired since it may contain bits - * of the *next* field datum. Update offsets - */ - previous_raw_datum = this_raw_datum; - datum_offset++; + /* For non-aligned case, there is one last datum to insert */ + + if (obj_desc->common_field.start_field_bit_offset != 0) { + merged_datum = (this_raw_datum >> obj_desc->common_field.start_field_bit_offset); + + acpi_ex_set_buffer_datum (merged_datum, buffer, buffer_length, + obj_desc->common_field.access_byte_width, buffer_datum_offset); } return_ACPI_STATUS (AE_OK); diff -Nru a/drivers/acpi/executer/exmisc.c b/drivers/acpi/executer/exmisc.c --- a/drivers/acpi/executer/exmisc.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/executer/exmisc.c Thu Dec 18 04:49:01 2003 @@ -121,8 +121,8 @@ default: - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid descriptor type %X in %p\n", - ACPI_GET_DESCRIPTOR_TYPE (obj_desc), obj_desc)); + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "%p has invalid descriptor [%s]\n", + obj_desc, acpi_ut_get_descriptor_name (obj_desc))); return_ACPI_STATUS (AE_TYPE); } @@ -139,7 +139,7 @@ *return_desc = reference_obj; ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Object %p Type [%s], returning Reference %p\n", - obj_desc, acpi_ut_get_object_type_name (obj_desc), *return_desc)); + obj_desc, acpi_ut_get_object_type_name (obj_desc), *return_desc)); return_ACPI_STATUS (AE_OK); } diff -Nru a/drivers/acpi/executer/exmutex.c b/drivers/acpi/executer/exmutex.c --- a/drivers/acpi/executer/exmutex.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/executer/exmutex.c Thu Dec 18 04:49:01 2003 @@ -159,7 +159,7 @@ if (!walk_state->thread) { ACPI_REPORT_ERROR (("Cannot acquire Mutex [%4.4s], null thread info\n", - obj_desc->mutex.node->name.ascii)); + acpi_ut_get_node_name (obj_desc->mutex.node))); return_ACPI_STATUS (AE_AML_INTERNAL); } @@ -169,7 +169,7 @@ */ if (walk_state->thread->current_sync_level > obj_desc->mutex.sync_level) { ACPI_REPORT_ERROR (("Cannot acquire Mutex [%4.4s], incorrect sync_level\n", - obj_desc->mutex.node->name.ascii)); + acpi_ut_get_node_name (obj_desc->mutex.node))); return_ACPI_STATUS (AE_AML_MUTEX_ORDER); } @@ -242,7 +242,7 @@ if (!obj_desc->mutex.owner_thread) { ACPI_REPORT_ERROR (("Cannot release Mutex [%4.4s], not acquired\n", - obj_desc->mutex.node->name.ascii)); + acpi_ut_get_node_name (obj_desc->mutex.node))); return_ACPI_STATUS (AE_AML_MUTEX_NOT_ACQUIRED); } @@ -250,7 +250,7 @@ if (!walk_state->thread) { ACPI_REPORT_ERROR (("Cannot release Mutex [%4.4s], null thread info\n", - obj_desc->mutex.node->name.ascii)); + acpi_ut_get_node_name (obj_desc->mutex.node))); return_ACPI_STATUS (AE_AML_INTERNAL); } @@ -260,7 +260,7 @@ ACPI_REPORT_ERROR (( "Thread %X cannot release Mutex [%4.4s] acquired by thread %X\n", walk_state->thread->thread_id, - obj_desc->mutex.node->name.ascii, + acpi_ut_get_node_name (obj_desc->mutex.node), obj_desc->mutex.owner_thread->thread_id)); return_ACPI_STATUS (AE_AML_NOT_OWNER); } @@ -271,7 +271,7 @@ */ if (obj_desc->mutex.sync_level > walk_state->thread->current_sync_level) { ACPI_REPORT_ERROR (("Cannot release Mutex [%4.4s], incorrect sync_level\n", - obj_desc->mutex.node->name.ascii)); + acpi_ut_get_node_name (obj_desc->mutex.node))); return_ACPI_STATUS (AE_AML_MUTEX_ORDER); } diff -Nru a/drivers/acpi/executer/exoparg1.c b/drivers/acpi/executer/exoparg1.c --- a/drivers/acpi/executer/exoparg1.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/executer/exoparg1.c Thu Dec 18 04:49:01 2003 @@ -351,8 +351,7 @@ if (digit > 0) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Integer too large to convert to BCD: %8.8X%8.8X\n", - ACPI_HIDWORD(operand[0]->integer.value), - ACPI_LODWORD(operand[0]->integer.value))); + ACPI_FORMAT_UINT64 (operand[0]->integer.value))); status = AE_AML_NUMERIC_OVERFLOW; goto cleanup; } diff -Nru a/drivers/acpi/executer/exoparg3.c b/drivers/acpi/executer/exoparg3.c --- a/drivers/acpi/executer/exoparg3.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/executer/exoparg3.c Thu Dec 18 04:49:01 2003 @@ -101,14 +101,13 @@ switch (walk_state->opcode) { - case AML_FATAL_OP: /* Fatal (fatal_type fatal_code fatal_arg) */ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "fatal_op: Type %X Code %X Arg %X <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n", - (u32) operand[0]->integer.value, (u32) operand[1]->integer.value, + (u32) operand[0]->integer.value, + (u32) operand[1]->integer.value, (u32) operand[2]->integer.value)); - fatal = ACPI_MEM_ALLOCATE (sizeof (struct acpi_signal_fatal_info)); if (fatal) { diff -Nru a/drivers/acpi/executer/exprep.c b/drivers/acpi/executer/exprep.c --- a/drivers/acpi/executer/exprep.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/executer/exprep.c Thu Dec 18 04:49:01 2003 @@ -351,7 +351,7 @@ */ nearest_byte_address = ACPI_ROUND_BITS_DOWN_TO_BYTES (field_bit_position); - obj_desc->common_field.base_byte_offset = + obj_desc->common_field.base_byte_offset = (u32) ACPI_ROUND_DOWN (nearest_byte_address, byte_alignment); /* @@ -539,7 +539,7 @@ acpi_ns_get_type (info->field_node)); ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Set named_obj %p [%4.4s], obj_desc %p\n", - info->field_node, info->field_node->name.ascii, obj_desc)); + info->field_node, acpi_ut_get_node_name (info->field_node), obj_desc)); /* Remove local reference to the object */ diff -Nru a/drivers/acpi/executer/exregion.c b/drivers/acpi/executer/exregion.c --- a/drivers/acpi/executer/exregion.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/executer/exregion.c Thu Dec 18 04:49:01 2003 @@ -161,7 +161,7 @@ (void **) &mem_info->mapped_logical_address); if (ACPI_FAILURE (status)) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not map memory at %8.8X%8.8X, size %X\n", - ACPI_HIDWORD (address), ACPI_LODWORD (address), (u32) window_size)); + ACPI_FORMAT_UINT64 (address), (u32) window_size)); mem_info->mapped_length = 0; return_ACPI_STATUS (status); } @@ -180,8 +180,8 @@ ((acpi_integer) address - (acpi_integer) mem_info->mapped_physical_address); ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "system_memory %d (%d width) Address=%8.8X%8.8X\n", function, bit_width, - ACPI_HIDWORD (address), ACPI_LODWORD (address))); + "system_memory %d (%d width) Address=%8.8X%8.8X\n", function, bit_width, + ACPI_FORMAT_UINT64 (address))); /* * Perform the memory read or write @@ -290,8 +290,8 @@ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "system_iO %d (%d width) Address=%8.8X%8.8X\n", function, bit_width, - ACPI_HIDWORD (address), ACPI_LODWORD (address))); + "system_iO %d (%d width) Address=%8.8X%8.8X\n", function, bit_width, + ACPI_FORMAT_UINT64 (address))); /* Decode the function parameter */ diff -Nru a/drivers/acpi/executer/exresolv.c b/drivers/acpi/executer/exresolv.c --- a/drivers/acpi/executer/exresolv.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/executer/exresolv.c Thu Dec 18 04:49:01 2003 @@ -349,6 +349,8 @@ /* All "References" point to a NS node */ if (ACPI_GET_DESCRIPTOR_TYPE (node) != ACPI_DESC_TYPE_NAMED) { + ACPI_REPORT_ERROR (("acpi_ex_resolve_multiple: Not a NS node %p [%s]\n", + node, acpi_ut_get_descriptor_name (node))); return_ACPI_STATUS (AE_AML_INTERNAL); } @@ -399,7 +401,9 @@ /* All "References" point to a NS node */ if (ACPI_GET_DESCRIPTOR_TYPE (node) != ACPI_DESC_TYPE_NAMED) { - return_ACPI_STATUS (AE_AML_INTERNAL); + ACPI_REPORT_ERROR (("acpi_ex_resolve_multiple: Not a NS node %p [%s]\n", + node, acpi_ut_get_descriptor_name (node))); + return_ACPI_STATUS (AE_AML_INTERNAL); } /* Get the attached object */ diff -Nru a/drivers/acpi/executer/exresop.c b/drivers/acpi/executer/exresop.c --- a/drivers/acpi/executer/exresop.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/executer/exresop.c Thu Dec 18 04:49:01 2003 @@ -247,8 +247,8 @@ /* Invalid descriptor */ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Bad descriptor type %X in Obj %p\n", - ACPI_GET_DESCRIPTOR_TYPE (obj_desc), obj_desc)); + "Invalid descriptor %p [%s]\n", + obj_desc, acpi_ut_get_descriptor_name (obj_desc))); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } diff -Nru a/drivers/acpi/executer/exstore.c b/drivers/acpi/executer/exstore.c --- a/drivers/acpi/executer/exstore.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/executer/exstore.c Thu Dec 18 04:49:01 2003 @@ -190,8 +190,7 @@ case ACPI_TYPE_INTEGER: ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "%8.8X%8.8X\n", - ACPI_HIDWORD (source_desc->integer.value), - ACPI_LODWORD (source_desc->integer.value))); + ACPI_FORMAT_UINT64 (source_desc->integer.value))); break; diff -Nru a/drivers/acpi/executer/exsystem.c b/drivers/acpi/executer/exsystem.c --- a/drivers/acpi/executer/exsystem.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/executer/exsystem.c Thu Dec 18 04:49:01 2003 @@ -111,11 +111,16 @@ * * FUNCTION: acpi_ex_system_do_stall * - * PARAMETERS: how_long - The amount of time to stall + * PARAMETERS: how_long - The amount of time to stall, + * in microseconds * * RETURN: Status * * DESCRIPTION: Suspend running thread for specified amount of time. + * Note: ACPI specification requires that Stall() does not + * relinquish the processor, and delays longer than 100 usec + * should use Sleep() instead. We allow stalls up to 255 usec + * for compatibility with other interpreters and existing BIOSs. * ******************************************************************************/ @@ -129,12 +134,15 @@ ACPI_FUNCTION_ENTRY (); - if (how_long > 100) /* 100 microseconds */ { + if (how_long > 255) /* 255 microseconds */ { /* - * Longer than 100 usec, use sleep instead - * (according to ACPI specification) + * Longer than 255 usec, this is an error + * + * (ACPI specifies 100 usec as max, but this gives some slack in + * order to support existing BIOSs) */ - status = acpi_ex_system_do_suspend ((how_long / 1000) + 1); + ACPI_REPORT_ERROR (("Stall: Time parameter is too large (%d)\n", how_long)); + status = AE_AML_OPERAND_VALUE; } else { acpi_os_stall (how_long); @@ -148,7 +156,8 @@ * * FUNCTION: acpi_ex_system_do_suspend * - * PARAMETERS: how_long - The amount of time to suspend + * PARAMETERS: how_long - The amount of time to suspend, + * in milliseconds * * RETURN: None * diff -Nru a/drivers/acpi/hardware/hwacpi.c b/drivers/acpi/hardware/hwacpi.c --- a/drivers/acpi/hardware/hwacpi.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/hardware/hwacpi.c Thu Dec 18 04:49:01 2003 @@ -119,7 +119,7 @@ * system does not support mode transition. */ if (!acpi_gbl_FADT->smi_cmd) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No SMI_CMD in FADT, mode transition failed.\n")); + ACPI_REPORT_ERROR (("No SMI_CMD in FADT, mode transition failed.\n")); return_ACPI_STATUS (AE_NO_HARDWARE_RESPONSE); } @@ -131,7 +131,7 @@ * transitions are not supported. */ if (!acpi_gbl_FADT->acpi_enable && !acpi_gbl_FADT->acpi_disable) { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "No mode transition supported in this system.\n")); + ACPI_REPORT_ERROR (("No ACPI mode transition supported in this system (enable/disable both zero)\n")); return_ACPI_STATUS (AE_OK); } @@ -162,6 +162,7 @@ } if (ACPI_FAILURE (status)) { + ACPI_REPORT_ERROR (("Could not write mode change, %s\n", acpi_format_exception (status))); return_ACPI_STATUS (status); } @@ -171,18 +172,16 @@ */ retry = 3000; while (retry) { - status = AE_NO_HARDWARE_RESPONSE; - if (acpi_hw_get_mode() == mode) { ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Mode %X successfully enabled\n", mode)); - status = AE_OK; - break; + return_ACPI_STATUS (AE_OK); } acpi_os_stall(1000); retry--; } - return_ACPI_STATUS (status); + ACPI_REPORT_ERROR (("Hardware never changed modes\n")); + return_ACPI_STATUS (AE_NO_HARDWARE_RESPONSE); } diff -Nru a/drivers/acpi/hardware/hwregs.c b/drivers/acpi/hardware/hwregs.c --- a/drivers/acpi/hardware/hwregs.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/hardware/hwregs.c Thu Dec 18 04:49:01 2003 @@ -418,16 +418,14 @@ ACPI_DEBUG_PRINT ((ACPI_DB_IO, "PM2 control: Read %X from %8.8X%8.8X\n", register_value, - ACPI_HIDWORD (acpi_gbl_FADT->xpm2_cnt_blk.address), - ACPI_LODWORD (acpi_gbl_FADT->xpm2_cnt_blk.address))); + ACPI_FORMAT_UINT64 (acpi_gbl_FADT->xpm2_cnt_blk.address))); ACPI_REGISTER_INSERT_VALUE (register_value, bit_reg_info->bit_position, bit_reg_info->access_bit_mask, value); ACPI_DEBUG_PRINT ((ACPI_DB_IO, "About to write %4.4X to %8.8X%8.8X\n", register_value, - ACPI_HIDWORD (acpi_gbl_FADT->xpm2_cnt_blk.address), - ACPI_LODWORD (acpi_gbl_FADT->xpm2_cnt_blk.address))); + ACPI_FORMAT_UINT64 (acpi_gbl_FADT->xpm2_cnt_blk.address))); status = acpi_hw_register_write (ACPI_MTX_DO_NOT_LOCK, ACPI_REGISTER_PM2_CONTROL, (u8) (register_value)); @@ -763,8 +761,7 @@ ACPI_DEBUG_PRINT ((ACPI_DB_IO, "Read: %8.8X width %2d from %8.8X%8.8X (%s)\n", *value, width, - ACPI_HIDWORD (reg->address), - ACPI_LODWORD (reg->address), + ACPI_FORMAT_UINT64 (reg->address), acpi_ut_get_region_name (reg->address_space_id))); return (status); @@ -850,8 +847,7 @@ ACPI_DEBUG_PRINT ((ACPI_DB_IO, "Wrote: %8.8X width %2d to %8.8X%8.8X (%s)\n", value, width, - ACPI_HIDWORD (reg->address), - ACPI_LODWORD (reg->address), + ACPI_FORMAT_UINT64 (reg->address), acpi_ut_get_region_name (reg->address_space_id))); return (status); diff -Nru a/drivers/acpi/hardware/hwsleep.c b/drivers/acpi/hardware/hwsleep.c --- a/drivers/acpi/hardware/hwsleep.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/hardware/hwsleep.c Thu Dec 18 04:49:01 2003 @@ -181,6 +181,13 @@ return_ACPI_STATUS (status); } + /* Set the system indicators to show the desired sleep state. */ + + status = acpi_evaluate_object (NULL, "\\_SI._SST", &arg_list, NULL); + if (ACPI_FAILURE (status) && status != AE_NOT_FOUND) { + ACPI_REPORT_ERROR (("Method _SST failed, %s\n", acpi_format_exception (status))); + } + return_ACPI_STATUS (AE_OK); } @@ -220,27 +227,28 @@ return_ACPI_STATUS (AE_AML_OPERAND_VALUE); } - sleep_type_reg_info = acpi_hw_get_bit_register_info (ACPI_BITREG_SLEEP_TYPE_A); sleep_enable_reg_info = acpi_hw_get_bit_register_info (ACPI_BITREG_SLEEP_ENABLE); - /* Clear wake status */ + if (sleep_state != ACPI_STATE_S5) { + /* Clear wake status */ - status = acpi_set_register (ACPI_BITREG_WAKE_STATUS, 1, ACPI_MTX_DO_NOT_LOCK); - if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); - } + status = acpi_set_register (ACPI_BITREG_WAKE_STATUS, 1, ACPI_MTX_DO_NOT_LOCK); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } - status = acpi_hw_clear_acpi_status(ACPI_MTX_DO_NOT_LOCK); - if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); - } + status = acpi_hw_clear_acpi_status (ACPI_MTX_DO_NOT_LOCK); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } - /* Disable BM arbitration */ + /* Disable BM arbitration */ - status = acpi_set_register (ACPI_BITREG_ARB_DISABLE, 1, ACPI_MTX_DO_NOT_LOCK); - if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); + status = acpi_set_register (ACPI_BITREG_ARB_DISABLE, 1, ACPI_MTX_DO_NOT_LOCK); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } } status = acpi_hw_disable_non_wakeup_gpes(); @@ -297,11 +305,13 @@ return_ACPI_STATUS (status); } - /* - * Wait a second, then try again. This is to get S4/5 to work on all machines. - */ if (sleep_state > ACPI_STATE_S3) { /* + * We wanted to sleep > S3, but it didn't happen (by virtue of the fact that + * we are still executing!) + * + * Wait ten seconds, then try again. This is to get S4/S5 to work on all machines. + * * We wait so long to allow chipsets that poll this reg very slowly to * still read the right value. Ideally, this entire block would go * away entirely. @@ -354,6 +364,7 @@ ACPI_FUNCTION_TRACE ("acpi_enter_sleep_state_s4bios"); + acpi_set_register (ACPI_BITREG_WAKE_STATUS, 1, ACPI_MTX_DO_NOT_LOCK); acpi_hw_clear_acpi_status(ACPI_MTX_DO_NOT_LOCK); @@ -389,15 +400,38 @@ acpi_status acpi_leave_sleep_state ( - u8 sleep_state) + u8 sleep_state) { - struct acpi_object_list arg_list; - union acpi_object arg; - acpi_status status; + struct acpi_object_list arg_list; + union acpi_object arg; + acpi_status status; + struct acpi_bit_register_info *sleep_type_reg_info; + struct acpi_bit_register_info *sleep_enable_reg_info; + u32 pm1x_control; ACPI_FUNCTION_TRACE ("acpi_leave_sleep_state"); + /* Some machines require SLP_TYPE and SLP_EN to be cleared */ + + sleep_type_reg_info = acpi_hw_get_bit_register_info (ACPI_BITREG_SLEEP_TYPE_A); + sleep_enable_reg_info = acpi_hw_get_bit_register_info (ACPI_BITREG_SLEEP_ENABLE); + + /* Get current value of PM1A control */ + + status = acpi_hw_register_read (ACPI_MTX_DO_NOT_LOCK, + ACPI_REGISTER_PM1_CONTROL, &pm1x_control); + if (ACPI_SUCCESS (status)) { + /* Clear SLP_TYP and SLP_EN */ + + pm1x_control &= ~(sleep_type_reg_info->access_bit_mask | + sleep_enable_reg_info->access_bit_mask); + + acpi_hw_register_write (ACPI_MTX_DO_NOT_LOCK, + ACPI_REGISTER_PM1A_CONTROL, pm1x_control); + acpi_hw_register_write (ACPI_MTX_DO_NOT_LOCK, + ACPI_REGISTER_PM1B_CONTROL, pm1x_control); + } /* Ensure enter_sleep_state_prep -> enter_sleep_state ordering */ @@ -407,12 +441,17 @@ arg_list.count = 1; arg_list.pointer = &arg; - arg.type = ACPI_TYPE_INTEGER; - arg.integer.value = sleep_state; /* Ignore any errors from these methods */ + arg.integer.value = 0; + status = acpi_evaluate_object (NULL, "\\_SI._SST", &arg_list, NULL); + if (ACPI_FAILURE (status) && status != AE_NOT_FOUND) { + ACPI_REPORT_ERROR (("Method _SST failed, %s\n", acpi_format_exception (status))); + } + + arg.integer.value = sleep_state; status = acpi_evaluate_object (NULL, "\\_BFS", &arg_list, NULL); if (ACPI_FAILURE (status) && status != AE_NOT_FOUND) { ACPI_REPORT_ERROR (("Method _BFS failed, %s\n", acpi_format_exception (status))); @@ -430,8 +469,8 @@ return_ACPI_STATUS (status); } - /* Disable BM arbitration */ - status = acpi_set_register (ACPI_BITREG_ARB_DISABLE, 0, ACPI_MTX_LOCK); + /* Enable BM arbitration */ + status = acpi_set_register (ACPI_BITREG_ARB_DISABLE, 0, ACPI_MTX_LOCK); return_ACPI_STATUS (status); } diff -Nru a/drivers/acpi/namespace/nsaccess.c b/drivers/acpi/namespace/nsaccess.c --- a/drivers/acpi/namespace/nsaccess.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/namespace/nsaccess.c Thu Dec 18 04:49:01 2003 @@ -314,8 +314,8 @@ else { prefix_node = scope_info->scope.node; if (ACPI_GET_DESCRIPTOR_TYPE (prefix_node) != ACPI_DESC_TYPE_NAMED) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "[%p] Not a namespace node\n", - prefix_node)); + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "%p Not a namespace node [%s]\n", + prefix_node, acpi_ut_get_descriptor_name (prefix_node))); return_ACPI_STATUS (AE_AML_INTERNAL); } @@ -379,7 +379,7 @@ ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Searching relative to prefix scope [%4.4s] (%p)\n", - prefix_node->name.ascii, prefix_node)); + acpi_ut_get_node_name (prefix_node), prefix_node)); /* * Handle multiple Parent Prefixes (carat) by just getting @@ -413,7 +413,7 @@ if (search_parent_flag == ACPI_NS_NO_UPSEARCH) { ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Search scope is [%4.4s], path has %d carat(s)\n", - this_node->name.ascii, num_carats)); + acpi_ut_get_node_name (this_node), num_carats)); } } diff -Nru a/drivers/acpi/namespace/nsalloc.c b/drivers/acpi/namespace/nsalloc.c --- a/drivers/acpi/namespace/nsalloc.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/namespace/nsalloc.c Thu Dec 18 04:49:01 2003 @@ -271,7 +271,7 @@ * alphabetic placement. */ previous_child_node = NULL; - while (acpi_ns_compare_names (child_node->name.ascii, node->name.ascii) < 0) { + while (acpi_ns_compare_names (acpi_ut_get_node_name (child_node), acpi_ut_get_node_name (node)) < 0) { if (child_node->flags & ANOBJ_END_OF_PEER_LIST) { /* Last peer; Clear end-of-list flag */ @@ -335,8 +335,9 @@ node->type = (u8) type; ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "%4.4s (%s) added to %4.4s (%s) %p at %p\n", - node->name.ascii, acpi_ut_get_type_name (node->type), - parent_node->name.ascii, acpi_ut_get_type_name (parent_node->type), parent_node, node)); + acpi_ut_get_node_name (node), acpi_ut_get_type_name (node->type), + acpi_ut_get_node_name (parent_node), acpi_ut_get_type_name (parent_node->type), + parent_node, node)); /* * Increment the reference count(s) of all parents up to diff -Nru a/drivers/acpi/namespace/nsdump.c b/drivers/acpi/namespace/nsdump.c --- a/drivers/acpi/namespace/nsdump.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/namespace/nsdump.c Thu Dec 18 04:49:01 2003 @@ -50,8 +50,8 @@ #define _COMPONENT ACPI_NAMESPACE ACPI_MODULE_NAME ("nsdump") -#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) +#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) /******************************************************************************* * @@ -76,7 +76,7 @@ return; } - /* Print the entire name */ + /* Print the entire name */ ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "[")); @@ -205,7 +205,7 @@ * Now we can print out the pertinent information */ acpi_os_printf ("%4.4s %-12s %p ", - this_node->name.ascii, acpi_ut_get_type_name (type), this_node); + acpi_ut_get_node_name (this_node), acpi_ut_get_type_name (type), this_node); dbg_level = acpi_dbg_level; acpi_dbg_level = 0; @@ -250,8 +250,7 @@ case ACPI_TYPE_INTEGER: acpi_os_printf ("= %8.8X%8.8X\n", - ACPI_HIDWORD (obj_desc->integer.value), - ACPI_LODWORD (obj_desc->integer.value)); + ACPI_FORMAT_UINT64 (obj_desc->integer.value)); break; @@ -302,8 +301,7 @@ acpi_os_printf ("[%s]", acpi_ut_get_region_name (obj_desc->region.space_id)); if (obj_desc->region.flags & AOPOBJ_DATA_VALID) { acpi_os_printf (" Addr %8.8X%8.8X Len %.4X\n", - ACPI_HIDWORD (obj_desc->region.address), - ACPI_LODWORD (obj_desc->region.address), + ACPI_FORMAT_UINT64 (obj_desc->region.address), obj_desc->region.length); } else { @@ -324,7 +322,7 @@ if (obj_desc->buffer_field.buffer_obj && obj_desc->buffer_field.buffer_obj->buffer.node) { acpi_os_printf ("Buf [%4.4s]", - obj_desc->buffer_field.buffer_obj->buffer.node->name.ascii); + acpi_ut_get_node_name (obj_desc->buffer_field.buffer_obj->buffer.node)); } break; @@ -332,29 +330,29 @@ case ACPI_TYPE_LOCAL_REGION_FIELD: acpi_os_printf ("Rgn [%4.4s]", - obj_desc->common_field.region_obj->region.node->name.ascii); + acpi_ut_get_node_name (obj_desc->common_field.region_obj->region.node)); break; case ACPI_TYPE_LOCAL_BANK_FIELD: acpi_os_printf ("Rgn [%4.4s] Bnk [%4.4s]", - obj_desc->common_field.region_obj->region.node->name.ascii, - obj_desc->bank_field.bank_obj->common_field.node->name.ascii); + acpi_ut_get_node_name (obj_desc->common_field.region_obj->region.node), + acpi_ut_get_node_name (obj_desc->bank_field.bank_obj->common_field.node)); break; case ACPI_TYPE_LOCAL_INDEX_FIELD: acpi_os_printf ("Idx [%4.4s] Dat [%4.4s]", - obj_desc->index_field.index_obj->common_field.node->name.ascii, - obj_desc->index_field.data_obj->common_field.node->name.ascii); + acpi_ut_get_node_name (obj_desc->index_field.index_obj->common_field.node), + acpi_ut_get_node_name (obj_desc->index_field.data_obj->common_field.node)); break; case ACPI_TYPE_LOCAL_ALIAS: - acpi_os_printf ("Target %4.4s (%p)\n", ((struct acpi_namespace_node *) obj_desc)->name.ascii, obj_desc); + acpi_os_printf ("Target %4.4s (%p)\n", acpi_ut_get_node_name (obj_desc), obj_desc); break; default: @@ -371,7 +369,7 @@ case ACPI_TYPE_LOCAL_BANK_FIELD: case ACPI_TYPE_LOCAL_INDEX_FIELD: - acpi_os_printf ("Off %.2X Len %.2X Acc %.2hd\n", + acpi_os_printf (" Off %.3X Len %.2X Acc %.2hd\n", (obj_desc->common_field.base_byte_offset * 8) + obj_desc->common_field.start_field_bit_offset, obj_desc->common_field.bit_length, @@ -408,8 +406,8 @@ case ACPI_TYPE_INTEGER: - acpi_os_printf (" N:%X%X\n", ACPI_HIDWORD(obj_desc->integer.value), - ACPI_LODWORD(obj_desc->integer.value)); + acpi_os_printf (" I:%8.8X8.8%X\n", + ACPI_FORMAT_UINT64 (obj_desc->integer.value)); break; case ACPI_TYPE_STRING: @@ -485,7 +483,8 @@ default: - acpi_os_printf ("(String or Buffer ptr - not an object descriptor)\n"); + acpi_os_printf ("(String or Buffer ptr - not an object descriptor) [%s]\n", + acpi_ut_get_descriptor_name (obj_desc)); bytes_to_dump = 16; break; } @@ -581,7 +580,6 @@ info.owner_id = owner_id; info.display_type = display_type; - (void) acpi_ns_walk_namespace (type, start_handle, max_depth, ACPI_NS_WALK_NO_UNLOCK, acpi_ns_dump_one_object, (void *) &info, NULL); @@ -627,7 +625,6 @@ search_handle = acpi_gbl_root_node; ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "\\\n")); } - acpi_ns_dump_objects (ACPI_TYPE_ANY, ACPI_DISPLAY_OBJECTS, max_depth, ACPI_UINT32_MAX, search_handle); diff -Nru a/drivers/acpi/namespace/nsdumpdv.c b/drivers/acpi/namespace/nsdumpdv.c --- a/drivers/acpi/namespace/nsdumpdv.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/namespace/nsdumpdv.c Thu Dec 18 04:49:01 2003 @@ -93,7 +93,7 @@ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES, " HID: %s, ADR: %8.8X%8.8X, Status: %X\n", info->hardware_id.value, - ACPI_HIDWORD (info->address), ACPI_LODWORD (info->address), + ACPI_FORMAT_UINT64 (info->address), info->current_status)); ACPI_MEM_FREE (info); } diff -Nru a/drivers/acpi/namespace/nsinit.c b/drivers/acpi/namespace/nsinit.c --- a/drivers/acpi/namespace/nsinit.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/namespace/nsinit.c Thu Dec 18 04:49:01 2003 @@ -144,10 +144,17 @@ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, "Executing all Device _STA and_INI methods:")); - /* Walk namespace for all objects of type Device */ + status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); + } - status = acpi_ns_walk_namespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, - ACPI_UINT32_MAX, FALSE, acpi_ns_init_one_device, &info, NULL); + /* Walk namespace for all objects of type Device or Processor */ + + status = acpi_ns_walk_namespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, + ACPI_UINT32_MAX, TRUE, acpi_ns_init_one_device, &info, NULL); + + (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); if (ACPI_FAILURE (status)) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "walk_namespace failed! %s\n", @@ -290,7 +297,8 @@ ACPI_DEBUG_PRINT_RAW ((ACPI_DB_ERROR, "\n")); ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not execute arguments for [%4.4s] (%s), %s\n", - node->name.ascii, acpi_ut_get_type_name (type), acpi_format_exception (status))); + acpi_ut_get_node_name (node), acpi_ut_get_type_name (type), + acpi_format_exception (status))); } /* Print a dot for each object unless we are going to print the entire pathname */ @@ -338,45 +346,48 @@ ACPI_FUNCTION_TRACE ("ns_init_one_device"); - if ((acpi_dbg_level <= ACPI_LV_ALL_EXCEPTIONS) && (!(acpi_dbg_level & ACPI_LV_INFO))) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, ".")); - } - - info->device_count++; - - status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE); - if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); - } - node = acpi_ns_map_handle_to_node (obj_handle); if (!node) { - (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); return_ACPI_STATUS (AE_BAD_PARAMETER); } - status = acpi_ut_release_mutex (ACPI_MTX_NAMESPACE); - if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); + /* + * We will run _STA/_INI on Devices and Processors only + */ + if ((node->type != ACPI_TYPE_DEVICE) && + (node->type != ACPI_TYPE_PROCESSOR)) { + return_ACPI_STATUS (AE_OK); + } + + if ((acpi_dbg_level <= ACPI_LV_ALL_EXCEPTIONS) && (!(acpi_dbg_level & ACPI_LV_INFO))) { + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, ".")); } + info->device_count++; + /* * Run _STA to determine if we can run _INI on the device. */ ACPI_DEBUG_EXEC (acpi_ut_display_init_pathname (ACPI_TYPE_METHOD, node, "_STA")); status = acpi_ut_execute_STA (node, &flags); + if (ACPI_FAILURE (status)) { - /* Ignore error and move on to next device */ + if (node->type == ACPI_TYPE_DEVICE) { + /* Ignore error and move on to next device */ - return_ACPI_STATUS (AE_OK); - } + return_ACPI_STATUS (AE_OK); + } - info->num_STA++; + /* _STA is not required for Processor objects */ + } + else { + info->num_STA++; - if (!(flags & 0x01)) { - /* don't look at children of a not present device */ + if (!(flags & 0x01)) { + /* Don't look at children of a not present device */ - return_ACPI_STATUS(AE_CTRL_DEPTH); + return_ACPI_STATUS(AE_CTRL_DEPTH); + } } /* diff -Nru a/drivers/acpi/namespace/nsobject.c b/drivers/acpi/namespace/nsobject.c --- a/drivers/acpi/namespace/nsobject.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/namespace/nsobject.c Thu Dec 18 04:49:01 2003 @@ -104,7 +104,8 @@ if (ACPI_GET_DESCRIPTOR_TYPE (node) != ACPI_DESC_TYPE_NAMED) { /* Not a name handle */ - ACPI_REPORT_ERROR (("ns_attach_object: Invalid handle\n")); + ACPI_REPORT_ERROR (("ns_attach_object: Invalid handle %p [%s]\n", + node, acpi_ut_get_descriptor_name (node))); return_ACPI_STATUS (AE_BAD_PARAMETER); } @@ -151,7 +152,7 @@ } ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Installing %p into Node %p [%4.4s]\n", - obj_desc, node, node->name.ascii)); + obj_desc, node, acpi_ut_get_node_name (node))); /* Detach an existing attached object if present */ @@ -234,7 +235,7 @@ node->type = ACPI_TYPE_ANY; ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Node %p [%4.4s] Object %p\n", - node, node->name.ascii, obj_desc)); + node, acpi_ut_get_node_name (node), obj_desc)); /* Remove one reference on the object (and all subobjects) */ diff -Nru a/drivers/acpi/namespace/nssearch.c b/drivers/acpi/namespace/nssearch.c --- a/drivers/acpi/namespace/nssearch.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/namespace/nssearch.c Thu Dec 18 04:49:01 2003 @@ -119,7 +119,7 @@ ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Name [%4.4s] (%s) %p found in scope [%4.4s] %p\n", (char *) &target_name, acpi_ut_get_type_name (next_node->type), - next_node, node->name.ascii, node)); + next_node, acpi_ut_get_node_name (node), node)); *return_node = next_node; return_ACPI_STATUS (AE_OK); @@ -145,7 +145,7 @@ ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Name [%4.4s] (%s) not found in search in scope [%4.4s] %p first child %p\n", (char *) &target_name, acpi_ut_get_type_name (type), - node->name.ascii, node, node->child)); + acpi_ut_get_node_name (node), node, node->child)); return_ACPI_STATUS (AE_NOT_FOUND); } diff -Nru a/drivers/acpi/namespace/nsutils.c b/drivers/acpi/namespace/nsutils.c --- a/drivers/acpi/namespace/nsutils.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/namespace/nsutils.c Thu Dec 18 04:49:01 2003 @@ -977,8 +977,8 @@ parent_node = acpi_ns_get_parent_node (child_node); if (parent_node) { ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Parent of %p [%4.4s] is %p [%4.4s]\n", - child_node, child_node->name.ascii, - parent_node, parent_node->name.ascii)); + child_node, acpi_ut_get_node_name (child_node), + parent_node, acpi_ut_get_node_name (parent_node))); if (parent_node->name.integer) { return_VALUE ((acpi_name) parent_node->name.integer); @@ -986,7 +986,7 @@ } ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "unable to find parent of %p (%4.4s)\n", - child_node, child_node->name.ascii)); + child_node, acpi_ut_get_node_name (child_node))); } return_VALUE (ACPI_UNKNOWN_NAME); diff -Nru a/drivers/acpi/namespace/nsxfname.c b/drivers/acpi/namespace/nsxfname.c --- a/drivers/acpi/namespace/nsxfname.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/namespace/nsxfname.c Thu Dec 18 04:49:01 2003 @@ -199,7 +199,7 @@ /* Just copy the ACPI name from the Node and zero terminate it */ - ACPI_STRNCPY (buffer->pointer, node->name.ascii, + ACPI_STRNCPY (buffer->pointer, acpi_ut_get_node_name (node), ACPI_NAME_SIZE); ((char *) buffer->pointer) [ACPI_NAME_SIZE] = 0; status = AE_OK; diff -Nru a/drivers/acpi/parser/psargs.c b/drivers/acpi/parser/psargs.c --- a/drivers/acpi/parser/psargs.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/parser/psargs.c Thu Dec 18 04:49:01 2003 @@ -490,7 +490,7 @@ acpi_ps_get_next_field ( struct acpi_parse_state *parser_state) { - u32 aml_offset = ACPI_PTR_DIFF (parser_state->aml, + u32 aml_offset = (u32) ACPI_PTR_DIFF (parser_state->aml, parser_state->aml_start); union acpi_parse_object *field; u16 opcode; @@ -677,7 +677,7 @@ /* Fill in bytelist data */ - arg->common.value.size = ACPI_PTR_DIFF (parser_state->pkg_end, + arg->common.value.size = (u32) ACPI_PTR_DIFF (parser_state->pkg_end, parser_state->aml); arg->named.data = parser_state->aml; diff -Nru a/drivers/acpi/parser/psparse.c b/drivers/acpi/parser/psparse.c --- a/drivers/acpi/parser/psparse.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/parser/psparse.c Thu Dec 18 04:49:01 2003 @@ -498,7 +498,7 @@ if (!op) { /* Get the next opcode from the AML stream */ - walk_state->aml_offset = ACPI_PTR_DIFF (parser_state->aml, + walk_state->aml_offset = (u32) ACPI_PTR_DIFF (parser_state->aml, parser_state->aml_start); walk_state->opcode = acpi_ps_peek_opcode (parser_state); @@ -710,7 +710,7 @@ while (GET_CURRENT_ARG_TYPE (walk_state->arg_types) && !walk_state->arg_count) { - walk_state->aml_offset = ACPI_PTR_DIFF (parser_state->aml, + walk_state->aml_offset = (u32) ACPI_PTR_DIFF (parser_state->aml, parser_state->aml_start); status = acpi_ps_get_next_arg (walk_state, parser_state, GET_CURRENT_ARG_TYPE (walk_state->arg_types), &arg); diff -Nru a/drivers/acpi/parser/psxface.c b/drivers/acpi/parser/psxface.c --- a/drivers/acpi/parser/psxface.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/parser/psxface.c Thu Dec 18 04:49:01 2003 @@ -127,7 +127,8 @@ op = acpi_ps_create_scope_op (); if (!op) { - return_ACPI_STATUS (AE_NO_MEMORY); + status = AE_NO_MEMORY; + goto cleanup1; } /* @@ -142,20 +143,24 @@ walk_state = acpi_ds_create_walk_state (obj_desc->method.owning_id, NULL, NULL, NULL); if (!walk_state) { - return_ACPI_STATUS (AE_NO_MEMORY); + status = AE_NO_MEMORY; + goto cleanup2; } status = acpi_ds_init_aml_walk (walk_state, op, method_node, obj_desc->method.aml_start, obj_desc->method.aml_length, NULL, NULL, 1); if (ACPI_FAILURE (status)) { - acpi_ds_delete_walk_state (walk_state); - return_ACPI_STATUS (status); + goto cleanup3; } /* Parse the AML */ status = acpi_ps_parse_aml (walk_state); acpi_ps_delete_parse_tree (op); + if (ACPI_FAILURE (status)) { + goto cleanup1; /* Walk state is already deleted */ + + } /* * 2) Execute the method. Performs second pass parse simultaneously @@ -168,7 +173,8 @@ op = acpi_ps_create_scope_op (); if (!op) { - return_ACPI_STATUS (AE_NO_MEMORY); + status = AE_NO_MEMORY; + goto cleanup1; } /* Init new op with the method name and pointer back to the NS node */ @@ -180,22 +186,30 @@ walk_state = acpi_ds_create_walk_state (0, NULL, NULL, NULL); if (!walk_state) { - return_ACPI_STATUS (AE_NO_MEMORY); + status = AE_NO_MEMORY; + goto cleanup2; } status = acpi_ds_init_aml_walk (walk_state, op, method_node, obj_desc->method.aml_start, obj_desc->method.aml_length, params, return_obj_desc, 3); if (ACPI_FAILURE (status)) { - acpi_ds_delete_walk_state (walk_state); - return_ACPI_STATUS (status); + goto cleanup3; } /* * The walk of the parse tree is where we actually execute the method */ status = acpi_ps_parse_aml (walk_state); + goto cleanup2; /* Walk state already deleted */ + + +cleanup3: + acpi_ds_delete_walk_state (walk_state); + +cleanup2: acpi_ps_delete_parse_tree (op); +cleanup1: if (params) { /* Take away the extra reference that we gave the parameters above */ @@ -204,6 +218,10 @@ (void) acpi_ut_update_object_reference (params[i], REF_DECREMENT); } + } + + if (ACPI_FAILURE (status)) { + return_ACPI_STATUS (status); } /* diff -Nru a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c --- a/drivers/acpi/pci_root.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/pci_root.c Thu Dec 18 04:49:01 2003 @@ -61,8 +61,6 @@ acpi_handle handle; struct acpi_pci_id id; struct pci_bus *bus; - u64 mem_tra; - u64 io_tra; }; static LIST_HEAD(acpi_pci_roots); @@ -114,97 +112,6 @@ } } -void -acpi_pci_get_translations ( - struct acpi_pci_id *id, - u64 *mem_tra, - u64 *io_tra) -{ - struct list_head *node = NULL; - struct acpi_pci_root *entry; - - /* TBD: Locking */ - list_for_each(node, &acpi_pci_roots) { - entry = list_entry(node, struct acpi_pci_root, node); - if ((id->segment == entry->id.segment) - && (id->bus == entry->id.bus)) { - *mem_tra = entry->mem_tra; - *io_tra = entry->io_tra; - return; - } - } - - *mem_tra = 0; - *io_tra = 0; -} - - -static u64 -acpi_pci_root_bus_tra ( - struct acpi_resource *resource, - int type) -{ - struct acpi_resource_address16 *address16; - struct acpi_resource_address32 *address32; - struct acpi_resource_address64 *address64; - - while (1) { - switch (resource->id) { - case ACPI_RSTYPE_END_TAG: - return 0; - - case ACPI_RSTYPE_ADDRESS16: - address16 = (struct acpi_resource_address16 *) &resource->data; - if (type == address16->resource_type) { - return address16->address_translation_offset; - } - break; - - case ACPI_RSTYPE_ADDRESS32: - address32 = (struct acpi_resource_address32 *) &resource->data; - if (type == address32->resource_type) { - return address32->address_translation_offset; - } - break; - - case ACPI_RSTYPE_ADDRESS64: - address64 = (struct acpi_resource_address64 *) &resource->data; - if (type == address64->resource_type) { - return address64->address_translation_offset; - } - break; - } - resource = ACPI_PTR_ADD (struct acpi_resource, - resource, resource->length); - } - - return 0; -} - - -static int -acpi_pci_evaluate_crs ( - struct acpi_pci_root *root) -{ - acpi_status status; - struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL}; - - ACPI_FUNCTION_TRACE("acpi_pci_evaluate_crs"); - - status = acpi_get_current_resources (root->handle, &buffer); - if (ACPI_FAILURE(status)) - return_VALUE(-ENODEV); - - root->io_tra = acpi_pci_root_bus_tra ((struct acpi_resource *) - buffer.pointer, ACPI_IO_RANGE); - root->mem_tra = acpi_pci_root_bus_tra ((struct acpi_resource *) - buffer.pointer, ACPI_MEMORY_RANGE); - - acpi_os_free(buffer.pointer); - return_VALUE(0); -} - - static int acpi_pci_root_add ( struct acpi_device *device) @@ -289,10 +196,8 @@ root->id.function = device->pnp.bus_address & 0xFFFF; /* - * Evaluate _CRS to get root bridge resources * TBD: Need PCI interface for enumeration/configuration of roots. */ - acpi_pci_evaluate_crs(root); /* TBD: Locking */ list_add_tail(&root->node, &acpi_pci_roots); diff -Nru a/drivers/acpi/processor.c b/drivers/acpi/processor.c --- a/drivers/acpi/processor.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/processor.c Thu Dec 18 04:49:01 2003 @@ -144,6 +144,8 @@ int platform_limit; u16 control_register; u16 status_register; + u8 control_register_bit_width; + u8 status_register_bit_width; int state_count; struct acpi_processor_px states[ACPI_PROCESSOR_MAX_PERFORMANCE]; }; @@ -902,7 +904,7 @@ } pr->performance.control_register = (u16) reg->address; - + pr->performance.control_register_bit_width = reg->bit_width; /* * status_register */ @@ -929,6 +931,7 @@ } pr->performance.status_register = (u16) reg->address; + pr->performance.status_register_bit_width = reg->bit_width; ACPI_DEBUG_PRINT((ACPI_DB_INFO, "control_register[0x%04x] status_register[0x%04x]\n", @@ -1018,6 +1021,42 @@ return_VALUE(result); } +static int +acpi_processor_write_port( + u16 port, + u8 bit_width, + u32 value) +{ + if (bit_width <= 8) { + outb(value, port); + } else if (bit_width <= 16) { + outw(value, port); + } else if (bit_width <= 32) { + outl(value, port); + } else { + return -ENODEV; + } + return 0; +} + +static int +acpi_processor_read_port( + u16 port, + u8 bit_width, + u32 *ret) +{ + *ret = 0; + if (bit_width <= 8) { + *ret = inb(port); + } else if (bit_width <= 16) { + *ret = inw(port); + } else if (bit_width <= 32) { + *ret = inl(port); + } else { + return -ENODEV; + } + return 0; +} static int acpi_processor_set_performance ( @@ -1025,7 +1064,9 @@ int state) { u16 port = 0; - u8 value = 0; + u8 bit_width = 0; + int ret = 0; + u32 value = 0; int i = 0; ACPI_FUNCTION_TRACE("acpi_processor_set_performance"); @@ -1064,12 +1105,18 @@ */ port = pr->performance.control_register; - value = (u16) pr->performance.states[state].control; + value = (u32) pr->performance.states[state].control; + bit_width = pr->performance.control_register_bit_width; ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "Writing 0x%02x to port 0x%04x\n", value, port)); + "Writing 0x%08x to port 0x%04x\n", value, port)); - outb(value, port); + ret = acpi_processor_write_port(port, bit_width, value); + if (ret) { + ACPI_DEBUG_PRINT((ACPI_DB_WARN, + "Invalid port width 0x%04x\n", bit_width)); + return_VALUE(ret); + } /* * Then we read the 'status_register' and compare the value with the @@ -1079,19 +1126,25 @@ */ port = pr->performance.status_register; + bit_width = pr->performance.status_register_bit_width; ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "Looking for 0x%02x from port 0x%04x\n", - (u8) pr->performance.states[state].status, port)); + "Looking for 0x%08x from port 0x%04x\n", + (u32) pr->performance.states[state].status, port)); for (i=0; i<100; i++) { - value = inb(port); - if (value == (u8) pr->performance.states[state].status) + ret = acpi_processor_read_port(port, bit_width, &value); + if (ret) { + ACPI_DEBUG_PRINT((ACPI_DB_WARN, + "Invalid port width 0x%04x\n", bit_width)); + return_VALUE(ret); + } + if (value == (u32) pr->performance.states[state].status) break; udelay(10); } - if (value != pr->performance.states[state].status) { + if (value != (u32) pr->performance.states[state].status) { ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Transition failed\n")); return_VALUE(-ENODEV); } diff -Nru a/drivers/acpi/resources/rscalc.c b/drivers/acpi/resources/rscalc.c --- a/drivers/acpi/resources/rscalc.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/resources/rscalc.c Thu Dec 18 04:49:01 2003 @@ -696,7 +696,7 @@ default: /* * If we get here, everything is out of sync, - * so exit with an error + * exit with an error */ return_ACPI_STATUS (AE_AML_INVALID_RESOURCE_TYPE); } @@ -704,7 +704,7 @@ /* * Update the return value and counter */ - buffer_size += ACPI_ALIGN_RESOURCE_SIZE(structure_size); + buffer_size += (u32) ACPI_ALIGN_RESOURCE_SIZE (structure_size); bytes_parsed += bytes_consumed; /* diff -Nru a/drivers/acpi/resources/rscreate.c b/drivers/acpi/resources/rscreate.c --- a/drivers/acpi/resources/rscreate.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/resources/rscreate.c Thu Dec 18 04:49:01 2003 @@ -331,7 +331,7 @@ /* Now align the current length */ - user_prt->length = ACPI_ROUND_UP_to_64_bITS (user_prt->length); + user_prt->length = (u32) ACPI_ROUND_UP_to_64_bITS (user_prt->length); /* * 4) Fourth subobject: Dereference the PRT.source_index diff -Nru a/drivers/acpi/resources/rsdump.c b/drivers/acpi/resources/rsdump.c --- a/drivers/acpi/resources/rsdump.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/resources/rsdump.c Thu Dec 18 04:49:01 2003 @@ -899,24 +899,19 @@ "" : "not "); acpi_os_printf (" Granularity: %8.8X%8.8X\n", - ACPI_HIDWORD (address64_data->granularity), - ACPI_LODWORD (address64_data->granularity)); + ACPI_FORMAT_UINT64 (address64_data->granularity)); acpi_os_printf (" Address range min: %8.8X%8.8X\n", - ACPI_HIDWORD (address64_data->min_address_range), - ACPI_HIDWORD (address64_data->min_address_range)); + ACPI_FORMAT_UINT64 (address64_data->min_address_range)); acpi_os_printf (" Address range max: %8.8X%8.8X\n", - ACPI_HIDWORD (address64_data->max_address_range), - ACPI_HIDWORD (address64_data->max_address_range)); + ACPI_FORMAT_UINT64 (address64_data->max_address_range)); acpi_os_printf (" Address translation offset: %8.8X%8.8X\n", - ACPI_HIDWORD (address64_data->address_translation_offset), - ACPI_HIDWORD (address64_data->address_translation_offset)); + ACPI_FORMAT_UINT64 (address64_data->address_translation_offset)); acpi_os_printf (" Address Length: %8.8X%8.8X\n", - ACPI_HIDWORD (address64_data->address_length), - ACPI_HIDWORD (address64_data->address_length)); + ACPI_FORMAT_UINT64 (address64_data->address_length)); if(0xFF != address64_data->resource_source.index) { acpi_os_printf (" Resource Source Index: %X\n", @@ -1126,8 +1121,7 @@ acpi_os_printf ("PCI IRQ Routing Table structure %X.\n", count++); acpi_os_printf (" Address: %8.8X%8.8X\n", - ACPI_HIDWORD (prt_element->address), - ACPI_LODWORD (prt_element->address)); + ACPI_FORMAT_UINT64 (prt_element->address)); acpi_os_printf (" Pin: %X\n", prt_element->pin); diff -Nru a/drivers/acpi/resources/rsirq.c b/drivers/acpi/resources/rsirq.c --- a/drivers/acpi/resources/rsirq.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/resources/rsirq.c Thu Dec 18 04:49:01 2003 @@ -132,26 +132,28 @@ temp8 = *buffer; /* - * Check for HE, LL or HL + * Check for HE, LL interrupts */ - if (temp8 & 0x01) { + switch (temp8 & 0x09) { + case 0x01: /* HE */ output_struct->data.irq.edge_level = ACPI_EDGE_SENSITIVE; output_struct->data.irq.active_high_low = ACPI_ACTIVE_HIGH; - } - else { - if (temp8 & 0x8) { - output_struct->data.irq.edge_level = ACPI_LEVEL_SENSITIVE; - output_struct->data.irq.active_high_low = ACPI_ACTIVE_LOW; - } - else { - /* - * Only _LL and _HE polarity/trigger interrupts - * are allowed (ACPI spec v1.0b ection 6.4.2.1), - * so an error will occur if we reach this point - */ - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Invalid interrupt polarity/trigger in resource list\n")); - return_ACPI_STATUS (AE_BAD_DATA); - } + break; + + case 0x08: /* LL */ + output_struct->data.irq.edge_level = ACPI_LEVEL_SENSITIVE; + output_struct->data.irq.active_high_low = ACPI_ACTIVE_LOW; + break; + + default: + /* + * Only _LL and _HE polarity/trigger interrupts + * are allowed (ACPI spec, section "IRQ Format") + * so 0x00 and 0x09 are illegal. + */ + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, + "Invalid interrupt polarity/trigger in resource list, %X\n", temp8)); + return_ACPI_STATUS (AE_BAD_DATA); } /* @@ -419,7 +421,7 @@ * Point the String pointer to the end of this structure. */ output_struct->data.extended_irq.resource_source.string_ptr = - (char *)(output_struct + struct_size); + (char *)((char *) output_struct + struct_size); temp_ptr = (u8 *) output_struct->data.extended_irq.resource_source.string_ptr; diff -Nru a/drivers/acpi/resources/rslist.c b/drivers/acpi/resources/rslist.c --- a/drivers/acpi/resources/rslist.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/resources/rslist.c Thu Dec 18 04:49:01 2003 @@ -312,8 +312,8 @@ * Set the Buffer to the next structure */ resource = ACPI_CAST_PTR (struct acpi_resource, buffer); - resource->length = ACPI_ALIGN_RESOURCE_SIZE(resource->length); - buffer += ACPI_ALIGN_RESOURCE_SIZE(structure_size); + resource->length = (u32) ACPI_ALIGN_RESOURCE_SIZE (resource->length); + buffer += ACPI_ALIGN_RESOURCE_SIZE (structure_size); } /* end while */ diff -Nru a/drivers/acpi/tables/tbget.c b/drivers/acpi/tables/tbget.c --- a/drivers/acpi/tables/tbget.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/tables/tbget.c Thu Dec 18 04:49:01 2003 @@ -148,8 +148,7 @@ (void *) &header); if (ACPI_FAILURE (status)) { ACPI_REPORT_ERROR (("Could not map memory at %8.8X%8.8X for length %X\n", - ACPI_HIDWORD (address->pointer.physical), - ACPI_LODWORD (address->pointer.physical), + ACPI_FORMAT_UINT64 (address->pointer.physical), sizeof (struct acpi_table_header))); return_ACPI_STATUS (status); } @@ -365,8 +364,7 @@ if (ACPI_FAILURE (status)) { ACPI_REPORT_ERROR (("Could not map memory for table [%4.4s] at %8.8X%8.8X for length %X\n", header->signature, - ACPI_HIDWORD (address->pointer.physical), - ACPI_LODWORD (address->pointer.physical), header->length)); + ACPI_FORMAT_UINT64 (address->pointer.physical), header->length)); return (status); } @@ -408,8 +406,7 @@ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Found table [%4.4s] at %8.8X%8.8X, mapped/copied to %p\n", full_table->signature, - ACPI_HIDWORD (address->pointer.physical), - ACPI_LODWORD (address->pointer.physical), full_table)); + ACPI_FORMAT_UINT64 (address->pointer.physical), full_table)); return_ACPI_STATUS (status); } @@ -458,6 +455,7 @@ if (instance == 1) { /* Get the first */ + *table_ptr_loc = NULL; if (acpi_gbl_table_lists[table_type].next) { *table_ptr_loc = acpi_gbl_table_lists[table_type].next->pointer; } diff -Nru a/drivers/acpi/tables/tbgetall.c b/drivers/acpi/tables/tbgetall.c --- a/drivers/acpi/tables/tbgetall.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/tables/tbgetall.c Thu Dec 18 04:49:01 2003 @@ -240,8 +240,7 @@ if ((status != AE_OK) && (status != AE_TABLE_NOT_SUPPORTED)) { ACPI_REPORT_WARNING (("%s, while getting table at %8.8X%8.8X\n", acpi_format_exception (status), - ACPI_HIDWORD (address.pointer.value), - ACPI_LODWORD (address.pointer.value))); + ACPI_FORMAT_UINT64 (address.pointer.value))); } } diff -Nru a/drivers/acpi/tables/tbrsdt.c b/drivers/acpi/tables/tbrsdt.c --- a/drivers/acpi/tables/tbrsdt.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/tables/tbrsdt.c Thu Dec 18 04:49:01 2003 @@ -278,8 +278,7 @@ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "RSDP located at %p, points to RSDT physical=%8.8X%8.8X \n", acpi_gbl_RSDP, - ACPI_HIDWORD (address.pointer.value), - ACPI_LODWORD (address.pointer.value))); + ACPI_FORMAT_UINT64 (address.pointer.value))); /* Check the RSDT or XSDT signature */ diff -Nru a/drivers/acpi/tables/tbxface.c b/drivers/acpi/tables/tbxface.c --- a/drivers/acpi/tables/tbxface.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/tables/tbxface.c Thu Dec 18 04:49:01 2003 @@ -251,7 +251,7 @@ /* Find all tables of the requested type */ table_desc = acpi_gbl_table_lists[table_type].next; - while (table_desc); { + while (table_desc) { /* * Delete all namespace entries owned by this table. Note that these * entries can appear anywhere in the namespace by virtue of the AML diff -Nru a/drivers/acpi/tables/tbxfroot.c b/drivers/acpi/tables/tbxfroot.c --- a/drivers/acpi/tables/tbxfroot.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/tables/tbxfroot.c Thu Dec 18 04:49:01 2003 @@ -211,8 +211,7 @@ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "RSDP located at %p, RSDT physical=%8.8X%8.8X \n", acpi_gbl_RSDP, - ACPI_HIDWORD (address.pointer.value), - ACPI_LODWORD (address.pointer.value))); + ACPI_FORMAT_UINT64 (address.pointer.value))); /* Insert processor_mode flags */ diff -Nru a/drivers/acpi/tables.c b/drivers/acpi/tables.c --- a/drivers/acpi/tables.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/tables.c Thu Dec 18 04:49:01 2003 @@ -60,6 +60,9 @@ [ACPI_HPET] = "HPET", }; +static char *mps_inti_flags_polarity[] = { "dfl", "high", "res", "low" }; +static char *mps_inti_flags_trigger[] = { "dfl", "edge", "res", "level" }; + /* System Description Table (RSDT/XSDT) */ struct acpi_table_sdt { unsigned long pa; @@ -136,8 +139,14 @@ { struct acpi_table_int_src_ovr *p = (struct acpi_table_int_src_ovr*) header; - printk(KERN_INFO PREFIX "INT_SRC_OVR (bus[%d] irq[0x%x] global_irq[0x%x] polarity[0x%x] trigger[0x%x])\n", - p->bus, p->bus_irq, p->global_irq, p->flags.polarity, p->flags.trigger); + printk(KERN_INFO PREFIX "INT_SRC_OVR (bus %d bus_irq %d global_irq %d %s %s)\n", + p->bus, p->bus_irq, p->global_irq, + mps_inti_flags_polarity[p->flags.polarity], + mps_inti_flags_trigger[p->flags.trigger]); + if(p->flags.reserved) + printk(KERN_INFO PREFIX "INT_SRC_OVR unexpected reserved flags: 0x%x\n", + p->flags.reserved); + } break; @@ -145,8 +154,9 @@ { struct acpi_table_nmi_src *p = (struct acpi_table_nmi_src*) header; - printk(KERN_INFO PREFIX "NMI_SRC (polarity[0x%x] trigger[0x%x] global_irq[0x%x])\n", - p->flags.polarity, p->flags.trigger, p->global_irq); + printk(KERN_INFO PREFIX "NMI_SRC (%s %s global_irq %d)\n", + mps_inti_flags_polarity[p->flags.polarity], + mps_inti_flags_trigger[p->flags.trigger], p->global_irq); } break; @@ -154,8 +164,10 @@ { struct acpi_table_lapic_nmi *p = (struct acpi_table_lapic_nmi*) header; - printk(KERN_INFO PREFIX "LAPIC_NMI (acpi_id[0x%02x] polarity[0x%x] trigger[0x%x] lint[0x%x])\n", - p->acpi_id, p->flags.polarity, p->flags.trigger, p->lint); + printk(KERN_INFO PREFIX "LAPIC_NMI (acpi_id[0x%02x] %s %s lint[0x%x])\n", + p->acpi_id, + mps_inti_flags_polarity[p->flags.polarity], + mps_inti_flags_trigger[p->flags.trigger], p->lint); } break; @@ -190,8 +202,10 @@ { struct acpi_table_plat_int_src *p = (struct acpi_table_plat_int_src*) header; - printk(KERN_INFO PREFIX "PLAT_INT_SRC (polarity[0x%x] trigger[0x%x] type[0x%x] id[0x%04x] eid[0x%x] iosapic_vector[0x%x] global_irq[0x%x]\n", - p->flags.polarity, p->flags.trigger, p->type, p->id, p->eid, p->iosapic_vector, p->global_irq); + printk(KERN_INFO PREFIX "PLAT_INT_SRC (%s %s type[0x%x] id[0x%04x] eid[0x%x] iosapic_vector[0x%x] global_irq[0x%x]\n", + mps_inti_flags_polarity[p->flags.polarity], + mps_inti_flags_trigger[p->flags.trigger], + p->type, p->id, p->eid, p->iosapic_vector, p->global_irq); } break; diff -Nru a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c --- a/drivers/acpi/thermal.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/thermal.c Thu Dec 18 04:49:01 2003 @@ -405,6 +405,7 @@ if (result) return_VALUE(result); + printk(KERN_EMERG "Critical temperature reached (%ld C), shutting down.\n", KELVIN_TO_CELSIUS(tz->temperature)); acpi_bus_generate_event(device, ACPI_THERMAL_NOTIFY_CRITICAL, tz->trips.critical.flags.enabled); acpi_thermal_call_usermode(ACPI_THERMAL_PATH_POWEROFF); diff -Nru a/drivers/acpi/utilities/utalloc.c b/drivers/acpi/utilities/utalloc.c --- a/drivers/acpi/utilities/utalloc.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/utilities/utalloc.c Thu Dec 18 04:49:01 2003 @@ -902,71 +902,30 @@ descriptor = ACPI_CAST_PTR (union acpi_descriptor, &element->user_space); if (descriptor->descriptor_id != ACPI_DESC_TYPE_CACHED) { - acpi_os_printf ("%p Len %04X %9.9s-%d ", + acpi_os_printf ("%p Len %04X %9.9s-%d [%s] ", descriptor, element->size, element->module, - element->line); + element->line, acpi_ut_get_descriptor_name (descriptor)); - /* Most of the elements will be internal objects. */ + /* Most of the elements will be Operand objects. */ switch (ACPI_GET_DESCRIPTOR_TYPE (descriptor)) { case ACPI_DESC_TYPE_OPERAND: - acpi_os_printf ("obj_type %12.12s R%hd", + acpi_os_printf ("%12.12s R%hd", acpi_ut_get_type_name (descriptor->object.common.type), descriptor->object.common.reference_count); break; case ACPI_DESC_TYPE_PARSER: - acpi_os_printf ("parse_obj aml_opcode %04hX", + acpi_os_printf ("aml_opcode %04hX", descriptor->op.asl.aml_opcode); break; case ACPI_DESC_TYPE_NAMED: - acpi_os_printf ("Node %4.4s", - descriptor->node.name.ascii); - break; - - case ACPI_DESC_TYPE_STATE: - acpi_os_printf ("Untyped state_obj"); - break; - - case ACPI_DESC_TYPE_STATE_UPDATE: - acpi_os_printf ("UPDATE state_obj"); - break; - - case ACPI_DESC_TYPE_STATE_PACKAGE: - acpi_os_printf ("PACKAGE state_obj"); - break; - - case ACPI_DESC_TYPE_STATE_CONTROL: - acpi_os_printf ("CONTROL state_obj"); - break; - - case ACPI_DESC_TYPE_STATE_RPSCOPE: - acpi_os_printf ("ROOT-PARSE-SCOPE state_obj"); - break; - - case ACPI_DESC_TYPE_STATE_PSCOPE: - acpi_os_printf ("PARSE-SCOPE state_obj"); - break; - - case ACPI_DESC_TYPE_STATE_WSCOPE: - acpi_os_printf ("WALK-SCOPE state_obj"); - break; - - case ACPI_DESC_TYPE_STATE_RESULT: - acpi_os_printf ("RESULT state_obj"); - break; - - case ACPI_DESC_TYPE_STATE_NOTIFY: - acpi_os_printf ("NOTIFY state_obj"); - break; - - case ACPI_DESC_TYPE_STATE_THREAD: - acpi_os_printf ("THREAD state_obj"); + acpi_os_printf ("%4.4s", + acpi_ut_get_node_name (&descriptor->node)); break; default: - /* All types should appear above */ break; } diff -Nru a/drivers/acpi/utilities/utdebug.c b/drivers/acpi/utilities/utdebug.c --- a/drivers/acpi/utilities/utdebug.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/utilities/utdebug.c Thu Dec 18 04:49:01 2003 @@ -447,7 +447,7 @@ acpi_ut_debug_print (ACPI_LV_FUNCTIONS, line_number, dbg_info, "%s %8.8X%8.8X\n", acpi_gbl_fn_exit_str, - ACPI_HIDWORD (value), ACPI_LODWORD (value)); + ACPI_FORMAT_UINT64 (value)); acpi_gbl_nesting_level--; } diff -Nru a/drivers/acpi/utilities/utdelete.c b/drivers/acpi/utilities/utdelete.c --- a/drivers/acpi/utilities/utdelete.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/utilities/utdelete.c Thu Dec 18 04:49:01 2003 @@ -140,7 +140,7 @@ /* Walk the handler list for this device */ - handler_desc = object->device.address_space; + handler_desc = object->device.handler; while (handler_desc) { next_desc = handler_desc->address_space.next; acpi_ut_remove_reference (handler_desc); @@ -193,7 +193,7 @@ * default handlers -- and therefore, we created the context object * locally, it was not created by an external caller. */ - handler_desc = object->region.address_space; + handler_desc = object->region.handler; if (handler_desc) { if (handler_desc->address_space.hflags & ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) { obj_pointer = second_desc->extra.region_context; diff -Nru a/drivers/acpi/utilities/uteval.c b/drivers/acpi/utilities/uteval.c --- a/drivers/acpi/utilities/uteval.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/utilities/uteval.c Thu Dec 18 04:49:01 2003 @@ -91,7 +91,7 @@ if (ACPI_FAILURE (status)) { if (status == AE_NOT_FOUND) { ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s.%s] was not found\n", - prefix_node->name.ascii, path)); + acpi_ut_get_node_name (prefix_node), path)); } else { ACPI_REPORT_METHOD_ERROR ("Method execution failed", @@ -544,7 +544,7 @@ if (AE_NOT_FOUND == status) { ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "_STA on %4.4s was not found, assuming device is present\n", - device_node->name.ascii)); + acpi_ut_get_node_name (device_node))); *flags = 0x0F; status = AE_OK; diff -Nru a/drivers/acpi/utilities/utglobal.c b/drivers/acpi/utilities/utglobal.c --- a/drivers/acpi/utilities/utglobal.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/utilities/utglobal.c Thu Dec 18 04:49:01 2003 @@ -358,7 +358,7 @@ /* ACPI_EVENT_GLOBAL */ {ACPI_BITREG_GLOBAL_LOCK_STATUS, ACPI_BITREG_GLOBAL_LOCK_ENABLE, ACPI_BITMASK_GLOBAL_LOCK_STATUS, ACPI_BITMASK_GLOBAL_LOCK_ENABLE}, /* ACPI_EVENT_POWER_BUTTON */ {ACPI_BITREG_POWER_BUTTON_STATUS, ACPI_BITREG_POWER_BUTTON_ENABLE, ACPI_BITMASK_POWER_BUTTON_STATUS, ACPI_BITMASK_POWER_BUTTON_ENABLE}, /* ACPI_EVENT_SLEEP_BUTTON */ {ACPI_BITREG_SLEEP_BUTTON_STATUS, ACPI_BITREG_SLEEP_BUTTON_ENABLE, ACPI_BITMASK_SLEEP_BUTTON_STATUS, ACPI_BITMASK_SLEEP_BUTTON_ENABLE}, - /* ACPI_EVENT_RTC */ {ACPI_BITREG_RT_CLOCK_STATUS, ACPI_BITREG_RT_CLOCK_ENABLE, 0, 0}, + /* ACPI_EVENT_RTC */ {ACPI_BITREG_RT_CLOCK_STATUS, ACPI_BITREG_RT_CLOCK_ENABLE, ACPI_BITMASK_RT_CLOCK_STATUS, ACPI_BITMASK_RT_CLOCK_ENABLE}, }; /***************************************************************************** @@ -531,6 +531,99 @@ } return (acpi_ut_get_type_name (ACPI_GET_OBJECT_TYPE (obj_desc))); +} + + +/***************************************************************************** + * + * FUNCTION: acpi_ut_get_node_name + * + * PARAMETERS: Object - A namespace node + * + * RETURN: Pointer to a string + * + * DESCRIPTION: Validate the node and return the node's ACPI name. + * + ****************************************************************************/ + +char * +acpi_ut_get_node_name ( + void *object) +{ + struct acpi_namespace_node *node; + + + if (!object) + { + return ("NULL NODE"); + } + + node = (struct acpi_namespace_node *) object; + + if (node->descriptor != ACPI_DESC_TYPE_NAMED) + { + return ("****"); + } + + if (!acpi_ut_valid_acpi_name (* (u32 *) node->name.ascii)) + { + return ("----"); + } + + return (node->name.ascii); +} + + +/***************************************************************************** + * + * FUNCTION: acpi_ut_get_descriptor_name + * + * PARAMETERS: Object - An ACPI object + * + * RETURN: Pointer to a string + * + * DESCRIPTION: Validate object and return the descriptor type + * + ****************************************************************************/ + +static const char *acpi_gbl_desc_type_names[] = /* printable names of descriptor types */ +{ + /* 00 */ "Invalid", + /* 01 */ "Cached", + /* 02 */ "State-Generic", + /* 03 */ "State-Update", + /* 04 */ "State-Package", + /* 05 */ "State-Control", + /* 06 */ "State-root_parse_scope", + /* 07 */ "State-parse_scope", + /* 08 */ "State-walk_scope", + /* 09 */ "State-Result", + /* 10 */ "State-Notify", + /* 11 */ "State-Thread", + /* 12 */ "Walk", + /* 13 */ "Parser", + /* 14 */ "Operand", + /* 15 */ "Node" +}; + + +char * +acpi_ut_get_descriptor_name ( + void *object) +{ + + if (!object) + { + return ("NULL OBJECT"); + } + + if (ACPI_GET_DESCRIPTOR_TYPE (object) > ACPI_DESC_TYPE_MAX) + { + return ((char *) acpi_gbl_bad_type); + } + + return ((char *) acpi_gbl_desc_type_names[ACPI_GET_DESCRIPTOR_TYPE (object)]); + } diff -Nru a/drivers/acpi/utilities/utobject.c b/drivers/acpi/utilities/utobject.c --- a/drivers/acpi/utilities/utobject.c Thu Dec 18 04:49:01 2003 +++ b/drivers/acpi/utilities/utobject.c Thu Dec 18 04:49:01 2003 @@ -223,29 +223,10 @@ return (TRUE); - case ACPI_DESC_TYPE_NAMED: - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "**** Obj %p is a named obj, not ACPI obj\n", object)); - break; - - case ACPI_DESC_TYPE_PARSER: - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "**** Obj %p is a parser obj, not ACPI obj\n", object)); - break; - - case ACPI_DESC_TYPE_CACHED: - - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "**** Obj %p has already been released to internal cache\n", object)); - break; - default: - - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "**** Obj %p has unknown descriptor type %X\n", object, - ACPI_GET_DESCRIPTOR_TYPE (object))); + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, + "%p is not not an ACPI operand obj [%s]\n", + object, acpi_ut_get_descriptor_name (object))); break; } @@ -322,7 +303,8 @@ if (ACPI_GET_DESCRIPTOR_TYPE (object) != ACPI_DESC_TYPE_OPERAND) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, - "Obj %p is not an ACPI object\n", object)); + "%p is not an ACPI Operand object [%s]\n", object, + acpi_ut_get_descriptor_name (object))); return_VOID; } diff -Nru a/include/acpi/acconfig.h b/include/acpi/acconfig.h --- a/include/acpi/acconfig.h Thu Dec 18 04:49:01 2003 +++ b/include/acpi/acconfig.h Thu Dec 18 04:49:01 2003 @@ -64,7 +64,7 @@ /* Version string */ -#define ACPI_CA_VERSION 0x20031002 +#define ACPI_CA_VERSION 0x20031203 /* Maximum objects in the various object caches */ diff -Nru a/include/acpi/acevents.h b/include/acpi/acevents.h --- a/include/acpi/acevents.h Thu Dec 18 04:49:01 2003 +++ b/include/acpi/acevents.h Thu Dec 18 04:49:01 2003 @@ -182,6 +182,17 @@ union acpi_operand_object *region_obj, u8 acpi_ns_is_locked); +acpi_status +acpi_ev_execute_reg_method ( + union acpi_operand_object *region_obj, + u32 function); + +acpi_status +acpi_ev_reg_run ( + acpi_handle obj_handle, + u32 level, + void *context, + void **return_value); /* * Evregini - Region initialization and setup diff -Nru a/include/acpi/acglobal.h b/include/acpi/acglobal.h --- a/include/acpi/acglobal.h Thu Dec 18 04:49:01 2003 +++ b/include/acpi/acglobal.h Thu Dec 18 04:49:01 2003 @@ -106,6 +106,9 @@ ACPI_EXTERN u8 acpi_gbl_integer_bit_width; ACPI_EXTERN u8 acpi_gbl_integer_byte_width; ACPI_EXTERN u8 acpi_gbl_integer_nybble_width; + +/* Keep local copies of these FADT-based registers */ + ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1a_enable; ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1b_enable; diff -Nru a/include/acpi/acmacros.h b/include/acpi/acmacros.h --- a/include/acpi/acmacros.h Thu Dec 18 04:49:01 2003 +++ b/include/acpi/acmacros.h Thu Dec 18 04:49:01 2003 @@ -48,7 +48,6 @@ /* * Data manipulation macros */ - #define ACPI_LOWORD(l) ((u16)(u32)(l)) #define ACPI_HIWORD(l) ((u16)((((u32)(l)) >> 16) & 0xFFFF)) #define ACPI_LOBYTE(l) ((u8)(u16)(l)) @@ -94,10 +93,18 @@ #endif #endif - /* - * Extract a byte of data using a pointer. Any more than a byte and we - * get into potential aligment issues -- see the STORE macros below - */ +/* + * printf() format helpers + */ + +/* Split 64-bit integer into two 32-bit values. use with %8,8_x%8.8X */ + +#define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i),ACPI_LODWORD(i) + +/* + * Extract a byte of data using a pointer. Any more than a byte and we + * get into potential aligment issues -- see the STORE macros below + */ #define ACPI_GET8(addr) (*(u8*)(addr)) /* Pointer arithmetic */ @@ -129,7 +136,6 @@ * If the hardware supports the transfer of unaligned data, just do the store. * Otherwise, we have to move one byte at a time. */ - #ifdef ACPI_BIG_ENDIAN /* * Macros for big-endian machines @@ -299,7 +305,6 @@ /* * Fast power-of-two math macros for non-optimized compilers */ - #define _ACPI_DIV(value,power_of2) ((u32) ((value) >> (power_of2))) #define _ACPI_MUL(value,power_of2) ((u32) ((value) << (power_of2))) #define _ACPI_MOD(value,divisor) ((u32) ((value) & ((divisor) -1))) @@ -443,7 +448,6 @@ /* * Reporting macros that are never compiled out */ - #define ACPI_PARAM_LIST(pl) pl /* @@ -451,7 +455,6 @@ * _THIS_MODULE gets compiled out when ACPI_DEBUG_OUTPUT isn't defined, only * use it in debug mode. */ - #ifdef ACPI_DEBUG_OUTPUT #define ACPI_REPORT_INFO(fp) {acpi_ut_report_info(_THIS_MODULE,__LINE__,_COMPONENT); \ @@ -490,7 +493,6 @@ /* * Debug macros that are conditionally compiled */ - #ifdef ACPI_DEBUG_OUTPUT #define ACPI_MODULE_NAME(name) static char ACPI_UNUSED_VAR *_THIS_MODULE = name; @@ -500,7 +502,6 @@ * The first parameter should be the procedure name as a quoted string. This is declared * as a local string ("_proc_name) so that it can be also used by the function exit macros below. */ - #define ACPI_FUNCTION_NAME(a) struct acpi_debug_print_info _dbg; \ _dbg.component_id = _COMPONENT; \ _dbg.proc_name = a; \ @@ -562,7 +563,6 @@ /* * Generate INT3 on ACPI_ERROR (Debug only!) */ - #define ACPI_ERROR_BREAK #ifdef ACPI_ERROR_BREAK #define ACPI_BREAK_ON_ERROR(lvl) if ((lvl)&ACPI_ERROR) \ @@ -577,7 +577,6 @@ * 1) Debug print for the current component is enabled * 2) Debug error level or trace level for the print statement is enabled */ - #define ACPI_DEBUG_PRINT(pl) acpi_ut_debug_print ACPI_PARAM_LIST(pl) #define ACPI_DEBUG_PRINT_RAW(pl) acpi_ut_debug_print_raw ACPI_PARAM_LIST(pl) @@ -587,7 +586,6 @@ * This is the non-debug case -- make everything go away, * leaving no executable debug code! */ - #define ACPI_MODULE_NAME(name) #define _THIS_MODULE "" @@ -662,7 +660,6 @@ /* * Memory allocation tracking (DEBUG ONLY) */ - #ifndef ACPI_DBG_TRACK_ALLOCATIONS /* Memory allocation */ diff -Nru a/include/acpi/acobject.h b/include/acpi/acobject.h --- a/include/acpi/acobject.h Thu Dec 18 04:49:01 2003 +++ b/include/acpi/acobject.h Thu Dec 18 04:49:01 2003 @@ -114,7 +114,7 @@ #define ACPI_COMMON_NOTIFY_INFO \ union acpi_operand_object *system_notify; /* Handler for system notifies */\ union acpi_operand_object *device_notify; /* Handler for driver notifies */\ - union acpi_operand_object *address_space; /* Handler for Address space */ + union acpi_operand_object *handler; /* Handler for Address space */ /****************************************************************************** @@ -214,7 +214,7 @@ ACPI_OBJECT_COMMON_HEADER u8 space_id; - union acpi_operand_object *address_space; /* Handler for region access */ + union acpi_operand_object *handler; /* Handler for region access */ struct acpi_namespace_node *node; /* containing object */ union acpi_operand_object *next; u32 length; @@ -464,21 +464,22 @@ /* Object descriptor types */ -#define ACPI_DESC_TYPE_CACHED 0x11 /* Used only when object is cached */ -#define ACPI_DESC_TYPE_STATE 0x20 -#define ACPI_DESC_TYPE_STATE_UPDATE 0x21 -#define ACPI_DESC_TYPE_STATE_PACKAGE 0x22 -#define ACPI_DESC_TYPE_STATE_CONTROL 0x23 -#define ACPI_DESC_TYPE_STATE_RPSCOPE 0x24 -#define ACPI_DESC_TYPE_STATE_PSCOPE 0x25 -#define ACPI_DESC_TYPE_STATE_WSCOPE 0x26 -#define ACPI_DESC_TYPE_STATE_RESULT 0x27 -#define ACPI_DESC_TYPE_STATE_NOTIFY 0x28 -#define ACPI_DESC_TYPE_STATE_THREAD 0x29 -#define ACPI_DESC_TYPE_WALK 0x44 -#define ACPI_DESC_TYPE_PARSER 0x66 -#define ACPI_DESC_TYPE_OPERAND 0x88 -#define ACPI_DESC_TYPE_NAMED 0xAA +#define ACPI_DESC_TYPE_CACHED 0x01 /* Used only when object is cached */ +#define ACPI_DESC_TYPE_STATE 0x02 +#define ACPI_DESC_TYPE_STATE_UPDATE 0x03 +#define ACPI_DESC_TYPE_STATE_PACKAGE 0x04 +#define ACPI_DESC_TYPE_STATE_CONTROL 0x05 +#define ACPI_DESC_TYPE_STATE_RPSCOPE 0x06 +#define ACPI_DESC_TYPE_STATE_PSCOPE 0x07 +#define ACPI_DESC_TYPE_STATE_WSCOPE 0x08 +#define ACPI_DESC_TYPE_STATE_RESULT 0x09 +#define ACPI_DESC_TYPE_STATE_NOTIFY 0x0A +#define ACPI_DESC_TYPE_STATE_THREAD 0x0B +#define ACPI_DESC_TYPE_WALK 0x0C +#define ACPI_DESC_TYPE_PARSER 0x0D +#define ACPI_DESC_TYPE_OPERAND 0x0E +#define ACPI_DESC_TYPE_NAMED 0x0F +#define ACPI_DESC_TYPE_MAX 0x0F union acpi_descriptor diff -Nru a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h --- a/include/acpi/acpi_drivers.h Thu Dec 18 04:49:01 2003 +++ b/include/acpi/acpi_drivers.h Thu Dec 18 04:49:01 2003 @@ -162,7 +162,6 @@ int acpi_pci_root_init (void); void acpi_pci_root_exit (void); -void acpi_pci_get_translations (struct acpi_pci_id* id, u64* mem_tra, u64* io_tra); /* ACPI PCI Interrupt Link (pci_link.c) */ diff -Nru a/include/acpi/acutils.h b/include/acpi/acutils.h --- a/include/acpi/acutils.h Thu Dec 18 04:49:01 2003 +++ b/include/acpi/acutils.h Thu Dec 18 04:49:01 2003 @@ -125,6 +125,14 @@ acpi_object_type type); char * +acpi_ut_get_node_name ( + void *object); + +char * +acpi_ut_get_descriptor_name ( + void *object); + +char * acpi_ut_get_object_type_name ( union acpi_operand_object *obj_desc);