forked from Imagelibrary/rtems
Transitioned to shared bsp_libc_init() and cleaned up comments.
This commit is contained 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)
|
||||
|
||||
|
||||
@@ -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,38 +124,8 @@ 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);
|
||||
bsp_libc_init((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_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
|
||||
/*
|
||||
@@ -188,13 +163,6 @@ void bsp_pretasking_hook(void)
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Use the shared bsp_postdriver_hook() implementation
|
||||
*/
|
||||
|
||||
void bsp_postdriver_hook(void);
|
||||
|
||||
|
||||
/*
|
||||
* bsp_start
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user