Drop excessive whitespace randomly sprinkled in romstage.c files.
[coreboot.git] / src / mainboard / via / vt8454c / acpi_tables.c
index f5e37f5069b494bbab31c1b142ae7011685e4a50..434bf8799d4deeff2bbcfb2a5df4ec25f8fdb331 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 <string.h>
 #include <console/console.h>
 #include <arch/acpi.h>
+#include <arch/ioapic.h>
 #include <device/device.h>
 #include <device/pci.h>
 #include <device/pci_ids.h>
 #include "dmi.h"
 
-extern unsigned char AmlCode[];
+extern const unsigned char AmlCode[];
 
 unsigned long acpi_fill_mcfg(unsigned long current)
 {
@@ -52,7 +53,7 @@ unsigned long acpi_fill_mcfg(unsigned long current)
 }
 
 
-void acpi_create_via_hpet(acpi_hpet_t * hpet)
+static void acpi_create_via_hpet(acpi_hpet_t * hpet)
 {
 #define HPET_ADDR  0xfe800000ULL
        acpi_header_t *header = &(hpet->header);
@@ -85,10 +86,6 @@ void acpi_create_via_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 Apic */
@@ -180,10 +177,11 @@ unsigned long write_acpi_tables(unsigned long start)
        acpi_create_facs(facs);
 
        dsdt = (acpi_header_t *) current;
-       current += ((acpi_header_t *) AmlCode)->length;
-       memcpy((void *) dsdt, (void *) AmlCode,
-              ((acpi_header_t *) AmlCode)->length);
-#if DONT_TRUST_IASL
+       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);
 #endif