diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2018-04-02 11:57:58 +0300 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2018-04-02 11:57:58 +0300 |
commit | ae02168d7877daf3a8ffcc60237a64398ed943aa (patch) | |
tree | 3e3c591765217cc70db6d212d4ce3f98730d8939 /drivers/acpi/acpica/psloop.c | |
parent | 8b29d29abc484d638213dd79a18a95ae7e5bb402 (diff) | |
parent | 4860ae7f58fa777405239e26698193801105fb2f (diff) | |
download | linux-ae02168d7877daf3a8ffcc60237a64398ed943aa.tar.xz |
Merge branch 'acpica'
* acpica: (21 commits)
ACPICA: Update version to 20180313
ACPICA: Cleanup/simplify module-level code support
ACPICA: Events: add a return on failure from acpi_hw_register_read
ACPICA: adding SPDX headers
ACPICA: Rename a global for clarity, no functional change
ACPICA: macros: fix ACPI_ERROR_NAMESPACE macro
ACPICA: Change a compile-time option to a runtime option
ACPICA: Remove calling of _STA from acpi_get_object_info()
ACPICA: AML Debug Object: Don't ignore output of zero-length strings
ACPICA: Fix memory leak on unusual memory leak
ACPICA: Events: Dispatch GPEs after enabling for the first time
ACPICA: Events: Add parallel GPE handling support to fix potential redundant _Exx evaluations
ACPICA: Events: Stop unconditionally clearing ACPI IRQs during suspend/resume
ACPICA: acpi: acpica: fix acpi operand cache leak in nseval.c
ACPICA: Update version to 20180209
ACPICA: Add option to disable Package object name resolution errors
ACPICA: Integrate package handling with module-level code
ACPICA: Revert "Fix for implicit result conversion for the To____ functions"
ACPICA: Update for some debug output. No functional change
ACPICA: Update error message, no functional change
...
Diffstat (limited to 'drivers/acpi/acpica/psloop.c')
-rw-r--r-- | drivers/acpi/acpica/psloop.c | 66 |
1 files changed, 25 insertions, 41 deletions
diff --git a/drivers/acpi/acpica/psloop.c b/drivers/acpi/acpica/psloop.c index 7dca287d7690..68422afc365f 100644 --- a/drivers/acpi/acpica/psloop.c +++ b/drivers/acpi/acpica/psloop.c @@ -1,45 +1,11 @@ +// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 /****************************************************************************** * * Module Name: psloop - Main AML parse loop * - *****************************************************************************/ - -/* * Copyright (C) 2000 - 2018, Intel Corp. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions, and the following disclaimer, - * without modification. - * 2. Redistributions in binary form must reproduce at minimum a disclaimer - * substantially similar to the "NO WARRANTY" disclaimer below - * ("Disclaimer") and any redistribution must be conditioned upon - * including a substantially similar Disclaimer requirement for further - * binary redistribution. - * 3. Neither the names of the above-listed copyright holders nor the names - * of any contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * Alternatively, this software may be distributed under the terms of the - * GNU General Public License ("GPL") version 2 as published by the Free - * Software Foundation. * - * NO WARRANTY - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGES. - */ + *****************************************************************************/ /* * Parse the AML and build an operation tree as most interpreters, (such as @@ -165,15 +131,23 @@ acpi_ps_get_arguments(struct acpi_walk_state *walk_state, } ACPI_DEBUG_PRINT((ACPI_DB_PARSE, - "Final argument count: %u pass %u\n", + "Final argument count: %8.8X pass %u\n", walk_state->arg_count, walk_state->pass_number)); /* - * Handle executable code at "module-level". This refers to - * executable opcodes that appear outside of any control method. + * This case handles the legacy option that groups all module-level + * code blocks together and defers execution until all of the tables + * are loaded. Execute all of these blocks at this time. + * Execute any module-level code that was detected during the table + * load phase. + * + * Note: this option is deprecated and will be eliminated in the + * future. Use of this option can cause problems with AML code that + * depends upon in-order immediate execution of module-level code. */ - if ((walk_state->pass_number <= ACPI_IMODE_LOAD_PASS2) && + if (acpi_gbl_group_module_level_code && + (walk_state->pass_number <= ACPI_IMODE_LOAD_PASS2) && ((walk_state->parse_flags & ACPI_PARSE_DISASSEMBLE) == 0)) { /* * We want to skip If/Else/While constructs during Pass1 because we @@ -340,6 +314,16 @@ acpi_ps_get_arguments(struct acpi_walk_state *walk_state, * object to the global list. Note, the mutex field of the method * object is used to link multiple module-level code objects. * + * NOTE: In this legacy option, each block of detected executable AML + * code that is outside of any control method is wrapped with a temporary + * control method object and placed on a global list below. + * + * This function executes the module-level code for all tables only after + * all of the tables have been loaded. It is a legacy option and is + * not compatible with other ACPI implementations. See acpi_ns_load_table. + * + * This function will be removed when the legacy option is removed. + * ******************************************************************************/ static void @@ -581,7 +565,7 @@ acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state) /* Check for arguments that need to be processed */ ACPI_DEBUG_PRINT((ACPI_DB_PARSE, - "Parseloop: argument count: %u\n", + "Parseloop: argument count: %8.8X\n", walk_state->arg_count)); if (walk_state->arg_count) { |