diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-05-15 15:54:55 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-05-15 15:54:55 +0000 |
commit | 2211b75c44ce7df4a576a060fe2d012df71d7cc8 (patch) | |
tree | 12f956589fb66fc24bd5fdc8ffc5f2b4e295331b /c/src/lib/libbsp/mips/jmr3904/startup/bspstart.c | |
parent | 2008-05-15 Joel Sherrill <joel.sherrill@OARcorp.com> (diff) | |
download | rtems-2211b75c44ce7df4a576a060fe2d012df71d7cc8.tar.bz2 |
2008-05-15 Joel Sherrill <joel.sherrill@OARcorp.com>
* configure.ac, startup/bspstart.c: Add capability for bootcard.c BSP
Initialization Framework to ask the BSP where it has memory for the
RTEMS Workspace and C Program Heap. These collectively are referred
to as work area. If the BSP supports this, then it does not have to
include code to split the available memory between the two areas.
This reduces the amount of code in the BSP specific bspstart.c file.
Additionally, the shared framework can initialize the C Library, call
rtems_debug_enable(), and dirty the work area memory. Until most/all
BSPs support this new capability, if the BSP supports this, it should
call RTEMS_BSP_BOOTCARD_HANDLES_RAM_ALLOCATION from its configure.ac.
When the transition is complete, this autoconf macro can be removed.
Diffstat (limited to '')
-rw-r--r-- | c/src/lib/libbsp/mips/jmr3904/startup/bspstart.c | 60 |
1 files changed, 17 insertions, 43 deletions
diff --git a/c/src/lib/libbsp/mips/jmr3904/startup/bspstart.c b/c/src/lib/libbsp/mips/jmr3904/startup/bspstart.c index e0c87c420e..e654182785 100644 --- a/c/src/lib/libbsp/mips/jmr3904/startup/bspstart.c +++ b/c/src/lib/libbsp/mips/jmr3904/startup/bspstart.c @@ -4,7 +4,7 @@ * The generic CPU dependent initialization has been performed * before this routine is invoked. * - * COPYRIGHT (c) 1989-2000. + * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -14,45 +14,25 @@ * $Id$ */ -#include <string.h> - #include <bsp.h> -#include <rtems/libio.h> -#include <rtems/libcsupport.h> /* - * Use the shared implementations of the following routines + * 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_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) +void bsp_get_workarea( + void **workarea_base, + size_t *workarea_size, + size_t *requested_heap_size +) { - extern int HeapBase; - extern int HeapSize; - void *heapStart = &HeapBase; - unsigned long heapSize = (unsigned long)&HeapSize; - - bsp_libc_init(heapStart, (uint32_t) heapSize, 0); - -#ifdef RTEMS_DEBUG - rtems_debug_enable( RTEMS_DEBUG_ALL_MASK ); -#endif + extern int WorkspaceBase; + extern int end; + *workarea_base = &WorkspaceBase; + *workarea_size = (void *)&end - (void *)&WorkspaceBase; + *requested_heap_size = 0; } /* @@ -63,22 +43,16 @@ void bsp_pretasking_hook(void) void bsp_start( void ) { - extern int WorkspaceBase; - extern void _sys_exit(int); extern void mips_install_isr_entries(void); - /* HACK -- tied to value linkcmds */ - if ( rtems_configuration_get_work_space_size() >(4096*1024) ) - _sys_exit( 1 ); - - Configuration.work_space_start = (void *) &WorkspaceBase; - mips_set_sr( 0xff00 ); /* all interrupts unmasked but globally off */ /* depend on the IRC to take care of things */ mips_install_isr_entries(); } -/* XXX */ +/* + * Required routine by some gcc run-times. + */ void clear_cache( void *address, size_t n ) { } |