diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-09-22 21:49:43 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-09-22 21:49:43 +0000 |
commit | 084369e07aae6e40a7aeb13721b05f3ef8c41dc6 (patch) | |
tree | f8176713415a3c71a42a63dffb6099db90407b1b /c | |
parent | 2008-09-22 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-084369e07aae6e40a7aeb13721b05f3ef8c41dc6.tar.bz2 |
2008-09-22 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, configure.ac, console/inch.c, console/keyboard.c,
include/bsp.h: Use standardized bsp_cleanup() which can optionally
print a message, poll for user to press key, and call bsp_reset().
Using this eliminates the various bsp_cleanup() implementations which
had their own implementation and variety of string constants.
Diffstat (limited to 'c')
-rw-r--r-- | c/src/lib/libbsp/i386/pc386/ChangeLog | 8 | ||||
-rw-r--r-- | c/src/lib/libbsp/i386/pc386/Makefile.am | 4 | ||||
-rw-r--r-- | c/src/lib/libbsp/i386/pc386/configure.ac | 9 | ||||
-rw-r--r-- | c/src/lib/libbsp/i386/pc386/console/inch.c | 16 | ||||
-rw-r--r-- | c/src/lib/libbsp/i386/pc386/console/keyboard.c | 12 | ||||
-rw-r--r-- | c/src/lib/libbsp/i386/pc386/include/bsp.h | 2 |
6 files changed, 24 insertions, 27 deletions
diff --git a/c/src/lib/libbsp/i386/pc386/ChangeLog b/c/src/lib/libbsp/i386/pc386/ChangeLog index ca9ec107ba..69291b1a41 100644 --- a/c/src/lib/libbsp/i386/pc386/ChangeLog +++ b/c/src/lib/libbsp/i386/pc386/ChangeLog @@ -1,3 +1,11 @@ +2008-09-22 Joel Sherrill <joel.sherrill@oarcorp.com> + + * Makefile.am, configure.ac, console/inch.c, console/keyboard.c, + include/bsp.h: Use standardized bsp_cleanup() which can optionally + print a message, poll for user to press key, and call bsp_reset(). + Using this eliminates the various bsp_cleanup() implementations which + had their own implementation and variety of string constants. + 2008-09-18 Joel Sherrill <joel.sherrill@oarcorp.com> * Makefile.am, configure.ac, startup/bspstart.c, startup/linkcmds: Add diff --git a/c/src/lib/libbsp/i386/pc386/Makefile.am b/c/src/lib/libbsp/i386/pc386/Makefile.am index 2c9451c1ac..36541c7b82 100644 --- a/c/src/lib/libbsp/i386/pc386/Makefile.am +++ b/c/src/lib/libbsp/i386/pc386/Makefile.am @@ -80,8 +80,8 @@ pci_SOURCES = ../../i386/shared/pci/pcibios.c \ include_HEADERS += ../../i386/shared/comm/uart.h startup_SOURCES = ../../shared/bsplibc.c ../../shared/bsppost.c \ ../../shared/bsppredriverhook.c startup/bspgetworkarea.c \ - ../../shared/bsppretaskinghook.c \ - startup/bspstart.c startup/bspclean.c ../../i386/shared/irq/idt.c \ + ../../shared/bsppretaskinghook.c startup/bspstart.c \ + ../../shared/bspclean.c startup/bspreset.c ../../i386/shared/irq/idt.c \ ../../i386/shared/irq/irq.c ../../i386/shared/irq/irq_init.c \ ../../shared/bootcard.c ../../shared/sbrk.c \ startup/ldsegs.S ../../i386/shared/irq/irq_asm.S diff --git a/c/src/lib/libbsp/i386/pc386/configure.ac b/c/src/lib/libbsp/i386/pc386/configure.ac index 2bb5bd8c83..6927d9e9ad 100644 --- a/c/src/lib/libbsp/i386/pc386/configure.ac +++ b/c/src/lib/libbsp/i386/pc386/configure.ac @@ -58,6 +58,15 @@ RTEMS_CONFIG_BUILD_SUBDIRS(tools) AC_SUBST(RTEMS_BSP) +RTEMS_BSPOPTS_SET([BSP_PRESS_KEY_FOR_RESET],[*],[1]) +RTEMS_BSPOPTS_HELP([BSP_PRESS_KEY_FOR_RESET], +[If defined, print a message and wait until pressed before resetting + board when application exits.]) + +RTEMS_BSPOPTS_SET([BSP_RESET_BOARD_AT_EXIT],[*],[1]) +RTEMS_BSPOPTS_HELP([BSP_RESET_BOARD_AT_EXIT], +[If defined, reset the board when the application exits.]) + RTEMS_BSP_BOOTCARD_HANDLES_RAM_ALLOCATION # Explicitly list all Makefiles here diff --git a/c/src/lib/libbsp/i386/pc386/console/inch.c b/c/src/lib/libbsp/i386/pc386/console/inch.c index 77d12d00fb..bc3a56dcff 100644 --- a/c/src/lib/libbsp/i386/pc386/console/inch.c +++ b/c/src/lib/libbsp/i386/pc386/console/inch.c @@ -30,6 +30,7 @@ +--------------------------------------------------------------------------*/ #include <bsp.h> +#include <bsp/bootcard.h> #include <bsp/irq.h> /*-------------------------------------------------------------------------+ @@ -72,19 +73,6 @@ static uint16_t kbd_last = 0; static uint16_t kbd_end = KBD_BUF_SIZE - 1; /*-------------------------------------------------------------------------+ -| Function: rtemsReboot -| Description: Reboot the PC. -| Global Variables: None. -| Arguments: None. -| Returns: Nothing. -+--------------------------------------------------------------------------*/ -void rtemsReboot(void) -{ - /* shutdown and reboot */ - outport_byte(0x64, 0xFE); /* use keyboard controler to do the job... */ -} /* rtemsReboot */ - -/*-------------------------------------------------------------------------+ | Function: _IBMPC_scankey | Description: This function can be called during a poll for input, or by | an ISR. Basically any time you want to process a keypress. @@ -174,7 +162,7 @@ _IBMPC_scankey(char *outChar) case 0x53: if (ctrl_pressed && alt_pressed) - rtemsReboot(); /* ctrl+alt+del -> reboot */ + bsp_reset(); /* ctrl+alt+del -> reboot */ break; /* diff --git a/c/src/lib/libbsp/i386/pc386/console/keyboard.c b/c/src/lib/libbsp/i386/pc386/console/keyboard.c index 6b0b36d8e8..dff91744fd 100644 --- a/c/src/lib/libbsp/i386/pc386/console/keyboard.c +++ b/c/src/lib/libbsp/i386/pc386/console/keyboard.c @@ -10,6 +10,7 @@ #include "i386kbd.h" #include <rtems/kd.h> #include <bsp.h> +#include <bsp/bootcard.h> #define SIZE(x) (sizeof(x)/sizeof((x)[0])) @@ -30,7 +31,6 @@ #endif extern void add_to_queue( unsigned short ); -extern void rtemsReboot( void ); int set_bit(int nr, unsigned long * addr) { @@ -134,14 +134,14 @@ static void show_state(void) } static void_fn do_null, enter, show_ptregs, send_intr, lastcons, caps_toggle, - num, hold, scroll_forw, scroll_back, boot_it, caps_on, compose, + num, hold, scroll_forw, scroll_back, caps_on, compose, SAK, decr_console, incr_console, spawn_console, bare_num; static void_fnp spec_fn_table[] = { do_null, enter, show_ptregs, show_mem, show_state, send_intr, lastcons, caps_toggle, num, hold, scroll_forw, scroll_back, - boot_it, caps_on, compose, SAK, + bsp_reset, caps_on, compose, SAK, decr_console, incr_console, spawn_console, bare_num }; @@ -455,12 +455,6 @@ static void scroll_back(void) { } -static void boot_it(void) -{ - printk( "boot_it() " ); - rtemsReboot(); -} - static void compose(void) { dead_key_next = 1; diff --git a/c/src/lib/libbsp/i386/pc386/include/bsp.h b/c/src/lib/libbsp/i386/pc386/include/bsp.h index 876f4647d1..a3b484f04a 100644 --- a/c/src/lib/libbsp/i386/pc386/include/bsp.h +++ b/c/src/lib/libbsp/i386/pc386/include/bsp.h @@ -175,8 +175,6 @@ void _IBMPC_outch (char); /* from 'outch.c' */ char _IBMPC_inch (void); /* from 'inch.c' */ char _IBMPC_inch_sleep (void); /* from 'inch.c' */ -void rtemsReboot(void); /* from 'exit.c' */ - void Wait_X_ms(unsigned int timeToWait); /* from 'timer.c' */ /* Definitions for BSPConsolePort */ |