13528 Commits

Author SHA1 Message Date
Robert Moore
0224156ef6 Merge pull request #312 from SchmErik/aslts_script
Add converter test sequence
2017-09-08 14:17:23 -07:00
Robert Moore
4a687c9ec5 Merge pull request #313 from SchmErik/iasl_dev
iASL: adding extra check to avoid NULL dereference of SourceFile
2017-09-08 14:16:57 -07:00
Robert Moore
336131640a Tools: Deploy -vd option (build date/time) across all tools
Common option for all tools.
2017-09-08 14:13:21 -07:00
Erik Schmauss
e3665e34bd ASLTS: add a 60 second timeout for loops
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-09-08 14:04:23 -07:00
Erik Schmauss
e87eeb98df iASL: adding extra check to avoid NULL dereference of SourceFile
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-09-08 13:49:24 -07:00
Erik Schmauss
f6d83487a7 ASLTS: make stylistic adjustments to pass converter test
MT_MUTEX/DYNOBJ - converter does not support nested comments.
      Remove the nested comment so that it is just a single-line comment
EXC - converter does not currently support #include directives.
      replace these with ASL include statements.

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-09-08 13:47:37 -07:00
Erik Schmauss
d6583fe044 ASLTS: add converter test sequence and rename all .dsl files to .asl
This is similar to the ASLTS disassembler test sequence.
The converter test sequence converts each test case using iasl -ca flag
and then recompiles using flags from a normal test case compilation.
After recompilation, normally compiled AML is compared with the
converted and recompiled AML.

Converter test sequence removes all .dsl files after testing. Because
of this, all .dsl files that belong in the ASLTS directory needs to be
renamed as .asl.

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-09-08 13:47:37 -07:00
Robert Moore
b7a80eaf31 iASL: Automated cleanup; no functional change
extra spaces and a couple tabs removed.
2017-09-08 13:23:31 -07:00
Robert Moore
a48cbca637 acpiexec: Update for new loop timeout mechanism
Adds new option to override a loop timeout, to allow method
execution to continue.
Rename -i option to -to (set timeout value).
2017-09-08 13:17:31 -07:00
Robert Moore
e017213698 Rename AE_AML_INFINITE_LOOP exception
More appropriately renamed to AE_AML_LOOP_TIMEOUT, now that
a real timer is used for the implementation.
2017-09-08 12:49:27 -07:00
Robert Moore
015c87ca38 Merge pull request #274 from zetalog/acpica-loop
Acpica loop
2017-09-08 07:47:30 -07:00
Lv Zheng
9605023e7e Dispatcher: Introduce timeout mechanism for infinite loop detection
This patch implements a new infinite loop detection mechanism to replace
the old one, it uses AcpiOsGetTimer() to limit loop execution into a
determined time slice.
This is useful in case some hardware/firmware operations really require the
AML interpreter to wait while the old mechanism could expire too fast on
recent machines.

The new mechanism converts old AcpiGbl_MaxLoopIterations to store the user
configurable value for the new mechanism in order to allow users to be
still able to configure this value for acpiexec via command line. This
patch also removes wrong initilization code of AcpiGbl_MaxLoopIterations
accordingly (it should have been initialized by ACPI_INIT_GLOBAL, and the
default value is also properly tuned for acpiexec). Reported by M. Foronda,
fixed by Lv Zheng.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=156501
Reported-by: M. Foronda <josemauricioforonda@gmail.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
2017-09-08 09:44:36 +08:00
Robert Moore
e6c50f76da Merge pull request #298 from icedieler/fix_doc
Fix function name in documentation
2017-09-07 18:21:26 -07:00
Robert Moore
8908211353 Merge pull request #310 from ColinIanKing/master
Avoid null pointer dereference on Op.
2017-09-07 18:14:41 -07:00
Robert Moore
efd4f43a93 Merge pull request #311 from SchmErik/iasl_dev
iASL: adding support for more detailed compiler errors
2017-09-06 14:26:36 -07:00
Robert Moore
ca2e733cbb Merge pull request #307 from juikim/hwtimer-fix
Fix an off-by-one error in AcpiGetTimerDuration().
2017-09-06 14:26:19 -07:00
Robert Moore
5e0f848d47 Merge branch 'master' of ssh://ssh.github.com/acpica/acpica 2017-09-06 09:51:12 -07:00
Robert Moore
391096bf3d acpiexec: Add hwtimer.c to the utility
This module was not being included in any ACPICA tool, and thus
not even built until it was included in a kernel.

Also add a few small tests in acpiexec that invoke the timer
interfaces in hwtimer.
2017-09-06 09:48:38 -07:00
Erik Schmauss
9a8f4b7d30 iASL: adding mechanism for error messages that refer to multiple parse nodes
If a name alredy exists in scope error occurs, an error message pointing to
the duplicate declaration is helpful because it informs users on the error
locations of conflicting declarations. This change adds support for
AslDualParseOpError, a function that can allow the error message like below.

DSDT.iiii   1692:       Device(PEG2) {
Error    6074 -                  ^ Name already exists in scope (PEG2)
                 Original name creation/declaration below:
DSDT.iiii     93:   External(\_SB.PCI0.PEG2, DeviceObj)

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-09-05 14:53:13 -07:00
Erik Schmauss
9f563e41db iASL: refactor iASL common error functions and add suberror field
AslCommonError and AslCommonError2 exhibit code duplication. This
change modularizes these functions as well as add a suberror field
within the ASL_ERROR_MSG structure for future features.

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-09-05 09:50:35 -07:00
Colin Ian King
08a00639b0 Avoid null pointer dereference on Op.
The calls to AcpiOsAcquireObject can result in a null being assigned
to Op (for example if a mutex acquire fails) which can lead to a
null pointer dereference on Op on the call to ASL_CV_TRANSFER_COMMENTS
(via function CvTransferComments).  Move the block into the previous
block that checks for a null Op so that we never can call
CvTransferComments with a null Op.

Detected by: CoverityScan CID#1371660 ("Dereference after null check")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
2017-09-04 14:54:56 +01:00
Robert Moore
6c41b48bb4 Merge pull request #309 from SchmErik/iaslExternalFix03
disassembler: reset ParserState's Aml pointer when parsing bad external declarations
2017-09-01 14:57:16 -07:00
Robert Moore
35916636a9 Merge pull request #308 from SchmErik/aslts_makefile_cleanup
Add functionality to invoke Do 2 if previous test run does not match the current test run results
2017-09-01 14:50:42 -07:00
Erik Schmauss
7d542c6f97 disassembler: getting rid of error message
This error message tends to clutter up the disassembled ASL
file with information that is unnecessary.

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-09-01 10:48:38 -07:00
Erik Schmauss
e7e2513747 Disassembler: reset ParserState's Aml pointer when parsing bad externals
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-09-01 10:43:04 -07:00
Robert Moore
0d3a7f1d96 iASL: Move all allocation functions to new modules
Memory allocation functions are in aslallocate.c
Cache functions are in aslcache.c
2017-09-01 10:38:59 -07:00
Robert Moore
8232c29974 iASL: Fix incorrect memory allocation
Was using UtLocalCalloc instead of UtStringCacheCalloc.
Reported by Colin Ian King.
ACPICA BZ 1416
2017-09-01 08:09:52 -07:00
Erik Schmauss
f306328d75 ASLTS: asltsrun: add functionality to save the output from Do 2 to the result directory
This is a convenient way to look at the difference between the current and
previous ASLTSL run if there exists a difference.

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-08-31 16:53:36 -07:00
Jung-uk Kim
b4fd33f3c2 Fix an off-by-one error in AcpiGetTimerDuration().
Delta calculation has an off-by-one error when there is a rollover.
For example, when StartTicks is 0x00FFFFFF and EndTicks is 0x00000000
(for 24-bit timer), DeltaTicks should be 1 (one) but it was 0 (zero).
2017-08-31 18:10:53 -04:00
Erik Schmauss
c5adbb87d2 ASLTS: scripts: trivial syntax edits, no functional change
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-08-31 11:15:46 -07:00
Robert Moore
faa9fdfbd0 Update version to 20170831
Version 20170831.
R08_31_17
2017-08-31 08:54:36 -07:00
Robert Moore
da8fed09b9 Logfile: Changes for version 20170831
Version 20170831.
2017-08-31 08:54:07 -07:00
Robert Moore
82f676f946 Merge pull request #305 from SchmErik/aslts_makefile_cleanup
ASLTS script clean up
2017-08-31 08:51:08 -07:00
Robert Moore
1cdcf16447 Update AcpiGetTimer for 64-bit interface to AcpiHwRead
Return value from AcpiHwRead is now 64 bits, but the ACPI PM
Timer is defined by the ACPI spec to be 32 bits.
2017-08-31 08:42:17 -07:00
Robert Moore
4cde388045 acpisrc: cleanup an exit path
Don't fclose a file twice. Colin Ian King.
2017-08-31 07:12:28 -07:00
Erik Schmauss
2e492ed995 ASLTS: script: removing debug messages, no functional change
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-08-30 15:05:37 -07:00
Erik Schmauss
be0c7aa577 ASLTS: Do: adding binary comparison for the aslplus and aslminus targets
This is intended to be used as a part of the disassembler test
sequence in order to ensure that compiling, disassembling and
recompiling has the same effect as simply compiling the ASL files.

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-08-30 15:05:37 -07:00
Erik Schmauss
d79775d864 ASLTS: script: add targets for disassembler test sequence
The disassembler test sequence is as follows:

Given a test case ASL file, it will compile, disassemble and re-compile.
The above procedures result in an AML file. This should be then compared
to a file that is compiled by ASLTS for a normal compilation by using
the acpibin utility (not yet implemented).

This sequence of commands ensures that the disassembler does not inject
any unwanted code in the AML.

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-08-30 15:05:37 -07:00
Erik Schmauss
6c50a9e3b5 ASLTS: Makefile: remove compile-disassemble-recompile from install_all_modes_of_test_case
Compile-disassemble-recompile will be in different targets. This means that
the OPT argument is no longer needed in install_all_modes_of_test_case.

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-08-30 15:05:37 -07:00
Erik Schmauss
05bc03a5df ASLTS: Makefile: splitting iASL flags to output and non-output based flags
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-08-30 15:05:37 -07:00
Erik Schmauss
ac8f111efc ASLTS: Do: moving NPARAM checking outside of run_asl_compiler for cleanliness
This NPARAM counts the amount of enabled test cases given to the Do script

Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
2017-08-30 15:05:37 -07:00
Lv Zheng
5a52881149 iasl: Move aslversion determination logic from Makefile.def to Do script 2017-08-30 15:05:37 -07:00
Lv Zheng
bf8ee64902 ASLTS: Split install target into install_n32/n64/s32/s64
This patch splits install target into install_n32/n64/s32/s64 targets
so that they can be invoked from "Do" script separately. Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
2017-08-30 15:05:37 -07:00
Lv Zheng
66b85dc874 ASLTS: Allow cases/modes to be specified for aslts compile
This patch adds support in Do to allow test cases/modes to be specified
in "Do 0" mode - build aslts aml test cases. Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
2017-08-30 15:05:37 -07:00
Lv Zheng
421e5d9439 ASLTS: Convert make_install into make_target
Convert make_install into make_target so that other targets can be used
in Do script. Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
2017-08-30 15:05:37 -07:00
Robert Moore
a2c83e75a5 acpisrc: Add option to check files for non-printable characters
Dirty little option to scan entire file for non-printable ASCII
characters. Useful for debugging garbage output in listing
and text debug files.
2017-08-30 13:28:38 -07:00
Robert Moore
e3574138af String conversions: Update to add new behaviors
1) Allow whitespace in string before the constant
2) UtStrtoul64 now always creates a 64-bit integer; iASL will
truncate this to the lower 32-bits if the table being compiled
is a 32-bit table (DSDT revision less than 2).
2017-08-30 12:35:29 -07:00
Robert Moore
affd12bb11 acpiexec: Do not change default max loop count
The acpiexec count was too small to run some of the tests,
so just use the acpica default. this count is scheduled to
be removed, to be replaced by a real timer/timeout.
2017-08-30 07:19:34 -07:00
Robert Moore
5221c19354 Merge pull request #303 from SchmErik/iasl_dev01
iASL: expand -vw optoin to ignore errors in addition to warnings and remarks
2017-08-28 12:52:17 -07:00
Robert Moore
44a1a65fb9 Disassembler: Ignore tiny buffers during ResourceTemplate detection
Ignore any buffers 2 bytes or smaller, as they either cannot be
or very highly probably cannot be (2 bytes) resource templates.
2017-08-28 12:40:28 -07:00