From c51efdcd623f58669aa07dd674f3601cfa1f7eee Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 15 Sep 2008 17:54:11 +0000 Subject: [PATCH] 2008-09-15 Joel Sherrill * shared/bspstart.c: Use shared bsp_get_work_area() in its own file and rely on BSP Framework to perform more initialization. * shared/bspgetworkarea.c: New file. --- c/src/lib/libbsp/sparc/ChangeLog | 6 +++ .../lib/libbsp/sparc/shared/bspgetworkarea.c | 39 +++++++++++++++++++ c/src/lib/libbsp/sparc/shared/bspstart.c | 23 ----------- 3 files changed, 45 insertions(+), 23 deletions(-) create mode 100644 c/src/lib/libbsp/sparc/shared/bspgetworkarea.c diff --git a/c/src/lib/libbsp/sparc/ChangeLog b/c/src/lib/libbsp/sparc/ChangeLog index ed894d2d9a..209308f47b 100644 --- a/c/src/lib/libbsp/sparc/ChangeLog +++ b/c/src/lib/libbsp/sparc/ChangeLog @@ -1,3 +1,9 @@ +2008-09-15 Joel Sherrill + + * shared/bspstart.c: Use shared bsp_get_work_area() in its own file and + rely on BSP Framework to perform more initialization. + * shared/bspgetworkarea.c: New file. + 2008-08-18 Ralf Corsépius * shared/bspstart.c: Remove bogus local declaration. diff --git a/c/src/lib/libbsp/sparc/shared/bspgetworkarea.c b/c/src/lib/libbsp/sparc/shared/bspgetworkarea.c new file mode 100644 index 0000000000..ec4f30f403 --- /dev/null +++ b/c/src/lib/libbsp/sparc/shared/bspgetworkarea.c @@ -0,0 +1,39 @@ +/* + * This set of routines are the BSP specific initialization + * support routines. + * + * COPYRIGHT (c) 1989-2008. + * 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 +#include + +/* + * 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 +) +{ + /* Tells us where to put the workspace in case remote debugger is present. */ + extern uint32_t rdb_start; + /* must be identical to STACK_SIZE in start.S */ + #define STACK_SIZE (16 * 1024) + + *work_area_start = &end; + *work_area_size = (void *)rdb_start - (void *)&end - STACK_SIZE; + *heap_start = BSP_BOOTCARD_HEAP_USES_WORK_AREA; + *heap_size = BSP_BOOTCARD_HEAP_SIZE_DEFAULT; +} diff --git a/c/src/lib/libbsp/sparc/shared/bspstart.c b/c/src/lib/libbsp/sparc/shared/bspstart.c index 9c27be19ef..753cfaad6a 100644 --- a/c/src/lib/libbsp/sparc/shared/bspstart.c +++ b/c/src/lib/libbsp/sparc/shared/bspstart.c @@ -59,29 +59,6 @@ void bsp_pretasking_hook(void) bsp_spurious_initialize(); } -/* - * 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 -) -{ - /* Tells us where to put the workspace in case remote debugger is present. */ - extern uint32_t rdb_start; - /* must be identical to STACK_SIZE in start.S */ - #define STACK_SIZE (16 * 1024) - - *work_area_start = &end; - *work_area_size = (void *)rdb_start - (void *)&end - STACK_SIZE; - *heap_start = BSP_BOOTCARD_HEAP_USES_WORK_AREA; - *heap_size = BSP_BOOTCARD_HEAP_SIZE_DEFAULT; -} - /* * bsp_start *