diff options
author | Myles Watson <mylesgw@gmail.com> | 2010-04-09 03:41:23 +0000 |
---|---|---|
committer | Myles Watson <mylesgw@gmail.com> | 2010-04-09 03:41:23 +0000 |
commit | ae60855f918dfc7f3f560528296fdd2d4b4ca791 (patch) | |
tree | 03d6d96f688b0c70756520413ee88cca59b2f122 /src/mainboard/via | |
parent | e64b63750f029dac66902dee8cf6a7cf82ba44a3 (diff) |
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
Diffstat (limited to 'src/mainboard/via')
-rw-r--r-- | src/mainboard/via/epia-m/acpi_tables.c | 9 | ||||
-rw-r--r-- | src/mainboard/via/epia-m700/acpi_tables.c | 30 | ||||
-rw-r--r-- | src/mainboard/via/epia-n/acpi_tables.c | 7 | ||||
-rw-r--r-- | src/mainboard/via/vt8454c/acpi_tables.c | 8 |
4 files changed, 30 insertions, 24 deletions
diff --git a/src/mainboard/via/epia-m/acpi_tables.c b/src/mainboard/via/epia-m/acpi_tables.c index 2589e3fed8..4d51eb6635 100644 --- a/src/mainboard/via/epia-m/acpi_tables.c +++ b/src/mainboard/via/epia-m/acpi_tables.c @@ -11,7 +11,7 @@ #include <string.h> #include <arch/acpi.h> -extern const acpi_header_t AmlCode; +extern const unsigned char AmlCode[]; unsigned long acpi_fill_mcfg(unsigned long current) { @@ -75,10 +75,11 @@ unsigned long write_acpi_tables(unsigned long start) acpi_create_facs(facs); 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); dsdt->checksum = 0; // don't trust intel iasl compiler to get this right - dsdt->checksum = acpi_checksum(dsdt,dsdt->length); + dsdt->checksum = acpi_checksum((u8*)dsdt, dsdt->length); printk(BIOS_DEBUG, "ACPI: * DSDT @ %p Length %x\n",dsdt,dsdt->length); printk(BIOS_DEBUG, "ACPI: * FADT\n"); diff --git a/src/mainboard/via/epia-m700/acpi_tables.c b/src/mainboard/via/epia-m700/acpi_tables.c index b826d6b3ed..ff890032c8 100644 --- a/src/mainboard/via/epia-m700/acpi_tables.c +++ b/src/mainboard/via/epia-m700/acpi_tables.c @@ -35,8 +35,8 @@ #include <device/pci_ids.h> #include <../../../northbridge/via/vx800/vx800.h> -extern const acpi_header_t AmlCode_dsdt; -extern const acpi_header_t AmlCode_ssdt; +extern const unsigned char AmlCode_dsdt[]; +extern const unsigned char AmlCode_ssdt[]; extern u32 wake_vec; @@ -80,8 +80,6 @@ unsigned long acpi_create_madt_lapic_nmis(unsigned long current, u16 flags, unsigned long acpi_fill_madt(unsigned long current) { - unsigned int gsi_base = 0x18; - /* Create all subtables for processors. */ current = acpi_create_madt_lapics(current); @@ -113,6 +111,7 @@ unsigned long acpi_fill_slit(unsigned long current) unsigned long acpi_fill_srat(unsigned long current) { /* No NUMA, no SRAT. */ + return current; } #define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1) @@ -122,14 +121,15 @@ unsigned long write_acpi_tables(unsigned long start) { unsigned long current; acpi_rsdp_t *rsdp; - acpi_srat_t *srat; acpi_rsdt_t *rsdt; - acpi_mcfg_t *mcfg; acpi_hpet_t *hpet; acpi_madt_t *madt; acpi_fadt_t *fadt; acpi_facs_t *facs; - acpi_header_t *dsdt, *ssdt; + acpi_header_t *dsdt; +#if 0 + acpi_header_t *ssdt; +#endif /* Align ACPI tables to 16 byte. */ start = (start + 0x0f) & -0x10; @@ -158,10 +158,11 @@ unsigned long write_acpi_tables(unsigned long start) printk(BIOS_DEBUG, "ACPI: * DSDT\n"); dsdt = (acpi_header_t *) current; - current += AmlCode_dsdt.length; - memcpy((void *)dsdt, &AmlCode_dsdt, AmlCode_dsdt.length); + memcpy(dsdt, &AmlCode_dsdt, sizeof(acpi_header_t)); + current += dsdt->length; + memcpy(dsdt, &AmlCode_dsdt, dsdt->length); dsdt->checksum = 0; /* Don't trust iasl to get this right. */ - dsdt->checksum = acpi_checksum(dsdt, dsdt->length); + dsdt->checksum = acpi_checksum((u8*)dsdt, dsdt->length); printk(BIOS_DEBUG, "ACPI: * DSDT @ %p Length %x\n", dsdt, dsdt->length); printk(BIOS_DEBUG, "ACPI: * FADT\n"); @@ -181,7 +182,7 @@ unsigned long write_acpi_tables(unsigned long start) /* NO MCFG in VX855, no PCI-E. */ printk(BIOS_DEBUG, "ACPI: * HPET\n"); - hpet = (acpi_mcfg_t *) current; + hpet = (acpi_hpet_t *) current; acpi_create_hpet(hpet); current += hpet->header.length; acpi_add_table(rsdp, hpet); @@ -189,10 +190,11 @@ unsigned long write_acpi_tables(unsigned long start) #if 0 printk(BIOS_DEBUG, "ACPI: * SSDT\n"); ssdt = (acpi_header_t *) current; - current += AmlCode_ssdt.length; - memcpy((void *)ssdt, &AmlCode_ssdt, AmlCode_ssdt.length); + memcpy(ssdt, &AmlCode_ssdt, sizeof(acpi_header_t)); + current += ssdt->length; + memcpy(ssdt, &AmlCode_ssdt, ssdt->length); ssdt->checksum = 0; /* Don't trust iasl to get this right. */ - ssdt->checksum = acpi_checksum(ssdt, ssdt->length); + ssdt->checksum = acpi_checksum((u8*)ssdt, ssdt->length); acpi_add_table(rsdp, ssdt); printk(BIOS_DEBUG, "ACPI: * SSDT @ %08x Length %x\n", ssdt, ssdt->length); #endif diff --git a/src/mainboard/via/epia-n/acpi_tables.c b/src/mainboard/via/epia-n/acpi_tables.c index 0f194de34f..1944b18de6 100644 --- a/src/mainboard/via/epia-n/acpi_tables.c +++ b/src/mainboard/via/epia-n/acpi_tables.c @@ -35,7 +35,7 @@ #include <device/pci_ids.h> #include "../../../southbridge/via/vt8237r/vt8237r.h" -extern const acpi_header_t AmlCode; +extern const unsigned char AmlCode[]; /* * These four macros are copied from <arch/smp/mpspec.h>, I have to do this @@ -160,8 +160,9 @@ unsigned long write_acpi_tables(unsigned long start) 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); #if 0 dsdt->checksum = 0; // don't trust intel iasl compiler to get this right dsdt->checksum = acpi_checksum(dsdt,dsdt->length); diff --git a/src/mainboard/via/vt8454c/acpi_tables.c b/src/mainboard/via/vt8454c/acpi_tables.c index b065c1fa5f..d31d8c55eb 100644 --- a/src/mainboard/via/vt8454c/acpi_tables.c +++ b/src/mainboard/via/vt8454c/acpi_tables.c @@ -27,7 +27,7 @@ #include <device/pci_ids.h> #include "dmi.h" -extern const acpi_header_t AmlCode; +extern const unsigned char AmlCode[]; unsigned long acpi_fill_mcfg(unsigned long current) { @@ -180,8 +180,10 @@ unsigned long write_acpi_tables(unsigned long start) acpi_create_facs(facs); dsdt = (acpi_header_t *) current; - current += AmlCode.length; - memcpy((void *) dsdt, &AmlCode,AmlCode.length); + dsdt = (acpi_header_t *)current; + memcpy(dsdt, &AmlCode, sizeof(acpi_header_t)); + current += dsdt->length; + memcpy(dsdt, &AmlCode, dsdt->length); #ifdef DONT_TRUST_IASL dsdt->checksum = 0; // don't trust intel iasl compiler to get this right dsdt->checksum = acpi_checksum(dsdt, dsdt->length); |