Merge tag 'v6.0.0-rc0'
[qemu/ar7.git] / tests / data / acpi / disassemle-aml.sh
blob253b7620a074fd029441ce31fa81928851ea49c1
1 #!/usr/bin/bash
3 outdir=
4 while getopts "o:" arg; do
5 case ${arg} in
6 o )
7 outdir=$OPTARG
8 ;;
9 \? )
10 echo "Usage: ./tests/data/acpi/disassemle-aml.sh [-o <output-directory>]"
11 exit 1
14 esac
15 done
17 for machine in tests/data/acpi/*
19 if [[ ! -d "$machine" ]];
20 then
21 continue
24 if [[ "${outdir}" ]];
25 then
26 mkdir -p "${outdir}"/${machine} || exit $?
28 for aml in $machine/*
30 if [[ "$aml" == $machine/*.dsl ]];
31 then
32 continue
34 if [[ "$aml" == $machine/SSDT*.* ]];
35 then
36 dsdt=${aml/SSDT*./DSDT.}
37 extra="-e ${dsdt}"
38 elif [[ "$aml" == $machine/SSDT* ]];
39 then
40 dsdt=${aml/SSDT*/DSDT};
41 extra="-e ${dsdt}"
42 else
43 extra=""
45 if [[ "${outdir}" ]];
46 then
47 # iasl strips an extension from prefix if there.
48 # since we have some files with . in the name, the
49 # last component gets interpreted as an extension:
50 # add another extension to work around that.
51 prefix="-p ${outdir}/${aml}.dsl"
52 else
53 prefix=""
55 iasl ${extra} ${prefix} -d ${aml}
56 done
57 done