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 | |
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')
27 files changed, 185 insertions, 148 deletions
diff --git a/src/mainboard/amd/dbm690t/acpi_tables.c b/src/mainboard/amd/dbm690t/acpi_tables.c index d28acc7bc3..1014962584 100644 --- a/src/mainboard/amd/dbm690t/acpi_tables.c +++ b/src/mainboard/amd/dbm690t/acpi_tables.c @@ -57,7 +57,7 @@ static void dump_mem(u32 start, u32 end) } #endif -extern const acpi_header_t AmlCode; +extern const unsigned char AmlCode[]; #define IO_APIC_ADDR 0xfec00000UL @@ -187,8 +187,9 @@ unsigned long write_acpi_tables(unsigned long start) /* 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); /* FADT */ printk(BIOS_DEBUG, "ACPI: * FADT\n"); diff --git a/src/mainboard/amd/mahogany/acpi_tables.c b/src/mainboard/amd/mahogany/acpi_tables.c index 692b0f2fcf..429a029761 100644 --- a/src/mainboard/amd/mahogany/acpi_tables.c +++ b/src/mainboard/amd/mahogany/acpi_tables.c @@ -57,13 +57,13 @@ static void dump_mem(u32 start, u32 end) } #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 @@ -144,7 +144,7 @@ unsigned long write_acpi_tables(unsigned long start) acpi_header_t *ssdt; #if CONFIG_ACPI_SSDTX_NUM >= 1 acpi_header_t *ssdtx; - acpi_header_t const *p; + void *p; int i; #endif @@ -223,8 +223,9 @@ unsigned long write_acpi_tables(unsigned long start) p = &AmlCode_ssdt5; break; } - current += p->length; - memcpy((void *)ssdtx, p, 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((u8 *)ssdtx, ssdtx->length); @@ -240,9 +241,10 @@ unsigned long write_acpi_tables(unsigned long start) /* DSDT */ printk(BIOS_DEBUG, "ACPI: * DSDT\n"); - dsdt = (acpi_header_t *) current; - 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); printk(BIOS_DEBUG, "ACPI: * DSDT @ %p Length %x\n", dsdt, dsdt->length); /* FADT */ printk(BIOS_DEBUG, "ACPI: * FADT\n"); diff --git a/src/mainboard/amd/mahogany_fam10/acpi_tables.c b/src/mainboard/amd/mahogany_fam10/acpi_tables.c index 25ac76f6e3..b9d58ce836 100644 --- a/src/mainboard/amd/mahogany_fam10/acpi_tables.c +++ b/src/mainboard/amd/mahogany_fam10/acpi_tables.c @@ -46,14 +46,14 @@ static void dump_mem(u32 start, u32 end) } #endif -extern const acpi_header_t AmlCode; -extern const acpi_header_t AmlCode_ssdt; +extern const unsigned char AmlCode[]; +extern const unsigned char AmlCode_ssdt[]; #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 @@ -132,7 +132,7 @@ unsigned long write_acpi_tables(unsigned long start) acpi_header_t *ssdt; #if CONFIG_ACPI_SSDTX_NUM >= 1 acpi_header_t *ssdtx; - acpi_header_t const *p; + void *p; int i; #endif @@ -194,8 +194,9 @@ unsigned long write_acpi_tables(unsigned long start) current = ( current + 0x0f) & -0x10; printk(BIOS_DEBUG, "ACPI: * SSDT at %lx\n", current); 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); //Here you need to set value in pci1234, sblk and sbdn in get_bus_conf.c update_ssdt((void*)ssdt); /* recalculate checksum */ @@ -237,8 +238,9 @@ unsigned long write_acpi_tables(unsigned long start) p = &AmlCode_ssdt5; break; } - current += p->length; - memcpy((void *)ssdtx, p, 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((u8 *)ssdtx, ssdtx->length); @@ -250,8 +252,9 @@ unsigned long write_acpi_tables(unsigned long start) current = ( current + 0x07) & -0x08; printk(BIOS_DEBUG, "ACPI: * DSDT at %lx\n", current); dsdt = (acpi_header_t *)current; // it will used by fadt - 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); /* FACS */ // it needs 64 bit alignment diff --git a/src/mainboard/amd/pistachio/acpi_tables.c b/src/mainboard/amd/pistachio/acpi_tables.c index 16d1cbbd47..030a7fa55c 100644 --- a/src/mainboard/amd/pistachio/acpi_tables.c +++ b/src/mainboard/amd/pistachio/acpi_tables.c @@ -57,7 +57,7 @@ static void dump_mem(u32 start, u32 end) } #endif -extern const acpi_header_t AmlCode; +extern const unsigned char AmlCode[]; #define IO_APIC_ADDR 0xfec00000UL @@ -187,9 +187,10 @@ unsigned long write_acpi_tables(unsigned long start) /* DSDT */ printk(BIOS_DEBUG, "ACPI: * DSDT\n"); dsdt = (acpi_header_t *) current; - 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); /* FADT */ printk(BIOS_DEBUG, "ACPI: * FADT\n"); diff --git a/src/mainboard/amd/serengeti_cheetah/acpi_tables.c b/src/mainboard/amd/serengeti_cheetah/acpi_tables.c index c7103f1ad9..e225aee991 100644 --- a/src/mainboard/amd/serengeti_cheetah/acpi_tables.c +++ b/src/mainboard/amd/serengeti_cheetah/acpi_tables.c @@ -38,11 +38,11 @@ static void dump_mem(u32 start, u32 end) } #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 unsigned char AmlCode_ssdt2[]; +extern const unsigned char AmlCode_ssdt3[]; +extern const unsigned char AmlCode_ssdt4[]; #endif #define IO_APIC_ADDR 0xfec00000UL @@ -194,7 +194,7 @@ unsigned long write_acpi_tables(unsigned long start) acpi_header_t *dsdt; acpi_header_t *ssdt; acpi_header_t *ssdtx; - acpi_header_t const *p; + void *p; int i; @@ -285,8 +285,9 @@ unsigned long write_acpi_tables(unsigned long start) default: continue; } - current += 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((u8 *)ssdtx, ssdtx->length); @@ -303,8 +304,9 @@ unsigned long write_acpi_tables(unsigned long start) /* DSDT */ printk(BIOS_DEBUG, "ACPI: * DSDT at %lx\n", current); 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 */ diff --git a/src/mainboard/amd/serengeti_cheetah_fam10/acpi_tables.c b/src/mainboard/amd/serengeti_cheetah_fam10/acpi_tables.c index 172b6588f7..6282ef60c9 100644 --- a/src/mainboard/amd/serengeti_cheetah_fam10/acpi_tables.c +++ b/src/mainboard/amd/serengeti_cheetah_fam10/acpi_tables.c @@ -46,14 +46,14 @@ static void dump_mem(u32 start, u32 end) } #endif -extern const acpi_header_t AmlCode; -extern const acpi_header_t AmlCode_ssdt; +extern const unsigned char AmlCode[]; +extern const unsigned char AmlCode_ssdt[]; #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 @@ -200,7 +200,7 @@ unsigned long write_acpi_tables(unsigned long start) acpi_header_t *dsdt; acpi_header_t *ssdt; acpi_header_t *ssdtx; - acpi_header_t const *p; + void *p; int i; @@ -262,8 +262,9 @@ unsigned long write_acpi_tables(unsigned long start) current = ( current + 0x0f) & -0x10; printk(BIOS_DEBUG, "ACPI: * SSDT at %lx\n", current); 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); //Here you need to set value in pci1234, sblk and sbdn in get_bus_conf.c update_ssdt((void*)ssdt); /* recalculate checksum */ @@ -305,8 +306,9 @@ unsigned long write_acpi_tables(unsigned long start) //HTX no io apic p = &AmlCode_ssdt5; } - current += p->length; - memcpy((void *)ssdtx, p, 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((u8 *)ssdtx, ssdtx->length); @@ -318,8 +320,9 @@ unsigned long write_acpi_tables(unsigned long start) current = ( current + 0x07) & -0x08; printk(BIOS_DEBUG, "ACPI: * DSDT at %lx\n", current); 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); /* FACS */ // it needs 64 bit alignment diff --git a/src/mainboard/asrock/939a785gmh/acpi_tables.c b/src/mainboard/asrock/939a785gmh/acpi_tables.c index 692b0f2fcf..429a029761 100644 --- a/src/mainboard/asrock/939a785gmh/acpi_tables.c +++ b/src/mainboard/asrock/939a785gmh/acpi_tables.c @@ -57,13 +57,13 @@ static void dump_mem(u32 start, u32 end) } #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 @@ -144,7 +144,7 @@ unsigned long write_acpi_tables(unsigned long start) acpi_header_t *ssdt; #if CONFIG_ACPI_SSDTX_NUM >= 1 acpi_header_t *ssdtx; - acpi_header_t const *p; + void *p; int i; #endif @@ -223,8 +223,9 @@ unsigned long write_acpi_tables(unsigned long start) p = &AmlCode_ssdt5; break; } - current += p->length; - memcpy((void *)ssdtx, p, 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((u8 *)ssdtx, ssdtx->length); @@ -240,9 +241,10 @@ unsigned long write_acpi_tables(unsigned long start) /* DSDT */ printk(BIOS_DEBUG, "ACPI: * DSDT\n"); - dsdt = (acpi_header_t *) current; - 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); printk(BIOS_DEBUG, "ACPI: * DSDT @ %p Length %x\n", dsdt, dsdt->length); /* FADT */ printk(BIOS_DEBUG, "ACPI: * FADT\n"); diff --git a/src/mainboard/asus/a8v-e_se/acpi_tables.c b/src/mainboard/asus/a8v-e_se/acpi_tables.c index 59cb3d4de6..4108ed1b4a 100644 --- a/src/mainboard/asus/a8v-e_se/acpi_tables.c +++ b/src/mainboard/asus/a8v-e_se/acpi_tables.c @@ -31,7 +31,7 @@ #include <../../../southbridge/via/vt8237r/vt8237r.h> #include <../../../southbridge/via/k8t890/k8t890.h> -extern const acpi_header_t AmlCode; +extern const unsigned char AmlCode[]; unsigned long acpi_fill_mcfg(unsigned long current) { @@ -117,11 +117,12 @@ unsigned long write_acpi_tables(unsigned long start) current += sizeof(acpi_facs_t); 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); 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"); diff --git a/src/mainboard/asus/m2v-mx_se/acpi_tables.c b/src/mainboard/asus/m2v-mx_se/acpi_tables.c index daa65e5a99..46a6c1f6a4 100644 --- a/src/mainboard/asus/m2v-mx_se/acpi_tables.c +++ b/src/mainboard/asus/m2v-mx_se/acpi_tables.c @@ -33,7 +33,7 @@ #include <../../../northbridge/amd/amdk8/amdk8_acpi.h> #include <cpu/amd/model_fxx_powernow.h> -extern const acpi_header_t AmlCode; +extern const unsigned char AmlCode[]; unsigned long acpi_fill_mcfg(unsigned long current) { @@ -133,10 +133,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 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"); diff --git a/src/mainboard/gigabyte/m57sli/acpi_tables.c b/src/mainboard/gigabyte/m57sli/acpi_tables.c index 2f39c6411d..1bd302271a 100644 --- a/src/mainboard/gigabyte/m57sli/acpi_tables.c +++ b/src/mainboard/gigabyte/m57sli/acpi_tables.c @@ -34,7 +34,7 @@ #include <device/pci.h> #include <cpu/amd/amdk8_sysconf.h> -extern const acpi_header_t AmlCode; +extern const unsigned char AmlCode[]; unsigned long acpi_fill_mcfg(unsigned long current) { @@ -143,10 +143,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 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"); diff --git a/src/mainboard/intel/d945gclf/acpi_tables.c b/src/mainboard/intel/d945gclf/acpi_tables.c index 5be0c9aef2..b7f92114c5 100644 --- a/src/mainboard/intel/d945gclf/acpi_tables.c +++ b/src/mainboard/intel/d945gclf/acpi_tables.c @@ -31,7 +31,7 @@ #define OLD_ACPI 0 -extern const acpi_header_t AmlCode; +extern const unsigned char AmlCode[]; #if CONFIG_HAVE_ACPI_SLIC unsigned long acpi_create_slic(unsigned long current); #endif @@ -273,8 +273,9 @@ 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); #if OLD_ACPI for (i=0; i < dsdt->length; i++) { diff --git a/src/mainboard/intel/eagleheights/acpi_tables.c b/src/mainboard/intel/eagleheights/acpi_tables.c index 7a941a5eb6..b4b12b1cbb 100644 --- a/src/mainboard/intel/eagleheights/acpi_tables.c +++ b/src/mainboard/intel/eagleheights/acpi_tables.c @@ -28,7 +28,7 @@ #include <device/pci_ids.h> #include "ioapic.h" -extern const acpi_header_t AmlCode; +extern const unsigned char AmlCode[]; unsigned long acpi_fill_mcfg(unsigned long current) { @@ -204,9 +204,10 @@ unsigned long write_acpi_tables(unsigned long start) acpi_create_facs(facs); dsdt = (acpi_header_t *) current; - current += AmlCode.length; + memcpy(dsdt, &AmlCode, sizeof(acpi_header_t)); + current += dsdt->length; + memcpy(dsdt, &AmlCode, dsdt->length); ALIGN_CURRENT; - memcpy((void *) dsdt, &AmlCode, AmlCode.length); printk(BIOS_DEBUG, "ACPI: * DSDT @ %p Length %x\n", dsdt, dsdt->length); diff --git a/src/mainboard/iwill/dk8_htx/acpi_tables.c b/src/mainboard/iwill/dk8_htx/acpi_tables.c index e8d1231774..8862444453 100644 --- a/src/mainboard/iwill/dk8_htx/acpi_tables.c +++ b/src/mainboard/iwill/dk8_htx/acpi_tables.c @@ -38,13 +38,13 @@ static void dump_mem(unsigned start, unsigned end) } #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 @@ unsigned long write_acpi_tables(unsigned long start) 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 @@ unsigned long write_acpi_tables(unsigned long start) 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 @@ unsigned long write_acpi_tables(unsigned long start) /* 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 */ diff --git a/src/mainboard/kontron/986lcd-m/acpi_tables.c b/src/mainboard/kontron/986lcd-m/acpi_tables.c index 1c6cc9d3ee..55f02b10c2 100644 --- a/src/mainboard/kontron/986lcd-m/acpi_tables.c +++ b/src/mainboard/kontron/986lcd-m/acpi_tables.c @@ -29,7 +29,7 @@ #include <cpu/x86/msr.h> #include "dmi.h" -extern const acpi_header_t AmlCode; +extern const unsigned char AmlCode[]; #if CONFIG_HAVE_ACPI_SLIC unsigned long acpi_create_slic(unsigned long current); #endif @@ -204,8 +204,9 @@ 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); ALIGN_CURRENT; diff --git a/src/mainboard/kontron/kt690/acpi_tables.c b/src/mainboard/kontron/kt690/acpi_tables.c index 7be5e990bc..5ecb613b7b 100644 --- a/src/mainboard/kontron/kt690/acpi_tables.c +++ b/src/mainboard/kontron/kt690/acpi_tables.c @@ -57,7 +57,7 @@ static void dump_mem(u32 start, u32 end) } #endif -extern const acpi_header_t AmlCode; +extern const unsigned char AmlCode[]; #define IO_APIC_ADDR 0xfec00000UL @@ -187,8 +187,9 @@ unsigned long write_acpi_tables(unsigned long start) /* DSDT */ printk(BIOS_DEBUG, "ACPI: * DSDT\n"); dsdt = (acpi_header_t *) current; - 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); /* FADT */ printk(BIOS_DEBUG, "ACPI: * FADT\n"); diff --git a/src/mainboard/msi/ms9652_fam10/acpi_tables.c b/src/mainboard/msi/ms9652_fam10/acpi_tables.c index a387408e1b..54e8be4f67 100644 --- a/src/mainboard/msi/ms9652_fam10/acpi_tables.c +++ b/src/mainboard/msi/ms9652_fam10/acpi_tables.c @@ -35,7 +35,7 @@ #include <cpu/amd/amdfam10_sysconf.h> #include "mb_sysconf.h" -extern const acpi_header_t AmlCode; +extern const unsigned char AmlCode[]; unsigned long acpi_fill_mcfg(unsigned long current) { @@ -147,8 +147,9 @@ 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 iasl to get this right. */ dsdt->checksum = acpi_checksum(dsdt, dsdt->length); printk(BIOS_DEBUG, "ACPI: * DSDT @ %p Length %x\n", dsdt, diff --git a/src/mainboard/roda/rk886ex/acpi_tables.c b/src/mainboard/roda/rk886ex/acpi_tables.c index 0dded2ad91..d89adf5e8b 100644 --- a/src/mainboard/roda/rk886ex/acpi_tables.c +++ b/src/mainboard/roda/rk886ex/acpi_tables.c @@ -30,7 +30,7 @@ #include <device/pci_ids.h> #include "dmi.h" -extern const acpi_header_t AmlCode; +extern const unsigned char AmlCode[]; #if CONFIG_HAVE_ACPI_SLIC unsigned long acpi_create_slic(unsigned long current); #endif @@ -273,8 +273,9 @@ 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); /* Fix up global NVS region for SMI handler. The GNVS region lives * in the (high) table area. The low memory map looks like this: diff --git a/src/mainboard/technexion/tim5690/acpi_tables.c b/src/mainboard/technexion/tim5690/acpi_tables.c index 7be5e990bc..5ecb613b7b 100644 --- a/src/mainboard/technexion/tim5690/acpi_tables.c +++ b/src/mainboard/technexion/tim5690/acpi_tables.c @@ -57,7 +57,7 @@ static void dump_mem(u32 start, u32 end) } #endif -extern const acpi_header_t AmlCode; +extern const unsigned char AmlCode[]; #define IO_APIC_ADDR 0xfec00000UL @@ -187,8 +187,9 @@ unsigned long write_acpi_tables(unsigned long start) /* DSDT */ printk(BIOS_DEBUG, "ACPI: * DSDT\n"); dsdt = (acpi_header_t *) current; - 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); /* FADT */ printk(BIOS_DEBUG, "ACPI: * FADT\n"); diff --git a/src/mainboard/technexion/tim8690/acpi_tables.c b/src/mainboard/technexion/tim8690/acpi_tables.c index 7be5e990bc..5ecb613b7b 100644 --- a/src/mainboard/technexion/tim8690/acpi_tables.c +++ b/src/mainboard/technexion/tim8690/acpi_tables.c @@ -57,7 +57,7 @@ static void dump_mem(u32 start, u32 end) } #endif -extern const acpi_header_t AmlCode; +extern const unsigned char AmlCode[]; #define IO_APIC_ADDR 0xfec00000UL @@ -187,8 +187,9 @@ unsigned long write_acpi_tables(unsigned long start) /* DSDT */ printk(BIOS_DEBUG, "ACPI: * DSDT\n"); dsdt = (acpi_header_t *) current; - 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); /* FADT */ printk(BIOS_DEBUG, "ACPI: * FADT\n"); diff --git a/src/mainboard/tyan/s2891/acpi_tables.c b/src/mainboard/tyan/s2891/acpi_tables.c index 0ee0d51faa..536e593f6a 100644 --- a/src/mainboard/tyan/s2891/acpi_tables.c +++ b/src/mainboard/tyan/s2891/acpi_tables.c @@ -20,7 +20,7 @@ #include <../../../northbridge/amd/amdk8/amdk8_acpi.h> #include <cpu/amd/model_fxx_powernow.h> -extern const acpi_header_t AmlCode; +extern const unsigned char AmlCode[]; unsigned long acpi_fill_mcfg(unsigned long current) { @@ -139,8 +139,9 @@ unsigned long write_acpi_tables(unsigned long start) current = ALIGN(current, 16); dsdt = (acpi_header_t *) current; printk(BIOS_DEBUG, "ACPI: * DSDT %p\n", dsdt); - 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); current = ALIGN(current, 16); diff --git a/src/mainboard/tyan/s2892/acpi_tables.c b/src/mainboard/tyan/s2892/acpi_tables.c index 0ee0d51faa..536e593f6a 100644 --- a/src/mainboard/tyan/s2892/acpi_tables.c +++ b/src/mainboard/tyan/s2892/acpi_tables.c @@ -20,7 +20,7 @@ #include <../../../northbridge/amd/amdk8/amdk8_acpi.h> #include <cpu/amd/model_fxx_powernow.h> -extern const acpi_header_t AmlCode; +extern const unsigned char AmlCode[]; unsigned long acpi_fill_mcfg(unsigned long current) { @@ -139,8 +139,9 @@ unsigned long write_acpi_tables(unsigned long start) current = ALIGN(current, 16); dsdt = (acpi_header_t *) current; printk(BIOS_DEBUG, "ACPI: * DSDT %p\n", dsdt); - 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); current = ALIGN(current, 16); diff --git a/src/mainboard/tyan/s2895/acpi_tables.c b/src/mainboard/tyan/s2895/acpi_tables.c index a2fb954f90..ba11a8f0d2 100644 --- a/src/mainboard/tyan/s2895/acpi_tables.c +++ b/src/mainboard/tyan/s2895/acpi_tables.c @@ -20,7 +20,7 @@ #include <../../../northbridge/amd/amdk8/amdk8_acpi.h> #include <cpu/amd/model_fxx_powernow.h> -extern const acpi_header_t AmlCode; +extern const unsigned char AmlCode[]; unsigned long acpi_fill_mcfg(unsigned long current) { @@ -164,8 +164,9 @@ unsigned long write_acpi_tables(unsigned long start) current = ALIGN(current, 16); dsdt = (acpi_header_t *) current; printk(BIOS_DEBUG, "ACPI: * DSDT %p\n", dsdt); - 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); current = ALIGN(current, 16); 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); diff --git a/src/northbridge/amd/amdfam10/amdfam10_acpi.c b/src/northbridge/amd/amdfam10/amdfam10_acpi.c index 34d5db5511..ba4c36bee4 100644 --- a/src/northbridge/amd/amdfam10/amdfam10_acpi.c +++ b/src/northbridge/amd/amdfam10/amdfam10_acpi.c @@ -268,7 +268,7 @@ void update_ssdt(void *ssdt) } -void update_sspr(void *sspr, u32 nodeid, u32 cpuindex) +static void update_sspr(void *sspr, u32 nodeid, u32 cpuindex) { u8 *CPU; u8 *CPUIN; @@ -291,7 +291,7 @@ void update_sspr(void *sspr, u32 nodeid, u32 cpuindex) CONTROL = sspr + 0x8d; STATUS = sspr + 0x8f; - sprintf(CPU, "%02x", (u8)cpuindex); + sprintf(CPU, "%02x", (char)cpuindex); *CPUIN = (u8) cpuindex; for(i=0;i<sysconf.p_state_num;i++) { @@ -305,11 +305,11 @@ void update_sspr(void *sspr, u32 nodeid, u32 cpuindex) } } -extern const acpi_header_t AmlCode_sspr5; -extern const acpi_header_t AmlCode_sspr4; -extern const acpi_header_t AmlCode_sspr3; -extern const acpi_header_t AmlCode_sspr2; -extern const acpi_header_t AmlCode_sspr1; +extern const unsigned char AmlCode_sspr5[]; +extern const unsigned char AmlCode_sspr4[]; +extern const unsigned char AmlCode_sspr3[]; +extern const unsigned char AmlCode_sspr2[]; +extern const unsigned char AmlCode_sspr1[]; /* fixme: find one good way for different p_state_num */ unsigned long acpi_add_ssdt_pstates(acpi_rsdp_t *rsdp, unsigned long current) @@ -321,7 +321,7 @@ unsigned long acpi_add_ssdt_pstates(acpi_rsdp_t *rsdp, unsigned long current) if(!sysconf.p_state_num) return current; - acpi_header_t *AmlCode_sspr; + void *AmlCode_sspr; switch(sysconf.p_state_num) { case 1: AmlCode_sspr = &AmlCode_sspr1; break; case 2: AmlCode_sspr = &AmlCode_sspr2; break; @@ -342,8 +342,9 @@ unsigned long acpi_add_ssdt_pstates(acpi_rsdp_t *rsdp, unsigned long current) current = ( current + 0x0f) & -0x10; ssdt = (acpi_header_t *)current; - current += AmlCode_sspr->length; - memcpy((void *)ssdt, AmlCode_sspr, AmlCode_sspr->length); + memcpy(ssdt, AmlCode_sspr, sizeof(acpi_header_t)); + current += ssdt->length; + memcpy(ssdt, AmlCode_sspr, ssdt->length); update_sspr((void*)ssdt,cpu->path.apic.node_id, cpu_index); /* recalculate checksum */ ssdt->checksum = 0; |