[ACPI] ACPICA 20060210
authorBob Moore <robert.moore@intel.com>
Mon, 2 Oct 2006 04:00:00 +0000 (00:00 -0400)
committerLen Brown <len.brown@intel.com>
Fri, 31 Mar 2006 07:19:03 +0000 (02:19 -0500)
Removed a couple of extraneous ACPI_ERROR messages that
appeared during normal execution. These became apparent
after the conversion from ACPI_DEBUG_PRINT.

Fixed a problem where the CreateField operator could hang
if the BitIndex or NumBits parameter referred to a named
object. From Valery Podrezov.
http://bugzilla.kernel.org/show_bug.cgi?id=5359

Fixed a problem where a DeRefOf operation on a buffer
object incorrectly failed with an exception. This also
fixes a couple of related RefOf and DeRefOf issues.
From Valery Podrezov.
http://bugzilla.kernel.org/show_bug.cgi?id=5360
http://bugzilla.kernel.org/show_bug.cgi?id=5387
http://bugzilla.kernel.org/show_bug.cgi?id=5392

Fixed a problem where the AE_BUFFER_LIMIT exception was
returned instead of AE_STRING_LIMIT on an out-of-bounds
Index() operation. From Valery Podrezov.
http://bugzilla.kernel.org/show_bug.cgi?id=5480

Implemented a memory cleanup at the end of the execution
of each iteration of an AML While() loop, preventing the
accumulation of outstanding objects. From Valery Podrezov.
http://bugzilla.kernel.org/show_bug.cgi?id=5427

Eliminated a chunk of duplicate code in the object
resolution code. From Valery Podrezov.
http://bugzilla.kernel.org/show_bug.cgi?id=5336

Fixed several warnings during the 64-bit code generation.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
93 files changed:
drivers/acpi/dispatcher/dsfield.c
drivers/acpi/dispatcher/dsmethod.c
drivers/acpi/dispatcher/dsmthdat.c
drivers/acpi/dispatcher/dsobject.c
drivers/acpi/dispatcher/dsopcode.c
drivers/acpi/dispatcher/dsutils.c
drivers/acpi/dispatcher/dswexec.c
drivers/acpi/dispatcher/dswload.c
drivers/acpi/dispatcher/dswscope.c
drivers/acpi/dispatcher/dswstate.c
drivers/acpi/events/evevent.c
drivers/acpi/events/evgpe.c
drivers/acpi/events/evgpeblk.c
drivers/acpi/events/evmisc.c
drivers/acpi/events/evregion.c
drivers/acpi/events/evrgnini.c
drivers/acpi/events/evxface.c
drivers/acpi/events/evxfevnt.c
drivers/acpi/events/evxfregn.c
drivers/acpi/executer/exconfig.c
drivers/acpi/executer/exconvrt.c
drivers/acpi/executer/exdump.c
drivers/acpi/executer/exfield.c
drivers/acpi/executer/exfldio.c
drivers/acpi/executer/exmisc.c
drivers/acpi/executer/exmutex.c
drivers/acpi/executer/exnames.c
drivers/acpi/executer/exoparg1.c
drivers/acpi/executer/exoparg2.c
drivers/acpi/executer/exoparg3.c
drivers/acpi/executer/exoparg6.c
drivers/acpi/executer/exregion.c
drivers/acpi/executer/exresnte.c
drivers/acpi/executer/exresolv.c
drivers/acpi/executer/exresop.c
drivers/acpi/executer/exstore.c
drivers/acpi/executer/exstoren.c
drivers/acpi/executer/exstorob.c
drivers/acpi/executer/exsystem.c
drivers/acpi/executer/exutils.c
drivers/acpi/hardware/hwgpe.c
drivers/acpi/hardware/hwregs.c
drivers/acpi/hardware/hwsleep.c
drivers/acpi/hardware/hwtimer.c
drivers/acpi/namespace/nsaccess.c
drivers/acpi/namespace/nsalloc.c
drivers/acpi/namespace/nsdump.c
drivers/acpi/namespace/nseval.c
drivers/acpi/namespace/nsinit.c
drivers/acpi/namespace/nsload.c
drivers/acpi/namespace/nsobject.c
drivers/acpi/namespace/nssearch.c
drivers/acpi/namespace/nsutils.c
drivers/acpi/namespace/nswalk.c
drivers/acpi/namespace/nsxfeval.c
drivers/acpi/namespace/nsxfname.c
drivers/acpi/namespace/nsxfobj.c
drivers/acpi/parser/psargs.c
drivers/acpi/parser/psloop.c
drivers/acpi/parser/psopcode.c
drivers/acpi/parser/psparse.c
drivers/acpi/parser/psscope.c
drivers/acpi/parser/pstree.c
drivers/acpi/parser/psutils.c
drivers/acpi/parser/pswalk.c
drivers/acpi/parser/psxface.c
drivers/acpi/resources/rscalc.c
drivers/acpi/resources/rslist.c
drivers/acpi/resources/rsmisc.c
drivers/acpi/resources/rsutils.c
drivers/acpi/resources/rsxface.c
drivers/acpi/tables/tbconvrt.c
drivers/acpi/tables/tbget.c
drivers/acpi/tables/tbgetall.c
drivers/acpi/tables/tbinstal.c
drivers/acpi/tables/tbrsdt.c
drivers/acpi/tables/tbutils.c
drivers/acpi/tables/tbxface.c
drivers/acpi/tables/tbxfroot.c
drivers/acpi/utilities/utalloc.c
drivers/acpi/utilities/utcache.c
drivers/acpi/utilities/utcopy.c
drivers/acpi/utilities/utdebug.c
drivers/acpi/utilities/utdelete.c
drivers/acpi/utilities/uteval.c
drivers/acpi/utilities/utglobal.c
drivers/acpi/utilities/utmisc.c
drivers/acpi/utilities/utobject.c
drivers/acpi/utilities/utresrc.c
drivers/acpi/utilities/utstate.c
include/acpi/acconfig.h
include/acpi/acdisasm.h
include/acpi/acutils.h

index 76bc0463f6de456814bbde5bc771a2690c1f9396..3d33bcc986783c143b8c78191fcc88dc5b7caac6 100644 (file)
@@ -425,6 +425,7 @@ acpi_ds_init_field_objects(union acpi_parse_object *op,
         * Walk the list of entries in the field_list
         */
        while (arg) {
+
                /* Ignore OFFSET and ACCESSAS terms here */
 
                if (arg->common.aml_opcode == AML_INT_NAMEDFIELD_OP) {
index c475546535b652fb313456c5440519c6fc66a0b9..238916ce5412aca7430a7a310ef04db3b0abb2a3 100644 (file)
@@ -81,6 +81,7 @@ acpi_ds_method_error(acpi_status status, struct acpi_walk_state *walk_state)
        /* Invoke the global exception handler */
 
        if (acpi_gbl_exception_handler) {
+
                /* Exit the interpreter, allow handler to execute methods */
 
                acpi_ex_exit_interpreter();
@@ -100,6 +101,7 @@ acpi_ds_method_error(acpi_status status, struct acpi_walk_state *walk_state)
        }
 #ifdef ACPI_DISASSEMBLER
        if (ACPI_FAILURE(status)) {
+
                /* Display method locals/args if disassembler is present */
 
                acpi_dm_dump_method_info(status, walk_state, walk_state->op);
@@ -249,6 +251,7 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread,
        }
 
        if (!(obj_desc->method.method_flags & AML_METHOD_INTERNAL_ONLY)) {
+
                /* 1) Parse: Create a new walk state for the preempting walk */
 
                next_walk_state =
@@ -378,9 +381,11 @@ acpi_ds_restart_control_method(struct acpi_walk_state *walk_state,
        /* Did the called method return a value? */
 
        if (return_desc) {
+
                /* Are we actually going to use the return value? */
 
                if (walk_state->return_used) {
+
                        /* Save the return value from the previous method */
 
                        status = acpi_ds_result_push(return_desc, walk_state);
index c025674f938bd14a75b802d89357464ae7117650..f7cb5170aa11bbf0dfd8f1b27799c72830d5fd25 100644 (file)
@@ -701,6 +701,7 @@ acpi_ds_method_data_get_type(u16 opcode,
 
        object = acpi_ns_get_attached_object(node);
        if (!object) {
+
                /* Uninitialized local/arg, return TYPE_ANY */
 
                return_VALUE(ACPI_TYPE_ANY);
index 8b21f0f9e5177f3d82f9ea72b38ff772c75f972f..1f2d0c6ef36c8eec759ae5bf9b000df519363479 100644 (file)
@@ -103,6 +103,7 @@ acpi_ds_build_internal_object(struct acpi_walk_state *walk_state,
                                                                         common.
                                                                         node)));
                        if (ACPI_FAILURE(status)) {
+
                                /* Check if we are resolving a named reference within a package */
 
                                if ((status == AE_NOT_FOUND)
@@ -195,6 +196,7 @@ acpi_ds_build_internal_buffer_obj(struct acpi_walk_state *walk_state,
         */
        obj_desc = *obj_desc_ptr;
        if (!obj_desc) {
+
                /* Create a new buffer object */
 
                obj_desc = acpi_ut_create_internal_object(ACPI_TYPE_BUFFER);
@@ -355,6 +357,7 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,
        arg = arg->common.next;
        for (i = 0; arg; i++) {
                if (arg->common.aml_opcode == AML_INT_RETURN_VALUE_OP) {
+
                        /* Object (package or buffer) is already built */
 
                        obj_desc->package.elements[i] =
@@ -408,6 +411,7 @@ acpi_ds_create_node(struct acpi_walk_state *walk_state,
        }
 
        if (!op->common.value.arg) {
+
                /* No arguments, there is nothing to do */
 
                return_ACPI_STATUS(AE_OK);
@@ -469,6 +473,7 @@ acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state,
        obj_desc = *ret_obj_desc;
        op_info = acpi_ps_get_opcode_info(opcode);
        if (op_info->class == AML_CLASS_UNKNOWN) {
+
                /* Unknown opcode */
 
                return_ACPI_STATUS(AE_TYPE);
@@ -626,6 +631,7 @@ acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state,
                default:        /* Other literals, etc.. */
 
                        if (op->common.aml_opcode == AML_INT_NAMEPATH_OP) {
+
                                /* Node was saved in Op */
 
                                obj_desc->reference.node = op->common.node;
index 6229c10674e186c41bb690d58d8c80feff6da6b6..8a690a9963f2b18599ef9908487e543cbbe0b790 100644 (file)
@@ -640,6 +640,7 @@ acpi_ds_eval_buffer_field_operands(struct acpi_walk_state *walk_state,
        /* Initialize the Buffer Field */
 
        if (op->common.aml_opcode == AML_CREATE_FIELD_OP) {
+
                /* NOTE: Slightly different operands for this opcode */
 
                status =
@@ -984,6 +985,7 @@ acpi_ds_exec_end_control_op(struct acpi_walk_state * walk_state,
                ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH, "[WHILE_OP] Op=%p\n", op));
 
                if (walk_state->control_state->common.value) {
+
                        /* Predicate was true, go back and evaluate it again! */
 
                        status = AE_CTRL_PENDING;
@@ -1014,6 +1016,7 @@ acpi_ds_exec_end_control_op(struct acpi_walk_state * walk_state,
                 * has been bubbled up the tree
                 */
                if (op->common.value.arg) {
+
                        /* Since we have a real Return(), delete any implicit return */
 
                        acpi_ds_clear_implicit_return(walk_state);
@@ -1047,6 +1050,7 @@ acpi_ds_exec_end_control_op(struct acpi_walk_state * walk_state,
                        walk_state->return_desc = walk_state->operands[0];
                } else if ((walk_state->results) &&
                           (walk_state->results->results.num_results > 0)) {
+
                        /* Since we have a real Return(), delete any implicit return */
 
                        acpi_ds_clear_implicit_return(walk_state);
index 53356a591ac19da2e7881fc81c0d9431920318b2..3fbe17ebef5a56c1e91fade2b1dc4474f70f833a 100644 (file)
@@ -202,6 +202,7 @@ acpi_ds_is_result_used(union acpi_parse_object * op,
         */
        if ((!op->common.parent) ||
            (op->common.parent->common.aml_opcode == AML_SCOPE_OP)) {
+
                /* No parent, the return value cannot possibly be used */
 
                ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
@@ -352,6 +353,7 @@ acpi_ds_delete_result_if_not_used(union acpi_parse_object *op,
        }
 
        if (!acpi_ds_is_result_used(op, walk_state)) {
+
                /* Must pop the result stack (obj_desc should be equal to result_obj) */
 
                status = acpi_ds_result_pop(&obj_desc, walk_state);
@@ -498,7 +500,9 @@ acpi_ds_create_operand(struct acpi_walk_state *walk_state,
                 */
                if ((walk_state->deferred_node) &&
                    (walk_state->deferred_node->type == ACPI_TYPE_BUFFER_FIELD)
-                   && (arg_index != 0)) {
+                   && (arg_index ==
+                       (u32) ((walk_state->opcode ==
+                               AML_CREATE_FIELD_OP) ? 3 : 2))) {
                        obj_desc =
                            ACPI_CAST_PTR(union acpi_operand_object,
                                          walk_state->deferred_node);
@@ -521,6 +525,7 @@ acpi_ds_create_operand(struct acpi_walk_state *walk_state,
                            && (parent_op->common.aml_opcode != AML_REGION_OP)
                            && (parent_op->common.aml_opcode !=
                                AML_INT_NAMEPATH_OP)) {
+
                                /* Enter name into namespace if not found */
 
                                interpreter_mode = ACPI_IMODE_LOAD_PASS2;
index f1af655ff11350dc82ebdd77eb03fcbc6b2666ab..198949f41048fd0ced4e1717ad061f64b6097c9b 100644 (file)
@@ -409,6 +409,7 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
                 * being the object_type and size_of operators.
                 */
                if (!(walk_state->op_info->flags & AML_NO_OPERAND_RESOLVE)) {
+
                        /* Resolve all operands */
 
                        status = acpi_ex_resolve_operands(walk_state->opcode,
@@ -548,6 +549,7 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
                         */
                        status = acpi_ds_resolve_operands(walk_state);
                        if (ACPI_FAILURE(status)) {
+
                                /* On error, clear all resolved operands */
 
                                acpi_ds_clear_operands(walk_state);
@@ -722,6 +724,7 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
       cleanup:
 
        if (walk_state->result_obj) {
+
                /* Break to debugger to display result */
 
                ACPI_DEBUGGER_EXEC(acpi_db_display_result_object
index d3d24da31c814db68766a705c9eb210dfa95a7ba..02b03126e14ef677b6fa09f5103f8dbd55314484 100644 (file)
@@ -261,6 +261,7 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state,
                 */
 
                if (walk_state->deferred_node) {
+
                        /* This name is already in the namespace, get the node */
 
                        node = walk_state->deferred_node;
@@ -311,6 +312,7 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state,
        /* Common exit */
 
        if (!op) {
+
                /* Create a new op */
 
                op = acpi_ps_alloc_op(walk_state->opcode);
@@ -413,6 +415,7 @@ acpi_status acpi_ds_load1_end_op(struct acpi_walk_state *walk_state)
 #endif
 
        if (op->common.aml_opcode == AML_NAME_OP) {
+
                /* For Name opcode, get the object type from the argument */
 
                if (op->common.value.arg) {
@@ -521,6 +524,7 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state,
                if ((walk_state->control_state) &&
                    (walk_state->control_state->common.state ==
                     ACPI_CONTROL_CONDITIONAL_EXECUTING)) {
+
                        /* We are executing a while loop outside of a method */
 
                        status = acpi_ds_exec_begin_op(walk_state, out_op);
@@ -554,10 +558,12 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state,
                /* Get the name we are going to enter or lookup in the namespace */
 
                if (walk_state->opcode == AML_INT_NAMEPATH_OP) {
+
                        /* For Namepath op, get the path string */
 
                        buffer_ptr = op->common.value.string;
                        if (!buffer_ptr) {
+
                                /* No name, just exit */
 
                                return_ACPI_STATUS(AE_OK);
@@ -680,6 +686,7 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state,
                /* All other opcodes */
 
                if (op && op->common.node) {
+
                        /* This op/node was previously entered into the namespace */
 
                        node = op->common.node;
@@ -705,6 +712,7 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state,
                 * Note: Name may already exist if we are executing a deferred opcode.
                 */
                if (walk_state->deferred_node) {
+
                        /* This name is already in the namespace, get the node */
 
                        node = walk_state->deferred_node;
@@ -727,6 +735,7 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state,
        }
 
        if (!op) {
+
                /* Create a new op */
 
                op = acpi_ps_alloc_op(walk_state->opcode);
index ada21ef4a1744d0c9e39aa0c16bdb7333b9e2e32..e2954fff8c5ee34f75a3e509839e0ca204325adf 100644 (file)
@@ -66,6 +66,7 @@ void acpi_ds_scope_stack_clear(struct acpi_walk_state *walk_state)
        ACPI_FUNCTION_NAME("ds_scope_stack_clear");
 
        while (walk_state->scope_info) {
+
                /* Pop a scope off the stack */
 
                scope_info = walk_state->scope_info;
@@ -105,6 +106,7 @@ acpi_ds_scope_stack_push(struct acpi_namespace_node *node,
        ACPI_FUNCTION_TRACE("ds_scope_stack_push");
 
        if (!node) {
+
                /* Invalid scope   */
 
                ACPI_ERROR((AE_INFO, "Null scope parameter"));
index fa78cb74ee367eb69ea4a359d681e1448ee146f5..5bc340b1b286ce04d30f1b1a902d96540dafcc0d 100644 (file)
@@ -170,6 +170,7 @@ acpi_ds_result_pop(union acpi_operand_object ** object,
        state->results.num_results--;
 
        for (index = ACPI_OBJ_NUM_OPERANDS; index; index--) {
+
                /* Check for a valid result object */
 
                if (state->results.obj_desc[index - 1]) {
@@ -448,6 +449,7 @@ acpi_ds_obj_stack_pop(u32 pop_count, struct acpi_walk_state * walk_state)
        ACPI_FUNCTION_NAME("ds_obj_stack_pop");
 
        for (i = 0; i < pop_count; i++) {
+
                /* Check for stack underflow */
 
                if (walk_state->num_operands == 0) {
@@ -494,6 +496,7 @@ acpi_ds_obj_stack_pop_and_delete(u32 pop_count,
        ACPI_FUNCTION_NAME("ds_obj_stack_pop_and_delete");
 
        for (i = 0; i < pop_count; i++) {
+
                /* Check for stack underflow */
 
                if (walk_state->num_operands == 0) {
@@ -598,6 +601,7 @@ struct acpi_walk_state *acpi_ds_pop_walk_state(struct acpi_thread_state *thread)
        walk_state = thread->walk_state_list;
 
        if (walk_state) {
+
                /* Next walk state becomes the current walk state */
 
                thread->walk_state_list = walk_state->next;
@@ -778,6 +782,7 @@ acpi_ds_init_aml_walk(struct acpi_walk_state *walk_state,
                }
 
                if (parser_state->start_node) {
+
                        /* Push start scope on scope stack and make it current  */
 
                        status =
index c9ac05c4685fae95ff7a54322dafb293e11631f5..c8d9752e31287a2926f0ca6076f504afb74e411b 100644 (file)
@@ -260,12 +260,14 @@ u32 acpi_ev_fixed_event_detect(void)
         * Check for all possible Fixed Events and dispatch those that are active
         */
        for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++) {
+
                /* Both the status and enable bits must be on for this event */
 
                if ((fixed_status & acpi_gbl_fixed_event_info[i].
                     status_bit_mask)
                    && (fixed_enable & acpi_gbl_fixed_event_info[i].
                        enable_bit_mask)) {
+
                        /* Found an active (signalled) event */
 
                        int_status |= acpi_ev_fixed_event_dispatch((u32) i);
index f64f977dd3d5a04b118ebc6f904f47a138f19ed8..7d7b81af972e4d2fdf196171fb714cb2f00aa403 100644 (file)
@@ -207,6 +207,7 @@ acpi_ev_enable_gpe(struct acpi_gpe_event_info *gpe_event_info,
                ACPI_SET_BIT(gpe_event_info->flags, ACPI_GPE_RUN_ENABLED);
 
                if (write_to_hardware) {
+
                        /* Clear the GPE (of stale events), then enable it */
 
                        status = acpi_hw_clear_gpe(gpe_event_info);
@@ -313,6 +314,7 @@ struct acpi_gpe_event_info *acpi_ev_get_gpe_event_info(acpi_handle gpe_device,
        /* A NULL gpe_block means use the FADT-defined GPE block(s) */
 
        if (!gpe_device) {
+
                /* Examine GPE Block 0 and 1 (These blocks are permanent) */
 
                for (i = 0; i < ACPI_MAX_GPE_BLOCKS; i++) {
@@ -402,6 +404,7 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list)
                 * Find all currently active GP events.
                 */
                for (i = 0; i < gpe_block->register_count; i++) {
+
                        /* Get the next status/enable pair */
 
                        gpe_register_info = &gpe_block->register_info[i];
@@ -437,6 +440,7 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list)
 
                        enabled_status_byte = (u8) (status_reg & enable_reg);
                        if (!enabled_status_byte) {
+
                                /* No active GPEs in this register, move on */
 
                                continue;
@@ -445,6 +449,7 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list)
                        /* Now look at the individual GPEs in this byte register */
 
                        for (j = 0; j < ACPI_GPE_REGISTER_WIDTH; j++) {
+
                                /* Examine one GPE bit */
 
                                if (enabled_status_byte &
index 0fd00b5ad650c454776908905cc73484f9bc3383..87e77a138fff9cb2124cf4a7f36babe158b9e7d3 100644 (file)
@@ -146,10 +146,12 @@ acpi_status acpi_ev_walk_gpe_list(ACPI_GPE_CALLBACK gpe_walk_callback)
 
        gpe_xrupt_info = acpi_gbl_gpe_xrupt_list_head;
        while (gpe_xrupt_info) {
+
                /* Walk all Gpe Blocks attached to this interrupt level */
 
                gpe_block = gpe_xrupt_info->gpe_block_list_head;
                while (gpe_block) {
+
                        /* One callback per GPE block */
 
                        status = gpe_walk_callback(gpe_xrupt_info, gpe_block);
@@ -195,6 +197,7 @@ acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
        /* Examine each GPE Register within the block */
 
        for (i = 0; i < gpe_block->register_count; i++) {
+
                /* Now look at the individual GPEs in this byte register */
 
                for (j = 0; j < ACPI_GPE_REGISTER_WIDTH; j++) {
@@ -289,6 +292,7 @@ acpi_ev_save_method_info(acpi_handle obj_handle,
 
        gpe_number = ACPI_STRTOUL(&name[2], NULL, 16);
        if (gpe_number == ACPI_UINT32_MAX) {
+
                /* Conversion failed; invalid method, just ignore it */
 
                ACPI_ERROR((AE_INFO,
@@ -371,6 +375,7 @@ acpi_ev_match_prw_and_gpe(acpi_handle obj_handle,
        status = acpi_ut_evaluate_object(obj_handle, METHOD_NAME__PRW,
                                         ACPI_BTYPE_PACKAGE, &pkg_desc);
        if (ACPI_FAILURE(status)) {
+
                /* Ignore all errors from _PRW, we don't want to abort the subsystem */
 
                return_ACPI_STATUS(AE_OK);
@@ -394,6 +399,7 @@ acpi_ev_match_prw_and_gpe(acpi_handle obj_handle,
        obj_desc = pkg_desc->package.elements[0];
 
        if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_INTEGER) {
+
                /* Use FADT-defined GPE device (from definition of _PRW) */
 
                target_gpe_device = acpi_gbl_fadt_gpe_device;
@@ -402,6 +408,7 @@ acpi_ev_match_prw_and_gpe(acpi_handle obj_handle,
 
                gpe_number = (u32) obj_desc->integer.value;
        } else if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_PACKAGE) {
+
                /* Package contains a GPE reference and GPE number within a GPE block */
 
                if ((obj_desc->package.count < 2) ||
@@ -679,6 +686,7 @@ acpi_status acpi_ev_delete_gpe_block(struct acpi_gpe_block_info *gpe_block)
        status = acpi_hw_disable_gpe_block(gpe_block->xrupt_block, gpe_block);
 
        if (!gpe_block->previous && !gpe_block->next) {
+
                /* This is the last gpe_block on this interrupt */
 
                status = acpi_ev_delete_gpe_xrupt(gpe_block->xrupt_block);
@@ -780,6 +788,7 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block)
        this_event = gpe_event_info;
 
        for (i = 0; i < gpe_block->register_count; i++) {
+
                /* Init the register_info for this GPE register (8 GPEs) */
 
                this_register->base_gpe_number =
@@ -1013,6 +1022,7 @@ acpi_ev_initialize_gpe_block(struct acpi_namespace_node *gpe_device,
 
        for (i = 0; i < gpe_block->register_count; i++) {
                for (j = 0; j < 8; j++) {
+
                        /* Get the info block for this particular GPE */
 
                        gpe_event_info =
@@ -1099,6 +1109,7 @@ acpi_status acpi_ev_gpe_initialize(void)
         * particular block is not supported.
         */
        if (acpi_gbl_FADT->gpe0_blk_len && acpi_gbl_FADT->xgpe0_blk.address) {
+
                /* GPE block 0 exists (has both length and address > 0) */
 
                register_count0 = (u16) (acpi_gbl_FADT->gpe0_blk_len / 2);
@@ -1121,6 +1132,7 @@ acpi_status acpi_ev_gpe_initialize(void)
        }
 
        if (acpi_gbl_FADT->gpe1_blk_len && acpi_gbl_FADT->xgpe1_blk.address) {
+
                /* GPE block 1 exists (has both length and address > 0) */
 
                register_count1 = (u16) (acpi_gbl_FADT->gpe1_blk_len / 2);
@@ -1168,6 +1180,7 @@ acpi_status acpi_ev_gpe_initialize(void)
        /* Exit if there are no GPE registers */
 
        if ((register_count0 + register_count1) == 0) {
+
                /* GPEs are not required by ACPI, this is OK */
 
                ACPI_DEBUG_PRINT((ACPI_DB_INIT,
index 0909ba69577e6806f4315f11389c97518423c2bf..334407239f2ff3996958fe5b24a9404c6d7834a1 100644 (file)
@@ -150,6 +150,7 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node,
 
        obj_desc = acpi_ns_get_attached_object(node);
        if (obj_desc) {
+
                /* We have the notify object, Get the right handler */
 
                switch (node->type) {
@@ -240,6 +241,7 @@ static void ACPI_SYSTEM_XFACE acpi_ev_notify_dispatch(void *context)
         * to the device.
         */
        if (notify_info->notify.value <= ACPI_MAX_SYS_NOTIFY) {
+
                /* Global system notification handler */
 
                if (acpi_gbl_system_notify.handler) {
@@ -297,6 +299,7 @@ static void ACPI_SYSTEM_XFACE acpi_ev_global_lock_thread(void *context)
        /* Signal threads that are waiting for the lock */
 
        if (acpi_gbl_global_lock_thread_count) {
+
                /* Send sufficient units to the semaphore */
 
                status =
@@ -335,6 +338,7 @@ static u32 acpi_ev_global_lock_handler(void *context)
         */
        ACPI_ACQUIRE_GLOBAL_LOCK(acpi_gbl_common_fACS.global_lock, acquired);
        if (acquired) {
+
                /* Got the lock, now wake all threads waiting for it */
 
                acpi_gbl_global_lock_acquired = TRUE;
@@ -439,6 +443,7 @@ acpi_status acpi_ev_acquire_global_lock(u16 timeout)
 
        ACPI_ACQUIRE_GLOBAL_LOCK(acpi_gbl_common_fACS.global_lock, acquired);
        if (acquired) {
+
                /* We got the lock */
 
                ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
@@ -492,6 +497,7 @@ acpi_status acpi_ev_release_global_lock(void)
 
        acpi_gbl_global_lock_thread_count--;
        if (acpi_gbl_global_lock_thread_count) {
+
                /* There are still some threads holding the lock, cannot release */
 
                return_ACPI_STATUS(AE_OK);
index 6da58e776413a819123d3401f080ac7df702d9c0..b831ec4bcae75b9c8b19bf01a0234acd195f9cae 100644 (file)
@@ -164,6 +164,7 @@ acpi_status acpi_ev_initialize_op_regions(void)
         * Run the _REG methods for op_regions in each default address space
         */
        for (i = 0; i < ACPI_NUM_DEFAULT_SPACES; i++) {
+
                /* TBD: Make sure handler is the DEFAULT handler, otherwise
                 * _REG will have already been run.
                 */
@@ -315,6 +316,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
                 */
                region_setup = handler_desc->address_space.setup;
                if (!region_setup) {
+
                        /* No initialization routine, exit with error */
 
                        ACPI_ERROR((AE_INFO,
@@ -361,6 +363,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
                        region_obj->region.flags |= AOPOBJ_SETUP_COMPLETE;
 
                        if (region_obj2->extra.region_context) {
+
                                /* The handler for this region was already installed */
 
                                ACPI_MEM_FREE(region_context);
@@ -463,6 +466,7 @@ acpi_ev_detach_region(union acpi_operand_object *region_obj,
 
        handler_obj = region_obj->region.handler;
        if (!handler_obj) {
+
                /* This region has no handler, all done */
 
                return_VOID;
@@ -474,6 +478,7 @@ acpi_ev_detach_region(union acpi_operand_object *region_obj,
        last_obj_ptr = &handler_obj->address_space.region_list;
 
        while (obj_desc) {
+
                /* Is this the correct Region? */
 
                if (obj_desc == region_obj) {
@@ -666,6 +671,7 @@ acpi_ev_install_handler(acpi_handle obj_handle,
 
        obj_desc = acpi_ns_get_attached_object(node);
        if (!obj_desc) {
+
                /* No object, just exit */
 
                return (AE_OK);
@@ -674,10 +680,12 @@ acpi_ev_install_handler(acpi_handle obj_handle,
        /* Devices are handled different than regions */
 
        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.handler;
                while (next_handler_obj) {
+
                        /* Found a handler, is it for the same address space? */
 
                        if (next_handler_obj->address_space.space_id ==
@@ -839,6 +847,7 @@ acpi_ev_install_space_handler(struct acpi_namespace_node * node,
                /* Walk the handler list for this device */
 
                while (handler_obj) {
+
                        /* Same space_id indicates a handler already installed */
 
                        if (handler_obj->address_space.space_id == space_id) {
@@ -1035,6 +1044,7 @@ acpi_ev_reg_run(acpi_handle obj_handle,
 
        obj_desc = acpi_ns_get_attached_object(node);
        if (!obj_desc) {
+
                /* No object, just exit */
 
                return (AE_OK);
index baed8c1a1b9fb74542f9ef1345382ab1a660fa09..a0bffc2a07871485f2e0ef115b67ca239aea2aef 100644 (file)
@@ -199,6 +199,7 @@ acpi_ev_pci_config_region_setup(acpi_handle handle,
         * handlers with that device.
         */
        if (handler_obj->address_space.node == acpi_gbl_root_node) {
+
                /* Start search from the parent object */
 
                pci_root_node = parent_node;
@@ -220,6 +221,7 @@ acpi_ev_pci_config_region_setup(acpi_handle handle,
                                        PCI_EXPRESS_ROOT_HID_STRING,
                                        sizeof(PCI_EXPRESS_ROOT_HID_STRING)))))
                                {
+
                                        /* Install a handler for this PCI root bridge */
 
                                        status =
@@ -478,11 +480,13 @@ acpi_ev_initialize_region(union acpi_operand_object *region_obj,
         * ie: acpi_gbl_root_node->parent_entry being set to NULL
         */
        while (node) {
+
                /* Check to see if a handler exists */
 
                handler_obj = NULL;
                obj_desc = acpi_ns_get_attached_object(node);
                if (obj_desc) {
+
                        /* Can only be a handler if the object exists */
 
                        switch (node->type) {
@@ -507,10 +511,12 @@ acpi_ev_initialize_region(union acpi_operand_object *region_obj,
                        }
 
                        while (handler_obj) {
+
                                /* Is this handler of the correct type? */
 
                                if (handler_obj->address_space.space_id ==
                                    space_id) {
+
                                        /* Found correct handler */
 
                                        ACPI_DEBUG_PRINT((ACPI_DB_OPREGION,
index b38b39dde54318619a29268bebf4ec6bb61df56c..ba16fda3a158b64d6dd5fdcd9bdb901f7ea907ad 100644 (file)
@@ -275,6 +275,7 @@ acpi_install_notify_handler(acpi_handle device,
         * only one <external> global handler can be regsitered (per notify type).
         */
        if (device == ACPI_ROOT_OBJECT) {
+
                /* Make sure the handler is not already installed */
 
                if (((handler_type & ACPI_SYSTEM_NOTIFY) &&
@@ -317,6 +318,7 @@ acpi_install_notify_handler(acpi_handle device,
 
                obj_desc = acpi_ns_get_attached_object(node);
                if (obj_desc) {
+
                        /* Object exists - make sure there's no handler */
 
                        if (((handler_type & ACPI_SYSTEM_NOTIFY) &&
@@ -370,6 +372,7 @@ acpi_install_notify_handler(acpi_handle device,
                }
 
                if (handler_type == ACPI_ALL_NOTIFY) {
+
                        /* Extra ref if installed in both */
 
                        acpi_ut_add_reference(notify_obj);
index ec9ce8429f15b823d5b0077f1e9da1c69888d70b..babebb5014058c609dc628abd721c5787849428e 100644 (file)
@@ -636,6 +636,7 @@ acpi_install_gpe_block(acpi_handle gpe_device,
 
        obj_desc = acpi_ns_get_attached_object(node);
        if (!obj_desc) {
+
                /* No object, create a new one */
 
                obj_desc = acpi_ut_create_internal_object(ACPI_TYPE_DEVICE);
index abf5caca9ae5a541596e6ee612665cc4566b9a82..368c8aa0094bcec721de89ca27c9942da0b0499b 100644 (file)
@@ -176,9 +176,11 @@ acpi_remove_address_space_handler(acpi_handle device,
        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 */
 
                if (handler_obj->address_space.space_id == space_id) {
+
                        /* Matched space_id, first dereference this in the Regions */
 
                        ACPI_DEBUG_PRINT((ACPI_DB_OPREGION,
index a29782fe3ecf20e3bd2c9e44469b3cc9af5b75f6..864530f754c3a19abf921e43164e7751d0aab7f9 100644 (file)
@@ -110,6 +110,7 @@ acpi_ex_add_table(struct acpi_table_header *table,
 
        if (ACPI_FAILURE(status)) {
                if (status == AE_ALREADY_EXISTS) {
+
                        /* Table already exists, just return the handle */
 
                        return_ACPI_STATUS(AE_OK);
@@ -121,6 +122,7 @@ acpi_ex_add_table(struct acpi_table_header *table,
 
        status = acpi_ns_load_table(table_info.installed_desc, parent_node);
        if (ACPI_FAILURE(status)) {
+
                /* Uninstall table on error */
 
                (void)acpi_tb_uninstall_table(table_info.installed_desc);
@@ -169,6 +171,7 @@ acpi_ex_load_table_op(struct acpi_walk_state *walk_state,
         */
        status = acpi_tb_match_signature(operand[0]->string.pointer, NULL);
        if (status == AE_OK) {
+
                /* Signature matched -- don't allow override */
 
                return_ACPI_STATUS(AE_ALREADY_EXISTS);
@@ -252,6 +255,7 @@ acpi_ex_load_table_op(struct acpi_walk_state *walk_state,
        /* Parameter Data (optional) */
 
        if (parameter_node) {
+
                /* Store the parameter data into the optional parameter object */
 
                status = acpi_ex_store(operand[5],
@@ -424,6 +428,7 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
 
        status = acpi_ex_add_table(table_ptr, acpi_gbl_root_node, &ddb_handle);
        if (ACPI_FAILURE(status)) {
+
                /* On error, table_ptr was deallocated above */
 
                return_ACPI_STATUS(status);
index e6d52e12d77a6bc18a35c9e54ccae51d84aa0a23..a2c93c9ba07c28af2fb8a242d1271b1fc6ac48a3 100644 (file)
@@ -319,6 +319,7 @@ acpi_ex_convert_to_ascii(acpi_integer integer,
                remainder = 0;
 
                for (i = decimal_length; i > 0; i--) {
+
                        /* Divide by nth factor of 10 */
 
                        digit = integer;
@@ -346,6 +347,7 @@ acpi_ex_convert_to_ascii(acpi_integer integer,
 
                hex_length = (acpi_native_uint) ACPI_MUL_2(data_width);
                for (i = 0, j = (hex_length - 1); i < hex_length; i++, j--) {
+
                        /* Get one hex digit, most significant digits first */
 
                        string[k] =
index a7cca8d4f85525f950724527e8df053bb3be5013..0a53d31e09de3ffa84a5546284b6546203eebb02 100644 (file)
@@ -463,6 +463,7 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
        }
 
        if (!obj_desc) {
+
                /* This could be a null element of a package */
 
                ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Null Object Descriptor\n"));
@@ -532,6 +533,7 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
                                       obj_desc->reference.offset);
 
                        if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_INTEGER) {
+
                                /* Value is an Integer */
 
                                acpi_os_printf(" value is [%8.8X%8.8x]",
index e259201ce9a091986ac2b92a4114d8e15eabe6bb..215783a33c2cbd22bcf00466f3615fb66150edb6 100644 (file)
@@ -142,6 +142,7 @@ acpi_ex_read_data_from_field(struct acpi_walk_state *walk_state,
        length =
            (acpi_size) ACPI_ROUND_BITS_UP_TO_BYTES(obj_desc->field.bit_length);
        if (length > acpi_gbl_integer_byte_width) {
+
                /* Field is too large for an Integer, create a Buffer instead */
 
                buffer_desc = acpi_ut_create_buffer_object(length);
@@ -329,6 +330,7 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
            ACPI_ROUND_BITS_UP_TO_BYTES(obj_desc->common_field.bit_length);
 
        if (length < required_length) {
+
                /* We need to create a new buffer */
 
                new_buffer = ACPI_MEM_CALLOCATE(required_length);
index bd1af35f7fcfc6497e1330d7092d58128f6eb9bc..d5a4b2627c190d87a8dfb12fd765f7bee45ba26a 100644 (file)
@@ -113,6 +113,7 @@ acpi_ex_setup_region(union acpi_operand_object *obj_desc,
        }
 
        if (rgn_desc->region.space_id == ACPI_ADR_SPACE_SMBUS) {
+
                /* SMBus has a non-linear address space */
 
                return_ACPI_STATUS(AE_OK);
@@ -491,6 +492,7 @@ acpi_ex_field_datum_io(union acpi_operand_object *obj_desc,
                                  value));
 
                if (read_write == ACPI_READ) {
+
                        /* Read the datum from the data_register */
 
                        status =
@@ -568,6 +570,7 @@ acpi_ex_write_with_update_rule(union acpi_operand_object *obj_desc,
        /* If the mask is all ones, we don't need to worry about the update rule */
 
        if (mask != ACPI_INTEGER_MAX) {
+
                /* Decode the update rule */
 
                switch (obj_desc->common_field.
@@ -704,6 +707,7 @@ acpi_ex_extract_from_field(union acpi_operand_object *obj_desc,
        /* Read the rest of the field */
 
        for (i = 1; i < field_datum_count; i++) {
+
                /* Get next input datum from the field */
 
                field_offset += obj_desc->common_field.access_byte_width;
@@ -817,6 +821,7 @@ acpi_ex_insert_into_field(union acpi_operand_object *obj_desc,
        /* Write the entire field */
 
        for (i = 1; i < field_datum_count; i++) {
+
                /* Write merged datum to the target field */
 
                merged_datum &= mask;
index 48c18d29222a4c1891a8b3e55478d4304a92d2bb..74f2c1a9bdaf8a10a13b9c3fbd1d71339cc0a7dc 100644 (file)
@@ -649,6 +649,7 @@ acpi_ex_do_logical_op(u16 opcode,
                        /* Length and all bytes must be equal */
 
                        if ((length0 == length1) && (compare == 0)) {
+
                                /* Length and all bytes match ==> TRUE */
 
                                local_result = TRUE;
index f843b22e20b965101fb676d2ddedc31f54e1f87e..eaee1de5e90d7b4d12fae34aefaf9f5a1cc0f4a2 100644 (file)
@@ -173,6 +173,7 @@ acpi_ex_acquire_mutex(union acpi_operand_object *time_desc,
        /* Support for multiple acquires by the owning thread */
 
        if (obj_desc->mutex.owner_thread) {
+
                /* Special case for Global Lock, allow all threads */
 
                if ((obj_desc->mutex.owner_thread->thread_id ==
@@ -192,6 +193,7 @@ acpi_ex_acquire_mutex(union acpi_operand_object *time_desc,
 
        status = acpi_ex_system_acquire_mutex(time_desc, obj_desc);
        if (ACPI_FAILURE(status)) {
+
                /* Includes failure from a timeout on time_desc */
 
                return_ACPI_STATUS(status);
@@ -286,6 +288,7 @@ acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
 
        obj_desc->mutex.acquisition_depth--;
        if (obj_desc->mutex.acquisition_depth != 0) {
+
                /* Just decrement the depth and return */
 
                return_ACPI_STATUS(AE_OK);
index 054fe5e1a3142982d10339b76d7247c16430b1d2..f9bc81c1b78d8f336b4db8317c0525dd81cce11f 100644 (file)
@@ -85,6 +85,7 @@ static char *acpi_ex_allocate_name_string(u32 prefix_count, u32 num_name_segs)
         * This may actually be somewhat longer than needed.
         */
        if (prefix_count == ACPI_UINT32_MAX) {
+
                /* Special case for root */
 
                size_needed = 1 + (ACPI_NAME_SIZE * num_name_segs) + 2 + 1;
@@ -119,11 +120,13 @@ static char *acpi_ex_allocate_name_string(u32 prefix_count, u32 num_name_segs)
        /* Set up Dual or Multi prefixes if needed */
 
        if (num_name_segs > 2) {
+
                /* Set up multi prefixes   */
 
                *temp_ptr++ = AML_MULTI_NAME_PREFIX_OP;
                *temp_ptr++ = (char)num_name_segs;
        } else if (2 == num_name_segs) {
+
                /* Set up dual prefixes */
 
                *temp_ptr++ = AML_DUAL_NAME_PREFIX;
@@ -184,6 +187,7 @@ static acpi_status acpi_ex_name_segment(u8 ** in_aml_address, char *name_string)
        /* Valid name segment  */
 
        if (index == 4) {
+
                /* Found 4 valid characters */
 
                char_buf[4] = '\0';
@@ -254,6 +258,7 @@ acpi_ex_get_name_string(acpi_object_type data_type,
        if (ACPI_TYPE_LOCAL_REGION_FIELD == data_type ||
            ACPI_TYPE_LOCAL_BANK_FIELD == data_type ||
            ACPI_TYPE_LOCAL_INDEX_FIELD == data_type) {
+
                /* Disallow prefixes for types associated with field_unit names */
 
                name_string = acpi_ex_allocate_name_string(0, 1);
@@ -410,6 +415,7 @@ acpi_ex_get_name_string(acpi_object_type data_type,
        }
 
        if (AE_CTRL_PENDING == status && has_prefix) {
+
                /* Ran out of segments after processing a prefix */
 
                ACPI_ERROR((AE_INFO, "Malformed Name at %p", name_string));
index 23d0823bcd5e69df8a8f88c78d639f57e3bfead5..4f3627ee2b2bdc00c7793e69fadd12081490da15 100644 (file)
@@ -342,6 +342,7 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state)
                        for (i = 0;
                             (i < acpi_gbl_integer_nybble_width) && (digit > 0);
                             i++) {
+
                                /* Get the least significant 4-bit BCD digit */
 
                                temp32 = ((u32) digit) & 0xF;
@@ -487,6 +488,7 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state)
                status = acpi_ex_convert_to_string(operand[0], &return_desc,
                                                   ACPI_EXPLICIT_CONVERT_DECIMAL);
                if (return_desc == operand[0]) {
+
                        /* No conversion performed, add ref to handle return value */
                        acpi_ut_add_reference(return_desc);
                }
@@ -497,6 +499,7 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state)
                status = acpi_ex_convert_to_string(operand[0], &return_desc,
                                                   ACPI_EXPLICIT_CONVERT_HEX);
                if (return_desc == operand[0]) {
+
                        /* No conversion performed, add ref to handle return value */
                        acpi_ut_add_reference(return_desc);
                }
@@ -506,6 +509,7 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state)
 
                status = acpi_ex_convert_to_buffer(operand[0], &return_desc);
                if (return_desc == operand[0]) {
+
                        /* No conversion performed, add ref to handle return value */
                        acpi_ut_add_reference(return_desc);
                }
@@ -516,6 +520,7 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state)
                status = acpi_ex_convert_to_integer(operand[0], &return_desc,
                                                    ACPI_ANY_BASE);
                if (return_desc == operand[0]) {
+
                        /* No conversion performed, add ref to handle return value */
                        acpi_ut_add_reference(return_desc);
                }
@@ -541,6 +546,7 @@ acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state)
        }
 
        if (ACPI_SUCCESS(status)) {
+
                /* Store the return value computed above into the target object */
 
                status = acpi_ex_store(return_desc, operand[1], walk_state);
@@ -625,6 +631,7 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
                temp_desc = operand[0];
                if (ACPI_GET_DESCRIPTOR_TYPE(temp_desc) ==
                    ACPI_DESC_TYPE_OPERAND) {
+
                        /* Internal reference object - prevent deletion */
 
                        acpi_ut_add_reference(temp_desc);
@@ -777,8 +784,25 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
 
                /* Check for a method local or argument, or standalone String */
 
-               if (ACPI_GET_DESCRIPTOR_TYPE(operand[0]) !=
+               if (ACPI_GET_DESCRIPTOR_TYPE(operand[0]) ==
                    ACPI_DESC_TYPE_NAMED) {
+                       temp_desc =
+                           acpi_ns_get_attached_object((struct
+                                                        acpi_namespace_node *)
+                                                       operand[0]);
+                       if (temp_desc
+                           &&
+                           ((ACPI_GET_OBJECT_TYPE(temp_desc) ==
+                             ACPI_TYPE_STRING)
+                            || (ACPI_GET_OBJECT_TYPE(temp_desc) ==
+                                ACPI_TYPE_LOCAL_REFERENCE))) {
+                               operand[0] = temp_desc;
+                               acpi_ut_add_reference(temp_desc);
+                       } else {
+                               status = AE_AML_OPERAND_TYPE;
+                               goto cleanup;
+                       }
+               } else {
                        switch (ACPI_GET_OBJECT_TYPE(operand[0])) {
                        case ACPI_TYPE_LOCAL_REFERENCE:
                                /*
@@ -827,13 +851,24 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
                                break;
 
                        case ACPI_TYPE_STRING:
+                               break;
 
+                       default:
+                               status = AE_AML_OPERAND_TYPE;
+                               goto cleanup;
+                       }
+               }
+
+               if (ACPI_GET_DESCRIPTOR_TYPE(operand[0]) !=
+                   ACPI_DESC_TYPE_NAMED) {
+                       if (ACPI_GET_OBJECT_TYPE(operand[0]) ==
+                           ACPI_TYPE_STRING) {
                                /*
                                 * This is a deref_of (String). The string is a reference
                                 * to a named ACPI object.
                                 *
                                 * 1) Find the owning Node
-                                * 2) Dereference the node to an actual object.  Could be a
+                                * 2) Dereference the node to an actual object. Could be a
                                 *    Field, so we need to resolve the node to a value.
                                 */
                                status =
@@ -857,11 +892,6 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
                                     (struct acpi_namespace_node, &return_desc),
                                     walk_state);
                                goto cleanup;
-
-                       default:
-
-                               status = AE_AML_OPERAND_TYPE;
-                               goto cleanup;
                        }
                }
 
index e263a5ddd405b8fe29418338e51a3cb3212a6f39..5e1abb12c74883ebfa14a6bc9bab9ae725b92040 100644 (file)
@@ -138,6 +138,7 @@ acpi_status acpi_ex_opcode_2A_0T_0R(struct acpi_walk_state *walk_state)
                            acpi_ev_check_for_wake_only_gpe(walk_state->
                                                            gpe_event_info);
                        if (ACPI_FAILURE(status)) {
+
                                /* AE_WAKE_ONLY_GPE only error, means ignore this notify */
 
                                return_ACPI_STATUS(AE_OK)
@@ -252,6 +253,7 @@ acpi_status acpi_ex_opcode_2A_2T_1R(struct acpi_walk_state *walk_state)
        acpi_ut_remove_reference(return_desc2);
 
        if (ACPI_FAILURE(status)) {
+
                /* Delete the return object */
 
                acpi_ut_remove_reference(return_desc1);
@@ -287,6 +289,7 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state)
        /* Execute the opcode */
 
        if (walk_state->op_info->flags & AML_MATH) {
+
                /* All simple math opcodes (add, etc.) */
 
                return_desc = acpi_ut_create_internal_object(ACPI_TYPE_INTEGER);
@@ -383,54 +386,70 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state)
                        goto cleanup;
                }
 
+               /* Initialize the Index reference object */
+
                index = operand[1]->integer.value;
+               return_desc->reference.offset = (u32) index;
+               return_desc->reference.opcode = AML_INDEX_OP;
+               return_desc->reference.object = operand[0];
 
-               /* At this point, the Source operand is a Package, Buffer, or String */
+               /*
+                * At this point, the Source operand is a String, Buffer, or Package.
+                * Verify that the index is within range.
+                */
+               switch (ACPI_GET_OBJECT_TYPE(operand[0])) {
+               case ACPI_TYPE_STRING:
 
-               if (ACPI_GET_OBJECT_TYPE(operand[0]) == ACPI_TYPE_PACKAGE) {
-                       /* Object to be indexed is a Package */
+                       if (index >= operand[0]->string.length) {
+                               status = AE_AML_STRING_LIMIT;
+                       }
+
+                       return_desc->reference.target_type =
+                           ACPI_TYPE_BUFFER_FIELD;
+                       break;
+
+               case ACPI_TYPE_BUFFER:
+
+                       if (index >= operand[0]->buffer.length) {
+                               status = AE_AML_BUFFER_LIMIT;
+                       }
+
+                       return_desc->reference.target_type =
+                           ACPI_TYPE_BUFFER_FIELD;
+                       break;
+
+               case ACPI_TYPE_PACKAGE:
 
                        if (index >= operand[0]->package.count) {
-                               ACPI_ERROR((AE_INFO,
-                                           "Index value (%X%8.8X) beyond package end (%X)",
-                                           ACPI_FORMAT_UINT64(index),
-                                           operand[0]->package.count));
                                status = AE_AML_PACKAGE_LIMIT;
-                               goto cleanup;
                        }
 
                        return_desc->reference.target_type = ACPI_TYPE_PACKAGE;
-                       return_desc->reference.object = operand[0];
                        return_desc->reference.where =
                            &operand[0]->package.elements[index];
-               } else {
-                       /* Object to be indexed is a Buffer/String */
+                       break;
 
-                       if (index >= operand[0]->buffer.length) {
-                               ACPI_ERROR((AE_INFO,
-                                           "Index value (%X%8.8X) beyond end of buffer (%X)",
-                                           ACPI_FORMAT_UINT64(index),
-                                           operand[0]->buffer.length));
-                               status = AE_AML_BUFFER_LIMIT;
-                               goto cleanup;
-                       }
+               default:
 
-                       return_desc->reference.target_type =
-                           ACPI_TYPE_BUFFER_FIELD;
-                       return_desc->reference.object = operand[0];
+                       status = AE_AML_INTERNAL;
+                       goto cleanup;
+               }
+
+               /* Failure means that the Index was beyond the end of the object */
+
+               if (ACPI_FAILURE(status)) {
+                       ACPI_EXCEPTION((AE_INFO, status,
+                                       "Index (%X%8.8X) is beyond end of object",
+                                       ACPI_FORMAT_UINT64(index)));
+                       goto cleanup;
                }
 
                /*
                 * Add a reference to the target package/buffer/string for the life
-                * of the index.
+                * of the index
                 */
                acpi_ut_add_reference(operand[0]);
 
-               /* Complete the Index reference object */
-
-               return_desc->reference.opcode = AML_INDEX_OP;
-               return_desc->reference.offset = (u32) index;
-
                /* Store the reference to the Target */
 
                status = acpi_ex_store(return_desc, operand[2], walk_state);
@@ -509,6 +528,7 @@ acpi_status acpi_ex_opcode_2A_0T_1R(struct acpi_walk_state *walk_state)
        /* Execute the Opcode */
 
        if (walk_state->op_info->flags & AML_LOGICAL_NUMERIC) {
+
                /* logical_op (Operand0, Operand1) */
 
                status = acpi_ex_do_logical_numeric_op(walk_state->opcode,
@@ -518,6 +538,7 @@ acpi_status acpi_ex_opcode_2A_0T_1R(struct acpi_walk_state *walk_state)
                                                       value, &logical_result);
                goto store_logical_result;
        } else if (walk_state->op_info->flags & AML_LOGICAL) {
+
                /* logical_op (Operand0, Operand1) */
 
                status = acpi_ex_do_logical_op(walk_state->opcode, operand[0],
index 6a3a883cb8a3b2a24bba6369b608a92cdec659b3..8da794ec35b093d26ea0767e7843ea475bc873a2 100644 (file)
@@ -208,6 +208,7 @@ acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state)
                        /* If the requested length is zero, don't allocate a buffer */
 
                        if (length > 0) {
+
                                /* Allocate a new buffer for the Buffer */
 
                                buffer = ACPI_MEM_CALLOCATE(length);
@@ -225,6 +226,7 @@ acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state)
                }
 
                if (buffer) {
+
                        /* We have a buffer, copy the portion requested */
 
                        ACPI_MEMCPY(buffer, operand[0]->string.pointer + index,
index e043d924444f9ad07c17de9016ac8492f16f997b..33e4fb1addcea5aca292b3660e26625be162e471 100644 (file)
@@ -276,6 +276,7 @@ acpi_status acpi_ex_opcode_6A_0T_1R(struct acpi_walk_state * walk_state)
                 * match was found.
                 */
                for (; index < operand[0]->package.count; index++) {
+
                        /* Get the current package element */
 
                        this_element = operand[0]->package.elements[index];
index 6a4cfdff606d14e97ec93b7bcced12c2f01f6b19..9db68d19253e8a95c7736afa9319495565445072 100644 (file)
@@ -135,6 +135,7 @@ acpi_ex_system_memory_space_handler(u32 function,
                 * Delete the existing mapping and create a new one.
                 */
                if (mem_info->mapped_length) {
+
                        /* Valid mapping, delete it */
 
                        acpi_os_unmap_memory(mem_info->mapped_logical_address,
index 01b26c80d22b84e6e1b2bdc124951e8053367234..417d914d9e19f01667ba5eb9eb52a499086d7088 100644 (file)
@@ -103,6 +103,7 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr,
 
        if ((entry_type == ACPI_TYPE_LOCAL_ALIAS) ||
            (entry_type == ACPI_TYPE_LOCAL_METHOD_ALIAS)) {
+
                /* There is always exactly one level of indirection */
 
                node = ACPI_CAST_PTR(struct acpi_namespace_node, node->object);
@@ -141,6 +142,7 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr,
 
                status = acpi_ds_get_package_arguments(source_desc);
                if (ACPI_SUCCESS(status)) {
+
                        /* Return an additional reference to the object */
 
                        obj_desc = source_desc;
@@ -158,6 +160,7 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr,
 
                status = acpi_ds_get_buffer_arguments(source_desc);
                if (ACPI_SUCCESS(status)) {
+
                        /* Return an additional reference to the object */
 
                        obj_desc = source_desc;
@@ -240,6 +243,8 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr,
                        /* This is a ddb_handle */
                        /* Return an additional reference to the object */
 
+               case AML_REF_OF_OP:
+
                        obj_desc = source_desc;
                        acpi_ut_add_reference(obj_desc);
                        break;
index 1deed492fe88c865cd3505f4afa0a7279f60f6d7..22dabdd10604389641e8b59fced74eb6dfb31fb0 100644 (file)
@@ -382,10 +382,16 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
        while (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_LOCAL_REFERENCE) {
                switch (obj_desc->reference.opcode) {
                case AML_REF_OF_OP:
+               case AML_INT_NAMEPATH_OP:
 
                        /* Dereference the reference pointer */
 
-                       node = obj_desc->reference.object;
+                       if (obj_desc->reference.opcode == AML_REF_OF_OP) {
+                               node = obj_desc->reference.object;
+                       } else {        /* AML_INT_NAMEPATH_OP */
+
+                               node = obj_desc->reference.node;
+                       }
 
                        /* All "References" point to a NS node */
 
@@ -401,6 +407,7 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
 
                        obj_desc = acpi_ns_get_attached_object(node);
                        if (!obj_desc) {
+
                                /* No object, use the NS node type */
 
                                type = acpi_ns_get_type(node);
@@ -432,6 +439,7 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
                         */
                        obj_desc = *(obj_desc->reference.where);
                        if (!obj_desc) {
+
                                /* NULL package elements are allowed */
 
                                type = 0;       /* Uninitialized */
@@ -439,39 +447,6 @@ acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state,
                        }
                        break;
 
-               case AML_INT_NAMEPATH_OP:
-
-                       /* Dereference the reference pointer */
-
-                       node = obj_desc->reference.node;
-
-                       /* All "References" point to a NS node */
-
-                       if (ACPI_GET_DESCRIPTOR_TYPE(node) !=
-                           ACPI_DESC_TYPE_NAMED) {
-                               ACPI_ERROR((AE_INFO, "Not a NS node %p [%s]",
-                                           node,
-                                           acpi_ut_get_descriptor_name(node)));
-                               return_ACPI_STATUS(AE_AML_INTERNAL);
-                       }
-
-                       /* Get the attached object */
-
-                       obj_desc = acpi_ns_get_attached_object(node);
-                       if (!obj_desc) {
-                               /* No object, use the NS node type */
-
-                               type = acpi_ns_get_type(node);
-                               goto exit;
-                       }
-
-                       /* Check for circular references */
-
-                       if (obj_desc == operand) {
-                               return_ACPI_STATUS(AE_AML_CIRCULAR_REFERENCE);
-                       }
-                       break;
-
                case AML_LOCAL_OP:
                case AML_ARG_OP:
 
index a1c000f5a4157799744c9723fccb0906c65527e4..42b9089dccc04ad27c1df227214f0471c3725c85 100644 (file)
@@ -77,6 +77,7 @@ acpi_ex_check_object_type(acpi_object_type type_needed,
        ACPI_FUNCTION_ENTRY();
 
        if (type_needed == ACPI_TYPE_ANY) {
+
                /* All types OK, so we don't perform any typechecks */
 
                return (AE_OK);
@@ -224,6 +225,7 @@ acpi_ex_resolve_operands(u16 opcode,
                        }
 
                        if (object_type == (u8) ACPI_TYPE_LOCAL_REFERENCE) {
+
                                /* Decode the Reference */
 
                                op_info = acpi_ps_get_opcode_info(opcode);
@@ -332,6 +334,7 @@ acpi_ex_resolve_operands(u16 opcode,
                        }
 
                        if (obj_desc->reference.opcode == AML_NAME_OP) {
+
                                /* Convert a named reference to the actual named object */
 
                                temp_node = obj_desc->reference.object;
@@ -662,6 +665,7 @@ acpi_ex_resolve_operands(u16 opcode,
                                }
 
                                if (target_op == AML_DEBUG_OP) {
+
                                        /* Allow store of any object to the Debug object */
 
                                        break;
index 3f020c0e2b95b6c7a67cdd321b637aa0ea31d1bc..287476f319f426385ca56e0064faa74553c7166e 100644 (file)
@@ -423,6 +423,7 @@ acpi_ex_store_object_to_index(union acpi_operand_object *source_desc,
                }
 
                if (obj_desc) {
+
                        /* Decrement reference count by the ref count of the parent package */
 
                        for (i = 0; i < ((union acpi_operand_object *)
@@ -572,6 +573,7 @@ acpi_ex_store_object_to_node(union acpi_operand_object *source_desc,
        /* If no implicit conversion, drop into the default case below */
 
        if ((!implicit_conversion) || (walk_state->opcode == AML_COPY_OP)) {
+
                /* Force execution of default (no implicit conversion) */
 
                target_type = ACPI_TYPE_ANY;
index 42967baf760de53ba7a5214739910e2a460dc74b..969f9cbbbeeb9efbdf4786bf387865daeff6d018 100644 (file)
@@ -97,6 +97,7 @@ acpi_ex_resolve_object(union acpi_operand_object **source_desc_ptr,
                 */
                if (ACPI_GET_OBJECT_TYPE(source_desc) ==
                    ACPI_TYPE_LOCAL_REFERENCE) {
+
                        /* Resolve a reference object first */
 
                        status =
@@ -121,6 +122,7 @@ acpi_ex_resolve_object(union acpi_operand_object **source_desc_ptr,
                    !((ACPI_GET_OBJECT_TYPE(source_desc) ==
                       ACPI_TYPE_LOCAL_REFERENCE)
                      && (source_desc->reference.opcode == AML_LOAD_OP))) {
+
                        /* Conversion successful but still not a valid type */
 
                        ACPI_ERROR((AE_INFO,
@@ -289,6 +291,7 @@ acpi_ex_store_object_to_object(union acpi_operand_object *source_desc,
        }
 
        if (actual_src_desc != source_desc) {
+
                /* Delete the intermediate (temporary) source object */
 
                acpi_ut_remove_reference(actual_src_desc);
index 6ab70708775007347a24cf236b0e494629993cea..41732d382bce4cb662e8d8f5ad54a7e26690648f 100644 (file)
@@ -91,6 +91,7 @@ acpi_ex_store_buffer_to_buffer(union acpi_operand_object *source_desc,
        /* Copy source buffer to target buffer */
 
        if (length <= target_desc->buffer.length) {
+
                /* Clear existing buffer and copy in the new one */
 
                ACPI_MEMSET(target_desc->buffer.pointer, 0,
@@ -113,6 +114,7 @@ acpi_ex_store_buffer_to_buffer(union acpi_operand_object *source_desc,
                 * copy must not truncate the original buffer.
                 */
                if (original_src_type == ACPI_TYPE_STRING) {
+
                        /* Set the new length of the target */
 
                        target_desc->buffer.length = length;
@@ -183,6 +185,7 @@ acpi_ex_store_string_to_string(union acpi_operand_object *source_desc,
                 */
                if (target_desc->string.pointer &&
                    (!(target_desc->common.flags & AOPOBJ_STATIC_POINTER))) {
+
                        /* Only free if not a pointer into the DSDT */
 
                        ACPI_MEM_FREE(target_desc->string.pointer);
index ea9144f42e1f98f2b4a1d37143cfb09fe8ae060c..6a2e47a0e1124bc4af56ebbdd10fc7d34c3958cd 100644 (file)
@@ -76,6 +76,7 @@ acpi_status acpi_ex_system_wait_semaphore(acpi_handle semaphore, u16 timeout)
        }
 
        if (status == AE_TIME) {
+
                /* We must wait, so unlock the interpreter */
 
                acpi_ex_exit_interpreter();
@@ -90,6 +91,7 @@ acpi_status acpi_ex_system_wait_semaphore(acpi_handle semaphore, u16 timeout)
 
                status2 = acpi_ex_enter_interpreter();
                if (ACPI_FAILURE(status2)) {
+
                        /* Report fatal error, could not acquire interpreter */
 
                        return_ACPI_STATUS(status2);
index f73a61aeb7eca52736f3eb9e71c9ab8e6e1e35ec..8543d1a0ed31865be9c7cdbc4000d746cac82e26 100644 (file)
@@ -194,6 +194,7 @@ u8 acpi_ex_acquire_global_lock(u32 field_flags)
        /* Only attempt lock if the always_lock bit is set */
 
        if (field_flags & AML_FIELD_LOCK_RULE_MASK) {
+
                /* We should attempt to get the lock, wait forever */
 
                status = acpi_ev_acquire_global_lock(ACPI_WAIT_FOREVER);
@@ -230,10 +231,12 @@ void acpi_ex_release_global_lock(u8 locked_by_me)
        /* Only attempt unlock if the caller locked it */
 
        if (locked_by_me) {
+
                /* OK, now release the lock */
 
                status = acpi_ev_release_global_lock();
                if (ACPI_FAILURE(status)) {
+
                        /* Report the error, but there isn't much else we can do */
 
                        ACPI_EXCEPTION((AE_INFO, status,
index d84942d22dd549269b7d87dfdfc5e417e664c375..729b68eb3e3577fef75d174a603159041cbac32f 100644 (file)
@@ -214,6 +214,7 @@ acpi_hw_disable_gpe_block(struct acpi_gpe_xrupt_info * gpe_xrupt_info,
        /* Examine each GPE Register within the block */
 
        for (i = 0; i < gpe_block->register_count; i++) {
+
                /* Disable all GPEs in this register */
 
                status = acpi_hw_low_level_write(8, 0x00,
@@ -250,6 +251,7 @@ acpi_hw_clear_gpe_block(struct acpi_gpe_xrupt_info * gpe_xrupt_info,
        /* Examine each GPE Register within the block */
 
        for (i = 0; i < gpe_block->register_count; i++) {
+
                /* Clear status on all GPEs in this register */
 
                status = acpi_hw_low_level_write(8, 0xFF,
index e1fe75498415c6eaffbc634d3529665d5fad83ca..95c4ccb3a378619f2ffac07f0952f6d71d6aa4b9 100644 (file)
@@ -295,6 +295,7 @@ acpi_status acpi_get_register(u32 register_id, u32 * return_value, u32 flags)
        }
 
        if (ACPI_SUCCESS(status)) {
+
                /* Normalize the value that was read */
 
                register_value =
index 89269272fd621d7e4d4f6054448617b8173422d8..284a59ebcc2c038d5d11cbcf13a95df14f3f6e19 100644 (file)
@@ -490,6 +490,7 @@ acpi_status acpi_leave_sleep_state(u8 sleep_state)
                                               ACPI_REGISTER_PM1_CONTROL,
                                               &PM1Acontrol);
                if (ACPI_SUCCESS(status)) {
+
                        /* Clear SLP_EN and SLP_TYP fields */
 
                        PM1Acontrol &= ~(sleep_type_reg_info->access_bit_mask |
index fc10b7cb456f1327935b9054bc821873f181367a..ef7c98e293a95a003323d1038d697d290c67846a 100644 (file)
@@ -155,6 +155,7 @@ acpi_get_timer_duration(u32 start_ticks, u32 end_ticks, u32 * time_elapsed)
                delta_ticks = end_ticks - start_ticks;
        } else if (start_ticks > end_ticks) {
                if (0 == acpi_gbl_FADT->tmr_val_ext) {
+
                        /* 24-bit Timer */
 
                        delta_ticks =
index 1149bc18fb359759ed84a70585a886adb0ad416c..6bdad8bfcf0bab4909c395adaf0ebe4560211439 100644 (file)
@@ -98,6 +98,7 @@ acpi_status acpi_ns_root_initialize(void)
                          "Entering predefined entries into namespace\n"));
 
        for (init_val = acpi_gbl_pre_defined_names; init_val->name; init_val++) {
+
                /* _OSI is optional for now, will be permanent later */
 
                if (!ACPI_STRCMP(init_val->name, "_OSI")
@@ -365,6 +366,7 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
         * Begin examination of the actual pathname
         */
        if (!pathname) {
+
                /* A Null name_path is allowed and refers to the root */
 
                num_segments = 0;
@@ -389,6 +391,7 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
                 * to the current scope).
                 */
                if (*path == (u8) AML_ROOT_PREFIX) {
+
                        /* Pathname is fully qualified, start from the root */
 
                        this_node = acpi_gbl_root_node;
@@ -416,6 +419,7 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
                        this_node = prefix_node;
                        num_carats = 0;
                        while (*path == (u8) AML_PARENT_PREFIX) {
+
                                /* Name is fully qualified, no search rules apply */
 
                                search_parent_flag = ACPI_NS_NO_UPSEARCH;
@@ -430,6 +434,7 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
                                num_carats++;
                                this_node = acpi_ns_get_parent_node(this_node);
                                if (!this_node) {
+
                                        /* Current scope has no parent scope */
 
                                        ACPI_ERROR((AE_INFO,
@@ -569,6 +574,7 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
                                             &this_node);
                if (ACPI_FAILURE(status)) {
                        if (status == AE_NOT_FOUND) {
+
                                /* Name not found in ACPI namespace */
 
                                ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
@@ -602,6 +608,7 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
                    (type_to_check_for != ACPI_TYPE_LOCAL_SCOPE) &&
                    (this_node->type != ACPI_TYPE_ANY) &&
                    (this_node->type != type_to_check_for)) {
+
                        /* Complain about a type mismatch */
 
                        ACPI_WARNING((AE_INFO,
index 9b871f38b61b81ff2480c951aae6095d6a13e1fd..cd26cb971a1c2e324cb33af21e1faee330912788 100644 (file)
@@ -115,6 +115,7 @@ void acpi_ns_delete_node(struct acpi_namespace_node *node)
        }
 
        if (prev_node) {
+
                /* Node is not first child, unlink it */
 
                prev_node->peer = next_node->peer;
@@ -125,6 +126,7 @@ void acpi_ns_delete_node(struct acpi_namespace_node *node)
                /* Node is first child (has no previous peer) */
 
                if (next_node->flags & ANOBJ_END_OF_PEER_LIST) {
+
                        /* No peers at all */
 
                        parent_node->child = NULL;
@@ -264,6 +266,7 @@ void acpi_ns_delete_children(struct acpi_namespace_node *parent_node)
         * Deallocate all children at this level
         */
        do {
+
                /* Get the things we need */
 
                next_node = child_node->peer;
@@ -352,11 +355,13 @@ void acpi_ns_delete_namespace_subtree(struct acpi_namespace_node *parent_node)
         * to where we started.
         */
        while (level > 0) {
+
                /* Get the next node in this scope (NULL if none) */
 
                child_node = acpi_ns_get_next_node(ACPI_TYPE_ANY, parent_node,
                                                   child_node);
                if (child_node) {
+
                        /* Found a child node - detach any attached object */
 
                        acpi_ns_detach_object(child_node);
@@ -427,6 +432,7 @@ static void acpi_ns_remove_reference(struct acpi_namespace_node *node)
         */
        this_node = node;
        while (this_node) {
+
                /* Prepare to move up to parent */
 
                parent_node = acpi_ns_get_parent_node(this_node);
@@ -438,6 +444,7 @@ static void acpi_ns_remove_reference(struct acpi_namespace_node *node)
                /* Delete the node if no more references */
 
                if (!this_node->reference_count) {
+
                        /* Delete all children and delete the node */
 
                        acpi_ns_delete_children(this_node);
@@ -500,6 +507,7 @@ void acpi_ns_delete_namespace_by_owner(acpi_owner_id owner_id)
 
                if (child_node) {
                        if (child_node->owner_id == owner_id) {
+
                                /* Found a matching child node - detach any attached object */
 
                                acpi_ns_detach_object(child_node);
index a2807317a84b0295a514f9bbfbd12d071fa73ae6..e275373b1705864c8915972f640de75e05c21f9f 100644 (file)
@@ -191,6 +191,7 @@ acpi_ns_dump_one_object(acpi_handle obj_handle,
        }
 
        if (!(info->display_type & ACPI_DISPLAY_SHORT)) {
+
                /* Indent the object according to the level */
 
                acpi_os_printf("%2d%*s", (u32) level - 1, (int)level * 2, " ");
@@ -226,6 +227,7 @@ acpi_ns_dump_one_object(acpi_handle obj_handle,
        case ACPI_DISPLAY_SUMMARY:
 
                if (!obj_desc) {
+
                        /* No attached object, we are done */
 
                        acpi_os_printf("\n");
@@ -419,6 +421,7 @@ acpi_ns_dump_one_object(acpi_handle obj_handle,
 
                acpi_os_printf("O:%p", obj_desc);
                if (!obj_desc) {
+
                        /* No attached object, we are done */
 
                        acpi_os_printf("\n");
@@ -682,6 +685,7 @@ void acpi_ns_dump_tables(acpi_handle search_base, u32 max_depth)
        }
 
        if (ACPI_NS_ALL == search_base) {
+
                /* Entire namespace */
 
                search_handle = acpi_gbl_root_node;
index 19d7b94d40c3844573599ea342de5c25ce40cdb2..80ef955456366b3e052abd2845f7bbb0c714ec61 100644 (file)
@@ -326,6 +326,7 @@ acpi_status acpi_ns_evaluate_by_handle(struct acpi_parameter_info *info)
         * Check if there is a return value on the stack that must be dealt with
         */
        if (status == AE_CTRL_RETURN_VALUE) {
+
                /* Map AE_CTRL_RETURN_VALUE to AE_OK, we are done with it */
 
                status = AE_OK;
index 9f929e479fd835b66183d7ab5478f768893acfce..9aa337c33887cc396965c9d927a210190d314544 100644 (file)
@@ -366,6 +366,7 @@ acpi_ns_init_one_device(acpi_handle obj_handle,
        status = acpi_ns_search_node(*ACPI_CAST_PTR(u32, METHOD_NAME__INI),
                                     device_node, ACPI_TYPE_METHOD, &ini_node);
        if (ACPI_FAILURE(status)) {
+
                /* No _INI method found - move on to next device */
 
                return_ACPI_STATUS(AE_OK);
@@ -386,6 +387,7 @@ acpi_ns_init_one_device(acpi_handle obj_handle,
 
        status = acpi_ut_execute_STA(pinfo.node, &flags);
        if (ACPI_FAILURE(status)) {
+
                /* Ignore error and move on to next device */
 
                return_ACPI_STATUS(AE_OK);
@@ -396,6 +398,7 @@ acpi_ns_init_one_device(acpi_handle obj_handle,
        }
 
        if (!(flags & ACPI_STA_DEVICE_PRESENT)) {
+
                /* Don't look at children of a not present device */
 
                return_ACPI_STATUS(AE_CTRL_DEPTH);
@@ -412,6 +415,7 @@ acpi_ns_init_one_device(acpi_handle obj_handle,
        pinfo.node = ini_node;
        status = acpi_ns_evaluate_by_handle(&pinfo);
        if (ACPI_FAILURE(status)) {
+
                /* Ignore error and move on to next device */
 
 #ifdef ACPI_DEBUG_OUTPUT
@@ -435,6 +439,7 @@ acpi_ns_init_one_device(acpi_handle obj_handle,
        }
 
        if (acpi_gbl_init_handler) {
+
                /* External initialization handler is present, call it */
 
                status =
index 4e0b0524c18831590c0513c16066ca6486671a64..80acfd35f3ecb3cd31c225859edfca7c31a155a4 100644 (file)
@@ -84,6 +84,7 @@ acpi_ns_load_table(struct acpi_table_desc *table_desc,
        if (!
            (acpi_gbl_table_data[table_desc->type].
             flags & ACPI_TABLE_EXECUTABLE)) {
+
                /* Just ignore this table */
 
                return_ACPI_STATUS(AE_OK);
@@ -325,6 +326,7 @@ static acpi_status acpi_ns_delete_subtree(acpi_handle start_handle)
         * to where we started.
         */
        while (level > 0) {
+
                /* Attempt to get the next object in this scope */
 
                status = acpi_get_next_object(ACPI_TYPE_ANY, parent_handle,
@@ -335,6 +337,7 @@ static acpi_status acpi_ns_delete_subtree(acpi_handle start_handle)
                /* Did we get a new object? */
 
                if (ACPI_SUCCESS(status)) {
+
                        /* Check if this object has any children */
 
                        if (ACPI_SUCCESS
index 10ae6292bca4d521d14a8319dc86991636f1c2bb..39dc87b228fce3e2e8aa3c5f565ecc60c469a8a0 100644 (file)
@@ -82,6 +82,7 @@ acpi_ns_attach_object(struct acpi_namespace_node *node,
         * Parameter validation
         */
        if (!node) {
+
                /* Invalid handle */
 
                ACPI_ERROR((AE_INFO, "Null named_obj handle"));
@@ -89,6 +90,7 @@ acpi_ns_attach_object(struct acpi_namespace_node *node,
        }
 
        if (!object && (ACPI_TYPE_ANY != type)) {
+
                /* Null object */
 
                ACPI_ERROR((AE_INFO,
@@ -97,6 +99,7 @@ acpi_ns_attach_object(struct acpi_namespace_node *node,
        }
 
        if (ACPI_GET_DESCRIPTOR_TYPE(node) != ACPI_DESC_TYPE_NAMED) {
+
                /* Not a name handle */
 
                ACPI_ERROR((AE_INFO, "Invalid handle %p [%s]",
index d64b78952f24c5b585010fc11efc0c34c4e37b2e..f73a3d56616808d6854c0bf54edbef4d5dfaa473 100644 (file)
@@ -114,9 +114,11 @@ acpi_ns_search_node(u32 target_name,
         */
        next_node = node->child;
        while (next_node) {
+
                /* Check for match against the name */
 
                if (next_node->name.integer == target_name) {
+
                        /* Resolve a control method alias if any */
 
                        if (acpi_ns_get_type(next_node) ==
@@ -146,6 +148,7 @@ acpi_ns_search_node(u32 target_name,
                 * so a flag is used to indicate the end-of-list
                 */
                if (next_node->flags & ANOBJ_END_OF_PEER_LIST) {
+
                        /* Searched entire list, we are done */
 
                        break;
index 3e7cad549a38739cf5ad752513e3f45e0735ce7a..e8c779114bec4c6a8b038fde4c0cdacd9886ad8a 100644 (file)
@@ -83,6 +83,7 @@ acpi_ns_report_error(char *module_name,
        acpi_ut_report_error(module_name, line_number);
 
        if (lookup_status == AE_BAD_CHARACTER) {
+
                /* There is a non-ascii character in the name */
 
                acpi_os_printf("[0x%4.4X] (NON-ASCII)",
@@ -267,6 +268,7 @@ u32 acpi_ns_local(acpi_object_type type)
        ACPI_FUNCTION_TRACE("ns_local");
 
        if (!acpi_ut_valid_object_type(type)) {
+
                /* Type code out of range  */
 
                ACPI_WARNING((AE_INFO, "Invalid Object Type %X", type));
@@ -411,6 +413,7 @@ acpi_status acpi_ns_build_internal_name(struct acpi_namestring_info *info)
                for (i = 0; i < ACPI_NAME_SIZE; i++) {
                        if (acpi_ns_valid_path_separator(*external_name) ||
                            (*external_name == 0)) {
+
                                /* Pad the segment with underscore(s) if segment is short */
 
                                result[i] = '_';
@@ -795,6 +798,7 @@ u32 acpi_ns_opens_scope(acpi_object_type type)
        ACPI_FUNCTION_TRACE_STR("ns_opens_scope", acpi_ut_get_type_name(type));
 
        if (!acpi_ut_valid_object_type(type)) {
+
                /* type code out of range  */
 
                ACPI_WARNING((AE_INFO, "Invalid Object Type %X", type));
@@ -838,6 +842,7 @@ acpi_ns_get_node_by_path(char *pathname,
        ACPI_FUNCTION_TRACE_PTR("ns_get_node_by_path", pathname);
 
        if (pathname) {
+
                /* Convert path to internal representation */
 
                status = acpi_ns_internalize_name(pathname, &internal_path);
@@ -963,6 +968,7 @@ acpi_name acpi_ns_find_parent_name(struct acpi_namespace_node * child_node)
        ACPI_FUNCTION_TRACE("ns_find_parent_name");
 
        if (child_node) {
+
                /* Valid entry.  Get the parent Node */
 
                parent_node = acpi_ns_get_parent_node(child_node);
index fcab1e784b8173072ae496e55203a92db9969b43..6bbc734bfee28bfd338d211933b49e5e0d2aec33 100644 (file)
@@ -76,6 +76,7 @@ struct acpi_namespace_node *acpi_ns_get_next_node(acpi_object_type type,
        ACPI_FUNCTION_ENTRY();
 
        if (!child_node) {
+
                /* It's really the parent's _scope_ that we want */
 
                if (parent_node->child) {
@@ -92,6 +93,7 @@ struct acpi_namespace_node *acpi_ns_get_next_node(acpi_object_type type,
        /* If any type is OK, we are done */
 
        if (type == ACPI_TYPE_ANY) {
+
                /* next_node is NULL if we are at the end-of-list */
 
                return (next_node);
@@ -100,6 +102,7 @@ struct acpi_namespace_node *acpi_ns_get_next_node(acpi_object_type type,
        /* Must search for the node -- but within this scope only */
 
        while (next_node) {
+
                /* If type matches, we are done */
 
                if (next_node->type == type) {
@@ -182,6 +185,7 @@ acpi_ns_walk_namespace(acpi_object_type type,
         * bubbled up to (and passed) the original parent handle (start_entry)
         */
        while (level > 0) {
+
                /* Get the next node in this scope.  Null if not found */
 
                status = AE_OK;
index a95f636dc35d454e16865732cff8e4c57ab3731f..71e7769d7dafcf66653cbb0d9ebb0f9e34c9b9c7 100644 (file)
@@ -110,6 +110,7 @@ acpi_evaluate_object_typed(acpi_handle handle,
        }
 
        if (return_buffer->length == 0) {
+
                /* Error because caller specifically asked for a return value */
 
                ACPI_ERROR((AE_INFO, "No return value"));
@@ -131,6 +132,7 @@ acpi_evaluate_object_typed(acpi_handle handle,
                    acpi_ut_get_type_name(return_type)));
 
        if (must_free) {
+
                /* Caller used ACPI_ALLOCATE_BUFFER, free the return buffer */
 
                acpi_os_free(return_buffer->pointer);
@@ -224,9 +226,9 @@ acpi_evaluate_object(acpi_handle handle,
         * 3) Valid handle
         */
        if ((pathname) && (acpi_ns_valid_root_prefix(pathname[0]))) {
-               /*
-                *  The path is fully qualified, just evaluate by name
-                */
+
+               /* The path is fully qualified, just evaluate by name */
+
                status = acpi_ns_evaluate_by_name(pathname, &info);
        } else if (!handle) {
                /*
@@ -235,11 +237,12 @@ acpi_evaluate_object(acpi_handle handle,
                 * qualified names above, this is an error
                 */
                if (!pathname) {
-                       ACPI_ERROR((AE_INFO,
-                                   "Both Handle and Pathname are NULL"));
+                       ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+                                         "Both Handle and Pathname are NULL"));
                } else {
-                       ACPI_ERROR((AE_INFO,
-                                   "Handle is NULL and Pathname is relative"));
+                       ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+                                         "Null Handle with relative pathname [%s]",
+                                         pathname));
                }
 
                status = AE_BAD_PARAMETER;
@@ -256,9 +259,8 @@ acpi_evaluate_object(acpi_handle handle,
                         */
                        status = acpi_ns_evaluate_by_handle(&info);
                } else {
-                       /*
-                        * Both a Handle and a relative Pathname
-                        */
+                       /* Both a Handle and a relative Pathname */
+
                        status = acpi_ns_evaluate_relative(pathname, &info);
                }
        }
@@ -295,6 +297,7 @@ acpi_evaluate_object(acpi_handle handle,
                                    acpi_ut_get_object_size(info.return_object,
                                                            &buffer_space_needed);
                                if (ACPI_SUCCESS(status)) {
+
                                        /* Validate/Allocate/Clear caller buffer */
 
                                        status =
@@ -303,7 +306,8 @@ acpi_evaluate_object(acpi_handle handle,
                                             buffer_space_needed);
                                        if (ACPI_FAILURE(status)) {
                                                /*
-                                                * Caller's buffer is too small or a new one can't be allocated
+                                                * Caller's buffer is too small or a new one can't
+                                                * be allocated
                                                 */
                                                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                                                                  "Needed buffer size %X, %s\n",
@@ -312,9 +316,8 @@ acpi_evaluate_object(acpi_handle handle,
                                                                  acpi_format_exception
                                                                  (status)));
                                        } else {
-                                               /*
-                                                *  We have enough space for the object, build it
-                                                */
+                                               /* We have enough space for the object, build it */
+
                                                status =
                                                    acpi_ut_copy_iobject_to_eobject
                                                    (info.return_object,
@@ -341,10 +344,10 @@ acpi_evaluate_object(acpi_handle handle,
                }
        }
 
-       /*
-        * Free the input parameter list (if we created one),
-        */
+       /* Free the input parameter list (if we created one) */
+
        if (info.parameters) {
+
                /* Free the allocated parameter block */
 
                acpi_ut_delete_internal_object_list(info.parameters);
@@ -473,6 +476,7 @@ acpi_ns_get_device_callback(acpi_handle obj_handle,
        }
 
        if (!(flags & ACPI_STA_DEVICE_PRESENT)) {
+
                /* Don't examine children of the device if not present */
 
                return (AE_CTRL_DEPTH);
@@ -489,6 +493,7 @@ acpi_ns_get_device_callback(acpi_handle obj_handle,
                }
 
                if (ACPI_STRNCMP(hid.value, info->hid, sizeof(hid.value)) != 0) {
+
                        /* Get the list of Compatible IDs */
 
                        status = acpi_ut_execute_CID(node, &cid);
@@ -563,9 +568,9 @@ acpi_get_devices(char *HID,
         * We're going to call their callback from OUR callback, so we need
         * to know what it is, and their context parameter.
         */
+       info.hid = HID;
        info.context = context;
        info.user_function = user_function;
-       info.hid = HID;
 
        /*
         * Lock the namespace around the walk.
@@ -578,9 +583,8 @@ acpi_get_devices(char *HID,
                return_ACPI_STATUS(status);
        }
 
-       status = acpi_ns_walk_namespace(ACPI_TYPE_DEVICE,
-                                       ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
-                                       ACPI_NS_WALK_UNLOCK,
+       status = acpi_ns_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
+                                       ACPI_UINT32_MAX, ACPI_NS_WALK_UNLOCK,
                                        acpi_ns_get_device_callback, &info,
                                        return_value);
 
index 8cd8675a47c0403c765c640f7b021b43fa89327a..55d26624ab9f5f6705569835bddd0f1e142ef5eb 100644 (file)
@@ -162,6 +162,7 @@ acpi_get_name(acpi_handle handle, u32 name_type, struct acpi_buffer * buffer)
        }
 
        if (name_type == ACPI_FULL_PATHNAME) {
+
                /* Get the full pathname (From the namespace root) */
 
                status = acpi_ns_handle_to_pathname(handle, buffer);
index a0332595677a9dbb51093443de445781ce43f1f8..9c5f3302799ce984953411f0f2c39a90ce5af89a 100644 (file)
@@ -206,6 +206,7 @@ acpi_get_next_object(acpi_object_type type,
        /* If null handle, use the parent */
 
        if (!child) {
+
                /* Start search at the beginning of the specified scope */
 
                parent_node = acpi_ns_map_handle_to_node(parent);
index de573be52718f611459ff1212f539547a3b295a0..1c5934fe18536e7464e89cbbef88f41864bc7fee 100644 (file)
@@ -275,6 +275,7 @@ acpi_ps_get_next_namepath(struct acpi_walk_state *walk_state,
         */
        if (ACPI_SUCCESS(status) &&
            possible_method_call && (node->type == ACPI_TYPE_METHOD)) {
+
                /* This name is actually a control method invocation */
 
                method_desc = acpi_ns_get_attached_object(node);
@@ -319,6 +320,7 @@ acpi_ps_get_next_namepath(struct acpi_walk_state *walk_state,
         * some not_found cases are allowed
         */
        if (status == AE_NOT_FOUND) {
+
                /* 1) not_found is ok during load pass 1/2 (allow forward references) */
 
                if ((walk_state->parse_flags & ACPI_PARSE_MODE_MASK) !=
@@ -354,6 +356,7 @@ acpi_ps_get_next_namepath(struct acpi_walk_state *walk_state,
 
                if ((walk_state->parse_flags & ACPI_PARSE_MODE_MASK) ==
                    ACPI_PARSE_EXECUTE) {
+
                        /* Report a control method execution error */
 
                        status = acpi_ds_method_error(status, walk_state);
@@ -620,6 +623,7 @@ acpi_ps_get_next_arg(struct acpi_walk_state *walk_state,
        case ARGP_FIELDLIST:
 
                if (parser_state->aml < parser_state->pkg_end) {
+
                        /* Non-empty list */
 
                        while (parser_state->aml < parser_state->pkg_end) {
@@ -645,6 +649,7 @@ acpi_ps_get_next_arg(struct acpi_walk_state *walk_state,
        case ARGP_BYTELIST:
 
                if (parser_state->aml < parser_state->pkg_end) {
+
                        /* Non-empty list */
 
                        arg = acpi_ps_alloc_op(AML_INT_BYTELIST_OP);
@@ -673,6 +678,7 @@ acpi_ps_get_next_arg(struct acpi_walk_state *walk_state,
                if (subop == 0 ||
                    acpi_ps_is_leading_char(subop) ||
                    acpi_ps_is_prefix_char(subop)) {
+
                        /* null_name or name_string */
 
                        arg = acpi_ps_alloc_op(AML_INT_NAMEPATH_OP);
@@ -703,6 +709,7 @@ acpi_ps_get_next_arg(struct acpi_walk_state *walk_state,
        case ARGP_OBJLIST:
 
                if (parser_state->aml < parser_state->pkg_end) {
+
                        /* Non-empty list of variable arguments, nothing returned */
 
                        walk_state->arg_count = ACPI_VAR_ARGS;
index 00b072e15d1921ef9f5e6bb86e7b13d0aaadcae9..42062d5abc9edcc4888701d3172a834768643e66 100644 (file)
@@ -95,6 +95,7 @@ acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state)
 #if (!defined (ACPI_NO_METHOD_EXECUTION) && !defined (ACPI_CONSTANT_EVAL_ONLY))
 
        if (walk_state->walk_type & ACPI_WALK_METHOD_RESTART) {
+
                /* We are restarting a preempted control method */
 
                if (acpi_ps_has_completed_scope(parser_state)) {
@@ -143,6 +144,7 @@ acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state)
                        ACPI_DEBUG_PRINT((ACPI_DB_PARSE,
                                          "Popped scope, Op=%p\n", op));
                } else if (walk_state->prev_op) {
+
                        /* We were in the middle of an op */
 
                        op = walk_state->prev_op;
@@ -156,6 +158,7 @@ acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state)
        while ((parser_state->aml < parser_state->aml_end) || (op)) {
                aml_op_start = parser_state->aml;
                if (!op) {
+
                        /* Get the next opcode from the AML stream */
 
                        walk_state->aml_offset =
@@ -213,6 +216,7 @@ acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state)
                        /* Create Op structure and append to parent's argument list */
 
                        if (walk_state->op_info->flags & AML_NAMED) {
+
                                /* Allocate a new pre_op if necessary */
 
                                if (!pre_op) {
@@ -388,6 +392,7 @@ acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state)
                /* Are there any arguments that must be processed? */
 
                if (walk_state->arg_types) {
+
                        /* Get arguments */
 
                        switch (op->common.aml_opcode) {
@@ -853,6 +858,7 @@ acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state)
                                }
 
                                else if (ACPI_FAILURE(status)) {
+
                                        /* First error is most important */
 
                                        (void)
index 11d6351ab8b288ed2d428e8677e2d017465adda2..9eb8d06638866fa60ec858d29df9be9eab4caf0c 100644 (file)
@@ -731,6 +731,7 @@ const struct acpi_opcode_info *acpi_ps_get_opcode_info(u16 opcode)
         * Detect normal 8-bit opcode or extended 16-bit opcode
         */
        if (!(opcode & 0xFF00)) {
+
                /* Simple (8-bit) opcode: 0-255, can't index beyond table  */
 
                return (&acpi_gbl_aml_op_info
@@ -739,6 +740,7 @@ const struct acpi_opcode_info *acpi_ps_get_opcode_info(u16 opcode)
 
        if (((opcode & 0xFF00) == AML_EXTENDED_OPCODE) &&
            (((u8) opcode) <= MAX_EXTENDED_OPCODE)) {
+
                /* Valid extended (16-bit) opcode */
 
                return (&acpi_gbl_aml_op_info
index a9f3229f4106f2750a21e5e7c59255405eabc35f..83d8916bc1af66d9c17df8da8eeea3b6d67d2ef6 100644 (file)
@@ -106,6 +106,7 @@ u16 acpi_ps_peek_opcode(struct acpi_parse_state * parser_state)
        opcode = (u16) ACPI_GET8(aml);
 
        if (opcode == AML_EXTENDED_OP_PREFIX) {
+
                /* Extended opcode, get the second opcode byte */
 
                aml++;
@@ -158,6 +159,7 @@ acpi_ps_complete_this_op(struct acpi_walk_state * walk_state,
        if (op->common.parent) {
                prev = op->common.parent->common.value.arg;
                if (!prev) {
+
                        /* Nothing more to do */
 
                        goto cleanup;
@@ -245,6 +247,7 @@ acpi_ps_complete_this_op(struct acpi_walk_state * walk_state,
                /* We must unlink this op from the parent tree */
 
                if (prev == op) {
+
                        /* This op is the first in the list */
 
                        if (replacement_op) {
@@ -265,6 +268,7 @@ acpi_ps_complete_this_op(struct acpi_walk_state * walk_state,
 
                else
                        while (prev) {
+
                                /* Traverse all siblings in the parent's argument list */
 
                                next = prev->common.next;
@@ -510,6 +514,7 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
                } else if (status == AE_CTRL_TERMINATE) {
                        status = AE_OK;
                } else if ((status != AE_OK) && (walk_state->method_desc)) {
+
                        /* Either the method parse or actual execution failed */
 
                        ACPI_ERROR_METHOD("Method parse/execution failed",
@@ -551,6 +556,7 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
                if (((walk_state->parse_flags & ACPI_PARSE_MODE_MASK) ==
                     ACPI_PARSE_EXECUTE) || (ACPI_FAILURE(status))) {
                        if (walk_state->method_desc) {
+
                                /* Decrement the thread count on the method parse tree */
 
                                if (walk_state->method_desc->method.
@@ -633,12 +639,14 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
                        }
                } else {
                        if (previous_walk_state->return_desc) {
+
                                /* Caller doesn't want it, must delete it */
 
                                acpi_ut_remove_reference(previous_walk_state->
                                                         return_desc);
                        }
                        if (previous_walk_state->implicit_return_obj) {
+
                                /* Caller doesn't want it, must delete it */
 
                                acpi_ut_remove_reference(previous_walk_state->
index bc6047caccd9befcbb105ed748804f05607f5fd5..edb7c9ba6ec21f172e5900958e5399668ebd37c8 100644 (file)
@@ -165,6 +165,7 @@ acpi_ps_push_scope(struct acpi_parse_state *parser_state,
        acpi_ut_push_generic_state(&parser_state->scope, scope);
 
        if (arg_count == ACPI_VAR_ARGS) {
+
                /* Multiple arguments */
 
                scope->parse_scope.arg_end = parser_state->pkg_end;
index dd6f16726fc437abab328359d315cc365ee146e1..6aa0012643cedf93d8820f6e74284f333c89e86a 100644 (file)
@@ -77,6 +77,7 @@ union acpi_parse_object *acpi_ps_get_arg(union acpi_parse_object *op, u32 argn)
 
        op_info = acpi_ps_get_opcode_info(op->common.aml_opcode);
        if (op_info->class == AML_CLASS_UNKNOWN) {
+
                /* Invalid opcode or ASCII character */
 
                return (NULL);
@@ -85,6 +86,7 @@ union acpi_parse_object *acpi_ps_get_arg(union acpi_parse_object *op, u32 argn)
        /* Check if this opcode requires argument sub-objects */
 
        if (!(op_info->flags & AML_HAS_ARGS)) {
+
                /* Has no linked argument objects */
 
                return (NULL);
@@ -130,6 +132,7 @@ acpi_ps_append_arg(union acpi_parse_object *op, union acpi_parse_object *arg)
 
        op_info = acpi_ps_get_opcode_info(op->common.aml_opcode);
        if (op_info->class == AML_CLASS_UNKNOWN) {
+
                /* Invalid opcode */
 
                ACPI_ERROR((AE_INFO, "Invalid AML Opcode: 0x%2.2X",
@@ -140,6 +143,7 @@ acpi_ps_append_arg(union acpi_parse_object *op, union acpi_parse_object *arg)
        /* Check if this opcode requires argument sub-objects */
 
        if (!(op_info->flags & AML_HAS_ARGS)) {
+
                /* Has no linked argument objects */
 
                return;
@@ -148,6 +152,7 @@ acpi_ps_append_arg(union acpi_parse_object *op, union acpi_parse_object *arg)
        /* Append the argument to the linked argument list */
 
        if (op->common.value.arg) {
+
                /* Append to existing argument list */
 
                prev_arg = op->common.value.arg;
@@ -222,12 +227,14 @@ union acpi_parse_object *acpi_ps_get_depth_next(union acpi_parse_object *origin,
                }
 
                if (arg == origin) {
+
                        /* Reached parent of origin, end search */
 
                        return (NULL);
                }
 
                if (parent->common.next) {
+
                        /* Found sibling of parent */
 
                        return (parent->common.next);
index 3e07cb9cb7487f6940324c1b218ebbf6d9bfa761..a4c33a4bfe354705a6d0ff01a483b4bbdfde5fc3 100644 (file)
@@ -135,6 +135,7 @@ union acpi_parse_object *acpi_ps_alloc_op(u16 opcode)
        /* Allocate the minimum required size object */
 
        if (flags == ACPI_PARSEOP_GENERIC) {
+
                /* The generic op (default) is by far the most common (16 to 1) */
 
                op = acpi_os_acquire_object(acpi_gbl_ps_node_cache);
index 06f05bfd761262c6f1776b25b3329b65b958c1b5..3d08b8c6db419cb9aa68d37d483bfeef4219071b 100644 (file)
@@ -69,13 +69,16 @@ void acpi_ps_delete_parse_tree(union acpi_parse_object *subtree_root)
        /* Visit all nodes in the subtree */
 
        while (op) {
+
                /* Check if we are not ascending */
 
                if (op != parent) {
+
                        /* Look for an argument or child of the current op */
 
                        next = acpi_ps_get_arg(op, 0);
                        if (next) {
+
                                /* Still going downward in tree (Op is not completed yet) */
 
                                op = next;
index 2dd48cbb7c0299c66e0606d8a8da9687eb35aa5c..e09a820ee2945495acbc892d85181c60b6c37aca 100644 (file)
@@ -317,9 +317,11 @@ acpi_ps_update_parameter_list(struct acpi_parameter_info *info, u16 action)
        acpi_native_uint i;
 
        if ((info->parameter_type == ACPI_PARAM_ARGS) && (info->parameters)) {
+
                /* Update reference count for each parameter */
 
                for (i = 0; info->parameters[i]; i++) {
+
                        /* Ignore errors, just do them all */
 
                        (void)acpi_ut_update_object_reference(info->
index 7d6481d9fbecded65bbeb2137bf718cd6ea18c64..223bdc4932690bd39d020223cfdd2a84af54df13 100644 (file)
@@ -78,6 +78,7 @@ static u8 acpi_rs_count_set_bits(u16 bit_field)
        ACPI_FUNCTION_ENTRY();
 
        for (bits_set = 0; bit_field; bits_set++) {
+
                /* Zero the least significant bit that is set */
 
                bit_field &= (bit_field - 1);
@@ -154,6 +155,7 @@ acpi_rs_stream_option_length(u32 resource_length,
         * length, minus one byte for the resource_source_index itself.
         */
        if (resource_length > minimum_aml_resource_length) {
+
                /* Compute the length of the optional string */
 
                string_length =
@@ -162,7 +164,7 @@ acpi_rs_stream_option_length(u32 resource_length,
 
        /* Round up length to 32 bits for internal structure alignment */
 
-       return (ACPI_ROUND_UP_to_32_bITS(string_length));
+       return ((u32) ACPI_ROUND_UP_to_32_bITS(string_length));
 }
 
 /*******************************************************************************
@@ -191,6 +193,7 @@ acpi_rs_get_aml_length(struct acpi_resource * resource, acpi_size * size_needed)
        /* Traverse entire list of internal resource descriptors */
 
        while (resource) {
+
                /* Validate the descriptor type */
 
                if (resource->type > ACPI_RESOURCE_TYPE_MAX) {
@@ -214,6 +217,7 @@ acpi_rs_get_aml_length(struct acpi_resource * resource, acpi_size * size_needed)
                         * is a Large Resource data type.
                         */
                        if (resource->data.vendor.byte_length > 7) {
+
                                /* Base size of a Large resource descriptor */
 
                                total_size =
@@ -346,6 +350,7 @@ acpi_rs_get_list_length(u8 * aml_buffer,
        /* Walk the list of AML resource descriptors */
 
        while (aml_buffer < end_aml) {
+
                /* Validate the Resource Type and Resource Length */
 
                status = acpi_ut_validate_resource(aml_buffer, &resource_index);
@@ -390,7 +395,7 @@ acpi_rs_get_list_length(u8 * aml_buffer,
                         * Vendor Resource:
                         * Ensure a 32-bit boundary for the structure
                         */
-                       extra_struct_bytes =
+                       extra_struct_bytes = (u32)
                            ACPI_ROUND_UP_to_32_bITS(resource_length) -
                            resource_length;
                        break;
@@ -407,7 +412,7 @@ acpi_rs_get_list_length(u8 * aml_buffer,
                         * Vendor Resource:
                         * Add vendor data and ensure a 32-bit boundary for the structure
                         */
-                       extra_struct_bytes =
+                       extra_struct_bytes = (u32)
                            ACPI_ROUND_UP_to_32_bITS(resource_length) -
                            resource_length;
                        break;
@@ -431,7 +436,7 @@ acpi_rs_get_list_length(u8 * aml_buffer,
                         */
                        buffer++;
 
-                       extra_struct_bytes =
+                       extra_struct_bytes = (u32)
                            /*
                             * Add 4 bytes for each additional interrupt. Note: at
                             * least one interrupt is required and is included in
@@ -450,7 +455,7 @@ acpi_rs_get_list_length(u8 * aml_buffer,
                         * Add the size of any optional data (resource_source)
                         * Ensure a 64-bit boundary for the structure
                         */
-                       extra_struct_bytes =
+                       extra_struct_bytes = (u32)
                            ACPI_ROUND_UP_to_64_bITS
                            (acpi_rs_stream_option_length
                             (resource_length, minimum_aml_resource_length));
@@ -525,6 +530,7 @@ acpi_rs_get_pci_routing_table_length(union acpi_operand_object *package_object,
        top_object_list = package_object->package.elements;
 
        for (index = 0; index < number_of_elements; index++) {
+
                /* Dereference the sub-package */
 
                package_element = *top_object_list;
index 1434e786477e82de414ebab1afdadd20daee6c00..c27dca64d5d0a7cf3234e4bc2202db7ad68c84b2 100644 (file)
@@ -77,6 +77,7 @@ acpi_rs_convert_aml_to_resources(u8 * aml, u32 aml_length, u8 * output_buffer)
        /* Loop until end-of-buffer or an end_tag is found */
 
        while (aml < end_aml) {
+
                /* Validate the Resource Type and Resource Length */
 
                status = acpi_ut_validate_resource(aml, &resource_index);
@@ -155,6 +156,7 @@ acpi_rs_convert_resources_to_aml(struct acpi_resource *resource,
        /* Walk the resource descriptor list, convert each descriptor */
 
        while (aml < end_aml) {
+
                /* Validate the (internal) Resource Type */
 
                if (resource->type > ACPI_RESOURCE_TYPE_MAX) {
@@ -191,6 +193,7 @@ acpi_rs_convert_resources_to_aml(struct acpi_resource *resource,
                /* Check for end-of-list, normal exit */
 
                if (resource->type == ACPI_RESOURCE_TYPE_END_TAG) {
+
                        /* An End Tag indicates the end of the input Resource Template */
 
                        return_ACPI_STATUS(AE_OK);
index ed866cf1c6d23c7f7ede4a11fb366ec64ecc9824..095730196a8af8227bc8ea6fed0d51763e9b5f3f 100644 (file)
@@ -84,6 +84,7 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
        ACPI_FUNCTION_TRACE("rs_get_resource");
 
        if (((acpi_native_uint) resource) & 0x3) {
+
                /* Each internal resource struct is expected to be 32-bit aligned */
 
                ACPI_WARNING((AE_INFO,
@@ -295,9 +296,11 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
 
       exit:
        if (!flags_mode) {
+
                /* Round the resource struct length up to the next 32-bit boundary */
 
-               resource->length = ACPI_ROUND_UP_to_32_bITS(resource->length);
+               resource->length =
+                   (u32) ACPI_ROUND_UP_to_32_bITS(resource->length);
        }
        return_ACPI_STATUS(AE_OK);
 }
@@ -535,6 +538,7 @@ if (((aml->irq.flags & 0x09) == 0x00) || ((aml->irq.flags & 0x09) == 0x09)) {
 
 resource->data.extended_irq.interrupt_count = temp8;
 if (temp8 < 1) {
+
        /* Must have at least one IRQ */
 
        return_ACPI_STATUS(AE_AML_BAD_RESOURCE_LENGTH);
index 25b5aedd661201eb7d6573d758d380e993025d1e..c5f7014929b4a2efd5bde0661635fe54b5a9a34b 100644 (file)
@@ -205,6 +205,7 @@ acpi_rs_set_resource_length(acpi_rsdesc_size total_length,
        /* Length is stored differently for large and small descriptors */
 
        if (aml->small_header.descriptor_type & ACPI_RESOURCE_NAME_LARGE) {
+
                /* Large descriptor -- bytes 1-2 contain the 16-bit length */
 
                ACPI_MOVE_16_TO_16(&aml->large_header.resource_length,
@@ -328,6 +329,7 @@ acpi_rs_get_resource_source(acpi_rs_length resource_length,
         * we add 1 to the minimum length.
         */
        if (total_length > (acpi_rsdesc_size) (minimum_length + 1)) {
+
                /* Get the resource_source_index */
 
                resource_source->index = aml_resource_source[0];
@@ -351,16 +353,20 @@ acpi_rs_get_resource_source(acpi_rs_length resource_length,
                 * Zero the entire area of the buffer.
                 */
                total_length =
+                   (u32)
                    ACPI_ROUND_UP_to_32_bITS(ACPI_STRLEN
-                                            ((char *)&aml_resource_source[1]) +
-                                            1);
+                                            (ACPI_CAST_PTR
+                                             (char,
+                                              &aml_resource_source[1])) + 1);
+
                ACPI_MEMSET(resource_source->string_ptr, 0, total_length);
 
                /* Copy the resource_source string to the destination */
 
                resource_source->string_length =
                    acpi_rs_strcpy(resource_source->string_ptr,
-                                  (char *)&aml_resource_source[1]);
+                                  ACPI_CAST_PTR(char,
+                                                &aml_resource_source[1]));
 
                return ((acpi_rs_length) total_length);
        }
@@ -405,6 +411,7 @@ acpi_rs_set_resource_source(union aml_resource * aml,
        /* Non-zero string length indicates presence of a resource_source */
 
        if (resource_source->string_length) {
+
                /* Point to the end of the AML descriptor */
 
                aml_resource_source = ACPI_ADD_PTR(u8, aml, minimum_length);
@@ -415,7 +422,7 @@ acpi_rs_set_resource_source(union aml_resource * aml,
 
                /* Copy the resource_source string */
 
-               ACPI_STRCPY((char *)&aml_resource_source[1],
+               ACPI_STRCPY(ACPI_CAST_PTR(char, &aml_resource_source[1]),
                            resource_source->string_ptr);
 
                /*
@@ -435,9 +442,9 @@ acpi_rs_set_resource_source(union aml_resource * aml,
  *
  * FUNCTION:    acpi_rs_get_prt_method_data
  *
- * PARAMETERS:  Handle          - a handle to the containing object
- *              ret_buffer      - a pointer to a buffer structure for the
- *                                  results
+ * PARAMETERS:  Handle          - Handle to the containing object
+ *              ret_buffer      - Pointer to a buffer structure for the
+ *                                results
  *
  * RETURN:      Status
  *
@@ -483,9 +490,9 @@ acpi_rs_get_prt_method_data(acpi_handle handle, struct acpi_buffer * ret_buffer)
  *
  * FUNCTION:    acpi_rs_get_crs_method_data
  *
- * PARAMETERS:  Handle          - a handle to the containing object
- *              ret_buffer      - a pointer to a buffer structure for the
- *                                  results
+ * PARAMETERS:  Handle          - Handle to the containing object
+ *              ret_buffer      - Pointer to a buffer structure for the
+ *                                results
  *
  * RETURN:      Status
  *
@@ -532,9 +539,9 @@ acpi_rs_get_crs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer)
  *
  * FUNCTION:    acpi_rs_get_prs_method_data
  *
- * PARAMETERS:  Handle          - a handle to the containing object
- *              ret_buffer      - a pointer to a buffer structure for the
- *                                  results
+ * PARAMETERS:  Handle          - Handle to the containing object
+ *              ret_buffer      - Pointer to a buffer structure for the
+ *                                results
  *
  * RETURN:      Status
  *
@@ -583,10 +590,10 @@ acpi_rs_get_prs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer)
  *
  * FUNCTION:    acpi_rs_get_method_data
  *
- * PARAMETERS:  Handle          - a handle to the containing object
+ * PARAMETERS:  Handle          - Handle to the containing object
  *              Path            - Path to method, relative to Handle
- *              ret_buffer      - a pointer to a buffer structure for the
- *                                  results
+ *              ret_buffer      - Pointer to a buffer structure for the
+ *                                results
  *
  * RETURN:      Status
  *
@@ -634,9 +641,9 @@ acpi_rs_get_method_data(acpi_handle handle,
  *
  * FUNCTION:    acpi_rs_set_srs_method_data
  *
- * PARAMETERS:  Handle          - a handle to the containing object
- *              in_buffer       - a pointer to a buffer structure of the
- *                                  parameter
+ * PARAMETERS:  Handle          - Handle to the containing object
+ *              in_buffer       - Pointer to a buffer structure of the
+ *                                parameter
  *
  * RETURN:      Status
  *
@@ -696,6 +703,7 @@ acpi_rs_set_srs_method_data(acpi_handle handle, struct acpi_buffer *in_buffer)
 
        status = acpi_ns_evaluate_relative(METHOD_NAME__SRS, &info);
        if (ACPI_SUCCESS(status)) {
+
                /* Delete any return object (especially if implicit_return is enabled) */
 
                if (info.return_object) {
index 88b67077aeeb12cf1a1cd1f85db6be9daaef0526..2e1bc71acd94b4d8663abf862bcc8e4292892f8c 100644 (file)
@@ -279,6 +279,7 @@ acpi_walk_resources(acpi_handle device_handle,
        /* Walk the resource list until the end_tag is found (or buffer end) */
 
        while (resource < resource_end) {
+
                /* Sanity check the resource */
 
                if (resource->type > ACPI_RESOURCE_TYPE_MAX) {
@@ -291,6 +292,7 @@ acpi_walk_resources(acpi_handle device_handle,
                status = user_function(resource, context);
                if (ACPI_FAILURE(status)) {
                        if (status == AE_CTRL_TERMINATE) {
+
                                /* This is an OK termination by the user function */
 
                                status = AE_OK;
index 03b37d2223bce30edea4c3aae5020404f2028bc3..254ebdbb7bef56e4c60bede6ae0ccc1fe173b822 100644 (file)
@@ -147,6 +147,7 @@ acpi_status acpi_tb_convert_to_xsdt(struct acpi_table_desc *table_info)
        /* Copy the table pointers */
 
        for (i = 0; i < acpi_gbl_rsdt_table_count; i++) {
+
                /* RSDT pointers are 32 bits, XSDT pointers are 64 bits */
 
                if (acpi_gbl_root_table_type == ACPI_TABLE_TYPE_RSDT) {
@@ -515,6 +516,7 @@ acpi_status acpi_tb_convert_table_fadt(void)
 
        if (acpi_gbl_FADT->revision >= FADT2_REVISION_ID) {
                if (acpi_gbl_FADT->length < sizeof(struct fadt_descriptor_rev2)) {
+
                        /* Length is too short to be a V2.0 table */
 
                        ACPI_WARNING((AE_INFO,
@@ -603,6 +605,7 @@ acpi_status acpi_tb_build_common_facs(struct acpi_table_desc *table_info)
        if ((acpi_gbl_RSDP->revision < 2) ||
            (acpi_gbl_FACS->length < 32) ||
            (!(acpi_gbl_FACS->xfirmware_waking_vector))) {
+
                /* ACPI 1.0 FACS or short table or optional X_ field is zero */
 
                acpi_gbl_common_fACS.firmware_waking_vector = ACPI_CAST_PTR(u64,
index 09b4ee6dfd60a6e96e7aa2f1a50ba6c4cbabe47a..4615e1afe8defcd1c0882e52be6e05e7a57ba136 100644 (file)
@@ -148,6 +148,10 @@ acpi_tb_get_table_header(struct acpi_pointer *address,
                                            sizeof(struct acpi_table_header),
                                            (void *)&header);
                if (ACPI_FAILURE(status)) {
+                       ACPI_ERROR((AE_INFO,
+                                   "Could not map memory at %8.8X%8.8X for table header",
+                                   ACPI_FORMAT_UINT64(address->pointer.
+                                                      physical)));
                        return_ACPI_STATUS(status);
                }
 
@@ -208,6 +212,7 @@ acpi_tb_get_table_body(struct acpi_pointer *address,
 
        status = acpi_tb_table_override(header, table_info);
        if (ACPI_SUCCESS(status)) {
+
                /* Table was overridden by the host OS */
 
                return_ACPI_STATUS(status);
@@ -250,6 +255,7 @@ acpi_tb_table_override(struct acpi_table_header *header,
         */
        status = acpi_os_table_override(header, &new_table);
        if (ACPI_FAILURE(status)) {
+
                /* Some severe error from the OSL, but we basically ignore it */
 
                ACPI_EXCEPTION((AE_INFO, status,
@@ -258,6 +264,7 @@ acpi_tb_table_override(struct acpi_table_header *header,
        }
 
        if (!new_table) {
+
                /* No table override */
 
                return_ACPI_STATUS(AE_NO_ACPI_TABLES);
@@ -381,6 +388,7 @@ acpi_tb_get_this_table(struct acpi_pointer *address,
 
 #if (!ACPI_CHECKSUM_ABORT)
                if (ACPI_FAILURE(status)) {
+
                        /* Ignore the error if configuration says so */
 
                        status = AE_OK;
@@ -440,6 +448,7 @@ acpi_tb_get_table_ptr(acpi_table_type table_type,
         * instance is always in the list head.
         */
        if (instance == 1) {
+
                /* Get the first */
 
                *table_ptr_loc = NULL;
index 134e5dce0bc172d03cf3d788cebb2cf4daa65a80..b4ec61d7cf06548b41b289a12fa5deb0bea795ec 100644 (file)
@@ -223,6 +223,7 @@ acpi_status acpi_tb_get_required_tables(void)
         * any SSDTs.
         */
        for (i = 0; i < acpi_gbl_rsdt_table_count; i++) {
+
                /* Get the table address from the common internal XSDT */
 
                address.pointer.value = acpi_gbl_XSDT->table_offset_entry[i];
index 7ffd0fddb4e55d1c7d75a192979d0657352915fc..ec2cb978b7c40d0914c857e70fe233c95b3e919c 100644 (file)
@@ -84,6 +84,7 @@ acpi_tb_match_signature(char *signature,
 
                if (!ACPI_STRNCMP(signature, acpi_gbl_table_data[i].signature,
                                  acpi_gbl_table_data[i].sig_length)) {
+
                        /* Found a signature match, return index if requested */
 
                        if (table_info) {
index 4d308220225d216b8786f32d35ab34b83a4f6b59..946d2f2d611d205fea5f11c50bd90b55945c8fe3 100644 (file)
@@ -190,6 +190,7 @@ acpi_status acpi_tb_validate_rsdt(struct acpi_table_header *table_ptr)
        }
 
        if (no_match) {
+
                /* Invalid RSDT or XSDT signature */
 
                ACPI_ERROR((AE_INFO,
index bc571592f087e784d93cca093e9a1f50472a0322..b463d4b88823fa73554624f30b35bc1674f89852 100644 (file)
@@ -96,6 +96,7 @@ acpi_status acpi_tb_is_table_installed(struct acpi_table_desc *new_table_desc)
                    (!ACPI_MEMCMP
                     (table_desc->pointer, new_table_desc->pointer,
                      new_table_desc->pointer->length))) {
+
                        /* Match: this table is already installed */
 
                        ACPI_DEBUG_PRINT((ACPI_DB_TABLES,
@@ -249,6 +250,7 @@ u8 acpi_tb_generate_checksum(void *buffer, u32 length)
        u8 sum = 0;
 
        if (buffer && length) {
+
                /*  Buffer and Length are valid   */
 
                end_buffer = ACPI_ADD_PTR(u8, buffer, length);
index 9fe53c9d5b9ad4a78f30af8bfcd1cd35d1e30e8d..3e902cdb83e154586d794334e09c6707cdb86f14 100644 (file)
@@ -174,6 +174,7 @@ acpi_status acpi_load_table(struct acpi_table_header *table_ptr)
        status = acpi_tb_install_table(&table_info);
        if (ACPI_FAILURE(status)) {
                if (status == AE_ALREADY_EXISTS) {
+
                        /* Table already exists, no error */
 
                        status = AE_OK;
@@ -208,6 +209,7 @@ acpi_status acpi_load_table(struct acpi_table_header *table_ptr)
        }
 
        if (ACPI_FAILURE(status)) {
+
                /* Uninstall table and free the buffer */
 
                (void)acpi_tb_uninstall_table(table_info.installed_desc);
@@ -397,6 +399,7 @@ acpi_get_table(acpi_table_type table_type,
        /* Get the table length */
 
        if (table_type == ACPI_TABLE_RSDP) {
+
                /* RSD PTR is the only "table" without a header */
 
                table_length = sizeof(struct rsdp_descriptor);
index a62db6af83c9139ad8ab02871862db6eeef9af90..7f68b759f15a122f2831519da1ff4a4e9ce46f17 100644 (file)
@@ -75,6 +75,7 @@ acpi_status acpi_tb_validate_rsdp(struct rsdp_descriptor *rsdp)
         *  The signature and checksum must both be correct
         */
        if (ACPI_STRNCMP((char *)rsdp, RSDP_SIG, sizeof(RSDP_SIG) - 1) != 0) {
+
                /* Nope, BAD Signature */
 
                return (AE_BAD_SIGNATURE);
@@ -217,6 +218,7 @@ acpi_get_firmware_table(acpi_string signature,
        /* Ensure that we have a RSDP */
 
        if (!acpi_gbl_RSDP) {
+
                /* Get the RSDP */
 
                status = acpi_os_get_root_pointer(flags, &address);
@@ -327,10 +329,12 @@ acpi_get_firmware_table(acpi_string signature,
                /* Compare table signatures and table instance */
 
                if (!ACPI_STRNCMP(header->signature, signature, ACPI_NAME_SIZE)) {
+
                        /* An instance of the table was found */
 
                        j++;
                        if (j >= instance) {
+
                                /* Found the correct instance, get the entire table */
 
                                status =
@@ -434,12 +438,14 @@ static u8 *acpi_tb_scan_memory_for_rsdp(u8 * start_address, u32 length)
 
        for (mem_rover = start_address; mem_rover < end_address;
             mem_rover += ACPI_RSDP_SCAN_STEP) {
+
                /* The RSDP signature and checksum must both be correct */
 
                status =
                    acpi_tb_validate_rsdp(ACPI_CAST_PTR
                                          (struct rsdp_descriptor, mem_rover));
                if (ACPI_SUCCESS(status)) {
+
                        /* Sig and checksum valid, we have found a real RSDP */
 
                        ACPI_DEBUG_PRINT((ACPI_DB_INFO,
@@ -495,6 +501,7 @@ acpi_tb_find_rsdp(struct acpi_table_desc *table_info, u32 flags)
         * Scan supports either logical addressing or physical addressing
         */
        if ((flags & ACPI_MEMORY_MODE) == ACPI_LOGICAL_ADDRESSING) {
+
                /* 1a) Get the location of the Extended BIOS Data Area (EBDA) */
 
                status = acpi_os_map_memory((acpi_physical_address)
@@ -542,6 +549,7 @@ acpi_tb_find_rsdp(struct acpi_table_desc *table_info, u32 flags)
                        acpi_os_unmap_memory(table_ptr, ACPI_EBDA_WINDOW_SIZE);
 
                        if (mem_rover) {
+
                                /* Return the physical address */
 
                                physical_address +=
@@ -576,6 +584,7 @@ acpi_tb_find_rsdp(struct acpi_table_desc *table_info, u32 flags)
                acpi_os_unmap_memory(table_ptr, ACPI_HI_RSDP_WINDOW_SIZE);
 
                if (mem_rover) {
+
                        /* Return the physical address */
 
                        physical_address =
@@ -609,6 +618,7 @@ acpi_tb_find_rsdp(struct acpi_table_desc *table_info, u32 flags)
                                                         (physical_address),
                                                         ACPI_EBDA_WINDOW_SIZE);
                        if (mem_rover) {
+
                                /* Return the physical address */
 
                                table_info->physical_address =
@@ -624,6 +634,7 @@ acpi_tb_find_rsdp(struct acpi_table_desc *table_info, u32 flags)
                                                 (ACPI_HI_RSDP_WINDOW_BASE),
                                                 ACPI_HI_RSDP_WINDOW_SIZE);
                if (mem_rover) {
+
                        /* Found it, return the physical address */
 
                        table_info->physical_address =
index 03b0044974c22b3846472167e1e11768fc362aac..34de3791d4c2a68650dab32bfe172d5abb8d4573 100644 (file)
@@ -308,6 +308,7 @@ void *acpi_ut_allocate(acpi_size size, u32 component, char *module, u32 line)
 
        allocation = acpi_os_allocate(size);
        if (!allocation) {
+
                /* Report allocation error */
 
                ACPI_ERROR((module, line,
@@ -351,6 +352,7 @@ void *acpi_ut_callocate(acpi_size size, u32 component, char *module, u32 line)
 
        allocation = acpi_os_allocate(size);
        if (!allocation) {
+
                /* Report allocation error */
 
                ACPI_ERROR((module, line,
@@ -477,6 +479,7 @@ void *acpi_ut_callocate_and_track(acpi_size size,
            acpi_ut_callocate(size + sizeof(struct acpi_debug_mem_header),
                              component, module, line);
        if (!allocation) {
+
                /* Report allocation error */
 
                ACPI_ERROR((module, line,
@@ -681,6 +684,7 @@ acpi_ut_remove_allocation(struct acpi_debug_mem_block *allocation,
 
        mem_list = acpi_gbl_global_list;
        if (NULL == mem_list->list_head) {
+
                /* No allocations! */
 
                ACPI_ERROR((module, line,
@@ -807,6 +811,7 @@ void acpi_ut_dump_allocations(u32 component, char *module)
                if ((element->component & component) &&
                    ((module == NULL)
                     || (0 == ACPI_STRCMP(module, element->module)))) {
+
                        /* Ignore allocated objects that are in a cache */
 
                        descriptor =
index 2177cb1ef2c43708c8af51e520bbdc8ad3e8a49f..044c890e5b3c20090f7d3f521ae7eec3a3dc27e1 100644 (file)
@@ -118,6 +118,7 @@ acpi_status acpi_os_purge_cache(struct acpi_memory_list * cache)
        /* Walk the list of objects in this cache */
 
        while (cache->list_head) {
+
                /* Delete and unlink one cached state object */
 
                next = *(ACPI_CAST_INDIRECT_PTR(char,
@@ -259,6 +260,7 @@ void *acpi_os_acquire_object(struct acpi_memory_list *cache)
        /* Check the cache first */
 
        if (cache->list_head) {
+
                /* There is an object available, use it */
 
                object = cache->list_head;
index df2d32096b72363e6a46301b41bdec19ae85c3b5..47875935c3f48e1b13f434e7a23a718da07a1249 100644 (file)
@@ -882,6 +882,7 @@ acpi_ut_copy_ipackage_to_ipackage(union acpi_operand_object *source_obj,
                                           acpi_ut_copy_ielement_to_ielement,
                                           walk_state);
        if (ACPI_FAILURE(status)) {
+
                /* On failure, delete the destination package object */
 
                acpi_ut_remove_reference(dest_obj);
index 35f3d581e0346f1df55bd9a0f4db512bd3408033..6e92b2a3c0fd186bab1331b2388692c2318c30b8 100644 (file)
@@ -123,12 +123,14 @@ static const char *acpi_ut_trim_function_name(const char *function_name)
        /* All Function names are longer than 4 chars, check is safe */
 
        if (*(ACPI_CAST_PTR(u32, function_name)) == ACPI_PREFIX_MIXED) {
+
                /* This is the case where the original source has not been modified */
 
                return (function_name + 4);
        }
 
        if (*(ACPI_CAST_PTR(u32, function_name)) == ACPI_PREFIX_LOWER) {
+
                /* This is the case where the source has been 'linuxized' */
 
                return (function_name + 5);
@@ -545,6 +547,7 @@ void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id)
        /* Nasty little dump buffer routine! */
 
        while (i < count) {
+
                /* Print current offset */
 
                acpi_os_printf("%6.4X: ", (u32) i);
@@ -553,6 +556,7 @@ void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id)
 
                for (j = 0; j < 16;) {
                        if (i + j >= count) {
+
                                /* Dump fill spaces */
 
                                acpi_os_printf("%*s", ((display * 2) + 1), " ");
index 1db9695b002927d9efb311bfe2b18626e769c455..dbae72121ceabab2bf93362eabe11ffe1dfd3256 100644 (file)
@@ -96,6 +96,7 @@ static void acpi_ut_delete_internal_obj(union acpi_operand_object *object)
                /* Free the actual string buffer */
 
                if (!(object->common.flags & AOPOBJ_STATIC_POINTER)) {
+
                        /* But only if it is NOT a pointer into an ACPI table */
 
                        obj_pointer = object->string.pointer;
@@ -111,6 +112,7 @@ static void acpi_ut_delete_internal_obj(union acpi_operand_object *object)
                /* Free the actual buffer */
 
                if (!(object->common.flags & AOPOBJ_STATIC_POINTER)) {
+
                        /* But only if it is NOT a pointer into an ACPI table */
 
                        obj_pointer = object->buffer.pointer;
@@ -415,6 +417,7 @@ acpi_ut_update_object_reference(union acpi_operand_object * object, u16 action)
        ACPI_FUNCTION_TRACE_PTR("ut_update_object_reference", object);
 
        while (object) {
+
                /* Make sure that this isn't a namespace handle */
 
                if (ACPI_GET_DESCRIPTOR_TYPE(object) == ACPI_DESC_TYPE_NAMED) {
index 106cc97cb4af9c21815d13741bb4108cabdfad35..952ffdea93aab23bd5f1b16df76404ea34dcbbc9 100644 (file)
@@ -98,6 +98,7 @@ acpi_status acpi_ut_osi_implementation(struct acpi_walk_state *walk_state)
                                 ACPI_CAST_PTR(char,
                                               acpi_gbl_valid_osi_strings[i])))
                {
+
                        /* This string is supported */
 
                        return_desc->integer.value = 0xFFFFFFFF;
@@ -343,6 +344,7 @@ acpi_ut_execute_HID(struct acpi_namespace_node *device_node,
        }
 
        if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_INTEGER) {
+
                /* Convert the Numeric HID to string */
 
                acpi_ex_eisa_id_to_string((u32) obj_desc->integer.value,
@@ -479,6 +481,7 @@ acpi_ut_execute_CID(struct acpi_namespace_node * device_node,
        /* The _CID object can be either a single CID or a package (list) of CIDs */
 
        if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_PACKAGE) {
+
                /* Translate each package element */
 
                for (i = 0; i < count; i++) {
@@ -543,6 +546,7 @@ acpi_ut_execute_UID(struct acpi_namespace_node *device_node,
        }
 
        if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_INTEGER) {
+
                /* Convert the Numeric UID to string */
 
                acpi_ex_unsigned_integer_to_string(obj_desc->integer.value,
index ffd13383a325ecae8ed8ae884187860b6566ce33..767c5e44a04b013b1c14021fcc8f5e3c07403d72 100644 (file)
@@ -119,6 +119,7 @@ const char *acpi_format_exception(acpi_status status)
        }
 
        if (!exception) {
+
                /* Exception code was not recognized */
 
                ACPI_ERROR((AE_INFO,
@@ -747,6 +748,7 @@ u8 acpi_ut_valid_object_type(acpi_object_type type)
 {
 
        if (type > ACPI_TYPE_LOCAL_MAX) {
+
                /* Note: Assumes all TYPEs are contiguous (external/local) */
 
                return (FALSE);
index 7364f5f8c9cd63556e80c5da13022620d46b11ac..60f36130663c19b1f5e73e908b9dd85e595717ac 100644 (file)
@@ -97,6 +97,7 @@ acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id)
 
                for (k = acpi_gbl_next_owner_id_offset; k < 32; k++) {
                        if (acpi_gbl_owner_id_mask[j] == ACPI_UINT32_MAX) {
+
                                /* There are no free IDs in this mask */
 
                                break;
@@ -273,6 +274,7 @@ void acpi_ut_print_string(char *string, u8 max_length)
 
        acpi_os_printf("\"");
        for (i = 0; string[i] && (i < max_length); i++) {
+
                /* Escape sequences */
 
                switch (string[i]) {
@@ -601,11 +603,13 @@ acpi_ut_strtoul64(char *string, u32 base, acpi_integer * ret_integer)
 
        while (*string) {
                if (ACPI_IS_DIGIT(*string)) {
+
                        /* Convert ASCII 0-9 to Decimal value */
 
                        this_digit = ((u8) * string) - '0';
                } else {
                        if (base == 10) {
+
                                /* Digit is out of range */
 
                                goto error_exit;
@@ -613,6 +617,7 @@ acpi_ut_strtoul64(char *string, u32 base, acpi_integer * ret_integer)
 
                        this_digit = (u8) ACPI_TOUPPER(*string);
                        if (ACPI_IS_XDIGIT((char)this_digit)) {
+
                                /* Convert ASCII Hex char to value */
 
                                this_digit = this_digit - 'A' + 10;
@@ -727,6 +732,7 @@ acpi_ut_walk_package_tree(union acpi_operand_object * source_object,
        }
 
        while (state) {
+
                /* Get one element of the package */
 
                this_index = state->pkg.index;
@@ -812,31 +818,6 @@ acpi_ut_walk_package_tree(union acpi_operand_object * source_object,
        return_ACPI_STATUS(AE_AML_INTERNAL);
 }
 
-/*******************************************************************************
- *
- * FUNCTION:    acpi_ut_generate_checksum
- *
- * PARAMETERS:  Buffer          - Buffer to be scanned
- *              Length          - number of bytes to examine
- *
- * RETURN:      The generated checksum
- *
- * DESCRIPTION: Generate a checksum on a raw buffer
- *
- ******************************************************************************/
-
-u8 acpi_ut_generate_checksum(u8 * buffer, u32 length)
-{
-       u32 i;
-       signed char sum = 0;
-
-       for (i = 0; i < length; i++) {
-               sum = (signed char)(sum + buffer[i]);
-       }
-
-       return ((u8) (0 - sum));
-}
-
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ut_error, acpi_ut_warning, acpi_ut_info
index 7ee2d1d980719e40cf8115064e26401b7f228029..b1205a58028cbd457c822624fe8ecf03292113bd 100644 (file)
@@ -173,6 +173,7 @@ union acpi_operand_object *acpi_ut_create_buffer_object(acpi_size buffer_size)
        /* Create an actual buffer only if size > 0 */
 
        if (buffer_size > 0) {
+
                /* Allocate the actual buffer */
 
                buffer = ACPI_MEM_CALLOCATE(buffer_size);
@@ -397,6 +398,7 @@ acpi_ut_get_simple_object_size(union acpi_operand_object *internal_object,
        length = sizeof(union acpi_object);
 
        if (ACPI_GET_DESCRIPTOR_TYPE(internal_object) == ACPI_DESC_TYPE_NAMED) {
+
                /* Object is a named object (reference), just return the length */
 
                *obj_length = ACPI_ROUND_UP_TO_NATIVE_WORD(length);
index 16461317113f09aec13c26401e27e7491742e848..27158dd0f877344623689a2a24212f222cc74bba 100644 (file)
@@ -273,6 +273,7 @@ acpi_status acpi_ut_validate_resource(void *aml, u8 * return_index)
         * Examine the large/small bit in the resource header
         */
        if (resource_type & ACPI_RESOURCE_NAME_LARGE) {
+
                /* Verify the large resource type (name) against the max */
 
                if (resource_type > ACPI_RESOURCE_NAME_LARGE_MAX) {
@@ -376,6 +377,7 @@ u8 acpi_ut_get_resource_type(void *aml)
         * Examine the large/small bit in the resource header
         */
        if (ACPI_GET8(aml) & ACPI_RESOURCE_NAME_LARGE) {
+
                /* Large Resource Type -- bits 6:0 contain the name */
 
                return (ACPI_GET8(aml));
@@ -411,6 +413,7 @@ u16 acpi_ut_get_resource_length(void *aml)
         * Examine the large/small bit in the resource header
         */
        if (ACPI_GET8(aml) & ACPI_RESOURCE_NAME_LARGE) {
+
                /* Large Resource type -- bytes 1-2 contain the 16-bit length */
 
                ACPI_MOVE_16_TO_16(&resource_length, ACPI_ADD_PTR(u8, aml, 1));
@@ -515,6 +518,7 @@ acpi_ut_get_resource_end_tag(union acpi_operand_object * obj_desc,
        /* Walk the resource template, one descriptor per iteration */
 
        while (aml < end_aml) {
+
                /* Validate the Resource Type and Resource Length */
 
                status = acpi_ut_validate_resource(aml, NULL);
index 4b134a72290711b81753003c81c30ed170386abb..69f2bfdc26ab592097e618b8e3013a3e2a6610bd 100644 (file)
@@ -129,6 +129,7 @@ union acpi_generic_state *acpi_ut_pop_generic_state(union acpi_generic_state
 
        state = *list_head;
        if (state) {
+
                /* Update the list head */
 
                *list_head = state->common.next;
@@ -158,6 +159,7 @@ union acpi_generic_state *acpi_ut_create_generic_state(void)
 
        state = acpi_os_acquire_object(acpi_gbl_state_cache);
        if (state) {
+
                /* Initialize */
                memset(state, 0, sizeof(union acpi_generic_state));
                state->common.data_type = ACPI_DESC_TYPE_STATE;
index e27dc8f299722f690d042adf47ae4ea3a54e94ef..28a6a23c863a9fe073efaa73500925190f8afddd 100644 (file)
@@ -63,7 +63,7 @@
 
 /* Current ACPICA subsystem version in YYYYMMDD format */
 
-#define ACPI_CA_VERSION                 0x20060127
+#define ACPI_CA_VERSION                 0x20060210
 
 /*
  * OS name, used for the _OS object.  The _OS object is essentially obsolete,
index 11a8fe39cb044d0d1090d331dd6acfb904bf9628..0727c132bd3c8096d9f887141283d7d75f93e148 100644 (file)
@@ -70,6 +70,7 @@ extern const char *acpi_gbl_match_ops[ACPI_NUM_MATCH_OPS];
 struct acpi_op_walk_info {
        u32 level;
        u32 bit_offset;
+       u32 flags;
        struct acpi_walk_state *walk_state;
 };
 
index 0927765df6aa065d173d7267c3b5ec274396d0c3..71ff78c7544138752d283b4cc4668fad2dfa458b 100644 (file)
@@ -483,8 +483,6 @@ acpi_status
 acpi_ut_get_resource_end_tag(union acpi_operand_object *obj_desc,
                             u8 ** end_tag);
 
-u8 acpi_ut_generate_checksum(u8 * buffer, u32 length);
-
 u32 acpi_ut_dword_byte_swap(u32 value);
 
 void acpi_ut_set_integer_width(u8 revision);