[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 19/19] tests: disassemble-asm.sh: generate AML in readable format
From: |
Michael S. Tsirkin |
Subject: |
[PULL 19/19] tests: disassemble-asm.sh: generate AML in readable format |
Date: |
Wed, 24 Jun 2020 19:07:18 -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 +++++++++++++++++++++++++++++++
1 file changed, 52 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
--
MST
- [PULL 09/19] acpi: drop serial/parallel enable bits from dsdt, (continued)
- [PULL 09/19] acpi: drop serial/parallel enable bits from dsdt, Michael S. Tsirkin, 2020/06/24
- [PULL 10/19] acpi: drop build_piix4_pm(), Michael S. Tsirkin, 2020/06/24
- [PULL 11/19] acpi: q35: drop _SB.PCI0.ISA.LPCD opregion., Michael S. Tsirkin, 2020/06/24
- [PULL 12/19] tests/acpi: update expected data files, Michael S. Tsirkin, 2020/06/24
- [PULL 14/19] arm/acpi: Add the TPM2.0 device under the DSDT, Michael S. Tsirkin, 2020/06/24
- [PULL 13/19] acpi: Some build_tpm2() code reshape, Michael S. Tsirkin, 2020/06/24
- [PULL 16/19] Stop vhost-user sending uninitialized mmap_offsets, Michael S. Tsirkin, 2020/06/24
- [PULL 15/19] docs/specs/tpm: ACPI boot now supported for TPM/ARM, Michael S. Tsirkin, 2020/06/24
- [PULL 17/19] Rename use_acpi_pci_hotplug to more appropriate use_acpi_hotplug_bridge, Michael S. Tsirkin, 2020/06/24
- [PULL 18/19] tests/qtest/bios-tables: Only run the TPM test with CONFIG_TPM enabled, Michael S. Tsirkin, 2020/06/24
- [PULL 19/19] tests: disassemble-asm.sh: generate AML in readable format,
Michael S. Tsirkin <=
- Re: [PULL 00/19] virtio,acpi,pci: fixes, cleanups, tools., Thomas Huth, 2020/06/25
- Re: [PULL 00/19] virtio,acpi,pci: fixes, cleanups, tools., Peter Maydell, 2020/06/25