Get rid of type-punned pointer errors.
[coreboot.git] / src / mainboard / asus / a8v-e_se / acpi_tables.c
index 9611872aecb84c51f994c5cd5ecb9c9117a1cb20..59cb3d4de6441023c3deaa0450776e9e4c45ecdf 100644 (file)
@@ -31,7 +31,7 @@
 #include <../../../southbridge/via/vt8237r/vt8237r.h>
 #include <../../../southbridge/via/k8t890/k8t890.h>
 
-extern unsigned char AmlCode[];
+extern const acpi_header_t AmlCode;
 
 unsigned long acpi_fill_mcfg(unsigned long current)
 {
@@ -118,9 +118,8 @@ unsigned long write_acpi_tables(unsigned long start)
        acpi_create_facs(facs);
 
        dsdt = (acpi_header_t *) current;
-       current += ((acpi_header_t *) AmlCode)->length;
-       memcpy((void *) dsdt, (void *) AmlCode,
-              ((acpi_header_t *) AmlCode)->length);
+       current += AmlCode.length;
+       memcpy((void *) dsdt, &AmlCode, AmlCode.length);
        dsdt->checksum = 0;     /* Don't trust iasl to get this right. */
        dsdt->checksum = acpi_checksum(dsdt, dsdt->length);
        printk(BIOS_DEBUG, "ACPI:     * DSDT @ %p Length %x\n", dsdt,