We define IO_APIC_ADDR in <arch/ioapic.h>, let's use it.
[coreboot.git] / src / mainboard / intel / d945gclf / acpi_tables.c
index 5be0c9aef202a6380eb0dfffaa9d5854e740b882..9fc2adbc7c469e464bd94e3c4a16a139accdfe62 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * This file is part of the coreboot project.
- * 
+ *
  * Copyright (C) 2007-2009 coresystems GmbH
  *
  * This program is free software; you can redistribute it and/or
 #include <device/pci.h>
 #include <device/pci_ids.h>
 #include <cpu/x86/msr.h>
+#include <arch/ioapic.h>
 #include "dmi.h"
 
 #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
@@ -65,7 +66,7 @@ typedef struct acpi_oemb {
 } __attribute__((packed)) acpi_oemb_t;
 #endif
 
-#include "../../../southbridge/intel/i82801gx/i82801gx_nvs.h"
+#include "southbridge/intel/i82801gx/i82801gx_nvs.h"
 
 #if OLD_ACPI
 static void acpi_create_oemb(acpi_oemb_t *oemb)
@@ -146,8 +147,6 @@ static void acpi_create_intel_hpet(acpi_hpet_t * hpet)
            acpi_checksum((void *) hpet, sizeof(acpi_hpet_t));
 }
 
-#define IO_APIC_ADDR   0xfec00000UL
-
 unsigned long acpi_fill_madt(unsigned long current)
 {
        /* Local APICs */
@@ -273,8 +272,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++) {