[coreboot] [commit] r4939 - in trunk: . src src/arch/i386/boot src/arch/i386/include/arch/smp src/console src/cpu/emulation/qemu-x86 src/devices src/include/smp src/lib src/mainboard/emulation/qemu-x86 util/x86emu

svn at coreboot.org svn at coreboot.org
Thu Nov 12 17:38:03 CET 2009


Author: myles
Date: 2009-11-12 17:38:03 +0100 (Thu, 12 Nov 2009)
New Revision: 4939

Modified:
   trunk/Makefile
   trunk/src/Kconfig
   trunk/src/arch/i386/boot/coreboot_table.c
   trunk/src/arch/i386/include/arch/smp/spinlock.h
   trunk/src/console/printk.c
   trunk/src/console/vsprintf.c
   trunk/src/cpu/emulation/qemu-x86/northbridge.c
   trunk/src/devices/device.c
   trunk/src/include/smp/spinlock.h
   trunk/src/lib/cbmem.c
   trunk/src/mainboard/emulation/qemu-x86/Kconfig
   trunk/util/x86emu/x86.c
Log:
Add CONFIG_WARNINGS_ARE_ERRORS and set it for qemu.

Remove all remaining warnings from qemu.

Signed-off-by: Myles Watson <mylesgw at gmail.com>
Acked-by: Ronald G. Minnich <rminnich at gmail.com>


Modified: trunk/Makefile
===================================================================
--- trunk/Makefile	2009-11-12 16:20:04 UTC (rev 4938)
+++ trunk/Makefile	2009-11-12 16:38:03 UTC (rev 4939)
@@ -247,6 +247,9 @@
 CFLAGS += -nostdlib -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes
 CFLAGS += -Wwrite-strings -Wredundant-decls -Wno-trigraphs 
 CFLAGS += -Wstrict-aliasing -Wshadow 
+ifeq ($(CONFIG_WARNINGS_ARE_ERRORS),y)
+CFLAGS += -Werror
+endif
 CFLAGS += -fno-common -ffreestanding -fno-builtin -fomit-frame-pointer
 
 CBFS_COMPRESS_FLAG:=l

Modified: trunk/src/Kconfig
===================================================================
--- trunk/src/Kconfig	2009-11-12 16:20:04 UTC (rev 4938)
+++ trunk/src/Kconfig	2009-11-12 16:38:03 UTC (rev 4939)
@@ -463,3 +463,7 @@
 config ENABLE_APIC_EXT_ID
 	bool
 	default n
+
+config WARNINGS_ARE_ERRORS
+	bool
+	default n

Modified: trunk/src/arch/i386/boot/coreboot_table.c
===================================================================
--- trunk/src/arch/i386/boot/coreboot_table.c	2009-11-12 16:20:04 UTC (rev 4938)
+++ trunk/src/arch/i386/boot/coreboot_table.c	2009-11-12 16:38:03 UTC (rev 4939)
@@ -65,11 +65,13 @@
 	return rec;
 }
 
+#if 0
 static struct lb_record *lb_next_record(struct lb_record *rec)
 {
 	rec = (void *)(((char *)rec) + rec->size);	
 	return rec;
 }
+#endif
 
 static struct lb_record *lb_new_record(struct lb_header *header)
 {
@@ -218,6 +220,7 @@
 
 }
 
+#if CONFIG_WRITE_HIGH_TABLES == 1
 static struct lb_forward *lb_forward(struct lb_header *header, struct lb_header *next_header)
 {
 	struct lb_record *rec;
@@ -229,6 +232,7 @@
 	forward->forward = (uint64_t)(unsigned long)next_header;
 	return forward;
 }
+#endif
 
 void lb_memory_range(struct lb_memory *mem,
 	uint32_t type, uint64_t start, uint64_t size)

Modified: trunk/src/arch/i386/include/arch/smp/spinlock.h
===================================================================
--- trunk/src/arch/i386/include/arch/smp/spinlock.h	2009-11-12 16:20:04 UTC (rev 4938)
+++ trunk/src/arch/i386/include/arch/smp/spinlock.h	2009-11-12 16:38:03 UTC (rev 4939)
@@ -11,6 +11,7 @@
 
 
 #define SPIN_LOCK_UNLOCKED (spinlock_t) { 1 }
+#define DECLARE_SPIN_LOCK(x) static spinlock_t x = SPIN_LOCK_UNLOCKED;
 
 /*
  * Simple spin lock operations.  There are two variants, one clears IRQ's

Modified: trunk/src/console/printk.c
===================================================================
--- trunk/src/console/printk.c	2009-11-12 16:20:04 UTC (rev 4938)
+++ trunk/src/console/printk.c	2009-11-12 16:38:03 UTC (rev 4939)
@@ -23,7 +23,7 @@
 int minimum_console_loglevel = MINIMUM_CONSOLE_LOGLEVEL;
 int default_console_loglevel = CONFIG_DEFAULT_CONSOLE_LOGLEVEL;
 
-static spinlock_t console_lock = SPIN_LOCK_UNLOCKED;
+DECLARE_SPIN_LOCK(console_lock)
 
 int do_printk(int msg_level, const char *fmt, ...)
 {

Modified: trunk/src/console/vsprintf.c
===================================================================
--- trunk/src/console/vsprintf.c	2009-11-12 16:20:04 UTC (rev 4938)
+++ trunk/src/console/vsprintf.c	2009-11-12 16:38:03 UTC (rev 4939)
@@ -24,7 +24,7 @@
 #include <smp/spinlock.h>
 #include <console/vtxprintf.h>
 
-static spinlock_t vsprintf_lock = SPIN_LOCK_UNLOCKED;
+DECLARE_SPIN_LOCK(vsprintf_lock)
 
 static char *str_buf;
 

Modified: trunk/src/cpu/emulation/qemu-x86/northbridge.c
===================================================================
--- trunk/src/cpu/emulation/qemu-x86/northbridge.c	2009-11-12 16:20:04 UTC (rev 4938)
+++ trunk/src/cpu/emulation/qemu-x86/northbridge.c	2009-11-12 16:38:03 UTC (rev 4939)
@@ -8,6 +8,7 @@
 #include <bitops.h>
 #include "chip.h"
 #include "northbridge.h"
+#include <delay.h>
 
 static void ram_resource(device_t dev, unsigned long index,
 	unsigned long basek, unsigned long sizek)
@@ -157,9 +158,9 @@
 	.enable_dev = enable_dev,
 };
 
-void udelay(int usecs)
+void udelay(unsigned usecs)
 {
-	int i;
+	unsigned i;
 	for(i = 0; i < usecs; i++)
 		inb(0x80);
 }

Modified: trunk/src/devices/device.c
===================================================================
--- trunk/src/devices/device.c	2009-11-12 16:20:04 UTC (rev 4938)
+++ trunk/src/devices/device.c	2009-11-12 16:38:03 UTC (rev 4939)
@@ -58,7 +58,9 @@
  *
  * @see device_path
  */
-static spinlock_t dev_lock = SPIN_LOCK_UNLOCKED;
+
+DECLARE_SPIN_LOCK(dev_lock)
+
 device_t alloc_dev(struct bus *parent, struct device_path *path)
 {
 	device_t dev, child;

Modified: trunk/src/include/smp/spinlock.h
===================================================================
--- trunk/src/include/smp/spinlock.h	2009-11-12 16:20:04 UTC (rev 4938)
+++ trunk/src/include/smp/spinlock.h	2009-11-12 16:38:03 UTC (rev 4939)
@@ -5,15 +5,7 @@
 #include <arch/smp/spinlock.h>
 #else /* !CONFIG_SMP */
 
-/* Most GCC versions have a nasty bug with empty initializers */
-#if (__GNUC__ > 2) 
-typedef struct { } spinlock_t;
-#define SPIN_LOCK_UNLOCKED (spinlock_t) { }
-#else
-typedef struct { int gcc_is_buggy; } spinlock_t;
-#define SPIN_LOCK_UNLOCKED (spinlock_t) { 0 }
-#endif
-
+#define DECLARE_SPIN_LOCK(x)
 #define barrier()		do {} while(0)
 #define spin_is_locked(lock)	0
 #define spin_unlock_wait(lock)	do {} while(0)

Modified: trunk/src/lib/cbmem.c
===================================================================
--- trunk/src/lib/cbmem.c	2009-11-12 16:20:04 UTC (rev 4938)
+++ trunk/src/lib/cbmem.c	2009-11-12 16:38:03 UTC (rev 4939)
@@ -35,9 +35,6 @@
 #define MAX_CBMEM_ENTRIES	16
 #define CBMEM_MAGIC		0x434f5245
 
-static void *cbmem_base;
-static int cbmem_size;
-
 struct cbmem_entry {
 	u32 magic;
 	u32 id;
@@ -151,7 +148,7 @@
 	cbmem_toc[0].base += size;
 	cbmem_toc[0].size -= size;
 
-	return (void *)cbmem_toc[i].base;
+	return (void *)(u32)cbmem_toc[i].base;
 }
 
 void *cbmem_find(u32 id)

Modified: trunk/src/mainboard/emulation/qemu-x86/Kconfig
===================================================================
--- trunk/src/mainboard/emulation/qemu-x86/Kconfig	2009-11-12 16:20:04 UTC (rev 4938)
+++ trunk/src/mainboard/emulation/qemu-x86/Kconfig	2009-11-12 16:38:03 UTC (rev 4939)
@@ -5,6 +5,7 @@
 	select CPU_EMULATION_QEMU_X86
 	select HAVE_PIRQ_TABLE
 	select BOARD_ROMSIZE_KB_256
+	select WARNINGS_ARE_ERRORS
 
 config MAINBOARD_DIR
 	string

Modified: trunk/util/x86emu/x86.c
===================================================================
--- trunk/util/x86emu/x86.c	2009-11-12 16:20:04 UTC (rev 4938)
+++ trunk/util/x86emu/x86.c	2009-11-12 16:38:03 UTC (rev 4939)
@@ -126,7 +126,7 @@
 void run_bios(struct device *dev, unsigned long addr)
 {
 	/* clear vga bios data area */
-	memset(0x400, 0, 0x200);
+	memset((void *)0x400, 0, 0x200);
 	
 	/* Set up C interrupt handlers */
 	setup_interrupt_handlers();





More information about the coreboot mailing list