summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/sparc/erc32/startup/bspstart.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--c/src/lib/libbsp/sparc/erc32/startup/bspstart.c66
1 files changed, 17 insertions, 49 deletions
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.