By setting the integer width, the disassembler no longer trucates 64-
bit integers in AML tables with revision 2 or higher.
Reported-by: Elia Geretto <elia.f.geretto@gmail.com>
Tested-by: Elia Geretto <elia.f.geretto@gmail.com>
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
CreateBufferField is a deferred op that is typically processed in
load pass 2. However, disassembly of control method contents walk the
parse tree with ACPI_PARSE_LOAD_PASS1 and AML_CREATE operators are
processed in a later walk. This is a problem when there is a control
method that has the same name as the AML_CREATE object. In this case,
any use of the name segment will be detected as a method call rather
than a reference to a buffer field. If this is detected as a method
call, it can result in a mal-formed parse tree if the control methods
have parameters.
This change in processing AML_CREATE ops earlier solves this issue by
inserting the named object in the ACPI namespace so that references
to this name would be detected as a name string rather than a method
call.
Reported-by: Elia Geretto <elia.f.geretto@gmail.com>
Tested-by: Elia Geretto <elia.f.geretto@gmail.com>
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
This change fixes the opcode walk and the transformation walk to only
traverse the parse tree after the entire parse tree has been formed.
parse tree. Walking the entire tree any earlier would require repeated
calls to walk the parse tree and results in longer execution time.
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
In iASL, not being able to find the internal representation of an
input file is an unrecoverable condition. Instead of returning NULL
for this case, it's better to simply abort iASL instead of continuing
the compilation.
Reported-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
When all templates are being generated, iasl will exit with a non-zero
status even when everything works just fine. Correct the exit() call
to exit(0) for this case, instead of exit(1).
Signed-off-by: Al Stone <ahs3@ahs3.net>
The error return path is not free'ing previously allocated
resource LocalityBuffer and hence there is a memory leak. Fix this
by free'ing it before returning.
Fixes: c22c0b1df98c ("Data table compiler: Add error messages for SLIT locality buffers")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
By removing leading whitespaces, the conversion computes the
correct number of elements in a given buffer or field encoding that
contains leading whitespaces.
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
acpiexec allows a user to provide a file that indicates values to
initialize named objects during table load with the -fi option. This
can provide more accurate simulation by setting named objects to
values found during OS runtime.
Previously, this option only supported integer objects. This change
adds user initialization support for field units, strings, buffers,
and packages.
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Since field unit data output from the debugger are now surrounded by
braces '{', support has been added to AcpiDbGetNextToken to recognize
strings beginning with this character as a ACPI_TYPE_FIELD_UNIT.
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
This helps differentiate the type of named objects between field
units and buffers. In other words, without this symbol, it would be
difficult to tell whether a particular named object is a buffer or a
field unit.
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
In acpiexec, this can be invoked by typing "fields" followed by a
number representing the address space ID of that field.
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
The tests/aslts/tmp directory contains previous test executions.
Since these are never committed to the ACPICA repository, ignore this
directory.
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
The disassembly of the optional padding field resulted in dumping
the remainder of the length in the subtable. This is problematic
when there are mappings that are describes after the padding field.
The length of the mappings are a part of the subtable length. When
dumping the optional padding field, the mapping length should be
subtracted from the rest of the field so that the proper length of
padding should be dumped.
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
For unloading an ACPI table, it is necessary to provide the index of
the table. The method intended for dynamically loading or hotplug
addition of tables, AcpiLoadTable(), should provide this information
via an optional pointer to the loaded table index.
This patch fixes the table unload function of acpi_configfs.
Reported-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Fixes: d06c47e3dd07f ("ACPI: configfs: Resolve objects on host-directed
table loads")
Signed-off-by: Nikolaus Voss <nikolaus.voss@loewensteinmedical.de>
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>