diff options
Diffstat (limited to '')
-rw-r--r-- | c/src/lib/libbsp/no_cpu/no_bsp/console/console.c | 4 | ||||
-rw-r--r-- | c/src/lib/libbsp/no_cpu/no_bsp/startup/bspstart.c | 36 | ||||
-rw-r--r-- | c/src/lib/libbsp/no_cpu/no_bsp/startup/main.c | 5 |
3 files changed, 37 insertions, 8 deletions
diff --git a/c/src/lib/libbsp/no_cpu/no_bsp/console/console.c b/c/src/lib/libbsp/no_cpu/no_bsp/console/console.c index 4b1ca4a0e3..5b12e09532 100644 --- a/c/src/lib/libbsp/no_cpu/no_bsp/console/console.c +++ b/c/src/lib/libbsp/no_cpu/no_bsp/console/console.c @@ -204,7 +204,9 @@ rtems_device_driver console_write( } outbyte( buffer[ count ] ); } - return maximum; + + rw_args->bytes_moved = maximum; + return 0; } /* diff --git a/c/src/lib/libbsp/no_cpu/no_bsp/startup/bspstart.c b/c/src/lib/libbsp/no_cpu/no_bsp/startup/bspstart.c index 75739aa39b..e28e791503 100644 --- a/c/src/lib/libbsp/no_cpu/no_bsp/startup/bspstart.c +++ b/c/src/lib/libbsp/no_cpu/no_bsp/startup/bspstart.c @@ -83,15 +83,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" @@ -119,7 +145,7 @@ bsp_postdriver_hook(void) rtems_fatal_error_occurred('STIO'); } -int main( +int bsp_start( int argc, char **argv, char **environp @@ -196,9 +222,9 @@ int main( * we do not use the pretasking_hook */ - 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; diff --git a/c/src/lib/libbsp/no_cpu/no_bsp/startup/main.c b/c/src/lib/libbsp/no_cpu/no_bsp/startup/main.c index 622edb1ad7..62126647e7 100644 --- a/c/src/lib/libbsp/no_cpu/no_bsp/startup/main.c +++ b/c/src/lib/libbsp/no_cpu/no_bsp/startup/main.c @@ -19,10 +19,11 @@ int main( int argc, - char **argv + char **argv, + char **environp ) { - bsp_start(); + bsp_start( argc, argv, environp ); /* * May be able to return to the "crt/start.s" code but also |