Author: myles Date: Fri Apr 9 05:41:23 2010 New Revision: 5384 URL: https://tracker.coreboot.org/trac/coreboot/changeset/5384
Log: 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
Modified: trunk/src/mainboard/amd/dbm690t/acpi_tables.c trunk/src/mainboard/amd/mahogany/acpi_tables.c trunk/src/mainboard/amd/mahogany_fam10/acpi_tables.c trunk/src/mainboard/amd/pistachio/acpi_tables.c trunk/src/mainboard/amd/serengeti_cheetah/acpi_tables.c trunk/src/mainboard/amd/serengeti_cheetah_fam10/acpi_tables.c trunk/src/mainboard/asrock/939a785gmh/acpi_tables.c trunk/src/mainboard/asus/a8v-e_se/acpi_tables.c trunk/src/mainboard/asus/m2v-mx_se/acpi_tables.c trunk/src/mainboard/gigabyte/m57sli/acpi_tables.c trunk/src/mainboard/intel/d945gclf/acpi_tables.c trunk/src/mainboard/intel/eagleheights/acpi_tables.c trunk/src/mainboard/iwill/dk8_htx/acpi_tables.c trunk/src/mainboard/kontron/986lcd-m/acpi_tables.c trunk/src/mainboard/kontron/kt690/acpi_tables.c trunk/src/mainboard/msi/ms9652_fam10/acpi_tables.c trunk/src/mainboard/roda/rk886ex/acpi_tables.c trunk/src/mainboard/technexion/tim5690/acpi_tables.c trunk/src/mainboard/technexion/tim8690/acpi_tables.c trunk/src/mainboard/tyan/s2891/acpi_tables.c trunk/src/mainboard/tyan/s2892/acpi_tables.c trunk/src/mainboard/tyan/s2895/acpi_tables.c trunk/src/mainboard/via/epia-m/acpi_tables.c trunk/src/mainboard/via/epia-m700/acpi_tables.c trunk/src/mainboard/via/epia-n/acpi_tables.c trunk/src/mainboard/via/vt8454c/acpi_tables.c trunk/src/northbridge/amd/amdfam10/amdfam10_acpi.c
Modified: trunk/src/mainboard/amd/dbm690t/acpi_tables.c ============================================================================== --- trunk/src/mainboard/amd/dbm690t/acpi_tables.c Thu Apr 8 23:04:45 2010 (r5383) +++ trunk/src/mainboard/amd/dbm690t/acpi_tables.c Fri Apr 9 05:41:23 2010 (r5384) @@ -57,7 +57,7 @@ } #endif
-extern const acpi_header_t AmlCode; +extern const unsigned char AmlCode[];
#define IO_APIC_ADDR 0xfec00000UL
@@ -187,8 +187,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); /* FADT */ printk(BIOS_DEBUG, "ACPI: * FADT\n");
Modified: trunk/src/mainboard/amd/mahogany/acpi_tables.c ============================================================================== --- trunk/src/mainboard/amd/mahogany/acpi_tables.c Thu Apr 8 23:04:45 2010 (r5383) +++ trunk/src/mainboard/amd/mahogany/acpi_tables.c Fri Apr 9 05:41:23 2010 (r5384) @@ -57,13 +57,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 @@ -144,7 +144,7 @@ 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 @@ 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 @@
/* 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");
Modified: trunk/src/mainboard/amd/mahogany_fam10/acpi_tables.c ============================================================================== --- trunk/src/mainboard/amd/mahogany_fam10/acpi_tables.c Thu Apr 8 23:04:45 2010 (r5383) +++ trunk/src/mainboard/amd/mahogany_fam10/acpi_tables.c Fri Apr 9 05:41:23 2010 (r5384) @@ -46,14 +46,14 @@ } #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 @@ 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 @@ 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 @@ 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 @@ 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
Modified: trunk/src/mainboard/amd/pistachio/acpi_tables.c ============================================================================== --- trunk/src/mainboard/amd/pistachio/acpi_tables.c Thu Apr 8 23:04:45 2010 (r5383) +++ trunk/src/mainboard/amd/pistachio/acpi_tables.c Fri Apr 9 05:41:23 2010 (r5384) @@ -57,7 +57,7 @@ } #endif
-extern const acpi_header_t AmlCode; +extern const unsigned char AmlCode[];
#define IO_APIC_ADDR 0xfec00000UL
@@ -187,9 +187,10 @@ /* 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");
Modified: trunk/src/mainboard/amd/serengeti_cheetah/acpi_tables.c ============================================================================== --- trunk/src/mainboard/amd/serengeti_cheetah/acpi_tables.c Thu Apr 8 23:04:45 2010 (r5383) +++ trunk/src/mainboard/amd/serengeti_cheetah/acpi_tables.c Fri Apr 9 05:41:23 2010 (r5384) @@ -38,11 +38,11 @@ } #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 @@ 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 @@ 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 @@ /* 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 */
Modified: trunk/src/mainboard/amd/serengeti_cheetah_fam10/acpi_tables.c ============================================================================== --- trunk/src/mainboard/amd/serengeti_cheetah_fam10/acpi_tables.c Thu Apr 8 23:04:45 2010 (r5383) +++ trunk/src/mainboard/amd/serengeti_cheetah_fam10/acpi_tables.c Fri Apr 9 05:41:23 2010 (r5384) @@ -46,14 +46,14 @@ } #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 @@ 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 @@ 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 @@ //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 @@ 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
Modified: trunk/src/mainboard/asrock/939a785gmh/acpi_tables.c ============================================================================== --- trunk/src/mainboard/asrock/939a785gmh/acpi_tables.c Thu Apr 8 23:04:45 2010 (r5383) +++ trunk/src/mainboard/asrock/939a785gmh/acpi_tables.c Fri Apr 9 05:41:23 2010 (r5384) @@ -57,13 +57,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 @@ -144,7 +144,7 @@ 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 @@ 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 @@
/* 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");
Modified: trunk/src/mainboard/asus/a8v-e_se/acpi_tables.c ============================================================================== --- trunk/src/mainboard/asus/a8v-e_se/acpi_tables.c Thu Apr 8 23:04:45 2010 (r5383) +++ trunk/src/mainboard/asus/a8v-e_se/acpi_tables.c Fri Apr 9 05:41:23 2010 (r5384) @@ -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 @@ 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");
Modified: trunk/src/mainboard/asus/m2v-mx_se/acpi_tables.c ============================================================================== --- trunk/src/mainboard/asus/m2v-mx_se/acpi_tables.c Thu Apr 8 23:04:45 2010 (r5383) +++ trunk/src/mainboard/asus/m2v-mx_se/acpi_tables.c Fri Apr 9 05:41:23 2010 (r5384) @@ -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 @@ 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");
Modified: trunk/src/mainboard/gigabyte/m57sli/acpi_tables.c ============================================================================== --- trunk/src/mainboard/gigabyte/m57sli/acpi_tables.c Thu Apr 8 23:04:45 2010 (r5383) +++ trunk/src/mainboard/gigabyte/m57sli/acpi_tables.c Fri Apr 9 05:41:23 2010 (r5384) @@ -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 @@ 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");
Modified: trunk/src/mainboard/intel/d945gclf/acpi_tables.c ============================================================================== --- trunk/src/mainboard/intel/d945gclf/acpi_tables.c Thu Apr 8 23:04:45 2010 (r5383) +++ trunk/src/mainboard/intel/d945gclf/acpi_tables.c Fri Apr 9 05:41:23 2010 (r5384) @@ -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 @@ 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++) {
Modified: trunk/src/mainboard/intel/eagleheights/acpi_tables.c ============================================================================== --- trunk/src/mainboard/intel/eagleheights/acpi_tables.c Thu Apr 8 23:04:45 2010 (r5383) +++ trunk/src/mainboard/intel/eagleheights/acpi_tables.c Fri Apr 9 05:41:23 2010 (r5384) @@ -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 @@ 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);
Modified: trunk/src/mainboard/iwill/dk8_htx/acpi_tables.c ============================================================================== --- trunk/src/mainboard/iwill/dk8_htx/acpi_tables.c Thu Apr 8 23:04:45 2010 (r5383) +++ trunk/src/mainboard/iwill/dk8_htx/acpi_tables.c Fri Apr 9 05:41:23 2010 (r5384) @@ -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 */
Modified: trunk/src/mainboard/kontron/986lcd-m/acpi_tables.c ============================================================================== --- trunk/src/mainboard/kontron/986lcd-m/acpi_tables.c Thu Apr 8 23:04:45 2010 (r5383) +++ trunk/src/mainboard/kontron/986lcd-m/acpi_tables.c Fri Apr 9 05:41:23 2010 (r5384) @@ -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 @@ 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;
Modified: trunk/src/mainboard/kontron/kt690/acpi_tables.c ============================================================================== --- trunk/src/mainboard/kontron/kt690/acpi_tables.c Thu Apr 8 23:04:45 2010 (r5383) +++ trunk/src/mainboard/kontron/kt690/acpi_tables.c Fri Apr 9 05:41:23 2010 (r5384) @@ -57,7 +57,7 @@ } #endif
-extern const acpi_header_t AmlCode; +extern const unsigned char AmlCode[];
#define IO_APIC_ADDR 0xfec00000UL
@@ -187,8 +187,9 @@ /* 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");
Modified: trunk/src/mainboard/msi/ms9652_fam10/acpi_tables.c ============================================================================== --- trunk/src/mainboard/msi/ms9652_fam10/acpi_tables.c Thu Apr 8 23:04:45 2010 (r5383) +++ trunk/src/mainboard/msi/ms9652_fam10/acpi_tables.c Fri Apr 9 05:41:23 2010 (r5384) @@ -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 @@ 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,
Modified: trunk/src/mainboard/roda/rk886ex/acpi_tables.c ============================================================================== --- trunk/src/mainboard/roda/rk886ex/acpi_tables.c Thu Apr 8 23:04:45 2010 (r5383) +++ trunk/src/mainboard/roda/rk886ex/acpi_tables.c Fri Apr 9 05:41:23 2010 (r5384) @@ -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 @@ 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:
Modified: trunk/src/mainboard/technexion/tim5690/acpi_tables.c ============================================================================== --- trunk/src/mainboard/technexion/tim5690/acpi_tables.c Thu Apr 8 23:04:45 2010 (r5383) +++ trunk/src/mainboard/technexion/tim5690/acpi_tables.c Fri Apr 9 05:41:23 2010 (r5384) @@ -57,7 +57,7 @@ } #endif
-extern const acpi_header_t AmlCode; +extern const unsigned char AmlCode[];
#define IO_APIC_ADDR 0xfec00000UL
@@ -187,8 +187,9 @@ /* 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");
Modified: trunk/src/mainboard/technexion/tim8690/acpi_tables.c ============================================================================== --- trunk/src/mainboard/technexion/tim8690/acpi_tables.c Thu Apr 8 23:04:45 2010 (r5383) +++ trunk/src/mainboard/technexion/tim8690/acpi_tables.c Fri Apr 9 05:41:23 2010 (r5384) @@ -57,7 +57,7 @@ } #endif
-extern const acpi_header_t AmlCode; +extern const unsigned char AmlCode[];
#define IO_APIC_ADDR 0xfec00000UL
@@ -187,8 +187,9 @@ /* 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");
Modified: trunk/src/mainboard/tyan/s2891/acpi_tables.c ============================================================================== --- trunk/src/mainboard/tyan/s2891/acpi_tables.c Thu Apr 8 23:04:45 2010 (r5383) +++ trunk/src/mainboard/tyan/s2891/acpi_tables.c Fri Apr 9 05:41:23 2010 (r5384) @@ -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 @@ 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);
Modified: trunk/src/mainboard/tyan/s2892/acpi_tables.c ============================================================================== --- trunk/src/mainboard/tyan/s2892/acpi_tables.c Thu Apr 8 23:04:45 2010 (r5383) +++ trunk/src/mainboard/tyan/s2892/acpi_tables.c Fri Apr 9 05:41:23 2010 (r5384) @@ -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 @@ 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);
Modified: trunk/src/mainboard/tyan/s2895/acpi_tables.c ============================================================================== --- trunk/src/mainboard/tyan/s2895/acpi_tables.c Thu Apr 8 23:04:45 2010 (r5383) +++ trunk/src/mainboard/tyan/s2895/acpi_tables.c Fri Apr 9 05:41:23 2010 (r5384) @@ -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 @@ 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);
Modified: trunk/src/mainboard/via/epia-m/acpi_tables.c ============================================================================== --- trunk/src/mainboard/via/epia-m/acpi_tables.c Thu Apr 8 23:04:45 2010 (r5383) +++ trunk/src/mainboard/via/epia-m/acpi_tables.c Fri Apr 9 05:41:23 2010 (r5384) @@ -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 @@ 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");
Modified: trunk/src/mainboard/via/epia-m700/acpi_tables.c ============================================================================== --- trunk/src/mainboard/via/epia-m700/acpi_tables.c Thu Apr 8 23:04:45 2010 (r5383) +++ trunk/src/mainboard/via/epia-m700/acpi_tables.c Fri Apr 9 05:41:23 2010 (r5384) @@ -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_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_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 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 @@
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 @@ /* 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 @@ #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
Modified: trunk/src/mainboard/via/epia-n/acpi_tables.c ============================================================================== --- trunk/src/mainboard/via/epia-n/acpi_tables.c Thu Apr 8 23:04:45 2010 (r5383) +++ trunk/src/mainboard/via/epia-n/acpi_tables.c Fri Apr 9 05:41:23 2010 (r5384) @@ -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 @@
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);
Modified: trunk/src/mainboard/via/vt8454c/acpi_tables.c ============================================================================== --- trunk/src/mainboard/via/vt8454c/acpi_tables.c Thu Apr 8 23:04:45 2010 (r5383) +++ trunk/src/mainboard/via/vt8454c/acpi_tables.c Fri Apr 9 05:41:23 2010 (r5384) @@ -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 @@ 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);
Modified: trunk/src/northbridge/amd/amdfam10/amdfam10_acpi.c ============================================================================== --- trunk/src/northbridge/amd/amdfam10/amdfam10_acpi.c Thu Apr 8 23:04:45 2010 (r5383) +++ trunk/src/northbridge/amd/amdfam10/amdfam10_acpi.c Fri Apr 9 05:41:23 2010 (r5384) @@ -268,7 +268,7 @@
}
-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 @@ 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 @@ } }
-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 @@
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 @@
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;