Index: c/src/lib/libbsp/mips/rbtx4938/ChangeLog
===================================================================
--- c/src/lib/libbsp/mips/rbtx4938/ChangeLog	(revision e95cf8c9d598677c79ae50dc814bab2fb6fade33)
+++ c/src/lib/libbsp/mips/rbtx4938/ChangeLog	(revision a444be62682524873b44e446a5b6f986c5f3d242)
@@ -1,2 +1,9 @@
+2008-09-14	Joel Sherrill <joel.sherrill@oarcorp.com>
+
+	* Makefile.am, configure.ac, startup/bspstart.c: Create
+	bsp_get_work_area() into its own file and use BSP Framework to
+	perform more initialization.
+	* startup/bspgetworkarea.c: New file.
+
 2008-09-10	Joel Sherrill <joel.sherrill@oarcorp.com>
 
Index: c/src/lib/libbsp/mips/rbtx4938/Makefile.am
===================================================================
--- c/src/lib/libbsp/mips/rbtx4938/Makefile.am	(revision e95cf8c9d598677c79ae50dc814bab2fb6fade33)
+++ c/src/lib/libbsp/mips/rbtx4938/Makefile.am	(revision a444be62682524873b44e446a5b6f986c5f3d242)
@@ -29,4 +29,5 @@
 
 startup_SOURCES = ../../shared/bspclean.c ../../shared/bsppredriverhook.c \
+    ../../shared/bsppretaskinghook.c startup/bspgetworkarea.c \
     ../../shared/bsplibc.c ../../shared/bsppost.c startup/bspstart.c \
     ../../shared/bootcard.c ../../shared/sbrk.c \
Index: c/src/lib/libbsp/mips/rbtx4938/configure.ac
===================================================================
--- c/src/lib/libbsp/mips/rbtx4938/configure.ac	(revision e95cf8c9d598677c79ae50dc814bab2fb6fade33)
+++ c/src/lib/libbsp/mips/rbtx4938/configure.ac	(revision a444be62682524873b44e446a5b6f986c5f3d242)
@@ -17,4 +17,6 @@
 RTEMS_PROG_CCAS
 
+RTEMS_BSP_BOOTCARD_HANDLES_RAM_ALLOCATION
+
 # Explicitly list all Makefiles here
 AC_CONFIG_FILES([Makefile])
Index: c/src/lib/libbsp/mips/rbtx4938/startup/bspgetworkarea.c
===================================================================
--- c/src/lib/libbsp/mips/rbtx4938/startup/bspgetworkarea.c	(revision a444be62682524873b44e446a5b6f986c5f3d242)
+++ c/src/lib/libbsp/mips/rbtx4938/startup/bspgetworkarea.c	(revision a444be62682524873b44e446a5b6f986c5f3d242)
@@ -0,0 +1,38 @@
+/*
+ *  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>
+
+extern void *_RamBase;
+extern void *_RamSize;
+extern void *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
+)
+{
+  uintptr_t size;
+
+  size = (uintptr_t)&_RamBase + (uintptr_t)&_RamSize - (uintptr_t)&end;
+
+  *work_area_start = (void *)&end;
+  *work_area_size  = size;
+  *heap_start      = BSP_BOOTCARD_HEAP_USES_WORK_AREA;
+  *heap_size       = BSP_BOOTCARD_HEAP_SIZE_DEFAULT;
+}
+
Index: c/src/lib/libbsp/mips/rbtx4938/startup/bspstart.c
===================================================================
--- c/src/lib/libbsp/mips/rbtx4938/startup/bspstart.c	(revision e95cf8c9d598677c79ae50dc814bab2fb6fade33)
+++ c/src/lib/libbsp/mips/rbtx4938/startup/bspstart.c	(revision a444be62682524873b44e446a5b6f986c5f3d242)
@@ -19,43 +19,5 @@
 #include <bsp.h>
 #include <rtems/libio.h>
-#include <rtems/libcsupport.h>
 
-#define LIBC_HEAP_SIZE (64 * 1024)
-
-extern int end; /* defined by linker */
-
-/*
- *  Use the shared implementations of the following routines
- */
- 
-void bsp_libc_init( void *, uint32_t, int );
-
-void init_exc_vecs(void);
-
-/*
- *  Function:   bsp_pretasking_hook
- *  Created:    95/03/10
- *
- *  Description:
- *      BSP pretasking hook.  Called just before drivers are initialized.
- *      Used to setup libc and install any BSP extensions.
- *
- *  NOTES:
- *      Must not use libc (to do io) from here, since drivers are
- *      not yet initialized.
- *
- */
- 
-void bsp_pretasking_hook(void)
-{
-    uint32_t heap_start;
-
-    heap_start = (uint32_t) &end;
-    if (heap_start & (CPU_ALIGNMENT-1))
-        heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
-
-    bsp_libc_init((void *) heap_start, LIBC_HEAP_SIZE, 0);
-}
- 
 /*
  *  bsp_start
@@ -66,11 +28,6 @@
 void bsp_start( void )
 {
-  extern int WorkspaceBase;
   extern void mips_install_isr_entries(void);
-
-  Configuration.work_space_start =
-       (void *)((uint64_t)((&end) + LIBC_HEAP_SIZE + 0x100) & ~0x7);
 
   mips_install_isr_entries();  /* Install generic MIPS exception handler */
 }
-
