summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/no_cpu/no_bsp/startup
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2008-09-14 22:03:54 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2008-09-14 22:03:54 +0000
commiteb3923bce56d845e02c69f8541a7686ac6c8900f (patch)
tree07cfe95077184b7b053375361c243e9bdb0e6b7b /c/src/lib/libbsp/no_cpu/no_bsp/startup
parent2008-09-14 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-eb3923bce56d845e02c69f8541a7686ac6c8900f.tar.bz2
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. * startup/main.c: Removed.
Diffstat (limited to 'c/src/lib/libbsp/no_cpu/no_bsp/startup')
-rw-r--r--c/src/lib/libbsp/no_cpu/no_bsp/startup/bspgetworkarea.c43
-rw-r--r--c/src/lib/libbsp/no_cpu/no_bsp/startup/bspstart.c49
-rw-r--r--c/src/lib/libbsp/no_cpu/no_bsp/startup/main.c37
3 files changed, 43 insertions, 86 deletions
diff --git a/c/src/lib/libbsp/no_cpu/no_bsp/startup/bspgetworkarea.c b/c/src/lib/libbsp/no_cpu/no_bsp/startup/bspgetworkarea.c
new file mode 100644
index 0000000000..d90a6da9ad
--- /dev/null
+++ b/c/src/lib/libbsp/no_cpu/no_bsp/startup/bspgetworkarea.c
@@ -0,0 +1,43 @@
+/*
+ * 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 some symbols from the linkcmds to use in the math.
+ */
+#if 0
+extern void *_RamBase;
+extern void *_RamSize;
+extern void *end;
+#endif
+
+/*
+ * 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)0;
+
+ *work_area_start = (void *)NULL;
+ *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/no_cpu/no_bsp/startup/bspstart.c b/c/src/lib/libbsp/no_cpu/no_bsp/startup/bspstart.c
index 8ea03ff62b..76b4369311 100644
--- a/c/src/lib/libbsp/no_cpu/no_bsp/startup/bspstart.c
+++ b/c/src/lib/libbsp/no_cpu/no_bsp/startup/bspstart.c
@@ -17,40 +17,6 @@
#include <string.h>
#include <bsp.h>
-#include <rtems/libio.h>
-#include <rtems/libcsupport.h>
-
-/*
- * Use the shared implementations of the following routines
- */
-
-void bsp_libc_init( void *, uint32_t, int );
-
-/*
- * 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)
-{
- 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, 64 * 1024, 0);
-}
/*
* bsp_start
@@ -60,19 +26,4 @@ void bsp_pretasking_hook(void)
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 *) 0;
}
diff --git a/c/src/lib/libbsp/no_cpu/no_bsp/startup/main.c b/c/src/lib/libbsp/no_cpu/no_bsp/startup/main.c
deleted file mode 100644
index ef8d420f3c..0000000000
--- a/c/src/lib/libbsp/no_cpu/no_bsp/startup/main.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* main()
- *
- * This is the entry point for the application. It calls
- * the bsp_start routine to the actual dirty work.
- *
- * 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 <rtems.h>
-#include <bsp.h>
-
-int main(
- int argc,
- char **argv,
- char **environp
-)
-{
- extern void bsp_start( int, char**, char ** );
-
- bsp_start( argc, argv, environp );
-
- /*
- * May be able to return to the "crt/start.s" code but also
- * may not be able to. Do something here which is board dependent.
- */
-
- rtems_fatal_error_occurred( 0 );
-
- return 0; /* just to satisfy the native compiler */
-}