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/unix/posix/startup/Makefile.in | 2 +- c/src/lib/libbsp/unix/posix/startup/bspstart.c | 117 +++++------------------- 2 files changed, 22 insertions(+), 97 deletions(-) (limited to 'c/src/lib/libbsp/unix') diff --git a/c/src/lib/libbsp/unix/posix/startup/Makefile.in b/c/src/lib/libbsp/unix/posix/startup/Makefile.in index a6117e64d4..a64f68a673 100644 --- a/c/src/lib/libbsp/unix/posix/startup/Makefile.in +++ b/c/src/lib/libbsp/unix/posix/startup/Makefile.in @@ -12,7 +12,7 @@ PGM=${ARCH}/startup.rel NO_CTOR_LIB=${ARCH}/libno-ctor.a # C source names, if any, go here -- minus the .c -C_PIECES=bspclean bspstart setvec +C_PIECES=bspclean bsplibc bspstart setvec C_FILES=$(C_PIECES:%=%.c) C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) diff --git a/c/src/lib/libbsp/unix/posix/startup/bspstart.c b/c/src/lib/libbsp/unix/posix/startup/bspstart.c index 11b9b67e19..4e0955e32a 100644 --- a/c/src/lib/libbsp/unix/posix/startup/bspstart.c +++ b/c/src/lib/libbsp/unix/posix/startup/bspstart.c @@ -1,5 +1,4 @@ -/* 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 @@ -7,10 +6,6 @@ * * 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. @@ -68,55 +63,11 @@ char **rtems_argv; rtems_unsigned32 CPU_CLICKS_PER_TICK; /* - * Function: bsp_libc_init - * Created: 94/12/6 - * - * Description: - * Initialize whatever libc we are using - * called from bsp_postdriver_hook - * - * - * Parameters: - * none - * - * Returns: - * none. - * - * Side Effects: - * - * - * Notes: - * - * Deficiencies/ToDo: - * - * + * Use the shared implementations of the following routines */ - -void -bsp_libc_init(void) -{ - void *heap_start; - - if (getenv("RTEMS_HEAPSPACE_SIZE")) - Heap_size = strtol(getenv("RTEMS_HEAPSPACE_SIZE"), 0, 0); - else - Heap_size = DEFAULT_HEAPSPACE_SIZE; - heap_start = 0; - - RTEMS_Malloc_Initialize((void *)heap_start, Heap_size, 1024 * 1024); - - /* - * 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(); - - libc_init(1); -} - +void bsp_postdriver_hook(void); +void bsp_libc_init( void *, unsigned32, int ); /* * Function: bsp_pretasking_hook @@ -126,28 +77,24 @@ bsp_libc_init(void) * 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: + * NOTES: * Must not use libc (to do io) from here, since drivers are * not yet initialized. - * - * Deficiencies/ToDo: - * - * */ -void -bsp_pretasking_hook(void) +void bsp_pretasking_hook(void) { - bsp_libc_init(); + void *heap_start; + + if (getenv("RTEMS_HEAPSPACE_SIZE")) + Heap_size = strtol(getenv("RTEMS_HEAPSPACE_SIZE"), 0, 0); + else + Heap_size = DEFAULT_HEAPSPACE_SIZE; + + heap_start = 0; + + bsp_libc_init((void *)heap_start, Heap_size, 1024 * 1024); + #ifdef RTEMS_DEBUG rtems_debug_enable( RTEMS_DEBUG_ALL_MASK ); @@ -165,40 +112,18 @@ bsp_pretasking_hook(void) * DO NOT Use the shared bsp_postdriver_hook() implementation */ -void -bsp_postdriver_hook(void) +void bsp_postdriver_hook(void) { return; } /* - * Function: bsp_start - * Created: 94/12/6 - * - * Description: - * called by crt0 as our "main" equivalent - * - * - * - * Parameters: - * - * - * Returns: - * - * - * Side Effects: - * - * - * Notes: - * - * - * Deficiencies/ToDo: - * + * bsp_start * + * This routine does the bulk of the system initialization. */ -void -bsp_start(void) +void bsp_start(void) { unsigned32 workspace_ptr; -- cgit v1.2.3