From 6a39cd4fec7dadd27f53b7943f77881da4bb884c Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Sun, 14 Sep 2008 21:38:25 +0000 Subject: [PATCH] 2008-09-14 Joel Sherrill * Makefile.am, startup/bspstart.c: Split out bsp_get_work_area() into its own file and use BSP Framework to perform more initialization. * startup/bspgetworkarea.c: New file. --- c/src/lib/libbsp/mips/jmr3904/ChangeLog | 6 ++++ c/src/lib/libbsp/mips/jmr3904/Makefile.am | 2 +- .../mips/jmr3904/startup/bspgetworkarea.c | 34 +++++++++++++++++++ .../libbsp/mips/jmr3904/startup/bspstart.c | 24 ++----------- 4 files changed, 43 insertions(+), 23 deletions(-) create mode 100644 c/src/lib/libbsp/mips/jmr3904/startup/bspgetworkarea.c diff --git a/c/src/lib/libbsp/mips/jmr3904/ChangeLog b/c/src/lib/libbsp/mips/jmr3904/ChangeLog index f7cd224502..0d2034bcca 100644 --- a/c/src/lib/libbsp/mips/jmr3904/ChangeLog +++ b/c/src/lib/libbsp/mips/jmr3904/ChangeLog @@ -1,3 +1,9 @@ +2008-09-14 Joel Sherrill + + * Makefile.am, startup/bspstart.c: Split out 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 * include/bsp.h: Review of all bsp_cleanup() implementations. In this diff --git a/c/src/lib/libbsp/mips/jmr3904/Makefile.am b/c/src/lib/libbsp/mips/jmr3904/Makefile.am index f6373be42e..99ff82ed5d 100644 --- a/c/src/lib/libbsp/mips/jmr3904/Makefile.am +++ b/c/src/lib/libbsp/mips/jmr3904/Makefile.am @@ -31,7 +31,7 @@ dist_project_lib_DATA += startup/linkcmds startup_SOURCES = startup/bspclean.c ../../shared/bsplibc.c \ ../../shared/bsppredriverhook.c ../../shared/bsppost.c \ - ../../shared/bsppretaskinghook.c \ + ../../shared/bsppretaskinghook.c startup/bspgetworkarea.c \ startup/bspstart.c ../../shared/bootcard.c ../../shared/sbrk.c \ ../../shared/gnatinstallhandler.c ../../shared/setvec.c clock_SOURCES = clock/clockdrv.c diff --git a/c/src/lib/libbsp/mips/jmr3904/startup/bspgetworkarea.c b/c/src/lib/libbsp/mips/jmr3904/startup/bspgetworkarea.c new file mode 100644 index 0000000000..f491b8f3ba --- /dev/null +++ b/c/src/lib/libbsp/mips/jmr3904/startup/bspgetworkarea.c @@ -0,0 +1,34 @@ +/* + * 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 + +extern int WorkspaceBase; +extern int 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 +) +{ + *work_area_start = &WorkspaceBase; + *work_area_size = (void *)&end - (void *)&WorkspaceBase; + *heap_start = BSP_BOOTCARD_HEAP_USES_WORK_AREA; + *heap_size = BSP_BOOTCARD_HEAP_SIZE_DEFAULT; +} diff --git a/c/src/lib/libbsp/mips/jmr3904/startup/bspstart.c b/c/src/lib/libbsp/mips/jmr3904/startup/bspstart.c index 0c1be686cb..612cdbad60 100644 --- a/c/src/lib/libbsp/mips/jmr3904/startup/bspstart.c +++ b/c/src/lib/libbsp/mips/jmr3904/startup/bspstart.c @@ -17,27 +17,6 @@ #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 -) -{ - extern int WorkspaceBase; - extern int end; - - *work_area_start = &WorkspaceBase; - *work_area_size = (void *)&end - (void *)&WorkspaceBase; - *heap_start = BSP_BOOTCARD_HEAP_USES_WORK_AREA; - *heap_size = BSP_BOOTCARD_HEAP_SIZE_DEFAULT; -} - /* * bsp_start * @@ -61,7 +40,8 @@ void clear_cache( void *address, size_t n ) } /* Structure filled in by get_mem_info. Only the size field is - actually used (to clear bss), so the others aren't even filled in. */ + * actually used (to clear bss), so the others aren't even filled in. + */ struct s_mem {