@@ -0,0 +1,63 @@
1+From 858dbaaeda33b05c1ac80aea0ba9a03924e09005 Mon Sep 17 00:00:00 2001
2+From: =?utf8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
3+Date: Wed, 9 May 2018 11:08:12 +0100
4+Subject: [PATCH] libacpi: fixes for iasl >= 20180427
5+MIME-Version: 1.0
6+Content-Type: text/plain; charset=utf8
7+Content-Transfer-Encoding: 8bit
8+
9+New versions of iasl have introduced improved C file generation, as
10+reported in the changelog:
11+
12+iASL: Enhanced the -tc option (which creates an AML hex file in C,
13+suitable for import into a firmware project):
14+ 1) Create a unique name for the table, to simplify use of multiple
15+SSDTs.
16+ 2) Add a protection #ifdef in the file, similar to a .h header file.
17+
18+The net effect of that on generated files is:
19+
20+-unsigned char AmlCode[] =
21++#ifndef __SSDT_S4_HEX__
22++#define __SSDT_S4_HEX__
23++
24++unsigned char ssdt_s4_aml_code[] =
25+
26+The above example is from ssdt_s4.asl.
27+
28+Fix the build with newer versions of iasl by stripping the '_aml_code'
29+suffix from the variable name on generated files.
30+
31+Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
32+Reviewed-by: Wei Liu <wei.liu2@citrix.com>
33+Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
34+Release-acked-by: Juergen Gross <jgross@suse.com>
35+---
36+ tools/libacpi/Makefile | 4 ++--
37+ 1 file changed, 2 insertions(+), 2 deletions(-)
38+
39+diff --git a/tools/libacpi/Makefile b/tools/libacpi/Makefile
40+index a47a658a25..c17f3924cc 100644
41+--- a/tools/libacpi/Makefile
42++++ b/tools/libacpi/Makefile
43+@@ -43,7 +43,7 @@ all: $(C_SRC) $(H_SRC)
44+
45+ $(H_SRC): $(ACPI_BUILD_DIR)/%.h: %.asl iasl
46+ iasl -vs -p $(ACPI_BUILD_DIR)/$*.$(TMP_SUFFIX) -tc $<
47+- sed -e 's/AmlCode/$*/g' $(ACPI_BUILD_DIR)/$*.hex >$@
48++ sed -e 's/AmlCode/$*/g' -e 's/_aml_code//g' $(ACPI_BUILD_DIR)/$*.hex >$@
49+ rm -f $(addprefix $(ACPI_BUILD_DIR)/, $*.aml $*.hex)
50+
51+ $(MK_DSDT): mk_dsdt.c
52+@@ -76,7 +76,7 @@ $(ACPI_BUILD_DIR)/dsdt_anycpu_arm.asl: $(MK_DSDT)
53+
54+ $(C_SRC): $(ACPI_BUILD_DIR)/%.c: iasl $(ACPI_BUILD_DIR)/%.asl
55+ iasl -vs -p $(ACPI_BUILD_DIR)/$*.$(TMP_SUFFIX) -tc $(ACPI_BUILD_DIR)/$*.asl
56+- sed -e 's/AmlCode/$*/g' $(ACPI_BUILD_DIR)/$*.hex > $@.$(TMP_SUFFIX)
57++ sed -e 's/AmlCode/$*/g' -e 's/_aml_code//g' $(ACPI_BUILD_DIR)/$*.hex > $@.$(TMP_SUFFIX)
58+ echo "int $*_len=sizeof($*);" >> $@.$(TMP_SUFFIX)
59+ mv -f $@.$(TMP_SUFFIX) $@
60+ rm -f $(addprefix $(ACPI_BUILD_DIR)/, $*.aml $*.hex)
61+--
62+2.11.0
63+