From 565a281f3696bf6252fe3153f4b680db85fe7906 Mon Sep 17 00:00:00 2001 From: Myles Watson Date: Wed, 24 Mar 2010 22:02:53 +0000 Subject: 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 Acked-by: Stefan Reinauer git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5286 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- src/northbridge/amd/amdfam10/amdfam10_acpi.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/northbridge') 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; -- cgit v1.2.3