From b6394ae43432a3c69f1737d1ed1e23db8e7896ba Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 15 Apr 1998 15:13:01 +0000 Subject: Transitioned to shared bsp_libc_init() and cleaned up comments. --- c/src/lib/libbsp/sh/gensh1/startup/bspstart.c | 56 ++++++--------------------- 1 file changed, 11 insertions(+), 45 deletions(-) (limited to 'c/src/lib/libbsp/sh/gensh1/startup/bspstart.c') diff --git a/c/src/lib/libbsp/sh/gensh1/startup/bspstart.c b/c/src/lib/libbsp/sh/gensh1/startup/bspstart.c index 72c2ec8bf0..dc25759d47 100644 --- a/c/src/lib/libbsp/sh/gensh1/startup/bspstart.c +++ b/c/src/lib/libbsp/sh/gensh1/startup/bspstart.c @@ -1,14 +1,9 @@ -/* bsp_start() - * +/* * This routine starts the application. It includes application, * board, and monitor specific initialization and configuration. * The generic CPU dependent initialization has been performed * before this routine is invoked. * - * INPUT: NONE - * - * OUTPUT: NONE - * * Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and * Bernd Becker (becker@faw.uni-ulm.de) * @@ -50,39 +45,12 @@ rtems_cpu_table Cpu_table; char *rtems_progname; -/* Initialize whatever libc we are using - * called from postdriver hook +/* + * Use the shared implementations of the following routines */ - - -void bsp_libc_init() -{ - /* - * The last parameter to RTEMS_Malloc_Initialize is the "chunk" - * size which a multiple of will be requested on each sbrk() - * call by malloc(). A value of 0 indicates that sbrk() should - * not be called to extend the heap. - */ - - RTEMS_Malloc_Initialize(&HeapStart, sizeof(unsigned32) * (&HeapEnd - &HeapStart), 0); - - /* - * Init the RTEMS libio facility to provide UNIX-like system - * calls for use by newlib (ie: provide __rtems_open, __rtems_close, etc) - * Uses malloc() to get area for the iops, so must be after malloc init - */ - - rtems_libio_init(); - - /* - * Set up for the libc handling. - */ - - if (BSP_Configuration.ticks_per_timeslice > 0) - libc_init(1); /* reentrant if possible */ - else - libc_init(0); /* non-reentrant */ -} + +void bsp_postdriver_hook(void); +void bsp_libc_init( void *, unsigned32, int ); /* * Function: bsp_pretasking_hook @@ -97,10 +65,9 @@ void bsp_libc_init() * */ -void -bsp_pretasking_hook(void) +void bsp_pretasking_hook(void) { - bsp_libc_init(); + bsp_libc_init((&HeapStart, sizeof(unsigned32) * (&HeapEnd - &HeapStart), 0); #ifdef RTEMS_DEBUG rtems_debug_enable( RTEMS_DEBUG_ALL_MASK ); @@ -108,11 +75,10 @@ bsp_pretasking_hook(void) } /* - * Use the shared bsp_postdriver_hook() implementation + * bsp_start + * + * This routine does the bulk of the system initialization. */ - -void bsp_postdriver_hook(void); - void bsp_start(void) { -- cgit v1.2.3