13440 Commits

Author SHA1 Message Date
Erik Schmauss
531a661195 iASL: update the OwnerId when duplicate externals are found because they could have appeared in different tabels.
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-05-03 15:30:48 -07:00
Erik Schmauss
dc167976cf Disassembler: simplify if statement during namespace load
Because the AML has been parsed at this point, assume that the
parse object has been constructed properly.

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-05-03 15:27:35 -07:00
Erik Schmauss
c1b0ca1956 Disassembler: use more meaningful statuses than AE_ERROR
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-05-03 15:23:40 -07:00
Erik Schmauss
200e49b56b Disassembler: fixing trace mechanism in AcpiDmMarkExternalConflict
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-05-03 15:18:59 -07:00
Erik Schmauss
7991e5745c Disassembler: trivial style edits, no functional change
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-05-03 15:14:44 -07:00
Erik Schmauss
0ff00c6f96 Disassembler: get rid of unnecessary resolution of external Op and treat external op as AML_NAMED parse object
Since External Ops are resolved during namespace load, the code
that resolves external ops within AcpiDmXrefDescendingWalk can
be removed. Because AML_EXTERNAL_OP is an AML_NAMED object, handle
External Ops similar to AML_NAMED objects.

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-05-03 11:06:50 -07:00
Erik Schmauss
e0fa798546 disassembler: add check of conflicting external declarations to AcpiDmEmitExternal.
This is different than AcpiDmEmitExternals due to the fact that
AcpiDmEmitExternal generates ASL based off of the parse tree
rather than AcpiGbl_ExternalList. This check searches
AcpiGbl_ExternalList to see if the External declaration being
emitted is a conflicting external declaration or not.

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-05-03 11:06:50 -07:00
Erik Schmauss
5b046951b4 disassembler: print warning message when emitting conflicting external declarations when using AcpiDmEmitExternals.
Conflicting external declarations are illegal in ASL. When the
disassembler encounters a conflicting external in the AML, the
conflicting external is emitted with a comment warning the user
that a conflicting external has been emitted. The alternative
approach to handling conflicting external declarations within
AML is for the disassembler to abort. This approach is not
preferred because the purpose of the disassembler is to
disassemble the AML rather than prevent the disassembly due to
the quality of AML.

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-05-03 11:06:50 -07:00
Erik Schmauss
0ed9f2e2cc Disassembler: allow conflicting external declarations to be emitted.
An external declaration is a conflicting declaration when a name has
been declared as an external and a named object within the same file.

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-05-03 11:06:50 -07:00
Erik Schmauss
a388ef1ae0 Externals: refactor AcpiDmAddNodeToExternalList to use AcpiDmGetExternalInternalPath and AcpiDmRemoveRootPrefix
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-05-03 11:06:50 -07:00
Erik Schmauss
ed5a0d6927 Externals: Extract AcpiDmRemoveRootPrefix and AcpiDmGetExternalAndInternalPath from AcpiDmAddNodeToExternalList for modularity
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-05-03 11:06:50 -07:00
Erik Schmauss
117be48195 Disassembler: add external op to namespace on first pass
By doing so, external control method resolutions can be resolved like
normal control methods. This eliminates the need to reparse the aml
all over again for external control methods that were encoded within
the aml with the 0x15 bytecode.

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-05-03 11:06:50 -07:00
Erik Schmauss
07b67810af Disassembler: Refactor AcpiDmAddExternalsToNamespace
This is done because there are certain parts of this function that need
to be used elsewhere in the code base.

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-05-03 11:06:50 -07:00
Erik Schmauss
c512c2bfcc Disassembler: prevent external op's from opening a new scope.
Since Externals could be of ACPI_TYPE_METHOD, there is a possibility
that the AcpiNsLookup may cause a new scope to be opened. Therefore,
disable opening the scope for all AcpiNsLookup invocations that deal
with externals.

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-05-03 11:06:50 -07:00
Erik Schmauss
34f27569bd Compiler: prevent PARSEOP_EXTERNAL from opening a scope.
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-05-03 11:06:50 -07:00
Erik Schmauss
d1dc888007 Disassembler: Adjust disassembly of externals due to changing externals to named objects
This means that the namepath of external ops should be referenced as Op->Named.Path rather
than Op->Common.Value.Name.

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-05-03 11:06:50 -07:00
Erik Schmauss
0372deae1e Changing AcpiDmGetExternalMethodCount to AcpiDmGetUnresolvedExternalMethodCount.
This method has been changed to count methods that are not resolved at this
point. Resolved methods do not need to be reparsed since the amount of
arguments should be known after it is parsed in PsParseLoop.

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-05-03 11:06:50 -07:00
Erik Schmauss
0e0a87111f Changed Gbl_DisasmFlag to AcpiGbl_DisasmFlag
This is a name change as well as a change in the scope of this flag.
This is done so that it can be referenced in the dispatcher.

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-05-03 11:06:50 -07:00
Erik Schmauss
0d5dd42fd7 Changing External to a named object.
This is done so that the aml parser will build the parse tree of
External Op as a named object. This is done to streamline creation
of external op parse nodes and facilitate namespace resolution of
externals.

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-05-03 11:06:50 -07:00
Lv Zheng
49f041a2f1 ASLTS: exc_result2: Fix old m689 breakage (exceptional)
When tests are meant to return exceptions, proceeding causes unexpected
number of exceptions left. This patch fixes such issues by interrupting the
tests when exception is expected. Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
2017-05-03 15:06:29 +08:00
Lv Zheng
2f79a52433 ASLTS: rstore: Fix old m689 breakage (store matrix)
The p6a0 store matrix is used to indicate "Stroe" allowable types while
b67a contains indexes to this matrix.
1. Row[3] is used for Package target,
   Row[4] is used for Method target,
   Row[5] is used for Non-computational data (Device/Event/...) target.
2. Col[2] is used for FIXED fields result,
   Col[3] is used for Computational data (Integer/String/Buffer) result,
   Col[4] is used for Package result.
As it is not possible to:
1. Store(Package/Method/Noncomputation, Field/Computationl/Package)
2. Store(Method/Noncomputation, Field/Computational)
We must change the matrix to reflect the validated Windows behavior. By
doing so, several m689 failures are fixed. Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
2017-05-03 15:06:29 +08:00
Lv Zheng
a12a7052a1 ASLTS: region: Fix old m702 breakage
In m702 tests, there are 2 lines trying to exclude 2 test cases, while
the test cases should be valid. OTOH, GeneralPurposeIo test is not
correct, it shouldn't validate the region access result as we don't
implement fully functioning region handlers in acpiexec. This patch fixes
these breakage. Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
2017-05-03 15:06:29 +08:00
Lv Zheng
8d8926ae4d ASLTS: reference: Fix old m34d breakage
Store(Integer/String/Buffer, Package) results in AE_AML_TARGET_TYPE. This
patch fixes ASLTS failures by removing these invalid test cases.

Note that m34d is not a kind of coverage test that also validates if
invalid Store test cases can trigger exceptions, it only contains valid
Store test cases where the results' ObjectType can be compared, so we
should just remove the invalid test cases instead of adding exception
check. Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
2017-05-03 15:06:29 +08:00
Lv Zheng
14a1c31432 ASLTS: scripts: Fix directory name of Identity2MS tests
This patch fixes the Identity2MS collection's directory name of its
sub-test-cases in order to fix unexpected error occurred to the following
command:
  aslts.sh -u -m n32 -c extra_aslts
The Identity2MS test cases are located at Identity2MS/abbu, rather than
Identity2MS/extra or Identity2MS/extra_aslts. Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
2017-05-03 15:06:29 +08:00
Erik Schmauss
b7eb1a90b3 iasl: trivial style fix. No functional change.
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-05-02 14:41:06 -07:00
Erik Schmauss
979346922f ASLTS: get rid of External declaration for _ERR because it is a redefinition of _ERR.
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-05-02 14:41:06 -07:00
Erik Schmauss
24a5af09ee iasl: add extra conditionals to identify redeclarations of named objects and/or externals.
If there is an external declaration and named object declaration with the
same name within the same table, this is considered a redefinition of that
named object or external.

For example, the following ASL code is considered a redeclaration:

DefinitonBlock (...)
{
    Name(abcd, 0)
    External(abcd)
}

This change enables the compiler to emit an error when compiling ASL code
that is similar to the above example.

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-05-02 14:41:06 -07:00
Erik Schmauss
df74adb649 iasl: generate a different OwnerId for each definition block.
By doing so, we can label each namespace node with a particular OwnerId.
This will be used in later changes to help identify redeclarations in
the presence of Externals.

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-05-02 14:41:06 -07:00
Robert Moore
e71f4639a9 Merge pull request #257 from SchmErik/asltsExternalTests01
Aslts external tests01
2017-05-02 14:30:22 -07:00
Erik Schmauss
3dda379ed4 ASLTS: fix spelling error
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-05-02 13:50:55 -07:00
Erik Schmauss
34bc64edf0 ASLTS: adding external statement test case so that they can be run by aslts.sh
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-05-02 12:42:52 -07:00
Erik Schmauss
46d3b8a88a ASLTS: adding tests for externals
This test ensures that each external declaration is resolved to the proper named objects.

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-05-02 12:42:52 -07:00
Erik Schmauss
06dddc5318 ASLTS: update comments, no functional change
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-05-02 12:42:52 -07:00
Erik Schmauss
9c2774ff5e ASLTS: fixing indentation and style, no functional change
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-05-02 12:42:52 -07:00
Robert Moore
73f7fab137 Update two error messages to emit control method name
Intention is to improve debugging by clarifying which method
has caused the error, in acpi_evaluate_object_typed.
2017-04-28 13:31:07 -07:00
Robert Moore
8170690c79 Revert "Update two error/debug messages, no functional change"
This reverts commit f5046066675799a200ea7082467926208bf3aa24.

GetMutexName can only be used for debug output.
2017-04-28 08:28:00 -07:00
Robert Moore
cd816f3948 Merge pull request #255 from zetalog/acpica-1703
Acpica 1703
2017-04-27 14:45:05 -07:00
Robert Moore
f504606667 Update two error/debug messages, no functional change
Always emit the actual mutex name for these messages.
2017-04-27 14:13:14 -07:00
Lv Zheng
e30ebbb92f acpisrc: Fix linuxize conversion of converter structures
Converter related structures are released to Linux kernel while they
are not correctly linuxized. This patch fixes this issue. Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
2017-04-27 17:23:47 +08:00
Robert Moore
27bc126d39 Merge pull request #254 from SchmErik/trivialFix005
iasl: only convert // comments to /* during conversion
2017-04-21 12:23:33 -07:00
Erik Schmauss
62eb112ca8 Converter: fix generation of include statements.
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-04-21 12:08:36 -07:00
Erik Schmauss
188a695513 iasl: only convert // comments to /* during conversion
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-04-21 11:26:34 -07:00
Robert Moore
89565151aa Fix for Device/Thermal objects with ObjectType and DerefOf
These types must be special cased because the namespace node
does not contain a subobject as do all other types.
2017-04-21 10:57:03 -07:00
Robert Moore
022e61a023 Merge pull request #241 from zetalog/acpica-gcc
Acpica gcc
2017-04-21 07:56:49 -07:00
Robert Moore
7d0b06a918 iASL: Additional handling of multiple extraneous parentheses
This change enhances the capability of the compiler to handle
multiple extraneous parens, for example:

Return (((((((((((INT1)))))))))))

ACPICA BZ 1380
2017-04-20 13:23:31 -07:00
Robert Moore
d9861dae21 Comment update: spelling/format. No functional change
Fix some spelling errors and reformat some long lines
With assistance from
Cao jin <caoj.fnst@cn.fujitsu.com>
2017-04-20 07:59:18 -07:00
Robert Moore
0f9aaa3cd5 Merge pull request #253 from SchmErik/trivialFix004
Fix typo
2017-04-18 10:09:36 -07:00
Erik Schmauss
45eb6384fb Update comments, no functional change
Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-04-18 09:46:37 -07:00
Erik Schmauss
cef42782fd Fix typo
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-04-14 15:47:38 -07:00
Robert Moore
00906ae0af Split resource descriptor decode strings to a new file
There are enough of these strings to justify a separate file.
Also, these strings are only used for the disassembler and
the debugger. Thus, this change improves ACPICA modularity.
2017-04-14 09:16:27 -07:00