re-import sources as agreed with the maintainer

This commit is contained in:
Adam Samalik 2023-07-10 13:34:40 +02:00
parent 0138f7e92b
commit 55c4f7c09c
41 changed files with 24128 additions and 2 deletions

99
.gitignore vendored
View File

@ -1,4 +1,99 @@
SOURCES/acpica-unix2-20180629.tar.gz series
SOURCES/acpitests-unix-20180629.tar.gz /acpica-unix2-20130823.tar.gz
/acpitests-unix-20130823.tar.gz
/acpica-unix2-20130927.tar.gz
/acpitests-unix-20130927.tar.gz
/acpica-unix2-20131115.tar.gz
/acpitests-unix-20131115.tar.gz
/acpica-unix2-20131218.tar.gz
/acpitests-unix-20131218.tar.gz
/acpica-unix2-20140114.tar.gz
/acpitests-unix-20140114.tar.gz
/acpica-unix2-20140214.tar.gz
/acpitests-unix-20140214.tar.gz
/acpica-unix2-20140325.tar.gz
/acpitests-unix-20140325.tar.gz
/acpica-unix2-20140424.tar.gz
/acpitests-unix-20140424.tar.gz
/acpica-unix2-20140724.tar.gz
/acpitests-unix-20140724.tar.gz
/acpica-unix2-20140828.tar.gz
/acpitests-unix-20140828.tar.gz
/acpica-unix2-20140926.tar.gz
/acpitests-unix-20140926.tar.gz
/acpica-unix2-20141107.tar.gz
/acpitests-unix-20141107.tar.gz
/acpica-unix2-20150204.tar.gz
/acpitests-unix-20150204.tar.gz
/acpica-unix2-20150408.tar.gz
/acpitests-unix-20150408.tar.gz
/acpica-unix2-20150410.tar.gz
/acpitests-unix-20150410.tar.gz
/acpica-unix2-20150515.tar.gz
/acpitests-unix-20150515.tar.gz
/acpica-unix2-20150619.tar.gz
/acpitests-unix-20150619.tar.gz
/acpitests-unix-20150717.tar.gz
/acpica-unix2-20150717.tar.gz
/acpica-unix2-20150818.tar.gz
/acpitests-unix-20150818.tar.gz
/acpica-unix2-20150930.tar.gz
/acpitests-unix-20150930.tar.gz
/acpica-unix2-20151124.tar.gz
/acpitests-unix-20151124.tar.gz
/acpica-unix2-20151218.tar.gz
/acpitests-unix-20151218.tar.gz
/acpica-unix2-20160108.tar.gz
/acpitests-unix-20160108.tar.gz
/acpica-unix2-20160212.tar.gz
/acpitests-unix-20160212.tar.gz
/acpica-unix2-20160318.tar.gz
/acpitests-unix-20160318.tar.gz
/acpica-unix2-20160422.tar.gz
/acpitests-unix-20160422.tar.gz
/acpica-unix2-20160527.tar.gz
/acpitests-unix-20160527.tar.gz
/acpica-unix2-20160729.tar.gz
/acpitests-unix-20160729.tar.gz
/acpica-unix2-20160831.tar.gz
/acpitests-unix-20160831.tar.gz
/acpica-unix2-20160930.tar.gz
/acpitests-unix-20160930.tar.gz
/acpica-unix2-20161117.tar.gz
/acpitests-unix-20161117.tar.gz
/acpica-unix2-20161222.tar.gz
/acpitests-unix-20161222.tar.gz
/acpica-unix2-20170119.tar.gz
/acpitests-unix-20170119.tar.gz
/acpica-unix2-20170224.tar.gz
/acpitests-unix-20170224.tar.gz
/acpica-unix2-20170303.tar.gz
/acpitests-unix-20170303.tar.gz
/acpica-unix2-20170531.tar.gz
/acpitests-unix-20170531.tar.gz
/acpica-unix2-20170629.tar.gz
/acpitests-unix-20170629.tar.gz
/acpica-unix2-20170728.tar.gz
/acpitests-unix-20170728.tar.gz
/acpica-unix2-20170831.tar.gz
/acpitests-unix-20170831.tar.gz
/acpica-unix2-20170929.tar.gz
/acpitests-unix-20170929.tar.gz
/acpica-unix2-20171110.tar.gz
/acpitests-unix-20171110.tar.gz
/acpica-unix2-20171215.tar.gz
/acpitests-unix-20171215.tar.gz
/acpica-unix2-20180105.tar.gz
/acpitests-unix-20180105.tar.gz
/acpica-unix2-20180209.tar.gz
/acpitests-unix-20180209.tar.gz
/acpica-unix2-20180313.tar.gz
/acpitests-unix-20180313.tar.gz
/acpica-unix2-20180427.tar.gz
/acpitests-unix-20180427.tar.gz
/acpica-unix2-20180508.tar.gz
/acpitests-unix-20180508.tar.gz
/acpica-unix2-20180531.tar.gz
/acpitests-unix-20180531.tar.gz
/acpica-unix2-20180629.tar.gz /acpica-unix2-20180629.tar.gz
/acpitests-unix-20180629.tar.gz /acpitests-unix-20180629.tar.gz

2
tests/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
tests.retry
artifacts

3
tests/acpidump/PURPOSE Normal file
View File

@ -0,0 +1,3 @@
PURPOSE of tests/acpidump
Description: sanity check that system ACPI tables can be read
Author: Al Stone <ahs3@redhat.com>

30
tests/acpidump/runtest.sh Executable file
View File

@ -0,0 +1,30 @@
#!/bin/bash
#
# simple script to run acpidump and verify we got
# some output.
#
PWD=$(pwd)
BINDIR="/usr/bin"
# see if acpidump runs
rm -f /tmp/acpi.tables
$BINDIR/acpidump -o /tmp/acpi.tables 2>&1
RET=$?
if [ $RET -ne 0 ]
then
echo FAIL acpidump
exit $RET
fi
RET=2
sz=$(ls -s /tmp/acpi.tables | cut -d' ' -f1)
[[ $sz -gt 0 ]] && RET=0
if [ $RET -ne 0 ]
then
echo FAIL acpidump
exit $RET
fi
echo PASS acpidump
exit 0

3
tests/acpixtract/PURPOSE Normal file
View File

@ -0,0 +1,3 @@
PURPOSE of tests/acpixtract
Description: sanity check that ACPI tables created by acpidump can be read
Author: Al Stone <ahs3@redhat.com>

39
tests/acpixtract/runtest.sh Executable file
View File

@ -0,0 +1,39 @@
#!/bin/bash
#
# simple script to run acpixtract and verify we got
# some output.
#
PWD=$(pwd)
BINDIR="/usr/bin"
# see if acpidump runs
rm -f /tmp/acpi.tables
$BINDIR/acpidump -o /tmp/acpi.tables 2>&1
RET=$?
if [ $RET -ne 0 ]
then
echo FAIL acpixtract-dump
exit $RET
fi
RET=2
sz=$(ls -s /tmp/acpi.tables | cut -d' ' -f1)
[[ $sz -gt 0 ]] && RET=0
if [ $RET -ne 0 ]
then
echo FAIL acpixtract-size
exit $RET
fi
# see if acpixtract runs
$BINDIR/acpixtract -a /tmp/acpi.tables 2>&1
RET=$?
if [ $RET -ne 0 ]
then
echo FAIL acpixtract-read
exit $RET
fi
echo PASS acpixtract
exit 0

36
tests/aslts/PURPOSE Normal file
View File

@ -0,0 +1,36 @@
from tests/aslts/README:
ACPICA ASL grammar validation Test Suite (ASLTS)
ASLTS verifies, in "hardware-independent" mode, conformity of ACPICA
ASL compiler and interpreter to the ACPI ASL grammar specification. The
more common task of ASLTS is to check, in "hardware-independent" mode also,
all the functionality of ACPICA which can be initiated and then verified
from inside the test modules coded in ASL. The first local task is performed
by the test collection named 'functional', to achieve the second one the tests
of other collections are intended: complex, exceptions, etc. The conditional
difference between the tests of 'functional' and 'complex' collections is that
the tests of 'functional' collection checks specific functionality of the
particular ASL operator while the tests of 'complex' collection verify the
more common functionality.
The testing is performed in "hardware-independent" mode without any
access to ACPI subsystem hardware. In this purpose the AcpiExec utility
is used which includes the entire ACPICA subsystem and allows to execute
the AML code and thus verify functionality of ACPICA subsystem.
The ASL source code is compiled to AML code and then passed to
AcpiExec utility. In this relation one more type tests are provided,
so called ASL-compilation control test collection, which check ability
of ASL compiler to reveal and report incorrect ASL code.
The tests of the exceptional conditions test collection
initiate and verify exceptional conditions, check that the
exceptions occur (or not occur) in the expected specified way.
The testing is provided in both 32-bit and 64-bit modes
(option -r of ASL compiler) as well both normal and slack
modes (option -s of AcpiExec).

Binary file not shown.

69
tests/aslts/runtest.sh Executable file
View File

@ -0,0 +1,69 @@
#!/bin/bash
#
# simple script to run ASLTS
#
PWD=$(pwd)
BINDIR="/usr/bin"
# figure out the release being used
release=$(ls acpitests-unix-*.tar.gz | cut -d- -f3 | cut -d. -f1)
tarball="acpitests-unix-${release}.tar.gz"
testdir="acpitests-unix-${release}"
# environmental setup
unset ASL
unset acpiexec
unset ASLTSDIR
export ASL=$BINDIR/iasl
export acpiexec=$BINDIR/acpiexec
export acpibin=$BINDIR/acpibin
export ASLTSDIR=$PWD/$testdir/tests/aslts
export PATH=$ASLTSDIR/bin:$PATH
TEST_MODES="n32 n64 o32 o64"
TEST_CASES=
# unpack the test suite
rm -rf $testdir
tar xzf $tarball
# set up test suite environment
. $ASLTSDIR/bin/common
. $ASLTSDIR/bin/settings
RESET_SETTINGS
INIT_ALL_AVAILABLE_CASES
INIT_ALL_AVAILABLE_MODES
INIT_LOG_RESULTS
# compile the test cases
pushd $testdir/tests
Do 0 $TEST_MODES $TEST_CASES
if [ $? -ne 0 ]; then
echo "ASLTS Compile Failure"
echo FAIL aslts
exit 1
fi
popd
# execute the test cases
pushd $testdir/tests
echo ""
echo "ASL Test Suite Started: `date`"
start_time=$(date)
Do 1 $TEST_MODES $TEST_CASES
RET=$?
echo ""
echo "ASL Test Suite Finished: `date`"
echo " Started: $start_time"
popd
if [ $RET -eq 0 ]
then
echo PASS aslts
else
echo FAIL aslts
fi
exit $RET

3
tests/badcode/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
badcode.aml
badcode.asl.actual
badcode.asl.expected

3
tests/badcode/PURPOSE Normal file
View File

@ -0,0 +1,3 @@
PURPOSE of tests/badcode
Description: sanity check that iasl is handling bad ASL properly
Author: Al Stone <ahs3@redhat.com>

406
tests/badcode/badcode.asl Normal file
View File

@ -0,0 +1,406 @@
/*
* badcode.asl
*
* This file contains examples of the extended error checking and
* typechecking capabilities of the iASL compiler. Other ASL compilers
* may ignore these errors completely. Note - this is not an exhaustive
* list of errors detected by iASL, it shows many of the errors that
* are not detected by other ASL compilers.
*
* To compile, use:
* iasl badcode.asl
*
* Output:
* Compilation complete. 45 Errors, 22 Warnings, 3 Remarks, 16 Optimizations
*
*/
DefinitionBlock ("badcode.aml", "DSDT", 1, "Intel", "Example", 0x00000001)
{
Name (INT1, 0)
Name (BUF1, Buffer() {0,1,2,3})
Event (EVT1)
// Invalid SyncLevel in Mutex declaration
Mutex (MTX1, 32)
// Integer beyond the table integer size (32 bits)
Name (BIG, 0x1234567887654321)
// CPackage length does not match initializer list length
Name (PKG1, Package(5) {0,1})
// Inadvertent use of single backslash in a string
Name (PATH, Buffer() {"\_SB_.PCI2._CRS"})
// Invalid hex escape sequence
Name (ESC1, "abcdefg\x00hijklmn")
// Field access beyond region bounds
OperationRegion (OPR1, SystemMemory, 0x2000, 6)
Field (OPR1, DWordAcc, NoLock, Preserve)
{
Offset (4),
FLD1, 8
}
// Some address spaces support only ByteAcc or BufferAcc
OperationRegion (OPR2, EmbeddedControl, 0x4000, 8)
Field (OPR2, DWordAcc, NoLock, Preserve)
{
FLD2, 8
}
OperationRegion (OPR3, SMBus, 0x8000, 16)
Field (OPR3, WordAcc, NoLock, Preserve)
{
FLD3, 8
}
// Invalid SyncLevel in method declaration
Method (MTH1, 0, NotSerialized, 32)
{
// Invalid arguments and uninitialized locals
Store (Arg3, Local0)
Store (Local1, Local2)
// Parameter typechecking (MTX1 is invalid type)
Subtract (MTX1, 4, Local3)
// Various invalid parameters
CreateField (BUF1, 0, Subtract (4, 4), FLD1)
// Unchecked mutex and event timeouts
Acquire (MTX1, 100)
Wait (EVT1, 1)
// Result from operation is not used - statement has no effect
Add (INT1, 8)
// Unreachable code
Return (0)
Store (5, INT1)
}
Method (MTH2)
{
// Switch with no Case statements
Switch (ToInteger (INT1))
{
Default
{
}
}
if (LEqual (INT1, 0))
{
Return (INT1)
}
// Fallthrough exit path does not return a value
}
Method (MTH3)
{
// Method MTH2 above does not always return a value
Store (MTH2 (), Local0)
}
// Method MTH4 does not explicitly return a value
Method (MTH4) {}
Method (MTH5) {Store (MTH4(), Local0)}
// Invalid _HID values
Device (H1)
{
Name (_HID, "*PNP0C0A") // Illegal leading asterisk
}
Device (H2)
{
Name (_HID, "PNP") // Too short, must be 7 or 8 chars
}
Device (H3)
{
Name (_HID, "MYDEVICE01") // Too long, must be 7 or 8 chars
}
Device (H4)
{
Name (_HID, "acpi0001") // non-hex chars must be uppercase
}
Device (H5)
{
Name (_HID, "PNP-123") // HID must be alphanumeric
}
Device (H6)
{
Name (_HID, "") // Illegal Null HID
Name (_CID, "") // Illegal Null CID
}
// Predefined Name typechecking
Name (_PRW, 4)
Name (_FDI, Buffer () {0})
// Predefined Name argument count validation
// and return value validation
Method (_OSC, 5)
{
}
// Predefined Names that must be implemented as control methods
Name (_L01, 1)
Name (_E02, 2)
Name (_Q03, 3)
Name (_ON, 0)
Name (_INI, 1)
Name (_PTP, 2)
// GPE methods that cause type collision (L vs. E)
Scope (\_GPE)
{
Method (_L1D)
{
}
Method (_E1D)
{
}
}
// Predefined names that should not have a return value
Method (_FDM, 1)
{
Return (Buffer(1){0x33})
}
Method (_Q22)
{
Return ("Unexpected Return Value")
}
// _REG must have a corresponding Operation Region declaration
// within the same scope
Device (EC)
{
Method (_REG, 2)
{
}
}
/*
* Resource Descriptor error checking
*/
Name (RSC1, ResourceTemplate ()
{
// Illegal nested StartDependent macros
StartDependentFn (0, 0)
{
StartDependentFn (0, 0)
{
}
}
// Missing EndDependentFn macro
})
Name (RSC2, ResourceTemplate ()
{
// AddressMin is larger than AddressMax
IO (Decode16,
0x07D0, // Range Minimum
0x03E8, // Range Maximum
0x01, // Alignment
0x20, // Length
)
// Length larger than Min/Max window size
Memory32 (ReadOnly,
0x00001000, // Range Minimum
0x00002000, // Range Maximum
0x00000004, // Alignment
0x00002000, // Length
)
// Min and Max not multiples of alignment value
Memory32 (ReadOnly,
0x00001001, // Range Minimum
0x00002002, // Range Maximum
0x00000004, // Alignment
0x00000200, // Length
)
// 10-bit ISA I/O address has a max of 0x3FF
FixedIO (
0xFFFF, // Address
0x20, // Length
)
// Invalid AccessSize parameter
Register (SystemIO,
0x08, // Bit Width
0x00, // Bit Offset
0x0000000000000100, // Address
0x05 // Access Size
)
// Invalid ResourceType (0xB0)
QWordSpace (0xB0, ResourceConsumer, PosDecode, MinFixed, MaxFixed, 0xA5,
0x0000, // Granularity
0xA000, // Range Minimum
0xBFFF, // Range Maximum
0x0000, // Translation Offset
0x2000, // Length
,, )
// AddressMin is larger than AddressMax
WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
0x0000, // Granularity
0x0200, // Range Minimum
0x0100, // Range Maximum
0x0000, // Translation Offset
0x0100, // Length
,, , TypeStatic)
// Length larger than Min/Max window size
DWordSpace (0xC3, ResourceConsumer, PosDecode, MinFixed, MaxFixed, 0xA5,
0x00000000, // Granularity
0x000C8000, // Range Minimum
0x000C9000, // Range Maximum
0x00000000, // Translation Offset
0x00001002, // Length
,, )
// Granularity must be (power-of-two -1)
DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxNotFixed, NonCacheable, ReadWrite,
0x00000010,
0x40000000,
0xFED9FFFF,
0x00000000,
0xBECA0000)
// Address Min (with zero length) not on granularity boundary
QWordIO (ResourceProducer, MinFixed, MaxNotFixed, PosDecode, EntireRange,
0x0000000000000003, // Granularity
0x0000000000000B02, // Range Minimum
0x0000000000000C00, // Range Maximum
0x0000000000000000, // Translation Offset
0x0000000000000000, // Length
,, , TypeStatic)
// Address Max (with zero length) not on (granularity boundary -1)
QWordMemory (ResourceProducer, PosDecode, MinNotFixed, MaxFixed, Cacheable, ReadWrite,
0x0000000000000001, // Granularity
0x0000000000100000, // Range Minimum
0x00000000002FFFFE, // Range Maximum
0x0000000000000000, // Translation Offset
0x0000000000000000, // Length
,, , AddressRangeMemory, TypeStatic)
// Invalid combination: zero length, both Min and Max are fixed
DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
0x00000000, // Granularity
0x000C8000, // Range Minimum
0x000C8FFF, // Range Maximum
0x00000000, // Translation Offset
0x00000000, // Length
,, )
// Invalid combination: non-zero length, Min Fixed, Max not fixed
DWordIO (ResourceProducer, MinFixed, MaxNotFixed, PosDecode, EntireRange,
0x00000001, // Granularity
0x000C8000, // Range Minimum
0x000C8FFF, // Range Maximum
0x00000000, // Translation Offset
0x00000100, // Length
,, )
// Invalid combination: non-zero length, Min not Fixed, Max fixed
DWordIO (ResourceProducer, MinNotFixed, MaxFixed, PosDecode, EntireRange,
0x00000001, // Granularity
0x000C8000, // Range Minimum
0x000C8FFF, // Range Maximum
0x00000000, // Translation Offset
0x00000200, // Length
,, )
// Granularity must be zero if non-zero length, min/max fixed
DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
0x0000000F, // Granularity
0x000C8000, // Range Minimum
0x000C8FFF, // Range Maximum
0x00000000, // Translation Offset
0x00001000, // Length
,, )
// Null descriptor (intended to be modified at runtime) must
// have a resource tag (to allow it to be modified at runtime)
DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
0x00000000, // Granularity
0x00000000, // Range Minimum
0x00000000, // Range Maximum
0x00000000, // Translation Offset
0x00000000, // Length
,, )
// Missing StartDependentFn macro
EndDependentFn ()
})
// Test descriptor for CreateXxxxField operators in REM1 below
Name (RSC3, ResourceTemplate ()
{
DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
0x00000000, // Granularity
0x000C8000, // Range Minimum
0x000C8FFF, // Range Maximum
0x00000000, // Translation Offset
0x00001000, // Length
,, DWI1)
})
Method (REM1)
{
// Tagged resource field larger than field being created
CreateWordField (RSC3, \DWI1._LEN, LEN)
CreateByteField (RSC3, \DWI1._MIN, MIN)
CreateBitField (RSC3, \DWI1._RNG, RNG1)
// Tagged resource field smaller than field being created
CreateQWordField (RSC3, \DWI1._MAX, MAX)
CreateBitField (RSC3, \DWI1._GRA, GRA)
CreateField (RSC3, \DWI1._MIF, 5, MIF)
CreateField (RSC3, \DWI1._RNG, 3, RNG2)
}
Method (L100)
{
/* Method Local is set but never used */
Store (40, Local0)
}
}

View File

@ -0,0 +1,266 @@
badcode.asl 25: Mutex (MTX1, 32)
Error 6125 - ^ SyncLevel must be in the range 0-15
badcode.asl 29: Name (BIG, 0x1234567887654321)
Warning 3038 - ^ Truncating 64-bit constant found in 32-bit table
badcode.asl 33: Name (PKG1, Package(5) {0,1})
Remark 2063 - ^ Initializer list shorter than declared package length
badcode.asl 37: Name (PATH, Buffer() {"\_SB_.PCI2._CRS"})
Warning 3046 - ^ Invalid or unknown escape sequence
badcode.asl 41: Name (ESC1, "abcdefg\x00hijklmn")
Warning 3055 - ^ Invalid Hex/Octal Escape - Non-ASCII or NULL
badcode.asl 49: FLD1, 8
Error 6030 - ^ Access width of Field Unit extends beyond region limit
badcode.asl 55: Field (OPR2, DWordAcc, NoLock, Preserve)
Error 6100 - ^ Host Operation Region requires ByteAcc access
badcode.asl 60: Field (OPR3, WordAcc, NoLock, Preserve)
Error 6099 - ^ Host Operation Region requires BufferAcc access
badcode.asl 67: Method (MTH1, 0, NotSerialized, 32)
Error 6125 - SyncLevel must be in the range 0-15 ^
badcode.asl 71: Store (Arg3, Local0)
Warning 3144 - ^ Method Local is set but never used (Local0)
badcode.asl 71: Store (Arg3, Local0)
Error 6006 - ^ Method argument is not initialized (Arg3)
badcode.asl 71: Store (Arg3, Local0)
Remark 2087 - ^ Not a parameter, used as local only (Arg3)
badcode.asl 72: Store (Local1, Local2)
Warning 3144 - ^ Method Local is set but never used (Local2)
badcode.asl 72: Store (Local1, Local2)
Error 6066 - ^ Method local variable is not initialized (Local1)
badcode.asl 76: Subtract (MTX1, 4, Local3)
Warning 3144 - Method Local is set but never used ^ (Local3)
badcode.asl 76: Subtract (MTX1, 4, Local3)
Error 6058 - Invalid type ^ ([Mutex] found, Subtract operator requires [Integer|String|Buffer])
badcode.asl 80: CreateField (BUF1, 0, Subtract (4, 4), FLD1)
Remark 2089 - Object is not referenced ^ (Name [FLD1] is within a method [MTH1])
badcode.asl 80: CreateField (BUF1, 0, Subtract (4, 4), FLD1)
Error 6083 - Operand evaluates to zero ^
badcode.asl 84: Acquire (MTX1, 100)
Warning 3130 - ^ Result is not used, possible operator timeout will be missed
badcode.asl 85: Wait (EVT1, 1)
Warning 3130 - ^ Result is not used, possible operator timeout will be missed
badcode.asl 89: Add (INT1, 8)
Error 6114 - ^ Result is not used, operator has no effect
badcode.asl 94: Store (5, INT1)
Warning 3134 - ^ Statement is unreachable
badcode.asl 97: Method (MTH2)
Remark 2119 - ^ Control Method marked Serialized (Due to use of Switch operator)
badcode.asl 97: Method (MTH2)
Warning 3115 - ^ Not all control paths return a value (MTH2)
badcode.asl 101: Switch (ToInteger (INT1))
Error 6078 - ^ No Case statements under Switch
badcode.asl 120: Store (MTH2 (), Local0)
Warning 3144 - ^ Method Local is set but never used (Local0)
badcode.asl 120: Store (MTH2 (), Local0)
Warning 3122 - ^ Called method may not always return a value
badcode.asl 126: Method (MTH5) {Store (MTH4(), Local0)}
Warning 3144 - Method Local is set but never used ^ (Local0)
badcode.asl 126: Method (MTH5) {Store (MTH4(), Local0)}
Error 6080 - Called method returns no value ^
badcode.asl 132: Name (_HID, "*PNP0C0A") // Illegal leading asterisk
Error 6061 - Invalid leading asterisk ^ (*PNP0C0A)
badcode.asl 136: Name (_HID, "PNP") // Too short, must be 7 or 8 chars
Error 6033 - ^ _HID string must be exactly 7 or 8 characters (PNP)
badcode.asl 140: Name (_HID, "MYDEVICE01") // Too long, must be 7 or 8 chars
Error 6033 - ^ _HID string must be exactly 7 or 8 characters (MYDEVICE01)
badcode.asl 144: Name (_HID, "acpi0001") // non-hex chars must be uppercase
Error 6034 - ^ _HID prefix must be all uppercase or decimal digits (acpi0001)
badcode.asl 148: Name (_HID, "PNP-123") // HID must be alphanumeric
Error 6002 - ^ String must be entirely alphanumeric (PNP-123)
badcode.asl 152: Name (_HID, "") // Illegal Null HID
Error 6091 - ^ Invalid zero-length (null) string
badcode.asl 153: Name (_CID, "") // Illegal Null CID
Error 6091 - ^ Invalid zero-length (null) string
badcode.asl 158: Name (_PRW, 4)
Error 6105 - ^ Invalid object type for reserved name (_PRW: found Integer, Package required)
badcode.asl 159: Name (_FDI, Buffer () {0})
Error 6105 - ^ Invalid object type for reserved name (_FDI: found Buffer, Package required)
badcode.asl 164: Method (_OSC, 5)
Warning 3101 - ^ Reserved method has too many arguments (_OSC requires 4)
badcode.asl 164: Method (_OSC, 5)
Warning 3107 - ^ Reserved method must return a value (Buffer required for _OSC)
badcode.asl 170: Name (_L01, 1)
Error 6103 - ^ Reserved name must be a control method (with zero arguments)
badcode.asl 171: Name (_E02, 2)
Error 6103 - ^ Reserved name must be a control method (with zero arguments)
badcode.asl 172: Name (_Q03, 3)
Error 6103 - ^ Reserved name must be a control method (with zero arguments)
badcode.asl 173: Name (_ON, 0)
Error 6103 - ^ Reserved name must be a control method (with zero arguments)
badcode.asl 174: Name (_INI, 1)
Error 6103 - ^ Reserved name must be a control method (with zero arguments)
badcode.asl 175: Name (_PTP, 2)
Error 6103 - ^ Reserved name must be a control method (with arguments)
badcode.asl 184: Method (_E1D)
Error 6032 - ^ Name conflicts with a previous GPE method (_L1D)
badcode.asl 193: Return (Buffer(1){0x33})
Warning 3104 - ^ Reserved method should not return a value (_FDM)
badcode.asl 197: Return ("Unexpected Return Value")
Warning 3104 - Reserved method should not return a value ^ (_Q22)
badcode.asl 203: Device (EC)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
badcode.asl 205: Method (_REG, 2)
Warning 3079 - ^ _REG has no corresponding Operation Region
badcode.asl 219: StartDependentFn (0, 0)
Error 6019 - ^ Dependent function macros cannot be nested
badcode.asl 225: })
Error 6070 - ^ Missing EndDependentFn() macro in dependent resource list
badcode.asl 242: 0x00002000, // Length
Error 6049 - ^ Length is larger than Min/Max window
badcode.asl 247: 0x00001001, // Range Minimum
Error 6001 - ^ Must be a multiple of alignment/granularity value
badcode.asl 248: 0x00002002, // Range Maximum
Error 6001 - ^ Must be a multiple of alignment/granularity value
badcode.asl 255: 0xFFFF, // Address
Warning 3060 - ^ Maximum 10-bit ISA address (0x3FF)
badcode.asl 264: 0x05 // Access Size
Error 6042 - ^ Invalid AccessSize (Maximum is 4 - QWord access)
badcode.asl 268: QWordSpace (0xB0, ResourceConsumer, PosDecode, MinFixed, MaxFixed, 0xA5,
Error 6139 - Constant out of range ^ (0xB0, allowable: 0xC0-0xFF)
badcode.asl 279: 0x0200, // Range Minimum
Error 6051 - ^ Address Min is greater than Address Max
badcode.asl 291: 0x00001002, // Length
Error 6049 - ^ Length is larger than Min/Max window
badcode.asl 296: 0x00000010,
Error 6048 - ^ Granularity must be zero or a power of two minus one
badcode.asl 305: 0x0000000000000B02, // Range Minimum
Error 6001 - ^ Must be a multiple of alignment/granularity value
badcode.asl 315: 0x00000000002FFFFE, // Range Maximum
Error 6001 - ^ Must be a multiple of alignment/granularity value (-1)
badcode.asl 326: 0x00000000, // Length
Error 6043 - ^ Invalid combination of Length and Min/Max fixed flags
badcode.asl 335: 0x00000100, // Length
Error 6043 - ^ Invalid combination of Length and Min/Max fixed flags
badcode.asl 344: 0x00000200, // Length
Error 6043 - ^ Invalid combination of Length and Min/Max fixed flags
badcode.asl 349: 0x0000000F, // Granularity
Error 6047 - ^ Granularity must be zero for fixed Min/Max
badcode.asl 358: DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
Error 6090 - ^ Min/Max/Length/Gran are all zero, but no resource tag
badcode.asl 368: EndDependentFn ()
Error 6071 - ^ Missing StartDependentFn() macro in dependent resource list
badcode.asl 388: CreateWordField (RSC3, \DWI1._LEN, LEN)
Warning 3128 - ResourceTag larger than Field ^ (Size mismatch, Tag: 32 bits, Field: 16 bits)
badcode.asl 388: CreateWordField (RSC3, \DWI1._LEN, LEN)
Remark 2089 - Object is not referenced ^ (Name [LEN_] is within a method [REM1])
badcode.asl 389: CreateByteField (RSC3, \DWI1._MIN, MIN)
Warning 3128 - ResourceTag larger than Field ^ (Size mismatch, Tag: 32 bits, Field: 8 bits)
badcode.asl 389: CreateByteField (RSC3, \DWI1._MIN, MIN)
Remark 2089 - Object is not referenced ^ (Name [MIN_] is within a method [REM1])
badcode.asl 390: CreateBitField (RSC3, \DWI1._RNG, RNG1)
Warning 3128 - ResourceTag larger than Field ^ (Size mismatch, Tag: 2 bits, Field: 1 bit)
badcode.asl 390: CreateBitField (RSC3, \DWI1._RNG, RNG1)
Remark 2089 - Object is not referenced ^ (Name [RNG1] is within a method [REM1])
badcode.asl 394: CreateQWordField (RSC3, \DWI1._MAX, MAX)
Warning 3129 - ResourceTag smaller than Field ^ (Size mismatch, Tag: 32 bits, Field: 64 bits)
badcode.asl 394: CreateQWordField (RSC3, \DWI1._MAX, MAX)
Remark 2089 - Object is not referenced ^ (Name [MAX_] is within a method [REM1])
badcode.asl 395: CreateBitField (RSC3, \DWI1._GRA, GRA)
Warning 3128 - ResourceTag larger than Field ^ (Size mismatch, Tag: 32 bits, Field: 1 bit)
badcode.asl 395: CreateBitField (RSC3, \DWI1._GRA, GRA)
Remark 2089 - Object is not referenced ^ (Name [GRA_] is within a method [REM1])
badcode.asl 396: CreateField (RSC3, \DWI1._MIF, 5, MIF)
Warning 3129 - ResourceTag smaller than Field ^ (Size mismatch, Tag: 1 bit, Field: 5 bits)
badcode.asl 396: CreateField (RSC3, \DWI1._MIF, 5, MIF)
Remark 2089 - Object is not referenced ^ (Name [MIF_] is within a method [REM1])
badcode.asl 397: CreateField (RSC3, \DWI1._RNG, 3, RNG2)
Warning 3129 - ResourceTag smaller than Field ^ (Size mismatch, Tag: 2 bits, Field: 3 bits)
badcode.asl 397: CreateField (RSC3, \DWI1._RNG, 3, RNG2)
Remark 2089 - Object is not referenced ^ (Name [RNG2] is within a method [REM1])
badcode.asl 404: Store (40, Local0)
Warning 3144 - ^ Method Local is set but never used (Local0)
Intel ACPI Component Architecture
ASL+ Optimizing Compiler/Disassembler version VVVVVVVV
Copyright (c) 2000 - 2018 Intel Corporation
Ignoring all errors, forcing AML file generation
ASL Input: badcode.asl - 408 lines, 11587 bytes, 81 keywords
AML Output: badcode.aml - 1195 bytes, 61 named objects, 20 executable opcodes
Compilation complete. 46 Errors, 28 Warnings, 11 Remarks, 16 Optimizations, 1 Constants Folded

33
tests/badcode/runtest.sh Executable file
View File

@ -0,0 +1,33 @@
#!/bin/bash
#
# run the misc tests: we need to do this in a script since
# these are expected to fail which would normally cause %check
# to stop. however, this is expected behavior. we are running
# iasl precisely because we expect it to stop when presented with
# faulty ASL.
#
# this script assumes it is in the source 'tests' directory at
# start.
#
PWD=$(pwd)
BINDIR="/usr/bin"
VERSION=$($BINDIR/iasl -v | grep Optimizing | cut -d" " -f5)
# create file to compare against
sed -e "s/VVVVVVVV/$VERSION/" \
badcode.asl.result > badcode.asl.expected
# see if badcode.asl failed as expected
# NB: the -f option is required so we can see all of the errors
$BINDIR/iasl -f badcode.asl > badcode.asl.actual 2>&1
diff badcode.asl.actual badcode.asl.expected
RET=$?
if [ $RET -eq 0 ]
then
echo PASS badcode
else
echo FAIL badcode
fi
exit $RET

3
tests/converterSample/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
converterSample.aml
converterSample.asl.actual
converterSample.asl.expected

View File

@ -0,0 +1,3 @@
PURPOSE of tests/converterSample
Description: sanity check that iasl is handling ASL converters properly
Author: Al Stone <ahs3@redhat.com>

View File

@ -0,0 +1,83 @@
/*
* top of the
* definition block
*/
DefinitionBlock(
"converterSample.aml", /* These comments */
"DSDT", /* within the */
0x02, /* definition block header */
"Intel", /* are not retained. */
"Many", /* They will be */
0x00000001 /* Discarded */)
{
/* first comment of named object b */
Name (b, 5)
Name(p008, Package()
{
0, 0,
0, 0xffffffff,
0x00012345, 0x00007abc,
0x00000012, 0x00000034,
0x00000001, 0x000000ff,
0x00000001, 0x0000ffff,
0x00000001, 0xffffffff,
// bit-size of multiplicand
0x67812345, 2,
// bit-size of multiplier
3, 0x45678123,
0xffffffff, 0xffffffff,
// ACPI: Overflow conditions are ignored and results are undefined.
})
Method(MAIN) {
/**********************************************************************
* *
* This is a long *
* multi-line *
* comment *
* *
**********************************************************************/
//c12
if(1==1)//c13
{ //c14
Name(b,0);
} //c15
}
//c16
Name (a,
Package(3)
{/*c20*/
0x04, /*c21*/
/*c22*/
0x05, /*c23*/
0x06 /*c24*/
}/*c25*/
)/*c26*/
//c34
Method(SCOP)
{
//c35
Name (a1, 0x04)
}
OperationRegion(GNVS,SystemMemory,0xFFFF0000,0xAA55)
Field(GNVS,AnyAcc,Lock,Preserve)
{
//c36
Offset(0),//c37
OSYS, 8//c38
}
} //c39
/*ending
comment*/

View File

@ -0,0 +1,21 @@
converterSample.asl 37: Method(MAIN) {
Remark 2120 - ^ Control Method should be made Serialized (due to creation of named objects within)
converterSample.asl 48: Name(b,0);
Remark 2089 - Object is not referenced ^ (Name [B___] is within a method [MAIN])
converterSample.asl 65: Method(SCOP)
Remark 2120 - ^ Control Method should be made Serialized (due to creation of named objects within)
converterSample.asl 68: Name (a1, 0x04)
Remark 2089 - Object is not referenced ^ (Name [A1__] is within a method [SCOP])
Intel ACPI Component Architecture
ASL+ Optimizing Compiler/Disassembler version VVVVVVVV
Copyright (c) 2000 - 2018 Intel Corporation
ASL Input: converterSample.asl - 85 lines, 1968 bytes, 11 keywords
AML Output: converterSample.aml - 180 bytes, 9 named objects, 2 executable opcodes
Compilation complete. 0 Errors, 0 Warnings, 4 Remarks, 11 Optimizations, 1 Constants Folded

View File

@ -0,0 +1,34 @@
#!/bin/bash
#
# run the misc tests: we need to do this in a script since
# these are expected to fail which would normally cause %check
# to stop. however, this is expected behavior. we are running
# iasl precisely because we expect it to stop when presented with
# faulty ASL.
#
# this script assumes it is in the source 'tests' directory at
# start.
#
PWD=$(pwd)
BINDIR="/usr/bin"
VERSION=$($BINDIR/iasl -v | grep Optimizing | cut -d" " -f5)
# create file to compare against
pushd ./converterSample > /dev/null
sed -e "s/VVVVVVVV/$VERSION/" \
converterSample.asl.result > converterSample.asl.expected
# see if converterSample.asl compiles as expected
$BINDIR/iasl converterSample.asl > converterSample.asl.actual 2>&1
diff converterSample.asl.actual converterSample.asl.expected >/dev/null 2>&1
RET=$?
popd > /dev/null
if [ $RET -eq 0 ]
then
echo PASS converterSample
else
echo FAIL converterSample
fi
exit $RET

View File

@ -0,0 +1,52 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /CoreOS/acpica-tools/dump-tables
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Author, maintainer and description of the test
AUTHOR=Mike Gahagan <mgahagan@redhat.com>
DESCRIPTION=Uses the utilities in acpica-tools to dump the ACPI tables on a system and upload to Beaker.
PACKAGE=acpica-tools
# The name of the test.
export TEST=/CoreOS/acpica-tools/dump-tables
# Version of the test. Used with make tag.
export TESTVERSION=2.0
# data files, .c files, scripts anything needed to either compile the test and/or run it.
FILES=$(METADATA) runtest.sh PURPOSE Makefile
run: $(FILES) build
./runtest.sh
build: $(BUILT_FILES) $(FILES)
chmod a+x ./runtest.sh
clean:
rm -f *~ *.rpm
rm -f $(METADATA)
rm -rf /mnt/testarea/dump-tables
# Include Common Makefile
include /usr/share/rhts/lib/rhts-make.include
# Generate the testinfo.desc here:
$(METADATA): Makefile
@touch $(METADATA)
@echo "Owner: $(AUTHOR)" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "License: GPLv2" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Description: $(DESCRIPTION)" >> $(METADATA)
@echo "TestTime: 12m" >> $(METADATA)
@echo "RunFor: $(PACKAGE)" >> $(METADATA)
@echo "Architectures: aarch64 i386 x86_64 ppc64 ppc64le" >> $(METADATA)
@echo "Type: Functional" >> $(METADATA)
@echo "Requires: $(PACKAGE)" >> $(METADATA)
rhts-lint $(METADATA)
# The include package takes care of all the dependencies
# Add any other dependencies there (/kernel/filesystems/xfs/include)

13
tests/dump-tables/PURPOSE Normal file
View File

@ -0,0 +1,13 @@
Uses the utilities in acpica-tools to dump the ACPI tables on a system and upload to Beaker.
The task will do the following:
- Capture the acpi tables currently in use by the running kernel in binary format (acpidump-acpica -b)
- Capture namespace information from the DSDT (acpinames dsdt.dat)
- Capture the acpi tables currently in use by the running kernel hexidecmal encoded (acpidump-acpica -o somefile.hex)
- Decompile the table files from the binary tables and store the resulting source code (iasl -d on each .dat file)
- Archive all of the above and send to Beaker.
Paramaters:
ACPIDUMP_BIN - Set to path/to/alternate-acpidump-binary to use a different acpidump tool from what acpica-tools provides,
set to "_sys_firmware" to bypass use of acpidump completely and dump from /sys/firmware/acpi/tables/ instead
note: using the acpidump binary is not supported on all platforms

90
tests/dump-tables/runtest.sh Executable file
View File

@ -0,0 +1,90 @@
#!/bin/bash
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/acpica-tools/dump-tables
# Description: Uses the utilities in acpica-tools to dump the ACPI tables on a system and upload to Beaker.
# Author: Mike Gahagan <mgahagan@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2017 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing
# to use, modify, copy, or redistribute it subject to the terms
# and conditions of the GNU General Public License version 2.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/bin/rhts-environment.sh
. /usr/share/beakerlib/beakerlib.sh
TESTNAME=$(basename $TEST)
OUTPUTDIR=/mnt/testarea/$TESTNAME
log_dir=$OUTPUTDIR/logs
# RHEL uses /usr/bin/acpidump-acpica, Fedora uses /usr/bin/acpidump
#ACPIDUMP_BIN="${ACPIDUMP_BIN:-acpidump-acpica}"
ACPIDUMP_BIN="${ACPIDUMP_BIN:-acpidump}"
PACKAGE="acpica-tools"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
[ $? -eq 0 ] || rlDie "$PACKAGE must be installed!... aborting.."
rlGetDistroRelease
rlGetDistroVariant
rlShowRunningKernel
rlGetPrimaryArch
rlGetSecondaryArch
rlRun "mkdir -p $OUTPUTDIR/{bin,logs,asl,hex}" 0 "Making output directories"
[ $? -eq 0 ] || rlDie "Cannot make output directories!... aborting.."
rlLog "Using acpidump binary: $ACPIDUMP_BIN"
rlPhaseEnd
rlPhaseStartTest
pushd $OUTPUTDIR/bin
if [[ $ACPIDUMP_BIN = "_sys_firmware" ]] ; then
rlLog "Dumping tables from /sys/firmware/acpi/tables..."
find /sys/firmware/acpi/tables/ -type f | while read f ; do
name="$(basename $f | tr '[[:upper:]]' '[[:lower:]]').dat"
cat $f > $name
done
else
rlRun "$ACPIDUMP_BIN -bz" 0 "Dumping binary ACPI info..."
fi
rlRun "acpinames dsdt.dat > ../logs/DSDT-ACPI-namespace.out 2>&1" 0 "Extracting namespace information from DSDT"
rlLog "Decompiling binary files"
for f in $(ls *.dat) ; do
rlRun "iasl -d $f" 0 "Decompiling $f"
done
rlRun "mv *.dsl ../asl" 0 "Moving source files to $OUTPUTDIR/asl"
popd
if [[ $ACPIDUMP_BIN != "_sys_firmware" ]]; then
rlRun "$ACPIDUMP_BIN -o $OUTPUTDIR/hex/$HOSTNAME-ACPI-TABLE.hex" 0 "Dumping hex-encoded ACPI info"
fi
rlPhaseEnd
rlPhaseStartCleanup
rlRun "tar -Jcf $log_dir/$HOSTNAME-ACPI-TABLE-AML.tar.xz $OUTPUTDIR/bin" 0 "Archiving aml files..."
rlRun "tar -Jcf $log_dir/$HOSTNAME-ACPI-TABLE-ASL.tar.xz $OUTPUTDIR/asl" 0 "Archiving asl files..."
if [ -f $OUTPUTDIR/hex/$HOSTNAME-ACPI-TABLE.hex ]; then
rlRun "cp $OUTPUTDIR/hex/$HOSTNAME-ACPI-TABLE.hex $log_dir" 0 "Copying hex-encoded ACPI info to log directory"
fi
for f in $log_dir/*; do
if [ -f $f ] ; then
rlFileSubmit $f
fi
done
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

3
tests/grammar/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
grammar.aml
grammar.asl.actual
grammar.asl.expected

3
tests/grammar/PURPOSE Normal file
View File

@ -0,0 +1,3 @@
PURPOSE of tests/grammar
Description: sanity check that iasl is handling ASL grammar properly
Author: Al Stone <ahs3@redhat.com>

10282
tests/grammar/grammar.asl Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,374 @@
grammar.asl 120: Device (A1)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 135: Device (A2)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 145: Device (A3)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 155: Device (A4)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 171: Device (IRES)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 199: Name (_NPK, Package ()
Warning 3133 - ^ Unknown reserved name (_NPK)
grammar.asl 208: Device (RES)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 399: CreateByteField (PRT0, R000._ASZ, RSIZ)
Remark 2089 - Object is not referenced ^ (Name [RSIZ] is within a method [_CRS])
grammar.asl 513: Name (_STR, Unicode ("test"))
Remark 2089 - ^ Object is not referenced (Name [_STR] is within a method [TCOP])
grammar.asl 515: Store (MFLD, Local0)
Warning 3144 - ^ Method Local is set but never used (Local0)
grammar.asl 522: NAME (ESC1, "abcdefg\x00hijklmn")
Warning 3055 - ^ Invalid Hex/Octal Escape - Non-ASCII or NULL
grammar.asl 523: NAME (ESC2, "abcdefg\000hijklmn")
Warning 3055 - ^ Invalid Hex/Octal Escape - Non-ASCII or NULL
grammar.asl 620: RCIV (Subtract (Arg0, 1))
Remark 2098 - ^ Recursive method call (RCIV)
grammar.asl 668: Method(SMWE, 4)
Remark 2146 - ^ Method Argument is never used (Arg0)
grammar.asl 668: Method(SMWE, 4)
Remark 2146 - ^ Method Argument is never used (Arg1)
grammar.asl 668: Method(SMWE, 4)
Remark 2146 - ^ Method Argument is never used (Arg2)
grammar.asl 668: Method(SMWE, 4)
Remark 2146 - ^ Method Argument is never used (Arg3)
grammar.asl 673: Method(SMRE, 4)
Remark 2146 - ^ Method Argument is never used (Arg0)
grammar.asl 673: Method(SMRE, 4)
Remark 2146 - ^ Method Argument is never used (Arg1)
grammar.asl 673: Method(SMRE, 4)
Remark 2146 - ^ Method Argument is never used (Arg2)
grammar.asl 673: Method(SMRE, 4)
Remark 2146 - ^ Method Argument is never used (Arg3)
grammar.asl 701: CreateField (\_SB_.SBUF, 148, 96, FLDV)
Remark 2089 - Object is not referenced ^ (Name [FLDV] is within a method [_INI])
grammar.asl 733: Method(_SRS)
Warning 3102 - ^ Reserved method has too few arguments (_SRS requires 1)
grammar.asl 738: Device(EIO)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar.asl 822: If(LNot(SMRE(0x09,0x17,Local2,RefOf(Local3)))){
Warning 3144 - Method Local is set but never used ^ (Local3)
grammar.asl 913: Device (DEV1)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 963: Divide (Local0, Local1, Local3)
Warning 3144 - Method Local is set but never used ^ (Local3)
grammar.asl 988: Method (R226, 2)
Remark 2146 - ^ Method Argument is never used (Arg0)
grammar.asl 988: Method (R226, 2)
Remark 2146 - ^ Method Argument is never used (Arg1)
grammar.asl 1011: Store (Local0, Local1)
Warning 3144 - ^ Method Local is set but never used (Local1)
grammar.asl 1296: Method (OBJ1, 1, SERIALIZED)
Remark 2146 - ^ Method Argument is never used (Arg0)
grammar.asl 1300: Name(BUFR, Buffer (Local0) {})
Remark 2089 - ^ Object is not referenced (Name [BUFR] is within a method [OBJ1])
grammar.asl 1307: Alias (MTX1, MTX2)
Remark 2089 - Object is not referenced ^ (Name [MTX2] is within a method [OBJ1])
grammar.asl 1329: CreateField (BUF2, 148, 96, FLD3)
Remark 2089 - Object is not referenced ^ (Name [FLD3] is within a method [FLDS])
grammar.asl 1394: Store (0x1234567887654321, QWD2)
Warning 3038 - ^ Truncating 64-bit constant found in 32-bit table
grammar.asl 1396: if (LNotEqual (Local0, 0x1234567887654321))
Warning 3038 - Truncating 64-bit constant found in 32-bit table ^
grammar.asl 1476: SizeOf (BUFO)
Error 6114 - ^ Result is not used, operator has no effect
grammar.asl 1496: Alias (MTX2, MTXA)
Remark 2089 - Object is not referenced ^ (Name [MTXA] is within a method [OBJ2])
grammar.asl 1502: Acquire (MTX2, 1)
Warning 3130 - ^ Result is not used, possible operator timeout will be missed
grammar.asl 1650: Add (Local0, Local1)
Error 6114 - ^ Result is not used, operator has no effect
grammar.asl 1661: Add (Local0, Local1, Local2)
Warning 3144 - Method Local is set but never used ^ (Local2)
grammar.asl 1777: Store (LAnd (0xFFFFFFFF, 0x11111111), Local0)
Warning 3144 - Method Local is set but never used ^ (Local0)
grammar.asl 1780: Store (LEqual (0xFFFFFFFF, 0x11111111), Local1)
Warning 3144 - Method Local is set but never used ^ (Local1)
grammar.asl 1783: Store (LGreater (0xFFFFFFFF, 0x11111111), Local2)
Warning 3144 - Method Local is set but never used ^ (Local2)
grammar.asl 1786: Store (LGreaterEqual (0xFFFFFFFF, 0x11111111), Local3)
Warning 3144 - Method Local is set but never used ^ (Local3)
grammar.asl 1789: Store (LLess (0xFFFFFFFF, 0x11111111), Local4)
Warning 3144 - Method Local is set but never used ^ (Local4)
grammar.asl 1792: Store (LLessEqual (0xFFFFFFFF, 0x11111111), Local5)
Warning 3144 - Method Local is set but never used ^ (Local5)
grammar.asl 1821: Method (COND)
Warning 3115 - ^ Not all control paths return a value (COND)
grammar.asl 1930: Store (RefOf (MAIN), Local5)
Warning 3144 - Method Local is set but never used ^ (Local5)
grammar.asl 2005: Device (IFEL)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 2162: Device (NOSV)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 2583: Device (IDXF)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 2611: Store (IFE0, Local0)
Warning 3144 - ^ Method Local is set but never used (Local0)
grammar.asl 2612: Store (IFE1, Local1)
Warning 3144 - ^ Method Local is set but never used (Local1)
grammar.asl 2613: Store (IFE2, Local2)
Warning 3144 - ^ Method Local is set but never used (Local2)
grammar.asl 2630: Device (NSTL)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar.asl 2658: Device (RTBF)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 2756: Device (GPE2)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 2771: Device (PRW2)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 2819: Device (PRW1)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 2886: Store (Arg0, Local0)
Warning 3144 - ^ Method Local is set but never used (Local0)
grammar.asl 2889: Device (RTLV)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar.asl 2993: Name (_CRS,0)
Error 6105 - ^ Invalid object type for reserved name (_CRS: found Integer, Buffer required)
grammar.asl 3017: Device (RETP)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar.asl 3053: Device (WHLR)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 3109: Device (ANDO)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 3383: Device (BRKP)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 3420: Device (ADSU)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 3513: Device (INDC)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 3611: Device (LOPS)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 3956: Device (FDSO)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 4120: Device (MLDV)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 4253: Device (NBIT)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 4489: Device (SHFT)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 4685: Device (XORD)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 5022: Device (CRBF)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 5100: Device (IDX4)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 5639: Device (EVNT)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 5867: Device (SZLV)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 5960: Device (BYTF)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar.asl 5970: Device (C005)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar.asl 5972: Device (C013)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar.asl 6027: Name (_HID, "*PNP0A06")
Error 6061 - Invalid leading asterisk ^ (*PNP0A06)
grammar.asl 6166: Name (C18C, Package (2)
Remark 2063 - ^ Initializer list shorter than declared package length
grammar.asl 6190: Device (C19B)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar.asl 6199: Divide (Local1, 10, Local0, Local2) // Local0 = Local1 / 10
Warning 3144 - Method Local is set but never used ^ (Local0)
grammar.asl 6244: Device (DWDF)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 6276: Method (MKW_, 2)
Remark 2146 - ^ Method Argument is never used (Arg0)
grammar.asl 6276: Method (MKW_, 2)
Remark 2146 - ^ Method Argument is never used (Arg1)
grammar.asl 6285: Device (DVAX)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 6328: Device (IDX6)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 6352: Device (TST_)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar.asl 6371: Store (IFE0, Local0)
Warning 3144 - ^ Method Local is set but never used (Local0)
grammar.asl 6372: Store (IFE1, Local1)
Warning 3144 - ^ Method Local is set but never used (Local1)
grammar.asl 6373: Store (IFE2, Local2)
Warning 3144 - ^ Method Local is set but never used (Local2)
grammar.asl 6376: Store (\IDX6.IFE0, Local3)
Warning 3144 - Method Local is set but never used ^ (Local3)
grammar.asl 6377: Store (\IDX6.IFE1, Local4)
Warning 3144 - Method Local is set but never used ^ (Local4)
grammar.asl 6379: Store (\IDX6.TST_.IFE0, Local5)
Warning 3144 - Method Local is set but never used ^ (Local5)
grammar.asl 6380: Store (\IDX6.TST_.IFE1, Local6)
Warning 3144 - Method Local is set but never used ^ (Local6)
grammar.asl 6393: Device (IDX5)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 6478: Name (_CRS, Buffer(26) {"\_SB_.PCI2._CRS..........."})
Warning 3046 - Invalid or unknown escape sequence ^
grammar.asl 6709: Device (BITI)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar.asl 6817: And (Local0, 1, Local0) // Local0 &= 1
Error 6066 - ^ Method local variable is not initialized (Local0)
grammar.asl 6903: Name (_HID, "*PNP0C0A") // Control Method Battey ID
Error 6061 - Invalid leading asterisk ^ (*PNP0C0A)
grammar.asl 6912: Device (IDX3)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar.asl 7057: Device(IDX7)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 7736: Device (MTCH)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 7757: CreateDWordField (TMD0, 4, DMA0)
Remark 2089 - Object is not referenced ^ (Name [DMA0] is within a method [TEST])
grammar.asl 7758: CreateDWordField (TMD0, 8, PIO1)
Remark 2089 - Object is not referenced ^ (Name [PIO1] is within a method [TEST])
grammar.asl 7759: CreateDWordField (TMD0, 12, DMA1)
Remark 2089 - Object is not referenced ^ (Name [DMA1] is within a method [TEST])
grammar.asl 7760: CreateDWordField (TMD0, 16, CHNF)
Remark 2089 - Object is not referenced ^ (Name [CHNF] is within a method [TEST])
grammar.asl 7934: Device (WHLB)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 8295: Device (IDX2)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar.asl 8678: Device (SIZO)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar.asl 8720: Name (PKG2, Package (4)
Remark 2063 - ^ Initializer list shorter than declared package length
grammar.asl 9132: Store (_OS, Local0)
Warning 3144 - ^ Method Local is set but never used (Local0)
grammar.asl 9262: Device (MBIT)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar.asl 9273: Device (MWRD)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar.asl 9281: Device (MBYT)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar.asl 9354: Device (SMIS)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar.asl 9408: Device(CNDT)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
Intel ACPI Component Architecture
ASL+ Optimizing Compiler/Disassembler version VVVVVVVV
Copyright (c) 2000 - 2018 Intel Corporation
Ignoring all errors, forcing AML file generation
ASL Input: grammar.asl - 10284 lines, 323650 bytes, 4818 keywords
AML Output: grammar.aml - 43469 bytes, 670 named objects, 4148 executable opcodes
Compilation complete. 6 Errors, 88 Warnings, 27 Remarks, 1232 Optimizations, 75 Constants Folded

33
tests/grammar/runtest.sh Executable file
View File

@ -0,0 +1,33 @@
#!/bin/bash
#
# run the misc tests: we need to do this in a script since
# these are expected to fail which would normally cause %check
# to stop. however, this is expected behavior. we are running
# iasl precisely because we expect it to stop when presented with
# faulty ASL.
#
# this script assumes it is in the source 'tests' directory at
# start.
#
PWD=$(pwd)
BINDIR="/usr/bin"
VERSION=$($BINDIR/iasl -v | grep Optimizing | cut -d" " -f5)
# create file to compare against
sed -e "s/VVVVVVVV/$VERSION/" \
grammar.asl.result > grammar.asl.expected
# see if grammar.asl failed as expected
# NB: the -f option is required so we can see all of the errors
$BINDIR/iasl -f grammar.asl > grammar.asl.actual 2>&1
diff grammar.asl.actual grammar.asl.expected
RET=$?
if [ $RET -eq 0 ]
then
echo PASS grammar
else
echo FAIL grammar
fi
exit $RET

3
tests/grammar2/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
grammar2.aml
grammar2.asl.actual
grammar2.asl.expected

3
tests/grammar2/PURPOSE Normal file
View File

@ -0,0 +1,3 @@
PURPOSE of tests/grammar
Description: sanity check that iasl is handling ASL grammar properly
Author: Al Stone <ahs3@redhat.com>

11652
tests/grammar2/grammar2.asl Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,368 @@
grammar2.asl 106: Device (A1)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar2.asl 121: Device (A2)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar2.asl 131: Device (A3)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar2.asl 141: Device (A4)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar2.asl 156: Device (IRES)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 184: Name (_NPK, Package (0x04)
Warning 3133 - ^ Unknown reserved name (_NPK)
grammar2.asl 191: Device (RES)
Warning 3141 - ^ Missing dependency (Device object requires a _HID or _ADR in same scope)
grammar2.asl 437: CreateByteField (PRT0, \RES._CRS._Y01._ASZ, RSIZ) // _ASZ: Access Size
Remark 2089 - Object is not referenced ^ (Name [RSIZ] is within a method [_CRS])
grammar2.asl 579: Name (_STR, Unicode ("test")) // _STR: Description String
Remark 2089 - ^ Object is not referenced (Name [_STR] is within a method [TCOP])
grammar2.asl 581: Local0 = MFLD /* \MFLD */
Warning 3144 - ^ Method Local is set but never used (Local0)
grammar2.asl 706: Method (RCIV, 1, NotSerialized)
Warning 3115 - ^ Not all control paths return a value (RCIV)
grammar2.asl 714: RCIV ((Arg0 - 0x01))
Remark 2098 - ^ Recursive method call (RCIV)
grammar2.asl 758: Method (SMWE, 4, NotSerialized)
Remark 2146 - ^ Method Argument is never used (Arg0)
grammar2.asl 758: Method (SMWE, 4, NotSerialized)
Remark 2146 - ^ Method Argument is never used (Arg1)
grammar2.asl 758: Method (SMWE, 4, NotSerialized)
Remark 2146 - ^ Method Argument is never used (Arg2)
grammar2.asl 758: Method (SMWE, 4, NotSerialized)
Remark 2146 - ^ Method Argument is never used (Arg3)
grammar2.asl 763: Method (SMRE, 4, NotSerialized)
Remark 2146 - ^ Method Argument is never used (Arg0)
grammar2.asl 763: Method (SMRE, 4, NotSerialized)
Remark 2146 - ^ Method Argument is never used (Arg1)
grammar2.asl 763: Method (SMRE, 4, NotSerialized)
Remark 2146 - ^ Method Argument is never used (Arg2)
grammar2.asl 763: Method (SMRE, 4, NotSerialized)
Remark 2146 - ^ Method Argument is never used (Arg3)
grammar2.asl 788: CreateField (\_SB.SBUF, 0x94, 0x60, FLDV)
Remark 2089 - Object is not referenced ^ (Name [FLDV] is within a method [_INI])
grammar2.asl 812: Method (_SRS, 0, NotSerialized) // _SRS: Set Resource Settings
Warning 3102 - ^ Reserved method has too few arguments (_SRS requires 1)
grammar2.asl 817: Device (EIO)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 885: If (!SMRE (0x09, 0x17, Local2, RefOf (Local3)))
Warning 3144 - Method Local is set but never used ^ (Local3)
grammar2.asl 981: Device (DEV1)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 1029: Divide (Local0, Local1, Local3)
Warning 3144 - Method Local is set but never used ^ (Local3)
grammar2.asl 1055: Method (R226, 2, NotSerialized)
Remark 2146 - ^ Method Argument is never used (Arg0)
grammar2.asl 1055: Method (R226, 2, NotSerialized)
Remark 2146 - ^ Method Argument is never used (Arg1)
grammar2.asl 1083: Local1 = Local0
Warning 3144 - ^ Method Local is set but never used (Local1)
grammar2.asl 1364: Method (OBJ1, 1, Serialized)
Remark 2146 - ^ Method Argument is never used (Arg0)
grammar2.asl 1367: Name (BUFR, Buffer (Local0){})
Remark 2089 - ^ Object is not referenced (Name [BUFR] is within a method [OBJ1])
grammar2.asl 1375: Alias (MTX1, MTX2)
Remark 2089 - Object is not referenced ^ (Name [MTX2] is within a method [OBJ1])
grammar2.asl 1393: CreateField (BUF2, 0x94, 0x60, FLD3)
Remark 2089 - Object is not referenced ^ (Name [FLD3] is within a method [FLDS])
grammar2.asl 1457: QWD2 = 0x1234567887654321
Warning 3038 - ^ Truncating 64-bit constant found in 32-bit table
grammar2.asl 1459: If ((Local0 != 0x1234567887654321))
Warning 3038 - ^ Truncating 64-bit constant found in 32-bit table
grammar2.asl 1536: SizeOf (BUFO)
Error 6114 - ^ Result is not used, operator has no effect
grammar2.asl 1550: Alias (MTX2, MTXA)
Remark 2089 - Object is not referenced ^ (Name [MTXA] is within a method [OBJ2])
grammar2.asl 1554: Acquire (MTX2, 0x0001)
Warning 3130 - ^ Result is not used, possible operator timeout will be missed
grammar2.asl 1669: (Local0 + Local1)
Error 6114 - ^ Result is not used, operator has no effect
grammar2.asl 1680: Local2 = (Local0 + Local1)
Warning 3144 - ^ Method Local is set but never used (Local2)
grammar2.asl 1792: Local0 = (0xFFFFFFFF && 0x11111111)
Warning 3144 - ^ Method Local is set but never used (Local0)
grammar2.asl 1794: Local1 = (0xFFFFFFFF == 0x11111111)
Warning 3144 - ^ Method Local is set but never used (Local1)
grammar2.asl 1796: Local2 = (0xFFFFFFFF > 0x11111111)
Warning 3144 - ^ Method Local is set but never used (Local2)
grammar2.asl 1798: Local3 = (0xFFFFFFFF >= 0x11111111)
Warning 3144 - ^ Method Local is set but never used (Local3)
grammar2.asl 1800: Local4 = (0xFFFFFFFF < 0x11111111)
Warning 3144 - ^ Method Local is set but never used (Local4)
grammar2.asl 1802: Local5 = (0xFFFFFFFF <= 0x11111111)
Warning 3144 - ^ Method Local is set but never used (Local5)
grammar2.asl 1827: Method (COND, 0, NotSerialized)
Warning 3115 - ^ Not all control paths return a value (COND)
grammar2.asl 1937: Local5 = RefOf (MAIN)
Warning 3144 - ^ Method Local is set but never used (Local5)
grammar2.asl 1999: Device (IFEL)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 2165: Device (NOSV)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 2604: Device (IDXF)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 2633: Local0 = IFE0 /* \IDXF.IFE0 */
Warning 3144 - ^ Method Local is set but never used (Local0)
grammar2.asl 2634: Local1 = IFE1 /* \IDXF.IFE1 */
Warning 3144 - ^ Method Local is set but never used (Local1)
grammar2.asl 2635: Local2 = IFE2 /* \IDXF.IFE2 */
Warning 3144 - ^ Method Local is set but never used (Local2)
grammar2.asl 2651: Device (NSTL)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 2681: Device (RTBF)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 2786: Device (GPE2)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 2801: Device (PRW2)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 2855: Device (PRW1)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 2936: Local0 = Arg0
Warning 3144 - ^ Method Local is set but never used (Local0)
grammar2.asl 2939: Device (RTLV)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 3052: Name (_CRS, 0x00) // _CRS: Current Resource Settings
Error 6105 - ^ Invalid object type for reserved name (_CRS: found Integer, Buffer required)
grammar2.asl 3159: Device (RETP)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 3199: Device (WHLR)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 3255: Device (ANDO)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 3543: Device (BRKP)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 3581: Device (ADSU)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 3706: Device (INDC)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 3835: Device (LOPS)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 4269: Device (FDSO)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 4484: Device (MLDV)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 4664: Device (NBIT)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 4955: Device (SHFT)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 5194: Device (XORD)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 5571: Device (CRBF)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 5674: Device (IDX4)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 6604: Device (EVNT)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 6867: Device (SZLV)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 6952: Device (BYTF)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 6963: Device (C005)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 6967: Device (C013)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 7039: Name (_HID, "*PNP0A06") // _HID: Hardware ID
Error 6061 - Invalid leading asterisk ^ (*PNP0A06)
grammar2.asl 7231: Name (C18C, Package (0x02)
Remark 2063 - ^ Initializer list shorter than declared package length
grammar2.asl 7264: Device (C19B)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 7276: Divide (Local1, 0x0A, Local0, Local2) /* Local0 = Local1 / 10 */
Warning 3144 - Method Local is set but never used ^ (Local0)
grammar2.asl 7321: Device (DWDF)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 7345: Method (MKW, 2, NotSerialized)
Remark 2146 - ^ Method Argument is never used (Arg0)
grammar2.asl 7345: Method (MKW, 2, NotSerialized)
Remark 2146 - ^ Method Argument is never used (Arg1)
grammar2.asl 7354: Device (DVAX)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 7394: Device (IDX6)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 7420: Device (TST)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 7441: Local0 = IFE0 /* \IDX6.IFE0 */
Warning 3144 - ^ Method Local is set but never used (Local0)
grammar2.asl 7442: Local1 = IFE1 /* \IDX6.IFE1 */
Warning 3144 - ^ Method Local is set but never used (Local1)
grammar2.asl 7443: Local2 = IFE2 /* \IDX6.IFE2 */
Warning 3144 - ^ Method Local is set but never used (Local2)
grammar2.asl 7446: Local3 = \IDX6.IFE0
Warning 3144 - ^ Method Local is set but never used (Local3)
grammar2.asl 7447: Local4 = \IDX6.IFE1
Warning 3144 - ^ Method Local is set but never used (Local4)
grammar2.asl 7450: Local5 = \IDX6.TST.IFE0
Warning 3144 - ^ Method Local is set but never used (Local5)
grammar2.asl 7451: Local6 = \IDX6.TST.IFE1
Warning 3144 - ^ Method Local is set but never used (Local6)
grammar2.asl 7463: Device (IDX5)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 7852: Device (BITI)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 7960: Local0 &= 0x01 /* Local0 &= 1 */
Error 6066 - ^ Method local variable is not initialized (Local0)
grammar2.asl 8123: Name (_HID, "*PNP0C0A") /* Control Method Battey ID */ // _HID: Hardware ID
Error 6061 - Invalid leading asterisk ^ (*PNP0C0A)
grammar2.asl 8133: Device (IDX3)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 8314: Device (IDX7)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 9020: Device (MTCH)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 9099: CreateDWordField (TMD0, 0x04, DMA0)
Remark 2089 - Object is not referenced ^ (Name [DMA0] is within a method [TEST])
grammar2.asl 9100: CreateDWordField (TMD0, 0x08, PIO1)
Remark 2089 - Object is not referenced ^ (Name [PIO1] is within a method [TEST])
grammar2.asl 9101: CreateDWordField (TMD0, 0x0C, DMA1)
Remark 2089 - Object is not referenced ^ (Name [DMA1] is within a method [TEST])
grammar2.asl 9102: CreateDWordField (TMD0, 0x10, CHNF)
Remark 2089 - Object is not referenced ^ (Name [CHNF] is within a method [TEST])
grammar2.asl 9295: Device (WHLB)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 9673: Device (IDX2)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 10054: Device (SIZO)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 10103: Name (PKG2, Package (0x04)
Remark 2063 - ^ Initializer list shorter than declared package length
grammar2.asl 10489: Local0 = _OS /* \_OS_ */
Warning 3144 - ^ Method Local is set but never used (Local0)
grammar2.asl 10621: Device (MBIT)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 10632: Device (MWRD)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 10640: Device (MBYT)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 10714: Device (SMIS)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
grammar2.asl 10780: Device (CNDT)
Warning 3141 - Missing dependency ^ (Device object requires a _HID or _ADR in same scope)
Intel ACPI Component Architecture
ASL+ Optimizing Compiler/Disassembler version VVVVVVVV
Copyright (c) 2000 - 2018 Intel Corporation
Ignoring all errors, forcing AML file generation
ASL Input: grammar2.asl - 11654 lines, 378020 bytes, 4899 keywords
AML Output: grammar2.aml - 43758 bytes, 670 named objects, 4229 executable opcodes
Compilation complete. 6 Errors, 86 Warnings, 27 Remarks, 1109 Optimizations

33
tests/grammar2/runtest.sh Executable file
View File

@ -0,0 +1,33 @@
#!/bin/bash
#
# run the misc tests: we need to do this in a script since
# these are expected to fail which would normally cause %check
# to stop. however, this is expected behavior. we are running
# iasl precisely because we expect it to stop when presented with
# faulty ASL.
#
# this script assumes it is in the source 'tests' directory at
# start.
#
PWD=$(pwd)
BINDIR="/usr/bin"
VERSION=$($BINDIR/iasl -v | grep Optimizing | cut -d" " -f5)
# create file to compare against
sed -e "s/VVVVVVVV/$VERSION/" \
grammar2.asl.result > grammar2.asl.expected
# see if grammar2.asl failed as expected
# NB: the -f option is required so we can see all of the errors
$BINDIR/iasl -f -of grammar2.asl > grammar2.asl.actual 2>&1
diff grammar2.asl.actual grammar2.asl.expected
RET=$?
if [ $RET -eq 0 ]
then
echo PASS grammar2
else
echo FAIL grammar2
fi
exit $RET

9
tests/test_acpidump.yml Normal file
View File

@ -0,0 +1,9 @@
- hosts: localhost
tags:
- classic
roles:
- role: standard-test-basic
tests:
- acpidump
required_packages:
- acpica-tools

View File

@ -0,0 +1,9 @@
- hosts: localhost
tags:
- classic
roles:
- role: standard-test-basic
tests:
- acpixtract
required_packages:
- acpica-tools

11
tests/test_aslts.yml Normal file
View File

@ -0,0 +1,11 @@
- hosts: localhost
roles:
- role: standard-test-beakerlib
tags:
- classic
- container
- atomic
tests:
- aslts
required_packages:
- acpica-tools

9
tests/test_badcode.yml Normal file
View File

@ -0,0 +1,9 @@
- hosts: localhost
tags:
- classic
roles:
- role: standard-test-basic
tests:
- badcode
required_packages:
- acpica-tools

View File

@ -0,0 +1,7 @@
- hosts: localhost
tags:
- classic
roles:
- role: standard-test-basic
tests:
- converterSample

View File

@ -0,0 +1,12 @@
# Tests that run in classic and atomic
- hosts: localhost
roles:
- role: standard-test-beakerlib
tags:
- classic
- atomic
tests:
- dump-tables
required_packages:
- acpica-tools

10
tests/test_grammar.yml Normal file
View File

@ -0,0 +1,10 @@
- hosts: localhost
tags:
- classic
roles:
- role: standard-test-basic
tests:
- grammar
required_packages:
- acpica-tools

10
tests/test_grammar2.yml Normal file
View File

@ -0,0 +1,10 @@
- hosts: localhost
tags:
- classic
roles:
- role: standard-test-basic
tests:
- grammar2
required_packages:
- acpica-tools

8
tests/tests.yml Normal file
View File

@ -0,0 +1,8 @@
- import_playbook: test_acpidump.yml
- import_playbook: test_acpixtract.yml
- import_playbook: test_badcode.yml
- import_playbook: test_grammar.yml
- import_playbook: test_grammar2.yml
- import_playbook: test_converterSample.yml
- import_playbook: test_dump-tables.yml
- import_playbook: test_aslts.yml