summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/i386/i386ex
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/i386ex
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 'c/src/lib/libbsp/i386/i386ex')
-rw-r--r--c/src/lib/libbsp/i386/i386ex/startup/Makefile.in2
-rw-r--r--c/src/lib/libbsp/i386/i386ex/startup/bspstart.c66
2 files changed, 22 insertions, 46 deletions
diff --git a/c/src/lib/libbsp/i386/i386ex/startup/Makefile.in b/c/src/lib/libbsp/i386/i386ex/startup/Makefile.in
index b62746f5bd..9f4b9ae2fb 100644
--- a/c/src/lib/libbsp/i386/i386ex/startup/Makefile.in
+++ b/c/src/lib/libbsp/i386/i386ex/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/i386/i386ex/startup/bspstart.c b/c/src/lib/libbsp/i386/i386ex/startup/bspstart.c
index 2bda7165fe..9fc13e0262 100644
--- a/c/src/lib/libbsp/i386/i386ex/startup/bspstart.c
+++ b/c/src/lib/libbsp/i386/i386ex/startup/bspstart.c
@@ -43,45 +43,11 @@ rtems_cpu_table Cpu_table;
extern rtems_unsigned32 rdb_start;
/*
- * bsp_libc_init
- *
- * Initialize whatever libc we are using called from bsp_postdriver_hook.
+ * Use the shared implementations of the following routines
*/
-
-
-void bsp_libc_init()
-{
- extern int heap_bottom;
- rtems_unsigned32 heap_start;
- rtems_unsigned32 heap_size;
-
- heap_start = (rtems_unsigned32) &heap_bottom;
- if (heap_start & (CPU_ALIGNMENT-1))
- heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
-
- heap_size = BSP_Configuration.work_space_start -(void *) heap_start ;
- heap_size &= 0xfffffff0; /* keep it as a multiple of 16 bytes */
-
- heap_size &= 0xfffffff0; /* keep it as a multiple of 16 bytes */
- RTEMS_Malloc_Initialize((void *) heap_start, heap_size, 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,22 +63,32 @@ void bsp_libc_init()
*
*/
-void
-bsp_pretasking_hook(void)
+void bsp_pretasking_hook(void)
{
- bsp_libc_init();
-
+ extern int heap_bottom;
+ rtems_unsigned32 heap_start;
+ rtems_unsigned32 heap_size;
+
+ heap_start = (rtems_unsigned32) &heap_bottom;
+ if (heap_start & (CPU_ALIGNMENT-1))
+ heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
+
+ heap_size = BSP_Configuration.work_space_start -(void *) heap_start ;
+ heap_size &= 0xfffffff0; /* keep it as a multiple of 16 bytes */
+
+ heap_size &= 0xfffffff0; /* keep it as a multiple of 16 bytes */
+ bsp_libc_init((void *) heap_start, heap_size, 0);
+
#ifdef RTEMS_DEBUG
rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
#endif
}
-
/*
- * 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 )
{