Use iasl -l flag to produce a mixed listing, where a source line is followed by matching AML. Since we use a preprocessed input, this generates long lines with multiple commands per line. To make it possible to match AML to source exactly, split the input that we supply iasl, with each command on a separate line. Signed-off-by: Michael S. Tsirkin <mst@xxxxxxxxxx> --- Makefile | 7 ++++--- src/splitdsl.pl | 16 ++++++++++++++++ 2 files changed, 20 insertions(+), 3 deletions(-) create mode 100755 src/splitdsl.pl diff --git a/Makefile b/Makefile index 109091b..5c011bb 100644 --- a/Makefile +++ b/Makefile @@ -192,10 +192,11 @@ $(OUT)vgabios.bin: $(OUT)vgabios.bin.raw tools/buildrom.py $(Q)./tools/buildrom.py $< $@ ####### dsdt build rules -src/%.hex: src/%.dsl +src/%.hex: src/%.dsl src/splitdsl.pl src/find_ej0.pl @echo "Compiling DSDT" - $(Q)cpp -P $< > $(OUT)$*.dsl.i - $(Q)iasl -tc -p $(OUT)$* $(OUT)$*.dsl.i + $(Q)cpp -P $< > $(OUT)$*.dsl.i.orig + $(Q)./src/splitdsl.pl $(OUT)$*.dsl.i.orig > $(OUT)$*.dsl.i + $(Q)iasl -l -tc -p $(OUT)$* $(OUT)$*.dsl.i $(Q)cp $(OUT)$*.hex $@ $(OUT)ccode32flat.o: src/acpi-dsdt.hex diff --git a/src/splitdsl.pl b/src/splitdsl.pl new file mode 100755 index 0000000..1caccba --- /dev/null +++ b/src/splitdsl.pl @@ -0,0 +1,16 @@ +#!/usr/bin/perl + +while (<>) +{ + #Remove // comments if any as we can not split lines after them + s#//.*##; + #Code after { starts a new line + s/(\{)(\s*\S)/$1\n$2/g; + #Operator after ) starts a new line + s/(\))(\s*[_A-Za-z])/$1\n$2/g; + #Code after } starts a new line + s/(})(\s*\S)/$1\n$2/g; + #} starts a new line + s/(\S\s*)(\})/$1\n$2/g; + print; +} -- 1.7.5.53.gc233e -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html