summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/i386/pc386/startup
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1998-04-15 15:13:01 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1998-04-15 15:13:01 +0000
commitb6394ae43432a3c69f1737d1ed1e23db8e7896ba (patch)
treea7f1ad9907ad430f3a3037ef606ba1bfc5ceb386 /c/src/lib/libbsp/i386/pc386/startup
parentStack checker now enabled via initial set of user extensions. This (diff)
downloadrtems-b6394ae43432a3c69f1737d1ed1e23db8e7896ba.tar.bz2
Transitioned to shared bsp_libc_init() and cleaned up comments.
Diffstat (limited to '')
-rw-r--r--c/src/lib/libbsp/i386/pc386/startup/Makefile.in2
-rw-r--r--c/src/lib/libbsp/i386/pc386/startup/bspstart.c51
2 files changed, 10 insertions, 43 deletions
diff --git a/c/src/lib/libbsp/i386/pc386/startup/Makefile.in b/c/src/lib/libbsp/i386/pc386/startup/Makefile.in
index cf3371536c..1c8f298249 100644
--- a/c/src/lib/libbsp/i386/pc386/startup/Makefile.in
+++ b/c/src/lib/libbsp/i386/pc386/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 exit irq main sbrk
+C_PIECES=bspclean bsplibc bsppost bspstart exit irq main sbrk
C_FILES=$(C_PIECES:%=%.c)
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
diff --git a/c/src/lib/libbsp/i386/pc386/startup/bspstart.c b/c/src/lib/libbsp/i386/pc386/startup/bspstart.c
index 18f36d61a1..773d3ba804 100644
--- a/c/src/lib/libbsp/i386/pc386/startup/bspstart.c
+++ b/c/src/lib/libbsp/i386/pc386/startup/bspstart.c
@@ -66,38 +66,8 @@ char *rtems_progname; /* Program name - from main(). */
| External Prototypes
+--------------------------------------------------------------------------*/
extern void _exit(int); /* define in exit.c */
-
-/*-------------------------------------------------------------------------+
-| Function: bsp_libc_init
-| Description: Initialize whatever libc we are using. Called from
-| pretasking hook.
-| Global Variables: rtemsFreeMemStart.
-| Arguments: None.
-| Returns: Nothing.
-+--------------------------------------------------------------------------*/
-static void
-bsp_libc_init(void)
-{
- if (rtemsFreeMemStart & (CPU_ALIGNMENT - 1)) /* not aligned => align it */
- rtemsFreeMemStart = (rtemsFreeMemStart+CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
-
- RTEMS_Malloc_Initialize((void *)rtemsFreeMemStart, HEAP_SIZE << 10, 0);
- rtemsFreeMemStart += HEAP_SIZE << 10; /* HEAP_SIZE is in KBytes */
-
- /* 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 initialization. */
-
- 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 */
-} /* bsp_libc_init */
-
+void bsp_libc_init( void *, unsigned32, int );
+void bsp_postdriver_hook(void);
/*-------------------------------------------------------------------------+
| Function: bsp_pretasking_hook
@@ -109,10 +79,14 @@ bsp_libc_init(void)
| Arguments: None.
| Returns: Nothing.
+--------------------------------------------------------------------------*/
-void
-bsp_pretasking_hook(void)
+void bsp_pretasking_hook(void)
{
- bsp_libc_init();
+ if (rtemsFreeMemStart & (CPU_ALIGNMENT - 1)) /* not aligned => align it */
+ rtemsFreeMemStart = (rtemsFreeMemStart+CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
+
+ bsp_libc_init((void *)rtemsFreeMemStart, HEAP_SIZE << 10, 0);
+ rtemsFreeMemStart += HEAP_SIZE << 10; /* HEAP_SIZE is in KBytes */
+
#ifdef RTEMS_DEBUG
@@ -122,13 +96,6 @@ bsp_pretasking_hook(void)
} /* bsp_pretasking_hook */
-/*
- * Use the shared bsp_postdriver_hook() implementation
- */
-
-void bsp_postdriver_hook(void);
-
-
/*-------------------------------------------------------------------------+
| Function: bsp_start
| Description: Called before main is invoked.