fix: Ctrl-C move out of LOS_MAGIC_KEY_ENABLE

由于没有tty,当前的Ctrl-C实现基于uart回调特定函数实现,后续tty实现后
可以重新考虑Ctrl-C设计实现。本次将Ctrl-C移除LOS_MAGIC_KEY_ENABLE,保
证任意情况下可以生效。

Change-Id: I4e1e51b2d92535879bbdbbfa91b0229119d0e90e
Signed-off-by: Guangyao Ma <guangyao.ma@outlook.com>
This commit is contained in:
Guangyao Ma 2021-07-01 10:16:02 +08:00
parent ee54cd8b7e
commit 40f239a7d4
9 changed files with 6 additions and 20 deletions

View File

@ -66,12 +66,6 @@ STATIC MagicKeyOp g_magicHelpOp = {
.magicKey = 0x1a /* ctrl + z */ .magicKey = 0x1a /* ctrl + z */
}; };
STATIC MagicKeyOp g_magicKillPgrp = {
.opHandler = KillPgrp,
.helpMsg = "Show all magic op key(ctrl+c) ",
.magicKey = 0x03 /* ctrl + c */
};
/* /*
* NOTICE:Suggest don't use * NOTICE:Suggest don't use
* ctrl+h/backspace=0x8, * ctrl+h/backspace=0x8,
@ -87,7 +81,7 @@ STATIC MagicKeyOp *g_magicOpTable[MAGIC_KEY_NUM] = {
&g_magicPanicOp, /* ctrl + p */ &g_magicPanicOp, /* ctrl + p */
&g_magicTaskShowOp, /* ctrl + t */ &g_magicTaskShowOp, /* ctrl + t */
&g_magicHelpOp, /* ctrl + z */ &g_magicHelpOp, /* ctrl + z */
&g_magicKillPgrp /* ctrl + c */ NULL
}; };
STATIC VOID OsMagicHelp(VOID) STATIC VOID OsMagicHelp(VOID)
@ -129,7 +123,11 @@ INT32 CheckMagicKey(CHAR key)
#ifdef LOSCFG_ENABLE_MAGICKEY #ifdef LOSCFG_ENABLE_MAGICKEY
INT32 i; INT32 i;
STATIC UINT32 magicKeySwitch = 0; STATIC UINT32 magicKeySwitch = 0;
if (key == 0x12) { /* ctrl + r */
if (key == 0x03) { /* ctrl + c */
KillPgrp();
return 0;
} else if (key == 0x12) { /* ctrl + r */
magicKeySwitch = ~magicKeySwitch; magicKeySwitch = ~magicKeySwitch;
if (magicKeySwitch != 0) { if (magicKeySwitch != 0) {
PRINTK("Magic key on\n"); PRINTK("Magic key on\n");
@ -137,11 +135,7 @@ INT32 CheckMagicKey(CHAR key)
PRINTK("Magic key off\n"); PRINTK("Magic key off\n");
} }
return 1; return 1;
} else if (key == 0x03) { /* ctrl + c */
KillPgrp();
return 0;
} }
if (magicKeySwitch != 0) { if (magicKeySwitch != 0) {
for (i = 0; i < MAGIC_KEY_NUM; i++) { for (i = 0; i < MAGIC_KEY_NUM; i++) {
if (g_magicOpTable[i] != NULL && key == g_magicOpTable[i]->magicKey) { if (g_magicOpTable[i] != NULL && key == g_magicOpTable[i]->magicKey) {

View File

@ -10,6 +10,5 @@ LOSCFG_BOARD_CONFIG_PATH="device/qemu/arm_virt/liteos_a/config/board"
# LOSCFG_FS_VFS is not set # LOSCFG_FS_VFS is not set
# LOSCFG_NET_LWIP_SACK is not set # LOSCFG_NET_LWIP_SACK is not set
# LOSCFG_PLATFORM_ADAPT is not set # LOSCFG_PLATFORM_ADAPT is not set
# LOSCFG_ENABLE_MAGICKEY is not set
# LOSCFG_DRIVERS is not set # LOSCFG_DRIVERS is not set
# LOSCFG_SECURITY is not set # LOSCFG_SECURITY is not set

View File

@ -8,7 +8,6 @@ LOSCFG_FS_VFS_BLOCK_DEVICE=y
LOSCFG_FS_FAT_CACHE_SYNC_THREAD=y LOSCFG_FS_FAT_CACHE_SYNC_THREAD=y
LOSCFG_FS_FAT_VIRTUAL_PARTITION=y LOSCFG_FS_FAT_VIRTUAL_PARTITION=y
LOSCFG_ENABLE_OOM_LOOP_TASK=y LOSCFG_ENABLE_OOM_LOOP_TASK=y
# LOSCFG_ENABLE_MAGICKEY is not set
LOSCFG_DRIVERS_USB_HOST_XHCI=y LOSCFG_DRIVERS_USB_HOST_XHCI=y
LOSCFG_DRIVERS_USB_ETHERNET=y LOSCFG_DRIVERS_USB_ETHERNET=y
LOSCFG_DRIVERS_USB_WIRELESS=y LOSCFG_DRIVERS_USB_WIRELESS=y

View File

@ -9,7 +9,6 @@ LOSCFG_KERNEL_VDSO=y
LOSCFG_FS_VFS_BLOCK_DEVICE=y LOSCFG_FS_VFS_BLOCK_DEVICE=y
LOSCFG_FS_FAT_VIRTUAL_PARTITION=y LOSCFG_FS_FAT_VIRTUAL_PARTITION=y
LOSCFG_ENABLE_OOM_LOOP_TASK=y LOSCFG_ENABLE_OOM_LOOP_TASK=y
# LOSCFG_ENABLE_MAGICKEY is not set
LOSCFG_DRIVERS_USB_HOST_XHCI=y LOSCFG_DRIVERS_USB_HOST_XHCI=y
LOSCFG_DRIVERS_USB_ETHERNET=y LOSCFG_DRIVERS_USB_ETHERNET=y
LOSCFG_DRIVERS_USB_WIRELESS=y LOSCFG_DRIVERS_USB_WIRELESS=y

View File

@ -10,7 +10,6 @@ LOSCFG_KERNEL_VDSO=y
LOSCFG_FS_VFS_BLOCK_DEVICE=y LOSCFG_FS_VFS_BLOCK_DEVICE=y
LOSCFG_FS_FAT_VIRTUAL_PARTITION=y LOSCFG_FS_FAT_VIRTUAL_PARTITION=y
LOSCFG_ENABLE_OOM_LOOP_TASK=y LOSCFG_ENABLE_OOM_LOOP_TASK=y
# LOSCFG_ENABLE_MAGICKEY is not set
LOSCFG_DRIVERS_USB_HOST_XHCI=y LOSCFG_DRIVERS_USB_HOST_XHCI=y
LOSCFG_DRIVERS_USB_ETHERNET=y LOSCFG_DRIVERS_USB_ETHERNET=y
LOSCFG_DRIVERS_USB_WIRELESS=y LOSCFG_DRIVERS_USB_WIRELESS=y

View File

@ -9,7 +9,6 @@ LOSCFG_FS_VFS_BLOCK_DEVICE=y
LOSCFG_FS_FAT_VIRTUAL_PARTITION=y LOSCFG_FS_FAT_VIRTUAL_PARTITION=y
LOSCFG_NET_LWIP_SACK_2_0=y LOSCFG_NET_LWIP_SACK_2_0=y
LOSCFG_ENABLE_OOM_LOOP_TASK=y LOSCFG_ENABLE_OOM_LOOP_TASK=y
# LOSCFG_ENABLE_MAGICKEY is not set
LOSCFG_DRIVERS_USB_HOST_XHCI=y LOSCFG_DRIVERS_USB_HOST_XHCI=y
LOSCFG_DRIVERS_USB_ETHERNET=y LOSCFG_DRIVERS_USB_ETHERNET=y
LOSCFG_DRIVERS_USB_WIRELESS=y LOSCFG_DRIVERS_USB_WIRELESS=y

View File

@ -9,7 +9,6 @@ LOSCFG_FS_VFS_BLOCK_DEVICE=y
LOSCFG_FS_FAT_VIRTUAL_PARTITION=y LOSCFG_FS_FAT_VIRTUAL_PARTITION=y
LOSCFG_NET_LWIP_SACK_2_0=y LOSCFG_NET_LWIP_SACK_2_0=y
LOSCFG_ENABLE_OOM_LOOP_TASK=y LOSCFG_ENABLE_OOM_LOOP_TASK=y
# LOSCFG_ENABLE_MAGICKEY is not set
LOSCFG_DRIVERS_USB_HOST_XHCI=y LOSCFG_DRIVERS_USB_HOST_XHCI=y
LOSCFG_DRIVERS_USB_ETHERNET=y LOSCFG_DRIVERS_USB_ETHERNET=y
LOSCFG_DRIVERS_USB_WIRELESS=y LOSCFG_DRIVERS_USB_WIRELESS=y

View File

@ -8,7 +8,6 @@ LOSCFG_FS_FAT_CACHE_SYNC_THREAD=y
LOSCFG_FS_FAT_VIRTUAL_PARTITION=y LOSCFG_FS_FAT_VIRTUAL_PARTITION=y
LOSCFG_NET_LWIP_SACK_2_0=y LOSCFG_NET_LWIP_SACK_2_0=y
LOSCFG_ENABLE_OOM_LOOP_TASK=y LOSCFG_ENABLE_OOM_LOOP_TASK=y
# LOSCFG_ENABLE_MAGICKEY is not set
LOSCFG_DRIVERS_USB_HOST_XHCI=y LOSCFG_DRIVERS_USB_HOST_XHCI=y
LOSCFG_DRIVERS_USB_ETHERNET=y LOSCFG_DRIVERS_USB_ETHERNET=y
LOSCFG_DRIVERS_USB_WIRELESS=y LOSCFG_DRIVERS_USB_WIRELESS=y

View File

@ -6,7 +6,6 @@ LOSCFG_FS_FAT=y
LOSCFG_FS_FAT_DISK=y LOSCFG_FS_FAT_DISK=y
LOSCFG_FS_FAT_VIRTUAL_PARTITION=y LOSCFG_FS_FAT_VIRTUAL_PARTITION=y
LOSCFG_FS_VFS_BLOCK_DEVICE=y LOSCFG_FS_VFS_BLOCK_DEVICE=y
LOSCFG_ENABLE_MAGICKEY=y
LOSCFG_DEBUG_VERSION=y LOSCFG_DEBUG_VERSION=y
# LOSCFG_SHELL_LK is not set # LOSCFG_SHELL_LK is not set
LOSCFG_USER_INIT_DEBUG=y LOSCFG_USER_INIT_DEBUG=y