diff options
Diffstat (limited to 'c/src/lib/libbsp/m68k/mvme136/startup/bspstart.c')
-rw-r--r-- | c/src/lib/libbsp/m68k/mvme136/startup/bspstart.c | 38 |
1 files changed, 30 insertions, 8 deletions
diff --git a/c/src/lib/libbsp/m68k/mvme136/startup/bspstart.c b/c/src/lib/libbsp/m68k/mvme136/startup/bspstart.c index 5f822855e8..3465f72416 100644 --- a/c/src/lib/libbsp/m68k/mvme136/startup/bspstart.c +++ b/c/src/lib/libbsp/m68k/mvme136/startup/bspstart.c @@ -54,10 +54,6 @@ void bsp_libc_init() extern int end; rtems_unsigned32 heap_start; -#ifdef RTEMS_DEBUG - rtems_debug_enable( RTEMS_DEBUG_ALL_MASK ); -#endif - heap_start = (rtems_unsigned32) &end; if (heap_start & (CPU_ALIGNMENT-1)) heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1); @@ -80,15 +76,41 @@ void bsp_libc_init() libc_init(1); /* reentrant if possible */ else libc_init(0); /* non-reentrant */ +} +/* + * Function: bsp_pretasking_hook + * Created: 95/03/10 + * + * Description: + * BSP pretasking hook. Called just before drivers are initialized. + * Used to setup libc and install any BSP extensions. + * + * NOTES: + * Must not use libc (to do io) from here, since drivers are + * not yet initialized. + * + */ + +void +bsp_pretasking_hook(void) +{ + bsp_libc_init(); + +#ifdef STACK_CHECKER_ON /* * Initialize the stack bounds checker + * We can either turn it on here or from the app. */ - -#ifdef STACK_CHECKER_ON + Stack_check_Initialize(); #endif + +#ifdef RTEMS_DEBUG + rtems_debug_enable( RTEMS_DEBUG_ALL_MASK ); +#endif } + /* * After drivers are setup, register some "filenames" @@ -152,9 +174,9 @@ int main( * we only use a hook to get the C library initialized. */ - Cpu_table.pretasking_hook = NULL; + Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */ - Cpu_table.predriver_hook = bsp_libc_init; /* RTEMS resources available */ + Cpu_table.predriver_hook = NULL; Cpu_table.postdriver_hook = bsp_postdriver_hook; |