diff options
Diffstat (limited to '')
-rw-r--r-- | c/src/lib/libbsp/i386/pc386/startup/Makefile.in | 12 | ||||
-rw-r--r-- | c/src/lib/libbsp/i386/pc386/startup/exit.c | 69 |
2 files changed, 14 insertions, 67 deletions
diff --git a/c/src/lib/libbsp/i386/pc386/startup/Makefile.in b/c/src/lib/libbsp/i386/pc386/startup/Makefile.in index 3ac6b77792..b59323c6ff 100644 --- a/c/src/lib/libbsp/i386/pc386/startup/Makefile.in +++ b/c/src/lib/libbsp/i386/pc386/startup/Makefile.in @@ -4,17 +4,14 @@ @SET_MAKE@ srcdir = @srcdir@ -VPATH = @srcdir@:@srcdir@/../../../shared +VPATH = @srcdir@:@srcdir@/../../../shared:@srcdir@/../../shared/irq RTEMS_ROOT = @top_srcdir@ PROJECT_ROOT = @PROJECT_ROOT@ PGM=${ARCH}/startup.rel -IMPORT_SRC=$(srcdir)/../../shared/irq/irq.c \ - $(srcdir)/../../shared/irq/irq_init.c $(srcdir)/../../shared/irq/irq_asm.s - # C source names, if any, go here -- minus the .c -C_PIECES=bspclean bsplibc bsppost bspstart exit irq irq_init main sbrk +C_PIECES=bsplibc bsppost bspstart exit irq irq_init main sbrk C_FILES=$(C_PIECES:%=%.c) C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) @@ -53,12 +50,9 @@ LDFLAGS += CLEAN_ADDITIONS += CLOBBER_ADDITIONS += -preinstall: - ${CP} ${IMPORT_SRC} . - ${PGM}: ${SRCS} ${OBJS} $(make-rel) -all: ${ARCH} preinstall $(SRCS) $(PGM) +all: ${ARCH} $(SRCS) $(PGM) $(INSTALL) $(srcdir)/linkcmds ${PROJECT_RELEASE}/lib # the .rel file built here will be put into libbsp.a by ../wrapup/Makefile diff --git a/c/src/lib/libbsp/i386/pc386/startup/exit.c b/c/src/lib/libbsp/i386/pc386/startup/exit.c index 5166049d34..6e72e4bbd8 100644 --- a/c/src/lib/libbsp/i386/pc386/startup/exit.c +++ b/c/src/lib/libbsp/i386/pc386/startup/exit.c @@ -37,67 +37,20 @@ #include <rtems/libio.h> #include <pc386uart.h> -/*-------------------------------------------------------------------------+ - | Which console is in use: either (-1) which means normal console or - | uart id if uart was used - +-------------------------------------------------------------------------*/ -extern int PC386ConsolePort; - -/*-------------------------------------------------------------------------+ -| External Prototypes -+--------------------------------------------------------------------------*/ -extern rtems_boolean _IBMPC_scankey(char *); /* defined in 'inch.c' */ - -/*-------------------------------------------------------------------------+ -| Function: _exit -| Description: Shutdown the PC. Called from libc's 'exit'. -| Global Variables: None. -| Arguments: status - exit status (ignored). -| Returns: Nothing. -+--------------------------------------------------------------------------*/ -void _exit(int status) +void bsp_cleanup() { - unsigned char ch, *cp; + unsigned char ch; static char line[]="EXECUTIVE SHUTDOWN! Any key to reboot..."; - - if(PC386ConsolePort == PC386_CONSOLE_PORT_CONSOLE) - { - - printk("\n"); - printk(line); - while(!_IBMPC_scankey(&ch)) - ; - printk("\n\n"); - } - else - { - /* Close console */ - __rtems_close(2); - __rtems_close(1); - __rtems_close(0); - - PC386_uart_intr_ctrl(PC386ConsolePort, PC386_UART_INTR_CTRL_DISABLE); - - PC386_uart_polled_write(PC386ConsolePort, '\r'); - PC386_uart_polled_write(PC386ConsolePort, '\n'); - - for(cp=line; *cp != 0; cp++) - { - PC386_uart_polled_write(PC386ConsolePort, *cp); - } - - PC386_uart_polled_read(PC386ConsolePort); - - PC386_uart_polled_write(PC386ConsolePort, '\r'); - PC386_uart_polled_write(PC386ConsolePort, '\n'); - PC386_uart_polled_write(PC386ConsolePort, '\r'); - PC386_uart_polled_write(PC386ConsolePort, '\n'); - } - + /* + * AT this point, the console driver is disconnected => we must + * use polled output/input. This is exactly what printk + * does. + */ + printk("\n"); + printk(line); + ch = BSP_poll_char(); rtemsReboot(); -} /* _exit */ - - +} |