History log of /linux-master/drivers/acpi/acpica/psloop.c
Revision Date Author Comments
# 612c2932 05-Apr-2023 Bob Moore <robert.moore@intel.com>

ACPICA: Update all copyrights/signons to 2023

ACPICA commit 25bddd1824b1e450829468a64bbdcb38074ba3d2

Copyright updates to 2023.

Link: https://github.com/acpica/acpica/commit/25bddd18
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 487ea80a 11-Apr-2022 Bob Moore <robert.moore@intel.com>

ACPICA: Update copyright notices to the year 2022

ACPICA commit 738d7b0726e6c0458ef93c0a01c0377490888d1e

Affects all source modules and utility signons.

Link: https://github.com/acpica/acpica/commit/738d7b07
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 4441e55d 15-Jan-2021 Bob Moore <robert.moore@intel.com>

ACPICA: Updated all copyrights to 2021

This affects all ACPICA source code modules.

ACPICA commit c570953c914437e621dd5f160f26ddf352e0d2f4

Link: https://github.com/acpica/acpica/commit/c570953c
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Erik Kaneda <erik.kaneda@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 25d866c4 15-Jan-2021 Maximilian Luz <luzmaximilian@gmail.com>

ACPICA: Clean up exception code class checks

ACPICA commit 5a8390fbd4c5c60da0b6d4ba53b5ee34fda9a0cb

With the exception code class check macros fixed in the previous
commit, let us now use those to simplify exception class checks
across ACPICA.

Link: https://github.com/acpica/acpica/commit/5a8390fb
Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Erik Kaneda <erik.kaneda@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 800ba7c5 10-Jan-2020 Bob Moore <robert.moore@intel.com>

ACPICA: All acpica: Update copyrights to 2020 Including tool signons.

ACPICA commit 8b9c69d0984067051ffbe8526f871448ead6a26b

Link: https://github.com/acpica/acpica/commit/8b9c69d0
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Erik Kaneda <erik.kaneda@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# aa342261 15-Feb-2019 Erik Kaneda <erik.kaneda@intel.com>

ACPICA: Remove legacy module-level code support

ACPICA commit 47f5607c204719d9239a12b889df725225098c8f

Module-level code refers to executable ASL code that runs during
table load. This is typically used in ASL to declare named objects
based on a condition evaluated during table load like so:

definition_block(...)
{
opreation_region (OPR1, system_memory, ...)
Field (OPR1)
{
FLD1, 8 /* Assume that FLD1's value is 0x1 */
}

/* The if statement below is referred to as module-level code */

If (FLD1)
{
/* Declare DEV1 conditionally */
Device (DEV1) {...}
}

Device (DEV2)
{
...
}
}

In legacy module-level code, the execution of the If statement
was deferred after other modules were loaded. The order of
code execution for the table above is the following:

1.) Load OPR1 to the ACPI Namespace
2.) Load FLD1 to the ACPI Namespace (not intended for drivers)
3.) Load DEV2 to the ACPI Namespace
4.) Execute If (FLD1) and load DEV1 if the condition is true

This legacy approach can be problematic for tables that look like the
following:

definition_block(...)
{
opreation_region (OPR1, system_memory, ...)
Field (OPR1)
{
FLD1, 8 /* Assume that FLD1's value is 0x1 */
}

/* The if statement below is referred to as module-level code */

If (FLD1)
{
/* Declare DEV1 conditionally */
Device (DEV1) {...}
}

Scope (DEV1)
{
/* Add objects DEV1's scope */
Name (OBJ1, 0x1234)
}
}

When loading this in the legacy approach, Scope DEV1 gets evaluated
before the If statement. The following is the order of execution:

1.) Load OPR1 to the ACPI Namespace
2.) Load FLD1 to the ACPI Namespace (not intended for drivers)
3.) Add OBJ1 under DEV1's scope -- ERROR. DEV1 does not exist
4.) Execute If (FLD1) and load DEV1 if the condition is true

The legacy approach can never succeed for tables like this due to the
deferral of the module-level code. Due to this limitation, a new
module-level code was developed. This new approach exeutes if
statements in the order that they appear in the definition block.
With this approach, the order of execution for the above defintion
block is as follows:

1.) Load OPR1 to the ACPI Namespace
2.) Load FLD1 to the ACPI Namespace (not intended for drivers)
3.) Execute If (FLD1) and load DEV1 because the condition is true
4.) Add OBJ1 under DEV1's scope.

Since DEV1 is loaded in the namespace in step 3, step 4 executes
successfully.

This change removes support for the legacy module-level code
execution. From this point onward, the new module-level code
execution will be the official approach.

Link: https://github.com/acpica/acpica/commit/47f5607c
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 840c02ca 14-Jan-2019 Bob Moore <robert.moore@intel.com>

ACPICA: All acpica: Update copyrights to 2019

ACPICA commit 62f4f98e941d86e41969bf2ab5a93b8dc94dc49e

The update includes userspace tool signons.

Link: https://github.com/acpica/acpica/commit/62f4f98e
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 178a0f63 13-Dec-2018 Erik Kaneda <erik.kaneda@intel.com>

ACPICA: Remove defines that use deprecated flag

This commit removes the use of ACPI_NO_METHOD_EXECUTE flag

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 927a6abf 05-Nov-2018 Bob Moore <robert.moore@intel.com>

ACPICA: iASL: Enhance error detection

Enhance error detection by validating that all name_seg elements
within a name_path actually exist. The previous behavior was spotty
at best, and such errors could be improperly ignored at compile
time (never at runtime, however). There are two new error messages.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 08930d56 17-Oct-2018 Erik Kaneda <erik.kaneda@intel.com>

ACPICA: Remove acpi_gbl_group_module_level_code and only use acpi_gbl_execute_tables_as_methods instead

acpi_gbl_group_module_level_code and acpi_gbl_execute_tables_as_methods were
used to enable different table load behavior. The different table
load behaviors are as follows:

A.) acpi_gbl_group_module_level_code enabled the legacy approach where
ASL if statements are executed after the namespace object has
been loaded.
B.) acpi_gbl_execute_tables_as_methods is currently used to enable the
table load to be a method invocation. This meaning that ASL If
statements are executed in-line rather than deferred until after
the ACPI namespace has been populated. This is the correct
behavior and option A will be removed in the future.

We do not support a table load behavior where these variables are
assigned the same value. In otherwords, we only support option A or B
and do not need acpi_gbl_group_module_level_code to enable A. From now on,
acpi_gbl_execute_tables_as_methods == 0 enables option A and
acpi_gbl_execute_tables_as_methods == 1 enables option B.

Note: option A is expected to be removed in the future and option B
will become the only supported table load behavior.

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# c64baa3a 17-Oct-2018 Erik Kaneda <erik.kaneda@intel.com>

ACPICA: AML Parser: fix parse loop to correctly skip erroneous extended opcodes

AML opcodes come in two lengths: 1-byte opcodes and 2-byte, extended opcodes.
If an error occurs due to illegal opcodes during table load, the AML parser
needs to continue loading the table. In order to do this, it needs to skip
parsing of the offending opcode and operands associated with that opcode.

This change fixes the AML parse loop to correctly skip parsing of incorrect
extended opcodes. Previously, only the short opcodes were skipped correctly.

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Cc: All applicable <stable@vger.kernel.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 4a7c94c7 10-Aug-2018 Erik Kaneda <erik.kaneda@intel.com>

ACPICA: AML Parser: skip opcodes that open a scope upon parse failure

This change skips the entire length of opcodes that open a scope
(Device, Scope, Processor, etc) if the creation of the op fails. The
failure could be caused by various errors including AE_ALREADY_EXISTS
and AE_NOT_FOUND.

Reported-by: Jeremy Linton <jeremy.linton@arm.com>
Tested-by: Jeremy Linton <jeremy.linton@arm.com>
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Cc: 4.17+ <stable@vger.kernel.org> # 4.17+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# d46b6537 10-Aug-2018 Erik Kaneda <erik.kaneda@intel.com>

ACPICA: AML Parser: ignore all exceptions resulting from incorrect AML during table load

Macros to classify different AML exception codes have been added in
order to ignore the exceptions,

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
[ rjw: Fix damaged white space ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 460a5310 28-Jul-2018 Erik Kaneda <erik.kaneda@intel.com>

ACPICA: AML Parser: ignore control method status in module-level code

Previous change in the AML parser code blindly set all non-successful
dispatcher statuses to AE_OK. That approach is incorrect, though,
because successful control method invocations from module-level
return AE_CTRL_TRANSFER. Overwriting AE_OK to this status causes the
AML parser to think that there was no return value from the control
method invocation.

Fixes: 92c0f4af386 (ACPICA: AML Parser: ignore dispatcher error status during table load)
Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Tested-by: Linus Torvalds <torvalds@linux-foundation.org>
Tested-by: Oleksandr Natalenko <oleksandr@natalenko.name>
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 73c2a01c 19-Jul-2018 Erik Kaneda <erik.kaneda@intel.com>

ACPICA: AML Parser: ignore dispatcher error status during table load

The dispatcher and the executer process the parse nodes During table
load. Error status from the evaluation confuses the AML parser. This
results in the parser failing to complete parsing of the current
scope op which becomes problematic. For the incorrect AML below, _ADR
never gets created.

definition_block(...)
{
Scope (\_SB)
{
Device (PCI0){...}
Name (OBJ1, 0x0)
OBJ1 = PCI0 + 5 // Results in an operand error.
} // \_SB not closed

// parser looks for \_SB._SB.PCI0, results in AE_NOT_FOUND error
// Entire scope block gets skipped.
Scope (\_SB.PCI0)
{
Name (_ADR, 0x0)
}
}

Fix the above error by properly completing the initial \_SB scope
after an error by clearing errors that occur during table load. In
the above case, this means that OBJ1 = PIC0 + 5 is skipped.

Fixes: 5088814a6e93 (ACPICA: AML parser: attempt to continue loading table after error)
Link: https://bugzilla.kernel.org/show_bug.cgi?id=200363
Tested-by: Bastien Nocera <hadess@hadess.net>
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Cc: 4.17+ <stable@vger.kernel.org> # 4.17+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 5088814a 01-Jun-2018 Erik Kaneda <erik.kaneda@intel.com>

ACPICA: AML parser: attempt to continue loading table after error

This change alters the parser so that the table load does not abort
upon an error.

Notable changes:

If there is an error while parsing an element of the termlist, we
will skip parsing the current termlist element and continue parsing
to the next opcode in the termlist.

If we get an error while parsing the conditional of If/Else/While or
the device name of Scope, we will skip the body of the statement all
together and pop the parser_state.

If we get an error while parsing the base offset and length of an
operation region declaration, we will remove the operation region
from the namespace.

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# a406dea8 14-Mar-2018 Bob Moore <robert.moore@intel.com>

ACPICA: Cleanup/simplify module-level code support

This prepares the code for eventual removal of the original
style of deferred execution of the MLC.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 95857638 14-Mar-2018 Erik Kaneda <erik.kaneda@intel.com>

ACPICA: adding SPDX headers

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 1ef63231 15-Feb-2018 Bob Moore <robert.moore@intel.com>

ACPICA: Update for some debug output. No functional change

ACPICA commit 3a08436fe3bff297a6de162252964e955946c7d3

Improve/simplify some of the debug messages.

Link: https://github.com/acpica/acpica/commit/3a08436f
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# da6f8320 04-Jan-2018 Bob Moore <robert.moore@intel.com>

ACPICA: All acpica: Update copyrights to 2018

including tool signons.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# a62a7117 03-Aug-2017 Bob Moore <robert.moore@intel.com>

ACPICA: Implement deferred resolution of reference package elements

ACPICA commit 0c08790c56fdf0dc081ae869495a09d8c4230854

This change defers the resolution of package elements that
are named references until after the entire namespace has been
loaded from the definition block. This allows such references
to be in fact forward references for both module level code
and control methods.

Link: https://github.com/acpica/acpica/commit/0c08790c
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 9cf7adec 27-Apr-2017 Bob Moore <robert.moore@intel.com>

ACPICA: iasl: add ASL conversion tool

ACPICA commit c04d310039d3e0ed1cb62876fe7e596fbc75ab01
ACPICA commit a65c1df7e6b4bad8e37df822018c40c6c446add9

The key feature of this utility is that the original comments within
the input ASL files are preserved during the conversion process, and
included within the converted ASL+ file -- thus creating a transparent
conversion of existing ASL files to ASL+ (ASL 2.0)

This patch is an automatic generation of the ASL converter commit,
Linux kernel isn't affected by the functionality provided in this
commit, but requires the linuxized changes to support future ACPICA
release automation.

Link: https://github.com/acpica/acpica/commit/c04d3100
Link: https://github.com/acpica/acpica/commit/a65c1df7
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Jung-uk Kim <jkim@FreeBSD.org>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 9ff5a21a 26-Apr-2017 Bob Moore <robert.moore@intel.com>

ACPICA: Cleanup AML opcode definitions, no functional change

ACPICA commit ec969d38fef3be95358e65f0dd071b5f2c045b6b

This change is a cleanup and further standardization of the AML
opcode defines in amlcode.h

Improves the readability and maintainability of the source code.

Link: https://github.com/acpica/acpica/commit/ec969d38
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 7735ca0e 07-Feb-2017 Bob Moore <robert.moore@intel.com>

ACPICA: Source tree: Update copyright notices to 2017

ACPICA commit 16577e5265923f4999b4d2c0addb2343b18135e1

Affects all files.

Link: https://github.com/acpica/acpica/commit/16577e52
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# ce87e09d 28-Dec-2016 Bob Moore <robert.moore@intel.com>

ACPICA: Parser: Allow method invocations as target operands

ACPICA commit a6cca7a4786cdbfd29cea67e84b5b01a8ae6ff1c

Method invocations as target operands are allowed as target
operands in the ASL grammar. This change implements support
for this. Method must return a reference for this to work
properly at runtime, however.

Link: https://github.com/acpica/acpica/commit/a6cca7a4
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# c8100dc4 14-Jan-2016 Bob Moore <robert.moore@intel.com>

ACPICA: Additional 2016 copyright changes

All tool/utility signons.
Dual-license module header.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 89438f96 28-Dec-2015 Bob Moore <robert.moore@intel.com>

ACPICA: Parser: Add constants for internal namepath function

ACPICA commit b216e39fe85feee955d29fe0a7190dd811e181ea

Add true/false constants for the "PossibleMethodCall" parameter
for acpi_ps_get_next_namepath.

Link: https://github.com/acpica/acpica/commit/b216e39f
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 1fad8738 28-Dec-2015 Bob Moore <robert.moore@intel.com>

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

ACPICA commit dfa394471f6c01b2ee9433dbc143ec70cb9bca72

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

Link: https://github.com/acpica/acpica/commit/dfa39447
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 25823e78 24-Aug-2015 Bob Moore <robert.moore@intel.com>

ACPICA: Add additional debug info/statements

ACPICA commit 74094ca9f51e2652a9b5f01722d8640a653cc75a

For _REG methods and module-level code blocks.
For acpiexec, add deletion of module-level blocks in case
of an early abort.

Link: https://github.com/acpica/acpica/commit/74094ca9
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# ec4252a6 22-Jul-2015 Lv Zheng <lv.zheng@intel.com>

ACPICA: Parser: Remove redundant opcode execution debugging output

ACPICA commit c832b0a9263c560b3ae3ae31d7298ef33988f8d5

This patch removes one redundant debugging output of opcode execution which
has already been covered by acpi_ex_start_trace_opcode(). Lv Zheng.

Link: https://github.com/acpica/acpica/commit/c832b0a9
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# ab6c5733 22-Jul-2015 Lv Zheng <lv.zheng@intel.com>

ACPICA: Executer: Add interpreter tracing mode for method tracing facility

ACPICA commit 07fffd02607685b655ed92ee15c160e6a810b60b

The acpi_debug_trace() is the mechanism known as ACPI method tracing that is
used by Linux as ACPICA debugging message reducer. This facility can be
controlled through Linux ACPI subsystem - /sys/module/acpi/parameters.
This facility requires CONFIG_ACPI_DEBUG to be enabled to see ACPICA trace
logs in the kernel dmesg output.

This patch enhances acpi_debug_trace() to make it not only a message reducer,
but a real tracer to trace AML interpreter execution. Note that in addition
to the AML tracer enabling, this patch also updates the facility with the
following enhancements:
1. Allow a full path to be specified by the acpi_debug_trace() API.
2. Allow any method rather than just the entrance of acpi_evaluate_object()
to be traced.
3. All interpreter ACPI_LV_TRACE_POINT messages are collected for
ACPI_EXECUTER layer.

The Makefile of drivers/acpi/acpica is also updated to include exdebug.o
and the duplicated stubs are removed after that.

Note that since this patch has enhanced the method tracing facility, Linux
need also be updated after applying this patch. Lv Zheng.

Link: https://github.com/acpica/acpica/commit/07fffd02
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# a616dc2f 22-Jul-2015 Lv Zheng <lv.zheng@intel.com>

ACPICA: Dispatcher: Add trace support for interpreter

ACPICA commit 71299ec8b49054daace0df50268e8e055654ca37

This patch adds trace point at the following point:
1. Begin/end of a control method execution;
2. Begin/end of an opcode execution.

The trace point feature can be enabled by defining ACPI_DEBUG_OUTPUT
and specifying a debug level that includes ACPI_LV_TRACDE_POINT and the
debug layers that include ACPI_PARSER and ACPI_DISPACTCHER.

In order to make aml_op_name of union acpi_parse_object usable for tracer, it is
enabled for ACPI_DEBUG_OUTPUT in this patch. Lv Zheng.

Link: https://github.com/acpica/acpica/commit/71299ec8
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 62eb935b 22-Jul-2015 Lv Zheng <lv.zheng@intel.com>

ACPICA: Dispatcher: Cleanup union acpi_operand_object's AML address assignments

ACPICA commit afb52611dbe7403551f93504d3798534f5c343f4

This patch cleans up the code of assigning the AML address to the
union acpi_operand_object.

The idea behind this cleanup is:
The AML address of the union acpi_operand_object should always be determined at
the point where the object is encountered. It should be started from the
first byte of the object. For example, the opcode of the object, the name
string of the user_term object, or the first byte of the packaged object
(where a pkg_length is prefixed). So it's not cleaner to have it assigned
here and there in the entire ACPICA source tree.

There are some special cases for the internal opcodes, before cleaning up
the internal opcodes, we should also determine the rules for the AML
addresses of the internal opcodes:
1. INT_NAMEPATH_OP: the address of the first byte for the name_string.
2. INT_METHODCALL_OP: the address of the first byte for the name_string.
3. INT_BYTELIST_OP: the address of the first byte for the byte_data list.
4. INT_EVAL_SUBTREE_OP: the address of the first byte for the
Region/Package/Buffer/bank_field/Field arguments.
5. INT_NAMEDFIELD_OP: the address to the name_seg.
6. INT_RESERVEDFIELD_OP: the address to the 0x00 prefix.
7. INT_ACCESSFIELD_OP: the address to the 0x01 prefix.
8. INT_CONNECTION_OP: the address to the 0x02 prefix.
9: INT_EXTACCESSFIELD_OP: the address to the 0x03 prefix.
10.INT_RETURN_VALUE_OP: the address of the replaced operand.
11.computational_data: the address to the
Byte/Word/Dword/Qword/string_prefix.

Before cleaning up the internal root scope of the aml_walk, turning it into
the term_list, we need to remember the aml_start address as the "Aml"
attribute for the union acpi_operand_object created by acpi_ps_create_scope_op().

Finally, we can delete some redundant AML address assignment in psloop.c.

Link: https://github.com/acpica/acpica/commit/afb52611
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 950a429c 22-Jul-2015 Lv Zheng <lv.zheng@intel.com>

ACPICA: Parser: Cleanup aml_offset in union acpi_operand_object

ACPICA commit 61b360074fde2bb8282722579410f5d1fb12f84d

This patch converts aml_offset in union acpi_operand_object to AML address.

AML offset is actually only used by the debugger, using AML address is more
direct and efficient during the parsing stage so that we don't need to
calculate the offset during the parsing stage and will not have
difficulities in converting it into other offset attributes.

Sometimes, aml_offset is not an indication of the offset from the table
header but the offset from the entry of a list of terms, which requires
additional efforts to convert it into an offset from the table header. By
using AML address directly, there is no such difficulty.
Thus this patch also deletes a logic in disassembler that is trying to
convert the aml_offset from
"offset from the start address of Method/Package/Buffer"
into the
"offset from the start address of the ACPI table"
(Sample code deletion can be seen in acpi_dm_deferred_parse(), but the
function is not in the Linux kernel). Lv Zheng.

Link: https://github.com/acpica/acpica/commit/61b36007
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 83482f75 22-Jul-2015 Lv Zheng <lv.zheng@intel.com>

ACPICA: Parser: Cleanup aml_offset in struct acpi_walk_state

ACPICA commit d254405814495058276c0c2f9d96794d15a6c91c

This patch converts aml_offset in struct acpi_walk_state to AML address.

AML offset is actually only used by the debugger, using AML address is more
direct and efficient during the parsing stage so that we don't need to
calculate it during the parsing stage.

On the other hand, we can see several issues in the current parser logic
around the aml_offset:
1. union acpi_operand_object.Common.aml_offset is redundantly assigned in
acpi_ps_parse_loop().
2. aml_offset is not an indication of the offset from the table header but
the offset from the entry of a list of objects. Sometimes, it indicates
an entry for a Method/Package/Buffer, which makes it difficult to be
reversely calculated to a table header offset.
3. When being used with method tracers (for example, Linux function trace),
it's better to have AML address logged instead of the AML offset because
the address is the only attribute that can uniquely identify the opcode.
This patch is required to solve the above issues. Lv Zheng.

Link: https://github.com/acpica/acpica/commit/d2544058
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# eb87a052 22-Jul-2015 Lv Zheng <lv.zheng@intel.com>

ACPICA: Parser: Reduce parser/namespace divergences for tracer support

This patch reduces divergences in parser/namespace components so that the
follow-up linuxized ACPICA upstream commits can be directly merged.
Including the fix to an indent issue reported and fixed by Zhouyi Zhou.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Zhouyi Zhou <yizhouzhou@ict.ac.cn>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 82a80941 05-Feb-2015 David E. Box <david.e.box@linux.intel.com>

ACPICA: Update Copyright headers to 2015

ACPICA commit 8990e73ab2aa15d6a0068b860ab54feff25bee36

Link: https://github.com/acpica/acpica/commit/8990e73a
Signed-off-by: David E. Box <david.e.box@linux.intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 22b5afce 24-Mar-2014 Bob Moore <robert.moore@intel.com>

ACPICA: Add auto-serialization support for ill-behaved control methods.

This change adds support to automatically mark a control method as
"serialized" if the method creates any named objects. This will
positively prevent the method from being entered by more than one
thread and thus preventing a possible abort when an attempt is
made to create an object twice.

Implemented by parsing all non-serialize control methods at table
load time.

This feature is disabled by default and this patch also adds a new
Linux kernel parameter "acpi_auto_serialize" to allow this feature
to be turned on for a specific boot.

References: https://bugzilla.kernel.org/show_bug.cgi?id=52191
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# fbb7a2dc 07-Feb-2014 Bob Moore <robert.moore@intel.com>

ACPICA: Update ACPICA copyrights to 2014.

Update ACPICA copyrights to 2014. Includes all source headers and
signons for the various tools.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 1d1ea1b7 07-Jun-2013 Chao Guan <chao.guan@intel.com>

ACPICA: Standardize all switch() blocks

After many years, different formatting for switch() has crept in.
This change makes every switch block identical. Chao Guan.
ACPICA bugzilla 997.

References: https://bugs.acpica.org/show_bug.cgi?id=997
Signed-off-by: Chao Guan <chao.guan@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 25f044e6 24-Jan-2013 Bob Moore <robert.moore@intel.com>

ACPICA: Update ACPICA copyrights to 2013

Includes all source headers and signons for the various tools.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 42f8fb75 11-Jan-2013 Bob Moore <robert.moore@intel.com>

ACPICA: Source restructuring: split large files into 8 new files.

Created logical splits for eight new files. Improves modularity
and configurability.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# c8d586f8 30-Dec-2012 Bob Moore <robert.moore@intel.com>

ACPICA: Lint changes, no functional change.

Some changes from lint.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 17b1f45a 30-Oct-2012 Bob Moore <robert.moore@intel.com>

ACPICA: Update for 64-bit generation of recent error message changes

Fix for errors on printf changes on 64-bit platforms and gcc.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 97171c6b 30-Oct-2012 Bob Moore <robert.moore@intel.com>

ACPICA: Add starting offset parameter to common dump buffer routine

Rename the dump buffer routines. Offset parameter can specify the
buffer starting offset that is used when displaying each line of
the buffer.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 00eb3255 30-Oct-2012 Bob Moore <robert.moore@intel.com>

ACPICA: Enhance error reporting for invalid opcodes and bad ACPI_NAMEs

For disassembler, dump the 48 bytes surrounding the invalid
opcode. Fix incorrect table offset reported for invalid opcodes.
Report original 32-bit value for bad ACPI_NAMEs.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# 86ff0e50 30-Oct-2012 Lv Zheng <lv.zheng@intel.com>

ACPICA: Fix unmerged acmacros.h divergences.

The 20121018 release depends on some unmerged acmaros.h fixes.
This patch includes the fixes made on acmaros.h that will not affect
the generated vmlinux binary.

This patch will not affect the generated vmlinux binary.
This will decrease 157 lines of 20120913 divergence.diff.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>


# ba494bee 11-Jul-2012 Bob Moore <robert.moore@intel.com>

ACPICA: AcpiSrc: Fix some translation issues for Linux conversion

Fixes issues like this:

i_aSL -> iASL
00-7_f -> 00-7F
local_fADT -> local_FADT
execute_oSI -> execute_OSI

Also, in function headers, the parameters are now translated to
lower case (with underscores if necessary.)

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>


# 77848130 11-Jan-2012 Bob Moore <robert.moore@intel.com>

ACPICA: Update all copyrights to 2012

Update all copyrights to 2012.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>


# b4e104ea 16-Jan-2011 Bob Moore <robert.moore@intel.com>

ACPICA: Update all ACPICA copyrights and signons to 2011

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>


# 26294842 11-Jan-2011 Lin Ming <ming.m.lin@intel.com>

ACPICA: Fix issues/fault with automatic "serialized" method support

History: This support changes a method to "serialized" on the fly if the
method generates an AE_ALREADY_EXISTS error, indicating the possibility
that it cannot handle reentrancy.

This fix repairs a couple of issues seen in the field, especially on
machines with many cores.

1) Delete method children only upon the exit of the last thread, so
as to not delete objects out from under running threads.

2) Set the "serialized" bit for the method only upon the exit of the
last thread, so as to not cause deadlock when running threads attempt
to exit.

3) Cleanup the use of the AML "MethodFlags" and internal method flags
so that there is no longer any confustion between the two.

Reported-by: Dana Myers <dana.myers@oracle.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>


# f6a22b0b 05-Mar-2010 Bob Moore <robert.moore@intel.com>

ACPICA: Standardize integer output for ACPICA warnings/errors

Always use 0x prefix for hex output, use %u for integer output
(all integers are unsigned.)

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>


# a8357b0c 22-Jan-2010 Bob Moore <robert.moore@intel.com>

ACPICA: Update all ACPICA copyrights and signons to 2010

Add 2010 copyright to all module headers and signons, including
the Linux header. This affects virtually every file in the ACPICA
core subsystem, iASL compiler, and all utilities.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>


# 9a884ab6 11-Nov-2009 Lin Ming <ming.m.lin@intel.com>

ACPICA: Add additional module-level code support

This change will execute module-level code that is not at the
root of the namespace (under a Device object, etc.).
ACPICA BZ 762.

http://www.acpica.org/bugzilla/show_bug.cgi?id=762

Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>


# 7f0c826a 13-Aug-2009 Lin Ming <ming.m.lin@intel.com>

ACPICA: Add support for module-level executable AML code

Add limited support for executable AML code that exists outside
of any control method. This type of code has been illegal since
ACPI 2.0. The code must exist in an If/Else/While block. All AML
tables are supported, including tables that are dynamically loaded.
ACPICA BZ 762.

http://acpica.org/bugzilla/show_bug.cgi?id=762

Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>


# e2f7a777 08-Jan-2009 Len Brown <len.brown@intel.com>

ACPICA: hide private headers

Signed-off-by: Len Brown <len.brown@intel.com>


# 95b482a8 08-Jan-2009 Len Brown <len.brown@intel.com>

ACPICA: create acpica/ directory

also, delete sleep/ and delete ACPI_CFLAGS from Makefile

Signed-off-by: Len Brown <len.brown@intel.com>