diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-09-16 19:06:45 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-09-16 19:06:45 +0000 |
commit | e76068d31feda0483fb2a83fcafe366c08dfc76c (patch) | |
tree | 203af67b4834dc0aad94da9a3b2f253fc17c6f53 /c | |
parent | 2008-09-16 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-e76068d31feda0483fb2a83fcafe366c08dfc76c.tar.bz2 |
2008-09-16 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, startup/bspstart.c: Add use of bsp_get_work_area() in
its own file and rely on BSP Framework to perform more
initialization. Remove unnecessary includes of rtems/libio.h and
rtems/libcsupport.h.
* startup/bspgetworkarea.c: New file.
Diffstat (limited to 'c')
-rw-r--r-- | c/src/lib/libbsp/powerpc/gen83xx/ChangeLog | 8 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/gen83xx/Makefile.am | 1 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/gen83xx/startup/bspgetworkarea.c | 47 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/gen83xx/startup/bspstart.c | 25 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/mpc55xxevb/ChangeLog | 8 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/mpc55xxevb/Makefile.am | 2 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/mpc55xxevb/startup/bspgetworkarea.c | 46 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/mpc55xxevb/startup/bspstart.c | 26 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/psim/ChangeLog | 8 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/psim/Makefile.am | 3 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/psim/startup/bspgetworkarea.c | 43 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/psim/startup/bspstart.c | 20 |
12 files changed, 174 insertions, 63 deletions
diff --git a/c/src/lib/libbsp/powerpc/gen83xx/ChangeLog b/c/src/lib/libbsp/powerpc/gen83xx/ChangeLog index 60e2987b24..475b98b9e9 100644 --- a/c/src/lib/libbsp/powerpc/gen83xx/ChangeLog +++ b/c/src/lib/libbsp/powerpc/gen83xx/ChangeLog @@ -1,3 +1,11 @@ +2008-09-16 Joel Sherrill <joel.sherrill@oarcorp.com> + + * Makefile.am, startup/bspstart.c: Add use of bsp_get_work_area() in + its own file and rely on BSP Framework to perform more + initialization. Remove unnecessary includes of rtems/libio.h and + rtems/libcsupport.h. + * startup/bspgetworkarea.c: New file. + 2008-09-10 Joel Sherrill <joel.sherrill@oarcorp.com> * include/bsp.h: Review of all bsp_cleanup() implementations. In this diff --git a/c/src/lib/libbsp/powerpc/gen83xx/Makefile.am b/c/src/lib/libbsp/powerpc/gen83xx/Makefile.am index a43209729f..7f222abd1e 100644 --- a/c/src/lib/libbsp/powerpc/gen83xx/Makefile.am +++ b/c/src/lib/libbsp/powerpc/gen83xx/Makefile.am @@ -54,6 +54,7 @@ startup_SOURCES = ../../shared/bsplibc.c \ startup/cpuinit.c \ startup/bspstart.c \ startup/bspclean.c \ + startup/bspgetworkarea.c \ startup/uboot_support.c \ ../shared/uboot_getenv.c diff --git a/c/src/lib/libbsp/powerpc/gen83xx/startup/bspgetworkarea.c b/c/src/lib/libbsp/powerpc/gen83xx/startup/bspgetworkarea.c new file mode 100644 index 0000000000..3e052ee2ce --- /dev/null +++ b/c/src/lib/libbsp/powerpc/gen83xx/startup/bspgetworkarea.c @@ -0,0 +1,47 @@ +/** + * @file + * + * @ingroup mpc83xx + * + * @brief Source for BSP startup code. + */ + +/* + * Copyright (c) 2008 + * Embedded Brains GmbH + * Obere Lagerstr. 30 + * D-82178 Puchheim + * Germany + * rtems@embedded-brains.de + * + * 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> + +#ifdef HAS_UBOOT + extern bd_t mpc83xx_uboot_board_info; +#endif /* HAS_UBOOT */ + +void bsp_get_work_area( + void **work_area_start, + size_t *work_area_size, + void **heap_start, + size_t *heap_size) +{ + #ifdef HAS_UBOOT + char *ram_end = (char *) mpc83xx_uboot_board_info.bi_memstart + + mpc83xx_uboot_board_info.bi_memsize; + #else /* HAS_UBOOT */ + char *ram_end = bsp_ram_end; + #endif /* HAS_UBOOT */ + + *work_area_start = bsp_work_area_start; + *work_area_size = ram_end - bsp_work_area_start; + *heap_start = BSP_BOOTCARD_HEAP_USES_WORK_AREA; + *heap_size = BSP_BOOTCARD_HEAP_SIZE_DEFAULT; +} diff --git a/c/src/lib/libbsp/powerpc/gen83xx/startup/bspstart.c b/c/src/lib/libbsp/powerpc/gen83xx/startup/bspstart.c index ea5df3e875..46ef22ac75 100644 --- a/c/src/lib/libbsp/powerpc/gen83xx/startup/bspstart.c +++ b/c/src/lib/libbsp/powerpc/gen83xx/startup/bspstart.c @@ -20,12 +20,6 @@ * $Id$ */ -#include <string.h> - -#include <rtems/libio.h> -#include <rtems/libcsupport.h> -#include <rtems/score/thread.h> - #include <libcpu/powerpc-utility.h> #include <libcpu/raw_exception.h> @@ -87,25 +81,6 @@ void _BSP_Fatal_error(unsigned n) } } -void bsp_get_work_area( - void **work_area_start, - size_t *work_area_size, - void **heap_start, - size_t *heap_size) -{ -#ifdef HAS_UBOOT - char *ram_end = (char *) mpc83xx_uboot_board_info.bi_memstart + - mpc83xx_uboot_board_info.bi_memsize; -#else /* HAS_UBOOT */ - char *ram_end = bsp_ram_end; -#endif /* HAS_UBOOT */ - - *work_area_start = bsp_work_area_start; - *work_area_size = ram_end - bsp_work_area_start; - *heap_start = BSP_BOOTCARD_HEAP_USES_WORK_AREA; - *heap_size = BSP_BOOTCARD_HEAP_SIZE_DEFAULT; -} - void bsp_start( void) { rtems_status_code sc = RTEMS_SUCCESSFUL; diff --git a/c/src/lib/libbsp/powerpc/mpc55xxevb/ChangeLog b/c/src/lib/libbsp/powerpc/mpc55xxevb/ChangeLog index 49596fab6e..fd987b03ed 100644 --- a/c/src/lib/libbsp/powerpc/mpc55xxevb/ChangeLog +++ b/c/src/lib/libbsp/powerpc/mpc55xxevb/ChangeLog @@ -1,3 +1,11 @@ +2008-09-16 Joel Sherrill <joel.sherrill@oarcorp.com> + + * Makefile.am, startup/bspstart.c: Add use of bsp_get_work_area() in + its own file and rely on BSP Framework to perform more + initialization. Remove unnecessary includes of rtems/libio.h and + rtems/libcsupport.h. + * startup/bspgetworkarea.c: New file. + 2008-09-10 Joel Sherrill <joel.sherrill@oarcorp.com> * Makefile.am: Review of all bsp_cleanup() implementations. In this diff --git a/c/src/lib/libbsp/powerpc/mpc55xxevb/Makefile.am b/c/src/lib/libbsp/powerpc/mpc55xxevb/Makefile.am index c2592e6f0f..d5ed464900 100644 --- a/c/src/lib/libbsp/powerpc/mpc55xxevb/Makefile.am +++ b/c/src/lib/libbsp/powerpc/mpc55xxevb/Makefile.am @@ -42,7 +42,7 @@ include_bsp_HEADERS = include/mpc55xxevb.h \ startup_SOURCES = ../../shared/bsplibc.c ../../shared/bsppost.c \ ../../shared/bootcard.c ../shared/src/tictac.c ../../shared/bspclean.c \ - startup/bspstart.c ../../shared/bsppretaskinghook.c + startup/bspstart.c startup/bspgetworkarea.c ../../shared/bsppretaskinghook.c clock_SOURCES = ../shared/clock/clock.c diff --git a/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/bspgetworkarea.c b/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/bspgetworkarea.c new file mode 100644 index 0000000000..301d9b82e1 --- /dev/null +++ b/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/bspgetworkarea.c @@ -0,0 +1,46 @@ +/** + * @file + * + * @ingroup mpc55xx + * + * @brief BSP Get Work Area of Memory. + */ + +/* + * Copyright (c) 2008 + * Embedded Brains GmbH + * Obere Lagerstr. 30 + * D-82178 Puchheim + * Germany + * rtems@embedded-brains.de + * + * 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. + */ + +#include <bsp.h> +#include <bsp/bootcard.h> +#include <libcpu/powerpc-utility.h> + +#define MPC55XX_INTERRUPT_STACK_SIZE 0x1000 + +/* Symbols defined in linker command file */ +LINKER_SYMBOL(bsp_ram_start); +LINKER_SYMBOL(bsp_ram_end); +LINKER_SYMBOL(bsp_external_ram_start); +LINKER_SYMBOL(bsp_external_ram_size); +LINKER_SYMBOL(bsp_section_bss_end); + +void bsp_get_work_area( + void **work_area_start, + size_t *work_area_size, + void **heap_start, + size_t *heap_size +) +{ + *work_area_start = bsp_section_bss_end; + *work_area_size = bsp_ram_end - 2 * + MPC55XX_INTERRUPT_STACK_SIZE - bsp_section_bss_end; + *heap_start = bsp_external_ram_start; + *heap_size = (size_t) bsp_external_ram_size; +} diff --git a/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/bspstart.c b/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/bspstart.c index 32c9f9aa69..13d207eae5 100644 --- a/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/bspstart.c +++ b/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/bspstart.c @@ -23,8 +23,6 @@ #include <mpc55xx/edma.h> #include <rtems.h> -#include <rtems/bspIo.h> -#include <rtems/libcsupport.h> #include <libcpu/powerpc-utility.h> @@ -43,11 +41,11 @@ #define MPC55XX_INTERRUPT_STACK_SIZE 0x1000 /* Symbols defined in linker command file */ -LINKER_SYMBOL( bsp_ram_start); -LINKER_SYMBOL( bsp_ram_end); -LINKER_SYMBOL( bsp_external_ram_start); -LINKER_SYMBOL( bsp_external_ram_size); -LINKER_SYMBOL( bsp_section_bss_end); +LINKER_SYMBOL(bsp_ram_start); +LINKER_SYMBOL(bsp_ram_end); +LINKER_SYMBOL(bsp_external_ram_start); +LINKER_SYMBOL(bsp_external_ram_size); +LINKER_SYMBOL(bsp_section_bss_end); unsigned int bsp_clock_speed = 0; @@ -79,14 +77,6 @@ void _BSP_Fatal_error( unsigned n) } } -void bsp_get_work_area( void **work_area_start, size_t *work_area_size, void **heap_start, size_t *heap_size) -{ - *work_area_start = bsp_section_bss_end; - *work_area_size = bsp_ram_end - 2 * MPC55XX_INTERRUPT_STACK_SIZE - bsp_section_bss_end; - *heap_start = bsp_external_ram_start; - *heap_size = (size_t) bsp_external_ram_size; -} - void bsp_predriver_hook() { rtems_status_code sc = RTEMS_SUCCESSFUL; @@ -193,7 +183,11 @@ void bsp_start(void) /* Initialize exceptions */ DEBUG_PRINT( "Initialize exceptions ...\n"); - ppc_exc_initialize( PPC_INTERRUPT_DISABLE_MASK_DEFAULT, interrupt_stack_start, interrupt_stack_size); + ppc_exc_initialize( + PPC_INTERRUPT_DISABLE_MASK_DEFAULT, + interrupt_stack_start, + interrupt_stack_size + ); DEBUG_DONE(); /* Initialize interrupts */ diff --git a/c/src/lib/libbsp/powerpc/psim/ChangeLog b/c/src/lib/libbsp/powerpc/psim/ChangeLog index c70707a083..3e81feb80f 100644 --- a/c/src/lib/libbsp/powerpc/psim/ChangeLog +++ b/c/src/lib/libbsp/powerpc/psim/ChangeLog @@ -1,3 +1,11 @@ +2008-09-16 Joel Sherrill <joel.sherrill@oarcorp.com> + + * Makefile.am, startup/bspstart.c: Add use of bsp_get_work_area() in + its own file and rely on BSP Framework to perform more + initialization. Remove unnecessary includes of rtems/libio.h and + rtems/libcsupport.h. + * startup/bspgetworkarea.c: New file. + 2008-09-10 Joel Sherrill <joel.sherrill@oarcorp.com> * include/bsp.h: Review of all bsp_cleanup() implementations. In this diff --git a/c/src/lib/libbsp/powerpc/psim/Makefile.am b/c/src/lib/libbsp/powerpc/psim/Makefile.am index 34566b3bdb..dd17a9ef4a 100644 --- a/c/src/lib/libbsp/powerpc/psim/Makefile.am +++ b/c/src/lib/libbsp/powerpc/psim/Makefile.am @@ -42,7 +42,8 @@ noinst_LIBRARIES = libbsp.a startup_SOURCES = startup/bspclean.c ../../shared/bsplibc.c \ ../../shared/bsppost.c ../../shared/bsppretaskinghook.c \ - ../../shared/bsppredriverhook.c startup/bspstart.c ../../shared/bootcard.c \ + ../../shared/bsppredriverhook.c startup/bspstart.c \ + startup/bspgetworkarea.c ../../shared/bootcard.c \ ../../shared/sbrk.c ../../shared/gnatinstallhandler.c \ startup/psim_registers.c diff --git a/c/src/lib/libbsp/powerpc/psim/startup/bspgetworkarea.c b/c/src/lib/libbsp/powerpc/psim/startup/bspgetworkarea.c new file mode 100644 index 0000000000..76bd79918d --- /dev/null +++ b/c/src/lib/libbsp/powerpc/psim/startup/bspgetworkarea.c @@ -0,0 +1,43 @@ +/* + * This set of routines starts the application. It includes application, + * board, and monitor specific initialization and configuration. + * The generic CPU dependent initialization has been performed + * before any of these are invoked. + * + * 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 <string.h> +#include <fcntl.h> +#include <bsp.h> +#include <bsp/bootcard.h> + +/* + * system init stack + */ +#define INIT_STACK_SIZE 0x1000 + +/* + * 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 = &end; + *work_area_size = (void *)&RAM_END - (void *)&end; + *heap_start = BSP_BOOTCARD_HEAP_USES_WORK_AREA; + *heap_size = BSP_BOOTCARD_HEAP_SIZE_DEFAULT; +} diff --git a/c/src/lib/libbsp/powerpc/psim/startup/bspstart.c b/c/src/lib/libbsp/powerpc/psim/startup/bspstart.c index a7c677d5ce..592a6e7703 100644 --- a/c/src/lib/libbsp/powerpc/psim/startup/bspstart.c +++ b/c/src/lib/libbsp/powerpc/psim/startup/bspstart.c @@ -19,8 +19,6 @@ #include <bsp.h> #include <bsp/irq.h> #include <bsp/bootcard.h> -#include <rtems/libio.h> -#include <rtems/libcsupport.h> #include <rtems/bspIo.h> #include <rtems/powerpc/powerpc.h> @@ -67,24 +65,6 @@ void _BSP_Fatal_error(unsigned int v) } /* - * 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 = &end; - *work_area_size = (void *)&RAM_END - (void *)&end; - *heap_start = BSP_BOOTCARD_HEAP_USES_WORK_AREA; - *heap_size = BSP_BOOTCARD_HEAP_SIZE_DEFAULT; -} - -/* * bsp_start * * This routine does the bulk of the system initialization. |