Yocto 2.4

Move OpenBMC to Yocto 2.4(rocko)

Tested: Built and verified Witherspoon and Palmetto images
Change-Id: I12057b18610d6fb0e6903c60213690301e9b0c67
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/import-layers/yocto-poky/meta/recipes-extended/acpica/acpica_20150515.bb b/import-layers/yocto-poky/meta/recipes-extended/acpica/acpica_20170303.bb
similarity index 82%
rename from import-layers/yocto-poky/meta/recipes-extended/acpica/acpica_20150515.bb
rename to import-layers/yocto-poky/meta/recipes-extended/acpica/acpica_20170303.bb
index 1326ebd..868505b 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/acpica/acpica_20150515.bb
+++ b/import-layers/yocto-poky/meta/recipes-extended/acpica/acpica_20170303.bb
@@ -19,14 +19,20 @@
 SRC_URI = "https://acpica.org/sites/acpica/files/acpica-unix2-${PV}.tar.gz \
     file://no-werror.patch \
     file://rename-yy_scan_string-manually.patch \
-    file://manipulate-fds-instead-of-FILE.patch \
+    file://manipulate-fds-instead-of-FILE.patch;striplevel=2 \
+    file://0001-Linux-add-support-for-X32-ABI-compilation.patch \
     "
-SRC_URI[md5sum] = "2bc4a7ccc82de9df9fa964f784ecb29c"
-SRC_URI[sha256sum] = "61204ec56d71bc9bfa2ee2ade4c66f7e8541772ac72ef8ccc20b3f339cc96374"
+SRC_URI[md5sum] = "48ef4314fb4ffdd0c96f14dcf20544e1"
+SRC_URI[sha256sum] = "b2d81e84107ac9a02be86ea43cbea7afa8fd4b4150270bc88c2d4c9fea0b8aad"
 UPSTREAM_CHECK_URI = "https://acpica.org/downloads"
 
 S = "${WORKDIR}/acpica-unix2-${PV}"
 
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+ALTERNATIVE_${PN} = "acpixtract"
+
 EXTRA_OEMAKE = "CC='${CC}' 'OPT_CFLAGS=-Wall'"
 
 do_install() {
diff --git a/import-layers/yocto-poky/meta/recipes-extended/acpica/acpitests/aapits-linux.patch b/import-layers/yocto-poky/meta/recipes-extended/acpica/acpitests/aapits-linux.patch
deleted file mode 100644
index 7c5d6b0..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/acpica/acpitests/aapits-linux.patch
+++ /dev/null
@@ -1,336 +0,0 @@
-From: Al Stone <ahs3@ahs3.net>
-Date: Mon, 7 Apr 2014 19:09:37 +0000
-Subject: [PATCH 1/2] Fixup aapits build
-
-From http://git.linaro.org/people/al.stone/acpica-tools.git
-Upstream-status: Unknown
-
-diff -urN acpica-unix2-20130626/tests/aapits/atexec.c acpica-unix2-20130626-aapits/tests/aapits/atexec.c
---- acpica-unix2-20130626/tests/aapits/atexec.c	2013-01-17 12:48:28.000000000 -0700
-+++ acpica-unix2-20130626-aapits/tests/aapits/atexec.c	2013-07-25 13:44:23.023894441 -0600
-@@ -639,6 +639,7 @@
- }
- 
- 
-+#if ACPI_MACHINE_WIDTH == 32
- /*******************************************************************************
-  *
-  * FUNCTION:    AtBuildLocalRSDT
-@@ -757,8 +758,9 @@
-         LocalRSDT->Header.Checksum = (UINT8)~LocalRSDT->Header.Checksum;
-     }
- }
-+#endif
- 
- 
- /*******************************************************************************
-  *
-  * FUNCTION:    AtBuildLocalXSDT
-@@ -1424,7 +1426,7 @@
-         ACPI_WARNING ((AE_INFO,
-             "Request on [%4.4s] is beyond region limit Req-%X+%X, Base=%X, Len-%X\n",
-             (RegionObject->Region.Node)->Name.Ascii, (UINT32) Address,
--            ByteWidth, (UINT32) BufferAddress, Length));
-+            ByteWidth, (UINT32) BufferAddress, (UINT32) Length));
- 
-         return (AE_AML_REGION_LIMIT);
-     }
-@@ -1792,7 +1796,9 @@
-             Path, Obj.Integer.Value, Value);
- #else
-         printf ("API Error: Value of %s is 0x%llx instead of expected 0x%llx\n",
--            Path, Obj.Integer.Value, Value);
-+            Path,
-+	    (long long unsigned int) Obj.Integer.Value,
-+	    (long long unsigned int) Value);
- #endif
-         Status = AE_ERROR;
-     }
-@@ -1871,7 +1877,7 @@
-     {
-         TestErrors++;
-         printf ("Test Error: cannot allocate buffer of %d bytes\n",
--            Results.Length);
-+                (int) Results.Length);
-         return (AE_NO_MEMORY);
-     }
-     Results.Pointer = Object;
-@@ -1952,7 +1956,8 @@
-     {
-         printf ("AtCheckBuffer: unexpected length %d of Buffer vs"
-             " calculated %d bytes\n",
--            Results.Length, ACPI_ROUND_UP_TO_NATIVE_WORD(sizeof (ACPI_OBJECT) + Length));
-+            (int)Results.Length,
-+	    (int)(ACPI_ROUND_UP_TO_NATIVE_WORD(sizeof (ACPI_OBJECT) + Length)));
-     }
- 
-     /* Initialize the return buffer structure */
-@@ -1961,7 +1968,7 @@
-     {
-         TestErrors++;
-         printf ("Test Error: cannot allocate buffer of %d bytes\n",
--            Results.Length);
-+            (int) Results.Length);
-         return (AE_NO_MEMORY);
-     }
-     Results.Pointer = Object;
-diff -urN acpica-unix2-20130626/tests/aapits/atinit.c acpica-unix2-20130626-aapits/tests/aapits/atinit.c
---- acpica-unix2-20130626/tests/aapits/atinit.c	2013-01-17 12:48:28.000000000 -0700
-+++ acpica-unix2-20130626-aapits/tests/aapits/atinit.c	2013-07-25 13:20:19.706705960 -0600
-@@ -3024,7 +3024,7 @@
-             AapiErrors++;
-             printf ("API Error: AcpiGetSystemInfo() returned"
-                 " Length %d, expected %d\n",
--                OutBuffer.Length, sizeof (Info));
-+                (int) OutBuffer.Length, (int) sizeof (Info));
-             return (AE_ERROR);
-         }
- 
-@@ -3046,7 +3046,7 @@
-             AapiErrors++;
-             printf ("API Error: AcpiGetSystemInfo() returned"
-                 " Length %d, expected %d\n",
--                OutBuffer.Length, sizeof (Info));
-+                (int) OutBuffer.Length, (int) sizeof (Info));
-             return (AE_ERROR);
-         }
- 
-@@ -3066,7 +3066,7 @@
-             AapiErrors++;
-             printf ("API Error: AcpiGetSystemInfo() returned"
-                 " Length %d, expected %d\n",
--                OutBuffer.Length, sizeof (Info));
-+                (int) OutBuffer.Length, (int) sizeof (Info));
-             return (AE_ERROR);
-         }
-         else if (OutBuffer.Pointer != &Info)
-@@ -3149,7 +3149,7 @@
-             AapiErrors++;
-             printf ("API Error: AcpiGetSystemInfo() returned"
-                 " Length %d, expected %d\n",
--                OutBuffer.Length, sizeof (Info));
-+                (int) OutBuffer.Length, (int) sizeof (Info));
-             return (AE_ERROR);
-         }
-         else if (OutBuffer.Pointer != &Info)
-@@ -3214,7 +3214,7 @@
-             AapiErrors++;
-             printf ("API Error: AcpiGetSystemInfo() returned"
-                 " Length %d, expected %d\n",
--                OutBuffer.Length, sizeof (ACPI_SYSTEM_INFO));
-+                (int) OutBuffer.Length, (int) sizeof (ACPI_SYSTEM_INFO));
-             return (AE_ERROR);
-         }
-         else
-diff -urN acpica-unix2-20130626/tests/aapits/atmain.c acpica-unix2-20130626-aapits/tests/aapits/atmain.c
---- acpica-unix2-20130626/tests/aapits/atmain.c	2013-01-17 12:48:28.000000000 -0700
-+++ acpica-unix2-20130626-aapits/tests/aapits/atmain.c	2013-07-25 13:18:22.083323948 -0600
-@@ -315,7 +315,7 @@
-     {
-         printf ("ACPICA API TS err: test num %ld of test case %ld"
-             " is not implemented\n",
--            test_num, test_case);
-+            (long int) test_num, (long int) test_case);
-         return (AtRetNotImpl);
-     }
- 
-@@ -430,7 +432,7 @@
-     if (test_case < 1 || test_case > AT_TEST_CASE_NUM)
-     {
-         printf ("ACPICA API TS err: test case %ld is out of range 1 - %d\n",
--            test_case, AT_TEST_CASE_NUM);
-+            (long int) test_case, (int) AT_TEST_CASE_NUM);
-         return (AtRetBadParam);
-     }
- 
-@@ -438,7 +440,7 @@
-     if (test_num < 0 || test_num > AtTestCase[test_case].TestsNum)
-     {
-         printf ("ACPICA API TS err: test num %ld is out of range 0 - %d\n",
--            test_num, AtTestCase[test_case].TestsNum);
-+            (long int) test_num, AtTestCase[test_case].TestsNum);
-         return (AtRetBadParam);
-     }
-
-diff -urN acpica-unix2-20130626/tests/aapits/atnamespace.c acpica-unix2-20130626-aapits/tests/aapits/atnamespace.c
---- acpica-unix2-20130626/tests/aapits/atnamespace.c	2013-01-17 12:48:28.000000000 -0700
-+++ acpica-unix2-20130626-aapits/tests/aapits/atnamespace.c	2013-07-25 13:24:15.366466707 -0600
-@@ -2535,7 +2535,8 @@
- #else
-                 printf ("API Error: Address of %s (0x%llX) != (0x%llX)\n",
-                     PathNames[2 * i + 1],
--                    Info->Address, ExpectedInfo[i].Address);
-+                    (long long unsigned int) Info->Address,
-+		    (long long unsigned int) ExpectedInfo[i].Address);
- #endif
- #else
-                 printf ("API Error: Address of %s (0x%X) != (0x%X)\n",
-@@ -2908,7 +2909,8 @@
-         TestErrors++;
-         printf ("AtGetNextObjectTypeCommon: different numbers of entities"
-             "in TypesNames (%d) and LevelTypes0000 (%d)\n",
--            TypesCount, sizeof (LevelTypes0000) / sizeof (ACPI_OBJECT_TYPE));
-+            TypesCount,
-+	    (int) (sizeof (LevelTypes0000) / sizeof (ACPI_OBJECT_TYPE)));
-         return (AE_ERROR);
-     }
- 
-@@ -4192,7 +4194,9 @@
-             Pathname, Obj.Integer.Value, Value);
- #else
-         printf ("API Error: Value of %s is 0x%llx instead of expected 0x%llx\n",
--            Pathname, Obj.Integer.Value, Value);
-+            Pathname,
-+	    (long long unsigned int) Obj.Integer.Value,
-+	    (long long unsigned int) Value);
- #endif
-         Status = AE_ERROR;
-     }
-@@ -5199,7 +5203,7 @@
-             {
-                 AapiErrors++;
-                 printf ("API Error: AcpiOsAllocate(%d) returned NULL\n",
--                    OutName.Length);
-+                    (int) OutName.Length);
-                 return (AE_ERROR);
-             }
-         }
-diff -urN acpica-unix2-20130626/tests/aapits/atosxfctrl.c acpica-unix2-20130626-aapits/tests/aapits/atosxfctrl.c
---- acpica-unix2-20130626/tests/aapits/atosxfctrl.c	2013-01-17 12:48:28.000000000 -0700
-+++ acpica-unix2-20130626-aapits/tests/aapits/atosxfctrl.c	2013-07-25 13:30:00.375492751 -0600
-@@ -737,13 +737,15 @@
- #if ACPI_MACHINE_WIDTH == 64
- #ifdef    _MSC_VER
-         printf("OsxfCtrlFingReg: unexpected Width %d of Reg 0x%I64x\n",
-+            Width, Address);
- #else
-         printf("OsxfCtrlFingReg: unexpected Width %d of Reg 0x%llx\n",
-+            Width, (long long unsigned int) Address);
- #endif
- #else
-         printf("OsxfCtrlFingReg: unexpected Width %d of Reg 0x%x\n",
--#endif
-             Width, Address);
-+#endif
-         return (NULL);
-     }
- 
-@@ -764,15 +766,19 @@
- #ifdef    _MSC_VER
-                 printf("OsxfCtrlFingReg: intersection Regs (0x%I64x: 0x%x)"
-                     " and (0x%I64x: 0x%x)\n",
-+                    Reg->Address, Reg->Width, Address, Width);
- #else
-                 printf("OsxfCtrlFingReg: intersection Regs (0x%llx: 0x%x)"
-                     " and (0x%llx: 0x%x)\n",
-+                    (long long unsigned int) Reg->Address,
-+		    Reg->Width,
-+		    (long long unsigned int) Address, Width);
- #endif
- #else
-                 printf("OsxfCtrlFingReg: intersection Regs (0x%x: 0x%x)"
-                     " and (0x%x: 0x%x)\n",
--#endif
-                     Reg->Address, Reg->Width, Address, Width);
-+#endif
-                 return (NULL);
-             }
-         }
-@@ -786,13 +792,15 @@
- #if ACPI_MACHINE_WIDTH == 64
- #ifdef    _MSC_VER
-             printf("OsxfCtrlFingReg: no memory for Reg (0x%I64x: 0x%x)\n",
-+                Reg->Address, Reg->Width);
- #else
-             printf("OsxfCtrlFingReg: no memory for Reg (0x%llx: 0x%x)\n",
-+                (long long unsigned int) Reg->Address, Reg->Width);
- #endif
- #else
-             printf("OsxfCtrlFingReg: no memory for Reg (0x%x: 0x%x)\n",
--#endif
-                 Reg->Address, Reg->Width);
-+#endif
-             return (NULL);
-         }
-         Reg->Type = Type;
-@@ -932,14 +940,19 @@
- #if ACPI_MACHINE_WIDTH == 64
- #ifdef    _MSC_VER
-             printf("%.2u (%s Address 0x%I64x: Width %.2u) r/w counts: %u/%u\n",
-+                i, (Reg->Type == EMUL_REG_SYS)? "SYS": "IO",
-+                Reg->Address, Reg->Width, Reg->ReadCount, Reg->WriteCount);
- #else
-             printf("%.2u (%s Address 0x%llx: Width %.2u) r/w counts: %u/%u\n",
-+                i, (Reg->Type == EMUL_REG_SYS)? "SYS": "IO",
-+                (long long unsigned int) Reg->Address,
-+		Reg->Width, Reg->ReadCount, Reg->WriteCount);
- #endif
- #else
-             printf("%.2u (%s Address 0x%.4x: Width %.2u) r/w counts: %u/%u\n",
--#endif
-                 i, (Reg->Type == EMUL_REG_SYS)? "SYS": "IO",
-                 Reg->Address, Reg->Width, Reg->ReadCount, Reg->WriteCount);
-+#endif
-             Reg = Reg->Next;
-             i++;
-         }
-diff -urN acpica-unix2-20130626/tests/aapits/atresource.c acpica-unix2-20130626-aapits/tests/aapits/atresource.c
---- acpica-unix2-20130626/tests/aapits/atresource.c	2013-01-17 12:48:29.000000000 -0700
-+++ acpica-unix2-20130626-aapits/tests/aapits/atresource.c	2013-07-25 13:25:49.423565947 -0600
-@@ -174,7 +174,7 @@
-         AapiErrors++;
-         printf ("API Error: AcpiGetCurrentResources(%s) returned Length %d,"
-             " expected %d\n",
--            Pathname, OutBuffer.Length, RT0000_DEV0_CRS_LEN);
-+            Pathname, (int) OutBuffer.Length, RT0000_DEV0_CRS_LEN);
-         return (AE_ERROR);
-     }
- 
-@@ -490,7 +490,7 @@
-         AapiErrors++;
-         printf ("API Error: AcpiGetCurrentResources(%s) returned Length %d,"
-             " expected %d\n",
--            Pathname, OutBuffer.Length, RT0000_DEV0_CRS_LEN);
-+            Pathname, (int) OutBuffer.Length, RT0000_DEV0_CRS_LEN);
-         return (AE_ERROR);
-     }
- 
-@@ -689,7 +689,7 @@
-         AapiErrors++;
-         printf ("Api Error: Resource->Length (%d) != %d\n",
-             CurrentResource->Length,
--            ACPI_ROUND_UP_TO_NATIVE_WORD (ACPI_RS_SIZE (ACPI_RESOURCE_IRQ)));
-+            (int) (ACPI_ROUND_UP_TO_NATIVE_WORD (ACPI_RS_SIZE (ACPI_RESOURCE_IRQ))));
-     }
- 
-     if (CurrentResource->Data.Irq.Triggering != 0) /* Level-Triggered */
-@@ -981,7 +981,7 @@
-         AapiErrors++;
-         printf ("API Error: AcpiGetPossibleResources(%s) returned Length %d,"
-             " expected %d\n",
--            Pathname, OutBuffer.Length, RT0000_DEV0_CRS_LEN);
-+            Pathname, (int) OutBuffer.Length, RT0000_DEV0_CRS_LEN);
-         return (AE_ERROR);
-     }
- 
-@@ -1923,7 +1923,7 @@
-         AapiErrors++;
-         printf ("API Error: AcpiGetIrqRoutingTable(%s) returned Length %d,"
-             " expected %d\n",
--            Pathname, OutBuffer.Length, 0xA48);
-+            Pathname, (int) OutBuffer.Length, 0xA48);
-         return (AE_ERROR);
-     }
-
-diff -urN acpica-unix2-20130626/tests/aapits/Makefile acpica-unix2-20130626-aapits/tests/aapits/Makefile
---- acpica-unix2-20130626/tests/aapits/Makefile	2013-01-17 12:48:29.000000000 -0700
-+++ acpica-unix2-20130626-aapits/tests/aapits/Makefile	2013-07-25 15:17:09.309236422 -0600
-@@ -194,7 +194,7 @@
- CFLAGS+= -Wall -g -D_LINUX -DNDEBUG -D_CONSOLE -DACPI_APITS -DACPI_EXEC_APP -D_MULTI_THREADED -Wstrict-prototypes -I../../source/include
-
- 
--acpiexec : $(patsubst %.c,%.o, $(SRCS))
-+$(PROG) : $(patsubst %.c,%.o, $(SRCS))
- 	$(CC) $(LDFLAGS) $(patsubst %.c,%.o, $(SRCS)) -o $(PROG)
- 
- CLEANFILES= $(PROG)
diff --git a/import-layers/yocto-poky/meta/recipes-extended/acpica/acpitests/aapits-makefile.patch b/import-layers/yocto-poky/meta/recipes-extended/acpica/acpitests/aapits-makefile.patch
deleted file mode 100644
index 4d9e997..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/acpica/acpitests/aapits-makefile.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From: Al Stone <ahs3@ahs3.net>
-Date: Mon, 7 Apr 2014 19:09:37 +0000
-Subject: [PATCH 1/2] Fixup aapits build
-
-From http://git.linaro.org/people/al.stone/acpica-tools.git
-Upstream-status: Unknown
-
-diff -urN acpica-unix2-20140325/tests/aapits/Makefile acpica-unix2-20140325/tests/aapits/Makefile
---- acpica-unix2-20140325/tests/aapits/Makefile	2014-04-05 14:23:14.683636794 -0600
-+++ acpica-unix2-20140325-aapits/tests/aapits/Makefile	2014-04-05 15:10:57.879184598 -0600
-@@ -16,6 +16,7 @@
- 	atosxfwrap.c \
- 	osunixxf.c \
- 	../../source/common/ahids.c \
-+	../../source/common/ahuuids.c \
- 	../../source/common/cmfsize.c \
- 	../../source/common/getopt.c \
- 	../../source/components/hardware/hwtimer.c \
-@@ -174,6 +175,7 @@
- 	../../source/components/utilities/utexcep.c \
- 	../../source/components/utilities/utfileio.c \
- 	../../source/components/utilities/utglobal.c \
-+	../../source/components/utilities/uthex.c \
- 	../../source/components/utilities/utids.c \
- 	../../source/components/utilities/utinit.c \
- 	../../source/components/utilities/utlock.c \
-@@ -189,6 +191,7 @@
- 	../../source/components/utilities/utstate.c \
- 	../../source/components/utilities/utstring.c \
- 	../../source/components/utilities/uttrack.c \
-+	../../source/components/utilities/utuuid.c \
- 	../../source/components/utilities/utxface.c \
- 	../../source/components/utilities/utxferror.c \
- 	../../source/components/utilities/utxfinit.c \
diff --git a/import-layers/yocto-poky/meta/recipes-extended/acpica/acpitests_20140828.bb b/import-layers/yocto-poky/meta/recipes-extended/acpica/acpitests_20140828.bb
deleted file mode 100644
index 45ac157..0000000
--- a/import-layers/yocto-poky/meta/recipes-extended/acpica/acpitests_20140828.bb
+++ /dev/null
@@ -1,36 +0,0 @@
-SUMMARY = "Test suite used to validate ACPICA"
-HOMEPAGE = "http://www.acpica.org/"
-
-LICENSE = "Intel"
-LIC_FILES_CHKSUM = "file://tests/aapits/atexec.c;beginline=1;endline=115;md5=e92bcdfcd01d117d1bda3e814bb2030a"
-
-DEPENDS = "bison flex"
-
-SRC_URI = "https://acpica.org/sites/acpica/files/acpitests-unix-${PV}.tar.gz;name=acpitests \
-           https://acpica.org/sites/acpica/files/acpica-unix2-${PV}.tar.gz;name=acpica \
-           file://aapits-linux.patch \
-           file://aapits-makefile.patch \
-"
-SRC_URI[acpitests.md5sum] = "db9d6fdaa8e3eb101d700ee5ba4938ed"
-SRC_URI[acpitests.sha256sum] = "e576c74bf1bf1c9f7348bf9419e05c8acfece7105abcdc052e66670c7af2cf00"
-SRC_URI[acpica.md5sum] = "6f05f0d10166a1b1ff6107f3d1cdf1e5"
-SRC_URI[acpica.sha256sum] = "01d8867656c5ba41dec307c4383ce676196ad4281ac2c9dec9f5be5fac6d888e"
-UPSTREAM_CHECK_URI = "https://acpica.org/downloads"
-
-S = "${WORKDIR}/acpitests-unix-${PV}"
-
-EXTRA_OEMAKE = "'CC=${CC}' 'OPT_CFLAGS=-Wall'"
-
-# The Makefiles expect a specific layout
-do_compile() {
-    cp -af ${WORKDIR}/acpica-unix2-${PV}/source ${S}
-    cd tests/aapits
-    oe_runmake
-}
-
-do_install() {
-    install -d ${D}${bindir}
-    install -m0755 tests/aapits/bin/aapits ${D}${bindir}
-}
-
-COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/acpica/files/0001-Linux-add-support-for-X32-ABI-compilation.patch b/import-layers/yocto-poky/meta/recipes-extended/acpica/files/0001-Linux-add-support-for-X32-ABI-compilation.patch
new file mode 100644
index 0000000..df74200
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/acpica/files/0001-Linux-add-support-for-X32-ABI-compilation.patch
@@ -0,0 +1,31 @@
+From d22241efc0708c9799f17a20eabb52a48d6d6ea1 Mon Sep 17 00:00:00 2001
+From: Anuj Mittal <anuj.mittal@intel.com>
+Date: Tue, 2 Jan 2018 12:35:32 +0800
+Subject: [PATCH] Linux: add support for X32 ABI compilation
+
+X32 follows ILP32 model. Check for ILP32 as well when checking for
+x86_64 to ensure the defines are correct for X32 ABI.
+
+Upstream-Status: Submitted [https://github.com/acpica/acpica/pull/348]
+
+Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
+---
+ source/include/platform/aclinux.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/source/include/platform/aclinux.h b/source/include/platform/aclinux.h
+index 75b1d82..6b8ff73 100644
+--- a/source/include/platform/aclinux.h
++++ b/source/include/platform/aclinux.h
+@@ -315,7 +315,7 @@
+ #define ACPI_FLUSH_CPU_CACHE()
+ #define ACPI_CAST_PTHREAD_T(Pthread) ((ACPI_THREAD_ID) (Pthread))
+ 
+-#if defined(__ia64__)    || defined(__x86_64__) ||\
++#if defined(__ia64__)    || (defined(__x86_64__) && !defined(__ILP32__)) ||\
+     defined(__aarch64__) || defined(__PPC64__) ||\
+     defined(__s390x__)
+ #define ACPI_MACHINE_WIDTH          64
+-- 
+2.7.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/acpica/files/manipulate-fds-instead-of-FILE.patch b/import-layers/yocto-poky/meta/recipes-extended/acpica/files/manipulate-fds-instead-of-FILE.patch
index 6944bb7..5610ed9 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/acpica/files/manipulate-fds-instead-of-FILE.patch
+++ b/import-layers/yocto-poky/meta/recipes-extended/acpica/files/manipulate-fds-instead-of-FILE.patch
@@ -1,6 +1,6 @@
-From 33a57979738e5ab13950ec1c0e7298e41ef50929 Mon Sep 17 00:00:00 2001
-From: Patrick Ohly <patrick.ohly@intel.com>
-Date: Thu, 23 Feb 2017 18:10:47 +0100
+From 69171c22f3872ecb4c1ab27985e93ca44084595e Mon Sep 17 00:00:00 2001
+From: Fan Xin <fan.xin@jp.fujitsu.com>
+Date: Mon, 5 Jun 2017 13:26:38 +0900
 Subject: [PATCH] aslfiles.c: manipulate fds instead of FILE
 
 Copying what stdout/stderr point to is not portable and fails with
@@ -12,60 +12,61 @@
 Upstream-Status: Inappropriate [embedded specific]
 
 Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
----
- source/compiler/aslfiles.c | 20 +++++++++++---------
- 1 file changed, 11 insertions(+), 9 deletions(-)
 
-diff --git a/source/compiler/aslfiles.c b/source/compiler/aslfiles.c
-index 947e465..7a352b4 100644
---- a/source/compiler/aslfiles.c
-+++ b/source/compiler/aslfiles.c
-@@ -44,6 +44,11 @@
+Rebase on acpica 20170303
+
+Signed-off-by: Fan Xin <fan.xin@jp.fujitsu.com>
+---
+ acpica-unix2-20170303/source/compiler/aslfiles.c | 14 +++++++++++---
+ 1 file changed, 11 insertions(+), 3 deletions(-)
+
+diff --git a/acpica-unix2-20170303/source/compiler/aslfiles.c b/acpica-unix2-20170303/source/compiler/aslfiles.c
+index 809090c..97898b1 100644
+--- a/acpica-unix2-20170303/source/compiler/aslfiles.c
++++ b/acpica-unix2-20170303/source/compiler/aslfiles.c
+@@ -44,6 +44,10 @@
  #include "aslcompiler.h"
  #include "acapps.h"
- 
+ #include "dtcompiler.h"
 +#include <sys/types.h>
 +#include <sys/stat.h>
 +#include <fcntl.h>
 +#include <unistd.h>
-+
+ 
  #define _COMPONENT          ACPI_COMPILER
          ACPI_MODULE_NAME    ("aslfiles")
- 
-@@ -569,6 +574,8 @@ FlOpenMiscOutputFiles (
+@@ -607,6 +611,8 @@ FlOpenMiscOutputFiles (
  
      if (Gbl_DebugFlag)
      {
-+        int fd;
++	int fd;
 +
          Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_DEBUG);
          if (!Filename)
          {
-@@ -582,20 +589,15 @@ FlOpenMiscOutputFiles (
-         /* TBD: hide this behind a FlReopenFile function */
+@@ -618,10 +624,10 @@ FlOpenMiscOutputFiles (
+         /* Open the debug file as STDERR, text mode */
  
          Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Filename = Filename;
 -        Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle =
 -            freopen (Filename, "w+t", stderr);
--
+ 
 -        if (!Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle)
 +        fd = open(Filename, O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
 +        if (fd < 0 ||
 +            dup2(fd, fileno(stderr)))
          {
--            /*
--             * A problem with freopen is that on error,
--             * we no longer have stderr.
--             */
-             Gbl_DebugFlag = FALSE;
--            memcpy (stderr, stdout, sizeof (FILE));
-             FlFileError (ASL_FILE_DEBUG_OUTPUT, ASL_MSG_DEBUG_FILENAME);
-             AslAbort ();
+             /*
+              * A problem with freopen is that on error, we no longer
+@@ -635,6 +641,8 @@ FlOpenMiscOutputFiles (
+             exit (1);
          }
-+        Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle = stderr;
  
++        Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle = stderr;
++
          AslCompilerSignon (ASL_FILE_DEBUG_OUTPUT);
          AslCompilerFileHeader (ASL_FILE_DEBUG_OUTPUT);
+     }
 -- 
-2.1.4
+1.9.1
 
diff --git a/import-layers/yocto-poky/meta/recipes-extended/acpica/files/no-werror.patch b/import-layers/yocto-poky/meta/recipes-extended/acpica/files/no-werror.patch
index 5d28f47..a6e7b54 100644
--- a/import-layers/yocto-poky/meta/recipes-extended/acpica/files/no-werror.patch
+++ b/import-layers/yocto-poky/meta/recipes-extended/acpica/files/no-werror.patch
@@ -1,7 +1,7 @@
 Description: remove -Werror flag
 Forwarded: not-needed
 Author: Fathi Boudra <fathi.boudra@linaro.org>
-
+Upstream-Status: Pending
 ---
  generate/unix/iasl/Makefile |   12 ++++++------
  1 file changed, 6 insertions(+), 6 deletions(-)