summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/mips
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2008-09-14 21:34:26 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2008-09-14 21:34:26 +0000
commit63c08c06df6305c61491faff2d1a02768d67241a (patch)
treef884c0395e9d9ebfebb4bb81e75f537b0fe3bc44 /c/src/lib/libbsp/mips
parent2008-09-14 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-63c08c06df6305c61491faff2d1a02768d67241a.tar.bz2
2008-09-14 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, configure.ac, startup/bspstart.c: Split out bsp_get_work_area() into its own file and user BSP Framework to perform more initialization. * startup/bspgetworkarea.c: New file.
Diffstat (limited to 'c/src/lib/libbsp/mips')
-rw-r--r--c/src/lib/libbsp/mips/hurricane/ChangeLog7
-rw-r--r--c/src/lib/libbsp/mips/hurricane/Makefile.am1
-rw-r--r--c/src/lib/libbsp/mips/hurricane/configure.ac2
-rw-r--r--c/src/lib/libbsp/mips/hurricane/startup/bspgetworkarea.c38
-rw-r--r--c/src/lib/libbsp/mips/hurricane/startup/bspstart.c55
5 files changed, 48 insertions, 55 deletions
diff --git a/c/src/lib/libbsp/mips/hurricane/ChangeLog b/c/src/lib/libbsp/mips/hurricane/ChangeLog
index 29717efb21..66143e526a 100644
--- a/c/src/lib/libbsp/mips/hurricane/ChangeLog
+++ b/c/src/lib/libbsp/mips/hurricane/ChangeLog
@@ -1,3 +1,10 @@
+2008-09-14 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * Makefile.am, configure.ac, startup/bspstart.c: Split out
+ bsp_get_work_area() into its own file and user BSP Framework to
+ perform more initialization.
+ * startup/bspgetworkarea.c: New file.
+
2008-09-05 Joel Sherrill <joel.sherrill@OARcorp.com>
* clock/ckinit.c: The Shared Memory Driver no longer requires the
diff --git a/c/src/lib/libbsp/mips/hurricane/Makefile.am b/c/src/lib/libbsp/mips/hurricane/Makefile.am
index 3c2d4c4fca..283dea484a 100644
--- a/c/src/lib/libbsp/mips/hurricane/Makefile.am
+++ b/c/src/lib/libbsp/mips/hurricane/Makefile.am
@@ -30,6 +30,7 @@ dist_project_lib_DATA += startup/linkcmds
startup_SOURCES = ../../shared/bspclean.c \
../../shared/bsplibc.c ../../shared/bsppost.c \
+ ../../shared/bsppretaskinghook.c startup/bspgetworkarea.c \
../../shared/bsppredriverhook.c startup/bspstart.c \
../../shared/bootcard.c ../../shared/sbrk.c \
../../shared/gnatinstallhandler.c ../../shared/setvec.c \
diff --git a/c/src/lib/libbsp/mips/hurricane/configure.ac b/c/src/lib/libbsp/mips/hurricane/configure.ac
index 5051c565f6..57cb605e5b 100644
--- a/c/src/lib/libbsp/mips/hurricane/configure.ac
+++ b/c/src/lib/libbsp/mips/hurricane/configure.ac
@@ -16,6 +16,8 @@ RTEMS_PROG_CC_FOR_TARGET([-ansi -fasm])
RTEMS_CANONICALIZE_TOOLS
RTEMS_PROG_CCAS
+RTEMS_BSP_BOOTCARD_HANDLES_RAM_ALLOCATION
+
# Explicitly list all Makefiles here
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
diff --git a/c/src/lib/libbsp/mips/hurricane/startup/bspgetworkarea.c b/c/src/lib/libbsp/mips/hurricane/startup/bspgetworkarea.c
new file mode 100644
index 0000000000..6ce807ccf1
--- /dev/null
+++ b/c/src/lib/libbsp/mips/hurricane/startup/bspgetworkarea.c
@@ -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;
+}
+
diff --git a/c/src/lib/libbsp/mips/hurricane/startup/bspstart.c b/c/src/lib/libbsp/mips/hurricane/startup/bspstart.c
index ac61c2c0f8..5d7cd13d92 100644
--- a/c/src/lib/libbsp/mips/hurricane/startup/bspstart.c
+++ b/c/src/lib/libbsp/mips/hurricane/startup/bspstart.c
@@ -23,67 +23,12 @@
uint32_t bsp_clicks_per_microsecond;
/*
- * 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.
- *
- */
-
-#define LIBC_HEAP_SIZE (64 * 1024)
-
-void bsp_pretasking_hook(void)
-{
- extern int end;
- 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);
-}
-
-extern int end; /* defined by linker */
-
-/*
* bsp_start
*
* This routine does the bulk of the system initialization.
*/
-
void bsp_start( void )
{
- /*
- * Allocate the memory for the RTEMS Work Space. This can come from
- * a variety of places: hard coded address, malloc'ed from outside
- * RTEMS world (e.g. simulator or primitive memory manager), or (as
- * typically done by stock BSPs) by subtracting the required amount
- * of work space from the last physical address on the CPU board.
- */
-
- /*
- * Need to "allocate" the memory for the RTEMS Workspace and
- * tell the RTEMS configuration where it is. This memory is
- * not malloc'ed. It is just "pulled from the air".
- */
-
- Configuration.work_space_start =
- (void *)((uint64_t)((&end) + LIBC_HEAP_SIZE + 0x2000) & ~0x7);
bsp_clicks_per_microsecond = CPU_CLOCK_RATE_MHZ;