1. gcc doesn't like a character array being cast to a struct.

-extern unsigned char AmlCode[];
+extern void* AmlCode;

2. Include <console/console.h> if you're using PRINTK_IN_CAR (not ROMCC)
3. Add a few more "nuisance" prototypes.

Signed-off-by: Myles Watson <[email protected]>

I think it would be nice to add the number of warnings for each board on one
of the build pages.  It looks like there are many that could compile without
any warnings, and some that look like they have a few too many.  Here's the
list after this patch:

coreboot-builds/a-trend_atc-6220/make.log:2
coreboot-builds/a-trend_atc-6240/make.log:2
coreboot-builds/abit_be6-ii_v2_0/make.log:2
coreboot-builds/advantech_pcm-5820/make.log:76
coreboot-builds/amd_db800/make.log:111
coreboot-builds/amd_dbm690t/make.log:132
coreboot-builds/amd_mahogany/make.log:182
coreboot-builds/amd_mahogany_fam10/make.log:378
coreboot-builds/amd_norwich/make.log:110
coreboot-builds/amd_pistachio/make.log:127
coreboot-builds/amd_rumba/make.log:65
coreboot-builds/amd_serengeti_cheetah/make.log:74
coreboot-builds/amd_serengeti_cheetah_fam10/make.log:270
coreboot-builds/arima_hdama/make.log:49
coreboot-builds/artecgroup_dbe61/make.log:112
coreboot-builds/asi_mb_5blgp/make.log:2
coreboot-builds/asi_mb_5blmp/make.log:2
coreboot-builds/asus_a8n_e/make.log:54
coreboot-builds/asus_a8v-e_se/make.log:74
coreboot-builds/asus_m2v-mx_se/make.log:103
coreboot-builds/asus_mew-am/make.log:9
coreboot-builds/asus_mew-vm/make.log:10
coreboot-builds/asus_p2b-d/make.log:3
coreboot-builds/asus_p2b-ds/make.log:3
coreboot-builds/asus_p2b-f/make.log:2
coreboot-builds/asus_p2b-ls/make.log:2
coreboot-builds/asus_p2b/make.log:2
coreboot-builds/asus_p3b-f/make.log:2
coreboot-builds/axus_tc320/make.log:2
coreboot-builds/azza_pt-6ibd/make.log:2
coreboot-builds/bcom_winnet100/make.log:2
coreboot-builds/bcom_winnetp680/make.log:100
coreboot-builds/biostar_m6tba/make.log:2
coreboot-builds/broadcom_blast/make.log:78
coreboot-builds/compaq_deskpro_en_sff_p600/make.log:2
coreboot-builds/dell_s1850/make.log:5
coreboot-builds/digitallogic_adl855pc/make.log:10
coreboot-builds/digitallogic_msm586seg/make.log:12
coreboot-builds/digitallogic_msm800sev/make.log:111
coreboot-builds/eaglelion_5bcm/make.log:2
coreboot-builds/emulation_qemu-x86/make.log:0
coreboot-builds/gigabyte_ga-6bxc/make.log:2
coreboot-builds/gigabyte_ga_2761gxdk/make.log:128
coreboot-builds/gigabyte_m57sli/make.log:133
coreboot-builds/hp_dl145_g3/make.log:110
coreboot-builds/hp_e_vectra_p2706t/make.log:9
coreboot-builds/ibm_e325/make.log:48
coreboot-builds/ibm_e326/make.log:50
coreboot-builds/iei_juki-511p/make.log:2
coreboot-builds/iei_nova4899r/make.log:2
coreboot-builds/iei_pcisa-lx-800-r10/make.log:111
coreboot-builds/intel_d945gclf/make.log:24
coreboot-builds/intel_eagleheights/make.log:49
coreboot-builds/intel_jarrell/make.log:13
coreboot-builds/intel_mtarvon/make.log:6
coreboot-builds/intel_truxton/make.log:6
coreboot-builds/intel_xe7501devkit/make.log:15
coreboot-builds/iwill_dk8_htx/make.log:51
coreboot-builds/iwill_dk8s2/make.log:58
coreboot-builds/iwill_dk8x/make.log:53
coreboot-builds/jetway_j7f24/make.log:99
coreboot-builds/kontron_986lcd-m/make.log:15
coreboot-builds/kontron_kt690/make.log:131
coreboot-builds/lippert_frontrunner/make.log:42
coreboot-builds/lippert_roadrunner-lx/make.log:113
coreboot-builds/lippert_spacerunner-lx/make.log:114
coreboot-builds/mitac_6513wu/make.log:9
coreboot-builds/msi_ms6119/make.log:2
coreboot-builds/msi_ms6147/make.log:2
coreboot-builds/msi_ms6156/make.log:2
coreboot-builds/msi_ms6178/make.log:9
coreboot-builds/msi_ms7135/make.log:58
coreboot-builds/msi_ms7260/make.log:131
coreboot-builds/msi_ms9185/make.log:108
coreboot-builds/msi_ms9282/make.log:132
coreboot-builds/msi_ms9652_fam10/make.log:298
coreboot-builds/nec_powermate2000/make.log:9
coreboot-builds/newisys_khepri/make.log:48
coreboot-builds/nvidia_l1_2pvv/make.log:135
coreboot-builds/olpc_btest/make.log:72
coreboot-builds/olpc_rev_a/make.log:71
coreboot-builds/pcengines_alix1c/make.log:112
coreboot-builds/rca_rm4100/make.log:1
coreboot-builds/roda_rk886ex/make.log:25
coreboot-builds/soyo_sy-6ba-plus-iii/make.log:2
coreboot-builds/sunw_ultra40/make.log:59
coreboot-builds/supermicro_h8dme/make.log:126
coreboot-builds/supermicro_h8dmr/make.log:124
coreboot-builds/supermicro_h8dmr_fam10/make.log:293
coreboot-builds/supermicro_h8qme_fam10/make.log:293
coreboot-builds/supermicro_x6dai_g/make.log:13
coreboot-builds/supermicro_x6dhe_g/make.log:17
coreboot-builds/supermicro_x6dhe_g2/make.log:9
coreboot-builds/supermicro_x6dhr_ig/make.log:6
coreboot-builds/supermicro_x6dhr_ig2/make.log:6
coreboot-builds/technexion_tim5690/make.log:130
coreboot-builds/technexion_tim8690/make.log:130
coreboot-builds/technologic_ts5300/make.log:10
coreboot-builds/televideo_tc7020/make.log:2
coreboot-builds/thomson_ip1000/make.log:0
coreboot-builds/tyan_s1846/make.log:2
coreboot-builds/tyan_s2735/make.log:78
coreboot-builds/tyan_s2850/make.log:52
coreboot-builds/tyan_s2875/make.log:50
coreboot-builds/tyan_s2880/make.log:54
coreboot-builds/tyan_s2881/make.log:53
coreboot-builds/tyan_s2882/make.log:51
coreboot-builds/tyan_s2885/make.log:49
coreboot-builds/tyan_s2891/make.log:58
coreboot-builds/tyan_s2892/make.log:4
coreboot-builds/tyan_s2895/make.log:49
coreboot-builds/tyan_s2912/make.log:136
coreboot-builds/tyan_s2912_fam10/make.log:298
coreboot-builds/tyan_s4880/make.log:53
coreboot-builds/tyan_s4882/make.log:44
coreboot-builds/via_epia-cn/make.log:48
coreboot-builds/via_epia-m/make.log:135
coreboot-builds/via_epia-m700/make.log:204
coreboot-builds/via_epia-n/make.log:132
coreboot-builds/via_epia/make.log:62
coreboot-builds/via_pc2500e/make.log:45
coreboot-builds/via_vt8454c/make.log:60
coreboot-builds/winent_pl6064/make.log:110

Thanks,
Myles
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)
-- 
coreboot mailing list: [email protected]
http://www.coreboot.org/mailman/listinfo/coreboot

Reply via email to