Skip to content

Commit

Permalink
ACPICA: Enable Scope change to root during module-level code execution.
Browse files Browse the repository at this point in the history
Allows constructs like this:
    If (XXXX)
        Scope (\)
        ...

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Feng Tang <feng.tang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Bob Moore authored and Len Brown committed Sep 21, 2012
1 parent a950c13 commit 28f538b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
14 changes: 14 additions & 0 deletions drivers/acpi/acpica/dswload.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,20 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state,
walk_state->scope_info->common.value = ACPI_TYPE_ANY;
break;

case ACPI_TYPE_METHOD:

/*
* Allow scope change to root during execution of module-level
* code. Root is typed METHOD during this time.
*/
if ((node == acpi_gbl_root_node) &&
(walk_state->
parse_flags & ACPI_PARSE_MODULE_LEVEL)) {
break;
}

/*lint -fallthrough */

default:

/* All other types are an error */
Expand Down
14 changes: 14 additions & 0 deletions drivers/acpi/acpica/dswload2.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,20 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state,
walk_state->scope_info->common.value = ACPI_TYPE_ANY;
break;

case ACPI_TYPE_METHOD:

/*
* Allow scope change to root during execution of module-level
* code. Root is typed METHOD during this time.
*/
if ((node == acpi_gbl_root_node) &&
(walk_state->
parse_flags & ACPI_PARSE_MODULE_LEVEL)) {
break;
}

/*lint -fallthrough */

default:

/* All other types are an error */
Expand Down

0 comments on commit 28f538b

Please sign in to comment.