From b06e68ef1f6df69cc86d72356c3a002054a35fad Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 17 Aug 1995 19:51:51 +0000 Subject: Numerous miscellaneous features incorporated from Tony Bennett (tbennett@divnc.com) including the following major additions: + variable length messages + named devices + debug monitor + association tables/variables --- .../lib/libbsp/hppa1.1/simhppa/startup/bspstart.c | 64 ++++++++++++++++++---- 1 file changed, 54 insertions(+), 10 deletions(-) (limited to 'c/src/lib/libbsp/hppa1.1/simhppa/startup/bspstart.c') diff --git a/c/src/lib/libbsp/hppa1.1/simhppa/startup/bspstart.c b/c/src/lib/libbsp/hppa1.1/simhppa/startup/bspstart.c index 115a5bd136..7e9b70f82e 100644 --- a/c/src/lib/libbsp/hppa1.1/simhppa/startup/bspstart.c +++ b/c/src/lib/libbsp/hppa1.1/simhppa/startup/bspstart.c @@ -1,6 +1,5 @@ /* - * @(#)bspstart.c 1.14 - 95/05/16 - * + * @(#)bspstart.c 1.16 - 95/06/28 */ /* bsp_start() @@ -24,13 +23,17 @@ * to the copyright license under the clause at DFARS 252.227-7013. This * notice must appear in all copies of this file and its derivatives. * - * bspstart.c,v 1.2 1995/05/09 20:17:33 joel Exp + * $Id$ */ +#include #include +#include + #include #include +#include #ifdef STACK_CHECKER_ON #include @@ -127,8 +130,17 @@ bsp_libc_init(void) RTEMS_Malloc_Initialize((void *) heap_start, 64 * 1024, 0); + /* + * Init the RTEMS libio facility to provide UNIX-like system + * calls for use by newlib (ie: provide __open, __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. + * XXX; this should allow for case of some other non-clock interrupts */ if (BSP_Configuration.ticks_per_timeslice > 0) @@ -219,6 +231,32 @@ bsp_pretasking_hook(void) #endif } +/* + * After drivers are setup, register some "filenames" + * and open stdin, stdout, stderr files + * + * Newlib will automatically associate the files with these + * (it hardcodes the numbers) + */ + +void +bsp_postdriver_hook(void) +{ + int stdin_fd, stdout_fd, stderr_fd; + + if ((stdin_fd = __open("/dev/tty00", O_RDONLY, 0)) == -1) + rtems_fatal_error_occurred('STD0'); + + if ((stdout_fd = __open("/dev/tty00", O_WRONLY, 0)) == -1) + rtems_fatal_error_occurred('STD1'); + + if ((stderr_fd = __open("/dev/tty00", O_WRONLY, 0)) == -1) + rtems_fatal_error_occurred('STD2'); + + if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2)) + rtems_fatal_error_occurred('STIO'); +} + /* * Function: bsp_start * Created: 94/12/6 @@ -289,7 +327,7 @@ bsp_start(void) Cpu_table.predriver_hook = NULL; - Cpu_table.postdriver_hook = NULL; + Cpu_table.postdriver_hook = bsp_postdriver_hook; /* register drivers */ Cpu_table.idle_task = NULL; /* do not override system IDLE task */ @@ -342,21 +380,27 @@ bsp_start(void) #endif #ifdef STACK_CHECKER_ON - /* - * Add 1 extension for stack checker - */ + /* + * Add 1 extension for stack checker + */ BSP_Configuration.maximum_extensions++; #endif #if SIMHPPA_FAST_IDLE - /* - * Add 1 extension for fast idle - */ + /* + * Add 1 extension for fast idle + */ BSP_Configuration.maximum_extensions++; #endif + /* + * Tell libio how many fd's we want and allow it to tweak config + */ + + rtems_libio_config(&BSP_Configuration, BSP_LIBIO_MAX_FDS); + /* * Add 1 extension for MPCI_fatal */ -- cgit v1.2.3