Index: c/src/lib/libbsp/arm/nds/ChangeLog
===================================================================
--- c/src/lib/libbsp/arm/nds/ChangeLog	(revision 4909a30e6329ddb3beff3145939bdc82d8c4dc80)
+++ c/src/lib/libbsp/arm/nds/ChangeLog	(revision 12d853d54be8fd75a66a1e9582ce592ff35ed6e3)
@@ -1,2 +1,10 @@
+2008-09-14	Joel Sherrill <joel.sherrill@oarcorp.com>
+
+	* Makefile.am, configure.ac: Split out bsp_cleanup() and
+	bsp_get_work_area() into their own files.
+	* startup/bspclean.c, startup/bspgetworkarea.c,
+	startup/bspstart.c: New files.
+	* startup/start.c: Removed.
+
 2008-09-10	Joel Sherrill <joel.sherrill@oarcorp.com>
 
Index: c/src/lib/libbsp/arm/nds/Makefile.am
===================================================================
--- c/src/lib/libbsp/arm/nds/Makefile.am	(revision 4909a30e6329ddb3beff3145939bdc82d8c4dc80)
+++ c/src/lib/libbsp/arm/nds/Makefile.am	(revision 12d853d54be8fd75a66a1e9582ce592ff35ed6e3)
@@ -33,6 +33,7 @@
 noinst_PROGRAMS += startup.rel
 startup_rel_SOURCES = ../../shared/bsplibc.c ../../shared/bsppost.c \
-    startup/start.c ../../shared/bsppredriverhook.c \
-    ../../shared/bsppretaskinghook.c ../../shared/bootcard.c
+    startup/bspstart.c startup/bspclean.c startup/bspgetworkarea.c \
+    ../../shared/bsppredriverhook.c ../../shared/bsppretaskinghook.c \
+    ../../shared/bootcard.c
 startup_rel_CPPFLAGS = $(AM_CPPFLAGS) -DARM9 -I$(srcdir)/libnds/include
 startup_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
Index: c/src/lib/libbsp/arm/nds/configure.ac
===================================================================
--- c/src/lib/libbsp/arm/nds/configure.ac	(revision 4909a30e6329ddb3beff3145939bdc82d8c4dc80)
+++ c/src/lib/libbsp/arm/nds/configure.ac	(revision 12d853d54be8fd75a66a1e9582ce592ff35ed6e3)
@@ -26,4 +26,6 @@
 ## $srcdir/mk_libnds.sh $srcdir
 
+RTEMS_BSP_BOOTCARD_HANDLES_RAM_ALLOCATION
+
 # Explicitly list all Makefiles here
 AC_CONFIG_FILES([Makefile])
Index: c/src/lib/libbsp/arm/nds/startup/bspclean.c
===================================================================
--- c/src/lib/libbsp/arm/nds/startup/bspclean.c	(revision 12d853d54be8fd75a66a1e9582ce592ff35ed6e3)
+++ c/src/lib/libbsp/arm/nds/startup/bspclean.c	(revision 12d853d54be8fd75a66a1e9582ce592ff35ed6e3)
@@ -0,0 +1,31 @@
+/*
+ *  This is a dummy bsp_cleanup routine.
+ *
+ *  COPYRIGHT (c) 1989-1999.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  $Id$
+ */
+
+#include <bsp.h>
+#include <bsp/bootcard.h>
+#include <nds.h>
+
+/*
+ * reset the platform using bios call.
+ */
+void bsp_reset (void)
+{
+  swiSoftReset ();
+}
+
+void bsp_cleanup( void )
+{
+  printk ("[!] executive ended, rebooting\n");
+
+  bsp_reset ();
+}
Index: c/src/lib/libbsp/arm/nds/startup/bspgetworkarea.c
===================================================================
--- c/src/lib/libbsp/arm/nds/startup/bspgetworkarea.c	(revision 12d853d54be8fd75a66a1e9582ce592ff35ed6e3)
+++ c/src/lib/libbsp/arm/nds/startup/bspgetworkarea.c	(revision 12d853d54be8fd75a66a1e9582ce592ff35ed6e3)
@@ -0,0 +1,36 @@
+/*
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  $Id$
+ */
+
+#include <bsp.h>
+#include <bsp/bootcard.h>
+#include <stdint.h>
+
+/*
+ *  These are from the linker script.
+ */
+extern void * _end;
+extern void *__ewram_end;
+
+/*
+ *  This method returns the base address and size of the area which
+ *  is to be allocated between the RTEMS Workspace and the C Program
+ *  Heap.
+ */
+void bsp_get_work_area(
+  void   **work_area_start,
+  size_t  *work_area_size,
+  void   **heap_start,
+  size_t  *heap_size
+)
+{
+  *work_area_start = &_end;
+  *work_area_size  = (void *)&__ewram_end - (void *)&_end;
+  *heap_start      = BSP_BOOTCARD_HEAP_USES_WORK_AREA;
+  *heap_size       = BSP_BOOTCARD_HEAP_SIZE_DEFAULT;
+}
+
Index: c/src/lib/libbsp/arm/nds/startup/bspstart.c
===================================================================
--- c/src/lib/libbsp/arm/nds/startup/bspstart.c	(revision 12d853d54be8fd75a66a1e9582ce592ff35ed6e3)
+++ c/src/lib/libbsp/arm/nds/startup/bspstart.c	(revision 12d853d54be8fd75a66a1e9582ce592ff35ed6e3)
@@ -0,0 +1,72 @@
+/*
+ * RTEMS for Nintendo DS platform initialization.
+ *
+ * Copyright (c) 2008 by Matthieu Bucchianeri <mbucchia@gmail.com>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ *
+ * http://www.rtems.com/license/LICENSE
+ *
+ * $Id$
+ */
+
+#include <bsp.h>
+#include <bsp/bootcard.h>
+#include <nds.h>
+
+/*
+ * This definition comes from ARM cpu code.
+ */
+extern unsigned int arm_cpu_mode;
+
+/*
+ * start the platform.
+ */
+
+void bsp_start (void)
+{
+  /* initialize irq management */
+  BSP_rtems_irq_mngt_init ();
+
+  /* setup console mode for lower screen */
+  irqEnable (IRQ_VBLANK);
+  videoSetMode (0);
+  videoSetModeSub (MODE_0_2D | DISPLAY_BG0_ACTIVE);
+  vramSetBankC (VRAM_C_SUB_BG);
+
+  SUB_BG0_CR = BG_MAP_BASE (31);
+  BG_PALETTE_SUB[255] = RGB15 (31, 31, 31);
+  consoleInitDefault ((u16 *) SCREEN_BASE_BLOCK_SUB (31),
+                      (u16 *) CHAR_BASE_BLOCK_SUB (0), 16);
+
+  /* print status message */
+  printk ("[+] kernel console started\n");
+
+  /* set the cpu mode to system user */
+  arm_cpu_mode = 0x1f;
+
+  /* configure clock period */
+  Configuration.microseconds_per_tick = 10000;  /* us */
+}
+
+/*
+ * reset bss area.
+ */
+
+void
+bss_reset (void)
+{
+  extern uint8_t __bss_start;
+  extern uint8_t __bss_end;
+
+  memset (&__bss_start, 0, (uint32_t) & __bss_end - (uint32_t) & __bss_start);
+}
+
+/*
+ * A few symbols needed by libnds but not used.
+ */
+
+#include "../include/sys/iosupport.h"
+const devoptab_t *devoptab_list[STD_MAX];
+void *punixTime;
Index: c/src/lib/libbsp/arm/nds/startup/start.c
===================================================================
--- c/src/lib/libbsp/arm/nds/startup/start.c	(revision 4909a30e6329ddb3beff3145939bdc82d8c4dc80)
+++ 	(revision )
@@ -1,119 +1,0 @@
-/*
- * RTEMS for Nintendo DS platform initialization.
- *
- * Copyright (c) 2008 by Matthieu Bucchianeri <mbucchia@gmail.com>
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- *
- * http://www.rtems.com/license/LICENSE
- *
- * $Id$
- */
-
-#include <bsp.h>
-#include <bsp/bootcard.h>
-#include <nds.h>
-
-/*
- * This definition comes from ARM cpu code.
- */
-extern unsigned int arm_cpu_mode;
-
-/*
- *  These are from the linker script.
- */
-extern uint8_t _end;
-extern uint8_t __ewram_end;
-
-/*
- *  This method returns the base address and size of the area which
- *  is to be allocated between the RTEMS Workspace and the C Program
- *  Heap.
- */
-void bsp_get_work_area(
-  void   **work_area_start,
-  size_t  *work_area_size,
-  void   **heap_start,
-  size_t  *heap_size
-)
-{
-  *work_area_start       = &_end;
-  *work_area_size       = (void *)&__ewram_end - (void *)&_end;
-  *heap_start = BSP_BOOTCARD_HEAP_USES_WORK_AREA;
-  *heap_size = BSP_BOOTCARD_HEAP_SIZE_DEFAULT;
-}
-
-/*
- * start the platform.
- */
-
-void
-bsp_start (void)
-{
-  /* initialize irq management */
-  BSP_rtems_irq_mngt_init ();
-
-  /* setup console mode for lower screen */
-  irqEnable (IRQ_VBLANK);
-  videoSetMode (0);
-  videoSetModeSub (MODE_0_2D | DISPLAY_BG0_ACTIVE);
-  vramSetBankC (VRAM_C_SUB_BG);
-
-  SUB_BG0_CR = BG_MAP_BASE (31);
-  BG_PALETTE_SUB[255] = RGB15 (31, 31, 31);
-  consoleInitDefault ((u16 *) SCREEN_BASE_BLOCK_SUB (31),
-                      (u16 *) CHAR_BASE_BLOCK_SUB (0), 16);
-
-  /* print status message */
-  printk ("[+] kernel console started\n");
-
-  /* set the cpu mode to system user */
-  arm_cpu_mode = 0x1f;
-
-  /* configure clock period */
-  Configuration.microseconds_per_tick = 10000;  /* us */
-}
-
-/*
- * reset bss area.
- */
-
-void
-bss_reset (void)
-{
-  extern uint8_t __bss_start;
-  extern uint8_t __bss_end;
-
-  memset (&__bss_start, 0, (uint32_t) & __bss_end - (uint32_t) & __bss_start);
-}
-
-/*
- * reset the platform using bios call.
- */
-
-void
-bsp_reset (void)
-{
-  swiSoftReset ();
-}
-
-/*
- * clean up platform before reset.
- */
-
-void
-bsp_cleanup (void)
-{
-  printk ("[!] executive ended, rebooting\n");
-
-  bsp_reset ();
-}
-
-/*
- * A few symbols needed by libnds but not used.
- */
-
-#include "../include/sys/iosupport.h"
-const devoptab_t *devoptab_list[STD_MAX];
-void *punixTime;
