diff options
author | Simon Glass <sjg@chromium.org> | 2014-02-27 20:26:22 (GMT) |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2014-03-18 02:05:49 (GMT) |
commit | ffb87905cb3883c84598b87ca05384c17d59dee1 (patch) | |
tree | 34a10775e3d35c5ebf5432222443094025cb14bb /drivers/serial | |
parent | 20f86a0aeaad5dfa0b4f50bf5d04dd7bf1f7c3e9 (diff) | |
download | u-boot-ffb87905cb3883c84598b87ca05384c17d59dee1.tar.xz |
sandbox: Allow Ctrl-C to work in sandbox
It is useful for Cltl-C to be handled by U-Boot as it is on other boards.
But it is also useful to be able to terminate U-Boot with Ctrl-C.
Add an option to enable signals while in raw mode, and make this the
default. Add an option to leave the terminal cooked, which is useful for
redirecting output.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/serial')
-rw-r--r-- | drivers/serial/sandbox.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/serial/sandbox.c b/drivers/serial/sandbox.c index c27b5b8..51fd871 100644 --- a/drivers/serial/sandbox.c +++ b/drivers/serial/sandbox.c @@ -15,6 +15,7 @@ #include <os.h> #include <serial.h> #include <linux/compiler.h> +#include <asm/state.h> /* * @@ -31,7 +32,10 @@ static unsigned int serial_buf_read; static int sandbox_serial_init(void) { - os_tty_raw(0); + struct sandbox_state *state = state_get_current(); + + if (state->term_raw != STATE_TERM_COOKED) + os_tty_raw(0, state->term_raw == STATE_TERM_RAW_WITH_SIGS); return 0; } |