Index: svn/src/arch/i386/lib/console.c
===================================================================
--- svn.orig/src/arch/i386/lib/console.c
+++ svn/src/arch/i386/lib/console.c
@@ -4,6 +4,7 @@
 #if CONFIG_USE_PRINTK_IN_CAR == 0
 #include "console_print.c"
 #else  /* CONFIG_USE_PRINTK_IN_CAR == 1 */
+#include <console/console.h>
 #include "console_printk.c"
 #endif /* CONFIG_USE_PRINTK_IN_CAR */
 
Index: svn/src/mainboard/tyan/s2895/acpi_tables.c
===================================================================
--- svn.orig/src/mainboard/tyan/s2895/acpi_tables.c
+++ svn/src/mainboard/tyan/s2895/acpi_tables.c
@@ -20,7 +20,7 @@
 #include <../../../northbridge/amd/amdk8/amdk8_acpi.h>
 #include <cpu/amd/model_fxx_powernow.h>
 
-extern unsigned char AmlCode[];
+extern void* AmlCode;
 
 unsigned long acpi_fill_mcfg(unsigned long current)
 {
Index: svn/src/mainboard/tyan/s2895/romstage.c
===================================================================
--- svn.orig/src/mainboard/tyan/s2895/romstage.c
+++ svn/src/mainboard/tyan/s2895/romstage.c
@@ -149,7 +149,7 @@ static void sio_setup(void)
 
 }
 
-void failover_process(unsigned long bist, unsigned long cpu_init_detectedx)
+static void failover_process(unsigned long bist, unsigned long cpu_init_detectedx)
 {
 	unsigned last_boot_normal_x = last_boot_normal();
 
@@ -204,6 +204,7 @@ void failover_process(unsigned long bist
 #endif
 
 void real_main(unsigned long bist, unsigned long cpu_init_detectedx);
+void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx);
 
 void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
 {
Index: svn/src/include/lib.h
===================================================================
--- svn.orig/src/include/lib.h
+++ svn/src/include/lib.h
@@ -19,8 +19,13 @@
 
 /* This file is for "nuisance prototypes" that have no other home. */
 
+#ifndef __LIB_H__
+#define __LIB_H__
+
+#ifndef __PRE_RAM__ /* Conflicts with romcc_io.h */
 /* Defined in src/lib/clog2.c */
 unsigned long log2(unsigned long x);
+#endif
 
 /* Defined in src/lib/lzma.c */
 unsigned long ulzma(unsigned char *src, unsigned char *dst);
@@ -28,3 +33,10 @@ unsigned long ulzma(unsigned char *src, 
 /* Defined in src/arch/i386/boot/gdt.c */
 void move_gdt(void);
 
+/* Defined in src/lib/ramtest.c */
+void ram_check(unsigned long start, unsigned long stop);
+
+/* Defined in src/pc80/serial.c */
+void uart_init(void);
+
+#endif /* __LIB_H__ */
Index: svn/src/lib/ramtest.c
===================================================================
--- svn.orig/src/lib/ramtest.c
+++ svn/src/lib/ramtest.c
@@ -1,3 +1,7 @@
+#ifndef __ROMCC__
+#include <lib.h> /* Prototypes */
+#endif
+
 static void write_phys(unsigned long addr, unsigned long value)
 {
 	// Assembler in lib/ is very ugly. But we properly guarded
Index: svn/src/pc80/serial.c
===================================================================
--- svn.orig/src/pc80/serial.c
+++ svn/src/pc80/serial.c
@@ -1,3 +1,7 @@
+#ifndef __ROMCC__
+#include <lib.h> /* Prototypes */
+#endif
+
 /* Base Address */
 #ifndef CONFIG_TTYS0_BASE
 #define CONFIG_TTYS0_BASE 0x3f8
Index: svn/src/lib/generic_sdram.c
===================================================================
--- svn.orig/src/lib/generic_sdram.c
+++ svn/src/lib/generic_sdram.c
@@ -1,3 +1,6 @@
+#ifndef __ROMCC__
+#include <lib.h> /* Prototypes */
+#endif
 
 #ifndef RAMINIT_SYSINFO
         #define RAMINIT_SYSINFO 0
@@ -12,14 +15,6 @@ static inline void print_debug_sdram_8(c
 #endif
 }
 
-void sdram_no_memory(void)
-{
-	print_err("No memory!!\r\n");
-	while(1) { 
-		hlt(); 
-	}
-}
-
 /* Setup SDRAM */
 #if RAMINIT_SYSINFO == 1
 void sdram_initialize(int controllers, const struct mem_controller *ctrl, void *sysinfo)
Index: svn/src/mainboard/amd/serengeti_cheetah/acpi_tables.c
===================================================================
--- svn.orig/src/mainboard/amd/serengeti_cheetah/acpi_tables.c
+++ svn/src/mainboard/amd/serengeti_cheetah/acpi_tables.c
@@ -38,11 +38,11 @@ static void dump_mem(unsigned start, uns
  }
 #endif
 
-extern unsigned char AmlCode[];
+extern void* AmlCode;
 #if CONFIG_ACPI_SSDTX_NUM >= 1
-extern unsigned char AmlCode_ssdt2[];
-extern unsigned char AmlCode_ssdt3[];
-extern unsigned char AmlCode_ssdt4[];
+extern void* AmlCode_ssdt2;
+extern void* AmlCode_ssdt3;
+extern void* AmlCode_ssdt4;
 #endif
 
 #define IO_APIC_ADDR	0xfec00000UL
Index: svn/src/mainboard/asus/a8v-e_se/acpi_tables.c
===================================================================
--- svn.orig/src/mainboard/asus/a8v-e_se/acpi_tables.c
+++ svn/src/mainboard/asus/a8v-e_se/acpi_tables.c
@@ -31,7 +31,7 @@
 #include <../../../southbridge/via/vt8237r/vt8237r.h>
 #include <../../../southbridge/via/k8t890/k8t890.h>
 
-extern unsigned char AmlCode[];
+extern void* AmlCode;
 
 unsigned long acpi_fill_mcfg(unsigned long current)
 {
Index: svn/src/mainboard/asus/m2v-mx_se/acpi_tables.c
===================================================================
--- svn.orig/src/mainboard/asus/m2v-mx_se/acpi_tables.c
+++ svn/src/mainboard/asus/m2v-mx_se/acpi_tables.c
@@ -33,7 +33,7 @@
 #include <../../../northbridge/amd/amdk8/amdk8_acpi.h>
 #include <cpu/amd/model_fxx_powernow.h>
 
-extern unsigned char AmlCode[];
+extern void* AmlCode;
 
 unsigned long acpi_fill_mcfg(unsigned long current)
 {
Index: svn/src/mainboard/gigabyte/m57sli/acpi_tables.c
===================================================================
--- svn.orig/src/mainboard/gigabyte/m57sli/acpi_tables.c
+++ svn/src/mainboard/gigabyte/m57sli/acpi_tables.c
@@ -34,7 +34,7 @@
 #include <device/pci.h>
 #include <cpu/amd/amdk8_sysconf.h>
 
-extern unsigned char AmlCode[];
+extern void* AmlCode;
 
 unsigned long acpi_fill_mcfg(unsigned long current)
 {
Index: svn/src/mainboard/intel/d945gclf/acpi_tables.c
===================================================================
--- svn.orig/src/mainboard/intel/d945gclf/acpi_tables.c
+++ svn/src/mainboard/intel/d945gclf/acpi_tables.c
@@ -31,7 +31,7 @@
 
 #define OLD_ACPI 0
 
-extern unsigned char AmlCode[];
+extern void* AmlCode;
 #if CONFIG_HAVE_ACPI_SLIC
 unsigned long acpi_create_slic(unsigned long current);
 #endif
Index: svn/src/mainboard/intel/eagleheights/acpi_tables.c
===================================================================
--- svn.orig/src/mainboard/intel/eagleheights/acpi_tables.c
+++ svn/src/mainboard/intel/eagleheights/acpi_tables.c
@@ -28,7 +28,7 @@
 #include <device/pci_ids.h>
 #include "ioapic.h"
 
-extern unsigned char AmlCode[];
+extern void* AmlCode;
 
 unsigned long acpi_fill_mcfg(unsigned long current)
 {
Index: svn/src/mainboard/iwill/dk8_htx/acpi_tables.c
===================================================================
--- svn.orig/src/mainboard/iwill/dk8_htx/acpi_tables.c
+++ svn/src/mainboard/iwill/dk8_htx/acpi_tables.c
@@ -38,13 +38,13 @@ static void dump_mem(unsigned start, uns
  }
 #endif
 
-extern unsigned char AmlCode[];
+extern void* AmlCode;
 
 #if CONFIG_ACPI_SSDTX_NUM >= 1
-extern unsigned char AmlCode_ssdt2[];
-extern unsigned char AmlCode_ssdt3[];
-extern unsigned char AmlCode_ssdt4[];
-extern unsigned char AmlCode_ssdt5[];
+extern void* AmlCode_ssdt2;
+extern void* AmlCode_ssdt3;
+extern void* AmlCode_ssdt4;
+extern void* AmlCode_ssdt5;
 #endif
 
 #define IO_APIC_ADDR	0xfec00000UL
Index: svn/src/mainboard/kontron/986lcd-m/acpi_tables.c
===================================================================
--- svn.orig/src/mainboard/kontron/986lcd-m/acpi_tables.c
+++ svn/src/mainboard/kontron/986lcd-m/acpi_tables.c
@@ -29,7 +29,7 @@
 #include <cpu/x86/msr.h>
 #include "dmi.h"
 
-extern unsigned char AmlCode[];
+extern void* AmlCode;
 #if CONFIG_HAVE_ACPI_SLIC
 unsigned long acpi_create_slic(unsigned long current);
 #endif
Index: svn/src/mainboard/msi/ms9652_fam10/acpi_tables.c
===================================================================
--- svn.orig/src/mainboard/msi/ms9652_fam10/acpi_tables.c
+++ svn/src/mainboard/msi/ms9652_fam10/acpi_tables.c
@@ -35,7 +35,7 @@
 #include <cpu/amd/amdfam10_sysconf.h>
 #include "mb_sysconf.h"
 
-extern unsigned char AmlCode[];
+extern void* AmlCode;
 
 unsigned long acpi_fill_mcfg(unsigned long current)
 {
Index: svn/src/mainboard/roda/rk886ex/acpi_tables.c
===================================================================
--- svn.orig/src/mainboard/roda/rk886ex/acpi_tables.c
+++ svn/src/mainboard/roda/rk886ex/acpi_tables.c
@@ -30,7 +30,7 @@
 #include <device/pci_ids.h>
 #include "dmi.h"
 
-extern unsigned char AmlCode[];
+extern void* AmlCode;
 #if CONFIG_HAVE_ACPI_SLIC
 unsigned long acpi_create_slic(unsigned long current);
 #endif
Index: svn/src/mainboard/tyan/s2891/acpi_tables.c
===================================================================
--- svn.orig/src/mainboard/tyan/s2891/acpi_tables.c
+++ svn/src/mainboard/tyan/s2891/acpi_tables.c
@@ -20,7 +20,7 @@
 #include <../../../northbridge/amd/amdk8/amdk8_acpi.h>
 #include <cpu/amd/model_fxx_powernow.h>
 
-extern unsigned char AmlCode[];
+extern void* AmlCode;
 
 unsigned long acpi_fill_mcfg(unsigned long current)
 {
Index: svn/src/mainboard/tyan/s2892/acpi_tables.c
===================================================================
--- svn.orig/src/mainboard/tyan/s2892/acpi_tables.c
+++ svn/src/mainboard/tyan/s2892/acpi_tables.c
@@ -20,7 +20,7 @@
 #include <../../../northbridge/amd/amdk8/amdk8_acpi.h>
 #include <cpu/amd/model_fxx_powernow.h>
 
-extern unsigned char AmlCode[];
+extern void* AmlCode;
 
 unsigned long acpi_fill_mcfg(unsigned long current)
 {
Index: svn/src/mainboard/via/epia-m/acpi_tables.c
===================================================================
--- svn.orig/src/mainboard/via/epia-m/acpi_tables.c
+++ svn/src/mainboard/via/epia-m/acpi_tables.c
@@ -11,7 +11,7 @@
 #include <string.h>
 #include <arch/acpi.h>
 
-extern unsigned char AmlCode[];
+extern void* AmlCode;
 
 unsigned long acpi_fill_mcfg(unsigned long current)
 {
Index: svn/src/mainboard/via/epia-m700/acpi_tables.c
===================================================================
--- svn.orig/src/mainboard/via/epia-m700/acpi_tables.c
+++ svn/src/mainboard/via/epia-m700/acpi_tables.c
@@ -35,8 +35,8 @@
 #include <device/pci_ids.h>
 #include <../../../northbridge/via/vx800/vx800.h>
 
-extern unsigned char AmlCode_dsdt[];
-extern unsigned char AmlCode_ssdt[];
+extern void* AmlCode_dsdt;
+extern void* AmlCode_ssdt;
 
 extern u32 wake_vec;
 
Index: svn/src/mainboard/via/epia-n/acpi_tables.c
===================================================================
--- svn.orig/src/mainboard/via/epia-n/acpi_tables.c
+++ svn/src/mainboard/via/epia-n/acpi_tables.c
@@ -35,7 +35,7 @@
 #include <device/pci_ids.h>
 #include "../../../southbridge/via/vt8237r/vt8237r.h"
 
-extern unsigned char AmlCode[];
+extern void* AmlCode;
 
 /*
  * These four macros are copied from <arch/smp/mpspec.h>, I have to do this
Index: svn/src/mainboard/via/vt8454c/acpi_tables.c
===================================================================
--- svn.orig/src/mainboard/via/vt8454c/acpi_tables.c
+++ svn/src/mainboard/via/vt8454c/acpi_tables.c
@@ -27,7 +27,7 @@
 #include <device/pci_ids.h>
 #include "dmi.h"
 
-extern unsigned char AmlCode[];
+extern void* AmlCode;
 
 unsigned long acpi_fill_mcfg(unsigned long current)
 {
Index: svn/src/northbridge/amd/amdfam10/amdfam10_acpi.c
===================================================================
--- svn.orig/src/northbridge/amd/amdfam10/amdfam10_acpi.c
+++ svn/src/northbridge/amd/amdfam10/amdfam10_acpi.c
@@ -305,11 +305,11 @@ void update_sspr(void *sspr, u32 nodeid,
 	}
 }
 
-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 void* AmlCode_sspr5;
+extern void* AmlCode_sspr4;
+extern void* AmlCode_sspr3;
+extern void* AmlCode_sspr2;
+extern void* 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)
