>From what I can see in this bug report, the issue being reported is not
a bug.  Removing the External() reference mentioned is the clue.

When iasl is decompiling a DSDT/SSDT, if there are external references
in the AML, it needs to know about the argument list to the externally
defined object to generate proper code.  In very old versions of iasl,
such as 20061109 mentioned here, this was not handled well at all,
either in iasl, nor in AML.  This has since been changed in the ACPI
specification so that now iasl can capture the argument list info that
it needs to work properly.  However, that also means that iasl needs
to be provided with *all* of the DSDTs/SSDTs that contain all of the
definitions of the externals being referenced.  If iasl does not have
all of the definitions needed, it cannot decompile properly and ergo
cannot recompile what it decompiled.

In more recent versions of iasl, the issue is specifically called out
if discovered.  For example, on my laptop, a Lenovo t540s:

$ iasl -d DSDT

Intel ACPI Component Architecture
ASL+ Optimizing Compiler version 20160108-64
Copyright (c) 2000 - 2016 Intel Corporation

Input file DSDT, Length 0x10DFE (69118) bytes
ACPI: DSDT 0x0000000000000000 010DFE (v01 LENOVO TP-GJ    00002280 INTL
20120711)
Pass 1 parse of [DSDT]
Pass 2 parse of [DSDT]
Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)

Parsing completed
ACPI Error: External method arg count mismatch _SB_.PCI0.VID_.GLIS:
Current 2, attempted 1 (20160108/dmextern-822)
ACPI Error: External method arg count mismatch _SB_.PCI0.VID_.GLIS:
Current 2, attempted 1 (20160108/dmextern-822)
ACPI Error: External method arg count mismatch _SB_.PCI0.VID_.GLIS:
Current 2, attempted 1 (20160108/dmextern-822)
ACPI Error: External method arg count mismatch _SB_.PCI0.VID_.GLIS:
Current 2, attempted 1 (20160108/dmextern-822)

Found 8 external control methods, reparsing with new information
Pass 1 parse of [DSDT]
Pass 2 parse of [DSDT]
Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)

Parsing completed
Disassembly completed
ASL Output:    DSDT.dsl - 559007 bytes

iASL Warning: There were 8 external control methods found during
disassembly, but additional ACPI tables to resolve these externals
were not specified. The resulting disassembler output file may not
compile because the disassembler did not know how many arguments
to assign to these methods. To specify the tables needed to resolve
external control method references, the -e option can be used to
specify the filenames. Note: SSDTs can be dynamically loaded at
runtime and may or may not be available via the host OS.
Example iASL invocations:
    iasl -e ssdt1.aml ssdt2.aml ssdt3.aml -d dsdt.aml
    iasl -e dsdt.aml ssdt2.aml -d ssdt1.aml
    iasl -e ssdt*.aml -d dsdt.aml

In addition, the -fe option can be used to specify a file containing
control method external declarations with the associated method
argument counts. Each line of the file must be of the form:
    External (<method pathname>, MethodObj, <argument count>)
Invocation:
    iasl -fe refs.txt -d dsdt.aml


-- 
Ciao,
al
----------------------------------------------------------------------
Al Stone                                         Debian Developer
E-mail: a...@debian.org                          http://www.debian.org
----------------------------------------------------------------------

Reply via email to