summaryrefslogtreecommitdiff
path: root/arch/sandbox/include
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2014-02-27 13:26:22 -0700
committerSimon Glass <sjg@chromium.org>2014-03-17 20:05:49 -0600
commitffb87905cb3883c84598b87ca05384c17d59dee1 (patch)
tree34a10775e3d35c5ebf5432222443094025cb14bb /arch/sandbox/include
parent20f86a0aeaad5dfa0b4f50bf5d04dd7bf1f7c3e9 (diff)
downloadu-boot-imx-ffb87905cb3883c84598b87ca05384c17d59dee1.zip
u-boot-imx-ffb87905cb3883c84598b87ca05384c17d59dee1.tar.gz
u-boot-imx-ffb87905cb3883c84598b87ca05384c17d59dee1.tar.bz2
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 'arch/sandbox/include')
-rw-r--r--arch/sandbox/include/asm/state.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/sandbox/include/asm/state.h b/arch/sandbox/include/asm/state.h
index 895b3a4..56bd9a0 100644
--- a/arch/sandbox/include/asm/state.h
+++ b/arch/sandbox/include/asm/state.h
@@ -17,6 +17,29 @@ enum exit_type_id {
STATE_EXIT_POWER_OFF,
};
+/**
+ * Selects the behavior of the serial terminal.
+ *
+ * If Ctrl-C is processed by U-Boot, then the only way to quit sandbox is with
+ * the 'reset' command, or equivalent.
+ *
+ * If the terminal is cooked, then Ctrl-C will terminate U-Boot, and the
+ * command line will not be quite such a faithful emulation.
+ *
+ * Options are:
+ *
+ * raw-with-sigs - Raw, but allow signals (Ctrl-C will quit)
+ * raw - Terminal is always raw
+ * cooked - Terminal is always cooked
+ */
+enum state_terminal_raw {
+ STATE_TERM_RAW_WITH_SIGS, /* Default */
+ STATE_TERM_RAW,
+ STATE_TERM_COOKED,
+
+ STATE_TERM_COUNT,
+};
+
struct sandbox_spi_info {
const char *spec;
const struct sandbox_spi_emu_ops *ops;
@@ -42,6 +65,7 @@ struct sandbox_state {
bool write_state; /* Write sandbox state on exit */
bool ignore_missing_state_on_read; /* No error if state missing */
bool show_lcd; /* Show LCD on start-up */
+ enum state_terminal_raw term_raw; /* Terminal raw/cooked */
/* Pointer to information for each SPI bus/cs */
struct sandbox_spi_info spi[CONFIG_SANDBOX_SPI_MAX_BUS]