[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 01/41] tests: disassemble-aml.sh: generate AML in readable form
From: |
Michael S. Tsirkin |
Subject: |
[PULL v2 01/41] tests: disassemble-aml.sh: generate AML in readable format |
Date: |
Sat, 4 Jul 2020 14:29:25 -0400 |
On systems where the IASL tool exists, we can convert
extected ACPI tables to ASL format, which is useful
for debugging and documentation purposes.
This script does this for all ACPI tables under tests/data/acpi/.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
tests/data/acpi/disassemle-aml.sh | 52 +++++++++++++++++++++++++
tests/data/acpi/rebuild-expected-aml.sh | 1 +
2 files changed, 53 insertions(+)
create mode 100755 tests/data/acpi/disassemle-aml.sh
diff --git a/tests/data/acpi/disassemle-aml.sh
b/tests/data/acpi/disassemle-aml.sh
new file mode 100755
index 0000000000..1d8a4d0301
--- /dev/null
+++ b/tests/data/acpi/disassemle-aml.sh
@@ -0,0 +1,52 @@
+#!/usr/bin/bash
+
+outdir=
+while getopts "o:" arg; do
+ case ${arg} in
+ o )
+ outdir=$OPTARG
+ ;;
+ \? )
+ echo "Usage: ./tests/data/acpi/disassemle-aml.sh [-o
<output-directory>]"
+ exit 1
+ ;;
+
+ esac
+done
+
+for machine in tests/data/acpi/*
+do
+ if [[ ! -d "$machine" ]];
+ then
+ continue
+ fi
+
+ if [[ "${outdir}" ]];
+ then
+ mkdir -p "${outdir}"/${machine} || exit $?
+ fi
+ for aml in $machine/*
+ do
+ if [[ "$aml" == $machine/*.dsl ]];
+ then
+ continue
+ fi
+ if [[ "$aml" == $machine/SSDT*.* ]];
+ then
+ dsdt=${aml/SSDT*./DSDT.}
+ extra="-e ${dsdt}"
+ elif [[ "$aml" == $machine/SSDT* ]];
+ then
+ dsdt=${aml/SSDT*/DSDT};
+ extra="-e ${dsdt}"
+ else
+ extra=""
+ fi
+ asl=${aml}.dsl
+ if [[ "${outdir}" ]];
+ then
+ asl="${outdir}"/${machine}/${asl}
+ fi
+ iasl -d -p ${asl} ${extra} ${aml}
+ done
+done
diff --git a/tests/data/acpi/rebuild-expected-aml.sh
b/tests/data/acpi/rebuild-expected-aml.sh
index 9cbaab1a4d..76cd797d1e 100755
--- a/tests/data/acpi/rebuild-expected-aml.sh
+++ b/tests/data/acpi/rebuild-expected-aml.sh
@@ -36,6 +36,7 @@ old_allowed_dif=`grep -v -e 'List of comma-separated changed
AML files to ignore
echo '/* List of comma-separated changed AML files to ignore */' >
${SRC_PATH}/tests/qtest/bios-tables-test-allowed-diff.h
echo "The files were rebuilt and can be added to git."
+echo "You can use ${SRC_PATH}/tests/data/acpi/disassemle-aml.sh to disassemble
them to ASL."
if [ -z "$old_allowed_dif" ]; then
echo "Note! Please do not commit expected files with source changes"
--
MST
- [PULL v2 00/41] virtio,acpi: features, fixes, cleanups., Michael S. Tsirkin, 2020/07/04
- [PULL v2 02/41] Revert "tests/migration: Reduce autoconverge initial bandwidth", Michael S. Tsirkin, 2020/07/04
- [PULL v2 03/41] virtio-balloon: always indicate S_DONE when migration fails, Michael S. Tsirkin, 2020/07/04
- [PULL v2 04/41] pc: Support coldplugging of virtio-pmem-pci devices on all buses, Michael S. Tsirkin, 2020/07/04
- [PULL v2 05/41] exec: Introduce ram_block_discard_(disable|require)(), Michael S. Tsirkin, 2020/07/04
- [PULL v2 07/41] accel/kvm: Convert to ram_block_discard_disable(), Michael S. Tsirkin, 2020/07/04
- [PULL v2 06/41] vfio: Convert to ram_block_discard_disable(), Michael S. Tsirkin, 2020/07/04
- [PULL v2 01/41] tests: disassemble-aml.sh: generate AML in readable format,
Michael S. Tsirkin <=
- [PULL v2 10/41] target/i386: sev: Use ram_block_discard_disable(), Michael S. Tsirkin, 2020/07/04
- [PULL v2 08/41] s390x/pv: Convert to ram_block_discard_disable(), Michael S. Tsirkin, 2020/07/04
- [PULL v2 09/41] virtio-balloon: Rip out qemu_balloon_inhibit(), Michael S. Tsirkin, 2020/07/04
- [PULL v2 11/41] migration/rdma: Use ram_block_discard_disable(), Michael S. Tsirkin, 2020/07/04
- [PULL v2 12/41] migration/colo: Use ram_block_discard_disable(), Michael S. Tsirkin, 2020/07/04
- [PULL v2 13/41] virtio-mem: Paravirtualized memory hot(un)plug, Michael S. Tsirkin, 2020/07/04
- [PULL v2 14/41] virtio-pci: Proxy for virtio-mem, Michael S. Tsirkin, 2020/07/04
- [PULL v2 15/41] MAINTAINERS: Add myself as virtio-mem maintainer, Michael S. Tsirkin, 2020/07/04
- [PULL v2 16/41] hmp: Handle virtio-mem when printing memory device info, Michael S. Tsirkin, 2020/07/04
- [PULL v2 17/41] numa: Handle virtio-mem in NUMA stats, Michael S. Tsirkin, 2020/07/04