Copy acpi blobs in two parts to make sure gcc does the right thing.
Signed-off-by: Myles Watson <mylesgw@gmail.com>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5384 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
diff --git a/src/mainboard/iwill/dk8_htx/acpi_tables.c b/src/mainboard/iwill/dk8_htx/acpi_tables.c
index e8d1231..8862444 100644
--- a/src/mainboard/iwill/dk8_htx/acpi_tables.c
+++ b/src/mainboard/iwill/dk8_htx/acpi_tables.c
@@ -38,13 +38,13 @@
}
#endif
-extern const acpi_header_t AmlCode;
+extern const unsigned char AmlCode[];
#if CONFIG_ACPI_SSDTX_NUM >= 1
-extern const acpi_header_t AmlCode_ssdt2;
-extern const acpi_header_t AmlCode_ssdt3;
-extern const acpi_header_t AmlCode_ssdt4;
-extern const acpi_header_t AmlCode_ssdt5;
+extern const unsigned char AmlCode_ssdt2[];
+extern const unsigned char AmlCode_ssdt3[];
+extern const unsigned char AmlCode_ssdt4[];
+extern const unsigned char AmlCode_ssdt5[];
#endif
#define IO_APIC_ADDR 0xfec00000UL
@@ -201,7 +201,7 @@
acpi_header_t *dsdt;
acpi_header_t *ssdt;
acpi_header_t *ssdtx;
- acpi_header_t const *p;
+ void *p;
int i;
@@ -295,8 +295,9 @@
p = &AmlCode_ssdt5;
break;
}
- current += ((acpi_header_t *)p)->length;
- memcpy((void *)ssdtx, (void *)p, ((acpi_header_t *)p)->length);
+ memcpy(ssdtx, p, sizeof(acpi_header_t));
+ current += ssdtx->length;
+ memcpy(ssdtx, p, ssdtx->length);
update_ssdtx((void *)ssdtx, i);
ssdtx->checksum = 0;
ssdtx->checksum = acpi_checksum((unsigned char *)ssdtx,ssdtx->length);
@@ -313,8 +314,9 @@
/* DSDT */
printk(BIOS_DEBUG, "ACPI: * DSDT\n");
dsdt = (acpi_header_t *)current;
- current += AmlCode.length;
- memcpy((void *)dsdt, &AmlCode, AmlCode.length);
+ memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
+ current += dsdt->length;
+ memcpy(dsdt, &AmlCode, dsdt->length);
printk(BIOS_DEBUG, "ACPI: * DSDT @ %p Length %x\n",dsdt,dsdt->length);
/* FDAT */