console: add CONFIG_CONSOLE_DISABLE_CTRLC to disable ctrlc

There are sometimes we would like to disable ctrlc, just enable it.

Change-Id: I2911650b22d47b057a039774d8293cad6317bb6d
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
This commit is contained in:
Joseph Chen 2019-03-08 17:11:23 +08:00 committed by Jianhong Chen
parent f3124cd744
commit 590d13d737
2 changed files with 7 additions and 10 deletions

View File

@ -249,6 +249,11 @@ config CONSOLE_RECORD_IN_SIZE
The buffer is allocated immediately after the malloc() region is
ready.
config CONSOLE_DISABLE_CTRLC
bool "disable ctrlc"
help
This disable ctrl+c when CONFIG_BOOTDELAY is 0.
config IDENT_STRING
string "Board specific string to be added to uboot version string"
help

View File

@ -412,13 +412,6 @@ int getc(void)
int tstc(void)
{
/* Don't allow drivers call tstc() to do some "exit" event(maybe enter hush) */
#if defined(CONFIG_ARCH_ROCKCHIP) && \
defined(CONFIG_AVB_VBMETA_PUBLIC_KEY_VALIDATE) && \
defined(CONFIG_BOOTDELAY) && (CONFIG_BOOTDELAY <= 0)
return 0;
#endif
#ifdef CONFIG_DISABLE_CONSOLE
if (gd->flags & GD_FLG_DISABLE_CONSOLE)
return 0;
@ -601,9 +594,8 @@ static int ctrlc_disabled = 0; /* see disable_ctrl() */
static int ctrlc_was_pressed = 0;
int ctrlc(void)
{
/* Don't allow drivers call ctrlc() to do some "exit" event(maybe enter hush) */
#if defined(CONFIG_ARCH_ROCKCHIP) && \
defined(CONFIG_AVB_VBMETA_PUBLIC_KEY_VALIDATE)
#if defined(CONFIG_CONSOLE_DISABLE_CTRLC) && \
defined(CONFIG_BOOTDELAY) && (CONFIG_BOOTDELAY <= 0)
return 0;
#endif