Code cleanup; make several boards compile & link.
diff --git a/cpu/arm920t/serial.c b/cpu/arm920t/serial.c
index 6104e75..1749e82 100644
--- a/cpu/arm920t/serial.c
+++ b/cpu/arm920t/serial.c
@@ -1,18 +1,18 @@
-/*
- * (C) Copyright 2002
- * Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
+ /*
+ * (C) Copyright 2002
+ * Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
@@ -28,13 +28,13 @@
#ifdef CONFIG_SERIAL1
#define UART_NR S3C24X0_UART0
-#elif CONFIG_SERIAL2
+#elif defined(CONFIG_SERIAL2)
# if defined(CONFIG_TRAB)
# error "TRAB supports only CONFIG_SERIAL1"
# endif
#define UART_NR S3C24X0_UART1
-#elif CONFIG_SERIAL3
+#elif defined(CONFIG_SERIAL3)
# if defined(CONFIG_TRAB)
# #error "TRAB supports only CONFIG_SERIAL1"
# endif
diff --git a/cpu/arm926ejs/interrupts.c b/cpu/arm926ejs/interrupts.c
index 10841fd..3770660 100644
--- a/cpu/arm926ejs/interrupts.c
+++ b/cpu/arm926ejs/interrupts.c
@@ -293,7 +293,7 @@
/* waits specified delay value and resets timestamp */
void udelay_masked (unsigned long usec)
{
- ulong tmo, tmp;
+ ulong tmo;
if(usec >= 1000){ /* if "big" number, spread normalization to seconds */
tmo = usec / 1000; /* start to normalize for usec to ticks per sec */
diff --git a/cpu/i386/serial.c b/cpu/i386/serial.c
index f58b47c..db13008 100644
--- a/cpu/i386/serial.c
+++ b/cpu/i386/serial.c
@@ -51,7 +51,7 @@
#include <asm/io.h>
#include <asm/ibmpc.h>
-#if CONFIG_SERIAL_SOFTWARE_FIFO
+#ifdef CONFIG_SERIAL_SOFTWARE_FIFO
#include <malloc.h>
#endif
@@ -81,7 +81,7 @@
#define asyncLSRRxFifoError1 0x80
-#if CONFIG_SERIAL_SOFTWARE_FIFO
+#ifdef CONFIG_SERIAL_SOFTWARE_FIFO
/*-----------------------------------------------------------------------------+
| Fifo
+-----------------------------------------------------------------------------*/
@@ -193,7 +193,7 @@
{
unsigned char status = 0;
-#if CONFIG_SERIAL_SOFTWARE_FIFO
+#ifdef CONFIG_SERIAL_SOFTWARE_FIFO
if (serial_buffer_active) {
return serial_buffered_getc();
}
@@ -225,7 +225,7 @@
{
unsigned char status;
-#if CONFIG_SERIAL_SOFTWARE_FIFO
+#ifdef CONFIG_SERIAL_SOFTWARE_FIFO
if (serial_buffer_active) {
return serial_buffered_tstc();
}
@@ -248,7 +248,7 @@
}
-#if CONFIG_SERIAL_SOFTWARE_FIFO
+#ifdef CONFIG_SERIAL_SOFTWARE_FIFO
void serial_isr(void *arg)
{
diff --git a/cpu/mpc5xxx/ide.c b/cpu/mpc5xxx/ide.c
index 4718869..1969172 100644
--- a/cpu/mpc5xxx/ide.c
+++ b/cpu/mpc5xxx/ide.c
@@ -73,7 +73,7 @@
*(vu_long *) MPC5XXX_ATA_PIO2 = reg;
#ifdef CONFIG_IDE_RESET
- init_ide_reset ();
+ init_ide_reset ();
#endif /* CONFIG_IDE_RESET */
return (0);
diff --git a/cpu/ppc4xx/405gp_pci.c b/cpu/ppc4xx/405gp_pci.c
index c9e2e9c..ff9215f 100644
--- a/cpu/ppc4xx/405gp_pci.c
+++ b/cpu/ppc4xx/405gp_pci.c
@@ -364,7 +364,7 @@
*/
static struct pci_config_table pci_405gp_config_table[] = {
/*if VendID is 0 it terminates the table search (ie Walnut)*/
-#if CFG_PCI_SUBSYS_VENDORID
+#ifdef CFG_PCI_SUBSYS_VENDORID
{CFG_PCI_SUBSYS_VENDORID, PCI_ANY_ID, PCI_CLASS_BRIDGE_HOST,
PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, pci_405gp_setup_bridge},
#endif
diff --git a/cpu/ppc4xx/cpu.c b/cpu/ppc4xx/cpu.c
index df19605..cdb5039 100644
--- a/cpu/ppc4xx/cpu.c
+++ b/cpu/ppc4xx/cpu.c
@@ -70,17 +70,17 @@
get_sys_info(&sys_info);
-#if CONFIG_405GP
+#ifdef CONFIG_405GP
puts ("IBM PowerPC 405GP");
if (pvr == PVR_405GPR_RB) {
putc('r');
}
puts (" Rev. ");
#endif
-#if CONFIG_405CR
+#ifdef CONFIG_405CR
puts ("IBM PowerPC 405CR Rev. ");
#endif
-#if CONFIG_405EP
+#ifdef CONFIG_405EP
puts ("IBM PowerPC 405EP Rev. ");
#endif
switch (pvr) {
@@ -89,7 +89,7 @@
putc('B');
break;
case PVR_405GP_RC:
-#if CONFIG_405CR
+#ifdef CONFIG_405CR
case PVR_405CR_RC:
#endif
putc('C');
@@ -97,7 +97,7 @@
case PVR_405GP_RD:
putc('D');
break;
-#if CONFIG_405GP
+#ifdef CONFIG_405GP
case PVR_405GP_RE:
putc('E');
break;
diff --git a/cpu/ppc4xx/serial.c b/cpu/ppc4xx/serial.c
index 2c77338..41402cc 100644
--- a/cpu/ppc4xx/serial.c
+++ b/cpu/ppc4xx/serial.c
@@ -48,7 +48,7 @@
#include <watchdog.h>
#include "vecnum.h"
-#if CONFIG_SERIAL_SOFTWARE_FIFO
+#ifdef CONFIG_SERIAL_SOFTWARE_FIFO
#include <malloc.h>
#endif
@@ -351,7 +351,7 @@
/*#define asyncRxBufferport1 ACTING_UART0_BASE+0x00 */
-#if CONFIG_SERIAL_SOFTWARE_FIFO
+#ifdef CONFIG_SERIAL_SOFTWARE_FIFO
/*-----------------------------------------------------------------------------+
| Fifo
+-----------------------------------------------------------------------------*/
@@ -637,7 +637,7 @@
}
-#if CONFIG_SERIAL_SOFTWARE_FIFO
+#ifdef CONFIG_SERIAL_SOFTWARE_FIFO
void serial_isr (void *arg)
{
diff --git a/cpu/ppc4xx/speed.c b/cpu/ppc4xx/speed.c
index 7172fe3..f8f88ff45 100644
--- a/cpu/ppc4xx/speed.c
+++ b/cpu/ppc4xx/speed.c
@@ -247,7 +247,7 @@
unsigned long temp1;
unsigned long lfdiv;
unsigned long m;
- unsigned long prbdv0;
+ unsigned long prbdv0;
/* Extract configured divisors */
mfsdr( sdr_sdstp0,strp0 );
diff --git a/cpu/s3c44b0/start.S b/cpu/s3c44b0/start.S
index ce31ec9..b4b7c3f 100644
--- a/cpu/s3c44b0/start.S
+++ b/cpu/s3c44b0/start.S
@@ -71,16 +71,15 @@
.word _start
/*
- * Note: _armboot_end_data and _armboot_end are defined
- * by the (board-dependent) linker script.
- * _armboot_end_data is the first usable FLASH address after armboot
+ * These are defined in the board-specific linker script.
*/
-.globl _armboot_end_data
-_armboot_end_data:
- .word armboot_end_data
-.globl _armboot_end
-_armboot_end:
- .word armboot_end
+.globl _bss_start
+_bss_start:
+ .word __bss_start
+
+.globl _bss_end
+_bss_end:
+ .word _end
#ifdef CONFIG_USE_IRQ
/* IRQ stack memory (calculated at run-time) */
@@ -130,7 +129,7 @@
beq stack_setup
ldr r2, _armboot_start
- ldr r3, _armboot_end
+ ldr r3, _bss_start
sub r2, r3, r2 /* r2 <- size of armboot */
add r2, r0, r2 /* r2 <- source end address */
diff --git a/cpu/sa1100/serial.c b/cpu/sa1100/serial.c
index d3b8628..a598489 100644
--- a/cpu/sa1100/serial.c
+++ b/cpu/sa1100/serial.c
@@ -66,7 +66,7 @@
Ser1UTCR1 = 0;
Ser1UTCR2 = (u32)reg;
Ser1UTCR3 = ( UTCR3_RXE | UTCR3_TXE );
-#elif CONFIG_SERIAL3
+#elif defined(CONFIG_SERIAL3)
/* Wait until port is ready ... */
while (Ser3UTSR1 & UTSR1_TBY) {
}
@@ -107,7 +107,7 @@
while ((Ser1UTSR0 & UTSR0_TFS) == 0);
Ser1UTDR = c;
-#elif CONFIG_SERIAL3
+#elif defined(CONFIG_SERIAL3)
/* wait for room in the tx FIFO on SERIAL3 */
while ((Ser3UTSR0 & UTSR0_TFS) == 0);
@@ -128,7 +128,7 @@
{
#ifdef CONFIG_SERIAL1
return Ser1UTSR1 & UTSR1_RNE;
-#elif CONFIG_SERIAL3
+#elif defined(CONFIG_SERIAL3)
return Ser3UTSR1 & UTSR1_RNE;
#endif
}
@@ -144,7 +144,7 @@
while (!(Ser1UTSR1 & UTSR1_RNE));
return (char) Ser1UTDR & 0xff;
-#elif CONFIG_SERIAL3
+#elif defined(CONFIG_SERIAL3)
while (!(Ser3UTSR1 & UTSR1_RNE));
return (char) Ser3UTDR & 0xff;