summaryrefslogtreecommitdiff
path: root/src/northbridge
diff options
context:
space:
mode:
authorMyles Watson <mylesgw@gmail.com>2010-03-24 22:02:53 +0000
committerMyles Watson <mylesgw@gmail.com>2010-03-24 22:02:53 +0000
commit565a281f3696bf6252fe3153f4b680db85fe7906 (patch)
treef9ae61466b69b7a06bbe9938e97af2e82dbb5337 /src/northbridge
parentd1149d7ef13ba63baac89dfe687bdd01e93f79ca (diff)
Get rid of type-punned pointer errors.
Defining AmlCode differently in different source files is a bit ugly... Creating a void * to do the casting is not exactly beautiful either... Signed-off-by: Myles Watson <mylesgw@gmail.com> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5286 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/northbridge')
-rw-r--r--src/northbridge/amd/amdfam10/amdfam10_acpi.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/northbridge/amd/amdfam10/amdfam10_acpi.c b/src/northbridge/amd/amdfam10/amdfam10_acpi.c
index bfc2307aa8..9f6bdaf531 100644
--- a/src/northbridge/amd/amdfam10/amdfam10_acpi.c
+++ b/src/northbridge/amd/amdfam10/amdfam10_acpi.c
@@ -305,11 +305,11 @@ void update_sspr(void *sspr, u32 nodeid, u32 cpuindex)
}
}
-extern unsigned char AmlCode_sspr5[];
-extern unsigned char AmlCode_sspr4[];
-extern unsigned char AmlCode_sspr3[];
-extern unsigned char AmlCode_sspr2[];
-extern unsigned char AmlCode_sspr1[];
+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;
/* fixme: find one good way for different p_state_num */
unsigned long acpi_add_ssdt_pstates(acpi_rsdp_t *rsdp, unsigned long current)
@@ -321,13 +321,13 @@ unsigned long acpi_add_ssdt_pstates(acpi_rsdp_t *rsdp, unsigned long current)
if(!sysconf.p_state_num) return current;
- u8 *AmlCode_sspr;
+ acpi_header_t *AmlCode_sspr;
switch(sysconf.p_state_num) {
- case 1: AmlCode_sspr = AmlCode_sspr1; break;
- case 2: AmlCode_sspr = AmlCode_sspr2; break;
- case 3: AmlCode_sspr = AmlCode_sspr3; break;
- case 4: AmlCode_sspr = AmlCode_sspr4; break;
- default: AmlCode_sspr = AmlCode_sspr5; break;
+ case 1: AmlCode_sspr = &AmlCode_sspr1; break;
+ case 2: AmlCode_sspr = &AmlCode_sspr2; break;
+ case 3: AmlCode_sspr = &AmlCode_sspr3; break;
+ case 4: AmlCode_sspr = &AmlCode_sspr4; break;
+ default: AmlCode_sspr = &AmlCode_sspr5; break;
}
for(cpu = all_devices; cpu; cpu = cpu->next) {
@@ -342,8 +342,8 @@ unsigned long acpi_add_ssdt_pstates(acpi_rsdp_t *rsdp, unsigned long current)
current = ( current + 0x0f) & -0x10;
ssdt = (acpi_header_t *)current;
- current += ((acpi_header_t *)AmlCode_sspr)->length;
- memcpy((void *)ssdt, (void *)AmlCode_sspr, ((acpi_header_t *)AmlCode_sspr)->length);
+ current += AmlCode_sspr->length;
+ memcpy((void *)ssdt, AmlCode_sspr, AmlCode_sspr->length);
update_sspr((void*)ssdt,cpu->path.apic.node_id, cpu_index);
/* recalculate checksum */
ssdt->checksum = 0;