summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/sparc
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/sparc
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/sparc')
-rw-r--r--c/src/lib/libbsp/sparc/erc32/startup/Makefile.in2
-rw-r--r--c/src/lib/libbsp/sparc/erc32/startup/bspstart.c66
2 files changed, 18 insertions, 50 deletions
diff --git a/c/src/lib/libbsp/sparc/erc32/startup/Makefile.in b/c/src/lib/libbsp/sparc/erc32/startup/Makefile.in
index bf4fcf17f4..1ef823537b 100644
--- a/c/src/lib/libbsp/sparc/erc32/startup/Makefile.in
+++ b/c/src/lib/libbsp/sparc/erc32/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 spurious
+C_PIECES=bspclean bsplibc bsppost bspstart main sbrk setvec spurious
C_FILES=$(C_PIECES:%=%.c)
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
diff --git a/c/src/lib/libbsp/sparc/erc32/startup/bspstart.c b/c/src/lib/libbsp/sparc/erc32/startup/bspstart.c
index 6c5e466889..166fe3cfac 100644
--- a/c/src/lib/libbsp/sparc/erc32/startup/bspstart.c
+++ b/c/src/lib/libbsp/sparc/erc32/startup/bspstart.c
@@ -1,12 +1,9 @@
-/* bspstart.c
- *
+/*
* This set of routines starts the application. It includes application,
* board, and monitor specific initialization and configuration.
* The generic CPU dependent initialization has been performed
* before any of these are invoked.
*
- * Called by RTEMS::RTEMS constructor in rtems-ctor.cc
- *
* COPYRIGHT (c) 1989-1998.
* On-Line Applications Research Corporation (OAR).
* Copyright assigned to U.S. Government, 1994.
@@ -41,7 +38,6 @@ extern rtems_configuration_table Configuration;
rtems_configuration_table BSP_Configuration;
rtems_cpu_table Cpu_table;
-rtems_unsigned32 bsp_isr_level;
/*
* Tells us where to put the workspace in case remote debugger is present.
@@ -72,9 +68,10 @@ rtems_unsigned32 CPU_SPARC_CLICKS_PER_TICK;
* approximately 5 seconds of wall time.
*/
-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;
@@ -101,12 +98,20 @@ fast_idle_switch_hook(rtems_tcb *current_task,
#endif
/*
- * bsp_libc_init
+ * Use the shared implementations of the following routines
+ */
+
+void bsp_postdriver_hook(void);
+void bsp_libc_init( void *, unsigned32, int );
+
+/*
+ * bsp_pretasking_hook
*
- * Initialize whatever libc we are using called from bsp_postdriver_hook.
+ * BSP pretasking hook. Called just before drivers are initialized.
+ * Used to setup libc and install any BSP extensions.
*/
-void bsp_libc_init(void)
+void bsp_pretasking_hook(void)
{
extern int end;
rtems_unsigned32 heap_start;
@@ -119,39 +124,9 @@ void bsp_libc_init(void)
heap_size = BSP_Configuration.work_space_start - (void *)&end;
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 */
-
-}
+ bsp_libc_init((void *) heap_start, heap_size, 0);
-/*
- * bsp_pretasking_hook
- *
- * BSP pretasking hook. Called just before drivers are initialized.
- * Used to setup libc and install any BSP extensions.
- */
-
-void bsp_pretasking_hook(void)
-{
- bsp_libc_init();
-
#if SIMSPARC_FAST_IDLE
/*
* Install the fast idle task switch extension
@@ -189,13 +164,6 @@ void bsp_pretasking_hook(void)
}
/*
- * Use the shared bsp_postdriver_hook() implementation
- */
-
-void bsp_postdriver_hook(void);
-
-
-/*
* bsp_start
*
* This routine does the bulk of the system initialization.