diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 1998-04-15 15:13:01 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 1998-04-15 15:13:01 +0000 |
commit | b6394ae43432a3c69f1737d1ed1e23db8e7896ba (patch) | |
tree | a7f1ad9907ad430f3a3037ef606ba1bfc5ceb386 /c/src/lib/libbsp/hppa1.1/simhppa/startup | |
parent | Stack checker now enabled via initial set of user extensions. This (diff) | |
download | rtems-b6394ae43432a3c69f1737d1ed1e23db8e7896ba.tar.bz2 |
Transitioned to shared bsp_libc_init() and cleaned up comments.
Diffstat (limited to 'c/src/lib/libbsp/hppa1.1/simhppa/startup')
-rw-r--r-- | c/src/lib/libbsp/hppa1.1/simhppa/startup/Makefile.in | 2 | ||||
-rw-r--r-- | c/src/lib/libbsp/hppa1.1/simhppa/startup/bspstart.c | 135 |
2 files changed, 21 insertions, 116 deletions
diff --git a/c/src/lib/libbsp/hppa1.1/simhppa/startup/Makefile.in b/c/src/lib/libbsp/hppa1.1/simhppa/startup/Makefile.in index 05f8abd940..240cf38e4b 100644 --- a/c/src/lib/libbsp/hppa1.1/simhppa/startup/Makefile.in +++ b/c/src/lib/libbsp/hppa1.1/simhppa/startup/Makefile.in @@ -11,7 +11,7 @@ PROJECT_ROOT = @PROJECT_ROOT@ PGM=${ARCH}/startup.rel # C source names, if any, go here -- minus the .c -C_PIECES=bspclean bsppost bspstart main sbrk setvec +C_PIECES=bspclean bsplibc bsppost bspstart main sbrk setvec C_FILES=$(C_PIECES:%=%.c) C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) diff --git a/c/src/lib/libbsp/hppa1.1/simhppa/startup/bspstart.c b/c/src/lib/libbsp/hppa1.1/simhppa/startup/bspstart.c index 8676be3ba6..a84f967504 100644 --- a/c/src/lib/libbsp/hppa1.1/simhppa/startup/bspstart.c +++ b/c/src/lib/libbsp/hppa1.1/simhppa/startup/bspstart.c @@ -1,16 +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. * - * Called by RTEMS::RTEMS constructor in startup-ctor.cc - * - * INPUT: NONE - * - * OUTPUT: NONE - * * COPYRIGHT (c) 1989-1998. * On-Line Applications Research Corporation (OAR). * Copyright assigned to U.S. Government, 1994. @@ -56,9 +49,10 @@ rtems_unsigned32 CPU_HPPA_CLICKS_PER_TICK; * Try to speed those tests up by speeding up the clock when in idle */ -rtems_extension -fast_idle_switch_hook(rtems_tcb *current_task, - rtems_tcb *heir_task) +rtems_extension fast_idle_switch_hook( + rtems_tcb *current_task, + rtems_tcb *heir_task +) { static rtems_unsigned32 normal_clock = ~0; static rtems_unsigned32 fast_clock; @@ -86,32 +80,26 @@ fast_idle_switch_hook(rtems_tcb *current_task, #endif /* - * Function: bsp_libc_init - * Created: 94/12/6 + * Use the shared implementations of the following routines + */ + +void bsp_postdriver_hook(void); +void bsp_libc_init( void *, unsigned32, int ); + +/* + * Function: bsp_pretasking_hook + * Created: 95/03/10 * * Description: - * Initialize whatever libc we are using - * called from bsp_postdriver_hook - * - * - * Parameters: - * none - * - * Returns: - * none. - * - * Side Effects: - * + * BSP pretasking hook. Called just before drivers are initialized. + * Used to setup libc and install any BSP extensions. * * Notes: - * - * Deficiencies/ToDo: - * - * + * Must not use libc (to do io) from here, since drivers are + * not yet initialized. */ -void -bsp_libc_init(void) +void bsp_pretasking_hook(void) { extern int end; rtems_unsigned32 heap_start; @@ -120,25 +108,7 @@ bsp_libc_init(void) if (heap_start & (CPU_ALIGNMENT-1)) heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1); - RTEMS_Malloc_Initialize((void *) heap_start, 64 * 1024, 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. - * XXX; this should allow for case of some other non-clock interrupts - */ - - if (BSP_Configuration.ticks_per_timeslice > 0) - libc_init(1); /* reentrant if possible */ - else - libc_init(0); /* non-reentrant */ + bsp_libc_init((void *) heap_start, 64 * 1024, 0); /* * on MP systems, always use the print buffer @@ -151,39 +121,6 @@ bsp_libc_init(void) #ifdef SIMHPPA_ROM use_print_buffer = 1; #endif -} - - -/* - * 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. - * - * Parameters: - * none - * - * Returns: - * nada - * - * Side Effects: - * installs a few extensions - * - * Notes: - * Must not use libc (to do io) from here, since drivers are - * not yet initialized. - * - * Deficiencies/ToDo: - * - * - */ - -void -bsp_pretasking_hook(void) -{ - bsp_libc_init(); #if SIMHPPA_FAST_IDLE /* @@ -213,38 +150,6 @@ bsp_pretasking_hook(void) #endif } -/* - * Use the shared bsp_postdriver_hook() implementation - */ - -void bsp_postdriver_hook(void); - -/* - * Function: bsp_start - * Created: 94/12/6 - * - * Description: - * called by crt0 as our "main" equivalent - * - * - * - * Parameters: - * - * - * Returns: - * - * - * Side Effects: - * - * - * Notes: - * - * - * Deficiencies/ToDo: - * - * - */ - void bsp_start(void) { /* |