From 40f239a7d4673dc740c853b1011b5072e48385b7 Mon Sep 17 00:00:00 2001 From: Guangyao Ma Date: Thu, 1 Jul 2021 10:16:02 +0800 Subject: [PATCH] fix: Ctrl-C move out of LOS_MAGIC_KEY_ENABLE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 由于没有tty,当前的Ctrl-C实现基于uart回调特定函数实现,后续tty实现后 可以重新考虑Ctrl-C设计实现。本次将Ctrl-C移除LOS_MAGIC_KEY_ENABLE,保 证任意情况下可以生效。 Change-Id: I4e1e51b2d92535879bbdbbfa91b0229119d0e90e Signed-off-by: Guangyao Ma --- kernel/common/los_magickey.c | 18 ++++++------------ .../debug/mini_qemu_liteos_a_clang.config | 1 - .../build/config/hispark_aries_release.config | 1 - .../build/config/hispark_taurus_release.config | 1 - .../config/hispark_taurus_release_tee.config | 1 - .../ipcamera_hi3516dv300_liteos_release.config | 1 - ...amera_hi3516dv300_liteos_release_tee.config | 1 - .../ipcamera_hi3518ev300_liteos_release.config | 1 - .../config/qemu_arm_virt_debug_shell.config | 1 - 9 files changed, 6 insertions(+), 20 deletions(-) diff --git a/kernel/common/los_magickey.c b/kernel/common/los_magickey.c index 9368f77f..1db5c88c 100644 --- a/kernel/common/los_magickey.c +++ b/kernel/common/los_magickey.c @@ -66,12 +66,6 @@ STATIC MagicKeyOp g_magicHelpOp = { .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 * ctrl+h/backspace=0x8, @@ -87,7 +81,7 @@ STATIC MagicKeyOp *g_magicOpTable[MAGIC_KEY_NUM] = { &g_magicPanicOp, /* ctrl + p */ &g_magicTaskShowOp, /* ctrl + t */ &g_magicHelpOp, /* ctrl + z */ - &g_magicKillPgrp /* ctrl + c */ + NULL }; STATIC VOID OsMagicHelp(VOID) @@ -129,7 +123,11 @@ INT32 CheckMagicKey(CHAR key) #ifdef LOSCFG_ENABLE_MAGICKEY INT32 i; 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; if (magicKeySwitch != 0) { PRINTK("Magic key on\n"); @@ -137,11 +135,7 @@ INT32 CheckMagicKey(CHAR key) PRINTK("Magic key off\n"); } return 1; - } else if (key == 0x03) { /* ctrl + c */ - KillPgrp(); - return 0; } - if (magicKeySwitch != 0) { for (i = 0; i < MAGIC_KEY_NUM; i++) { if (g_magicOpTable[i] != NULL && key == g_magicOpTable[i]->magicKey) { diff --git a/tools/build/config/debug/mini_qemu_liteos_a_clang.config b/tools/build/config/debug/mini_qemu_liteos_a_clang.config index 6670fbb1..f5ab9aa4 100644 --- a/tools/build/config/debug/mini_qemu_liteos_a_clang.config +++ b/tools/build/config/debug/mini_qemu_liteos_a_clang.config @@ -10,6 +10,5 @@ LOSCFG_BOARD_CONFIG_PATH="device/qemu/arm_virt/liteos_a/config/board" # LOSCFG_FS_VFS is not set # LOSCFG_NET_LWIP_SACK is not set # LOSCFG_PLATFORM_ADAPT is not set -# LOSCFG_ENABLE_MAGICKEY is not set # LOSCFG_DRIVERS is not set # LOSCFG_SECURITY is not set diff --git a/tools/build/config/hispark_aries_release.config b/tools/build/config/hispark_aries_release.config index 2bdc4dea..36fba84b 100644 --- a/tools/build/config/hispark_aries_release.config +++ b/tools/build/config/hispark_aries_release.config @@ -8,7 +8,6 @@ LOSCFG_FS_VFS_BLOCK_DEVICE=y LOSCFG_FS_FAT_CACHE_SYNC_THREAD=y LOSCFG_FS_FAT_VIRTUAL_PARTITION=y LOSCFG_ENABLE_OOM_LOOP_TASK=y -# LOSCFG_ENABLE_MAGICKEY is not set LOSCFG_DRIVERS_USB_HOST_XHCI=y LOSCFG_DRIVERS_USB_ETHERNET=y LOSCFG_DRIVERS_USB_WIRELESS=y diff --git a/tools/build/config/hispark_taurus_release.config b/tools/build/config/hispark_taurus_release.config index 83d0d4f0..8b510ac2 100644 --- a/tools/build/config/hispark_taurus_release.config +++ b/tools/build/config/hispark_taurus_release.config @@ -9,7 +9,6 @@ LOSCFG_KERNEL_VDSO=y LOSCFG_FS_VFS_BLOCK_DEVICE=y LOSCFG_FS_FAT_VIRTUAL_PARTITION=y LOSCFG_ENABLE_OOM_LOOP_TASK=y -# LOSCFG_ENABLE_MAGICKEY is not set LOSCFG_DRIVERS_USB_HOST_XHCI=y LOSCFG_DRIVERS_USB_ETHERNET=y LOSCFG_DRIVERS_USB_WIRELESS=y diff --git a/tools/build/config/hispark_taurus_release_tee.config b/tools/build/config/hispark_taurus_release_tee.config index 46a2d492..f5b6eba8 100644 --- a/tools/build/config/hispark_taurus_release_tee.config +++ b/tools/build/config/hispark_taurus_release_tee.config @@ -10,7 +10,6 @@ LOSCFG_KERNEL_VDSO=y LOSCFG_FS_VFS_BLOCK_DEVICE=y LOSCFG_FS_FAT_VIRTUAL_PARTITION=y LOSCFG_ENABLE_OOM_LOOP_TASK=y -# LOSCFG_ENABLE_MAGICKEY is not set LOSCFG_DRIVERS_USB_HOST_XHCI=y LOSCFG_DRIVERS_USB_ETHERNET=y LOSCFG_DRIVERS_USB_WIRELESS=y diff --git a/tools/build/config/ipcamera_hi3516dv300_liteos_release.config b/tools/build/config/ipcamera_hi3516dv300_liteos_release.config index c62d4cb8..f0c14d2b 100644 --- a/tools/build/config/ipcamera_hi3516dv300_liteos_release.config +++ b/tools/build/config/ipcamera_hi3516dv300_liteos_release.config @@ -9,7 +9,6 @@ LOSCFG_FS_VFS_BLOCK_DEVICE=y LOSCFG_FS_FAT_VIRTUAL_PARTITION=y LOSCFG_NET_LWIP_SACK_2_0=y LOSCFG_ENABLE_OOM_LOOP_TASK=y -# LOSCFG_ENABLE_MAGICKEY is not set LOSCFG_DRIVERS_USB_HOST_XHCI=y LOSCFG_DRIVERS_USB_ETHERNET=y LOSCFG_DRIVERS_USB_WIRELESS=y diff --git a/tools/build/config/ipcamera_hi3516dv300_liteos_release_tee.config b/tools/build/config/ipcamera_hi3516dv300_liteos_release_tee.config index c62d4cb8..f0c14d2b 100644 --- a/tools/build/config/ipcamera_hi3516dv300_liteos_release_tee.config +++ b/tools/build/config/ipcamera_hi3516dv300_liteos_release_tee.config @@ -9,7 +9,6 @@ LOSCFG_FS_VFS_BLOCK_DEVICE=y LOSCFG_FS_FAT_VIRTUAL_PARTITION=y LOSCFG_NET_LWIP_SACK_2_0=y LOSCFG_ENABLE_OOM_LOOP_TASK=y -# LOSCFG_ENABLE_MAGICKEY is not set LOSCFG_DRIVERS_USB_HOST_XHCI=y LOSCFG_DRIVERS_USB_ETHERNET=y LOSCFG_DRIVERS_USB_WIRELESS=y diff --git a/tools/build/config/ipcamera_hi3518ev300_liteos_release.config b/tools/build/config/ipcamera_hi3518ev300_liteos_release.config index f323e791..805febf4 100644 --- a/tools/build/config/ipcamera_hi3518ev300_liteos_release.config +++ b/tools/build/config/ipcamera_hi3518ev300_liteos_release.config @@ -8,7 +8,6 @@ LOSCFG_FS_FAT_CACHE_SYNC_THREAD=y LOSCFG_FS_FAT_VIRTUAL_PARTITION=y LOSCFG_NET_LWIP_SACK_2_0=y LOSCFG_ENABLE_OOM_LOOP_TASK=y -# LOSCFG_ENABLE_MAGICKEY is not set LOSCFG_DRIVERS_USB_HOST_XHCI=y LOSCFG_DRIVERS_USB_ETHERNET=y LOSCFG_DRIVERS_USB_WIRELESS=y diff --git a/tools/build/config/qemu_arm_virt_debug_shell.config b/tools/build/config/qemu_arm_virt_debug_shell.config index cef8fbb3..0efa46b2 100644 --- a/tools/build/config/qemu_arm_virt_debug_shell.config +++ b/tools/build/config/qemu_arm_virt_debug_shell.config @@ -6,7 +6,6 @@ LOSCFG_FS_FAT=y LOSCFG_FS_FAT_DISK=y LOSCFG_FS_FAT_VIRTUAL_PARTITION=y LOSCFG_FS_VFS_BLOCK_DEVICE=y -LOSCFG_ENABLE_MAGICKEY=y LOSCFG_DEBUG_VERSION=y # LOSCFG_SHELL_LK is not set LOSCFG_USER_INIT_DEBUG=y