Skip to content

Commit

Permalink
shell: kernel_service: reorg the commands
Browse files Browse the repository at this point in the history
Split the `kernel_service.c` into multiple subcommand files,
each file would register with the main `kernel` cmd based on
the dependencies in Kconfig/CMakeLists.txt.

This greatly reduces the number of precompiler directives.

Signed-off-by: Yong Cong Sin <[email protected]>
Signed-off-by: Yong Cong Sin <[email protected]>
  • Loading branch information
ycsin committed Sep 12, 2024
1 parent 9559996 commit 65e1bc6
Show file tree
Hide file tree
Showing 22 changed files with 944 additions and 720 deletions.
8 changes: 4 additions & 4 deletions subsys/shell/modules/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# SPDX-License-Identifier: Apache-2.0

zephyr_sources_ifdef(
CONFIG_KERNEL_SHELL
kernel_service.c
)
add_subdirectory_ifdef(CONFIG_KERNEL_SHELL
kernel_service
)

zephyr_sources_ifdef(
CONFIG_DEVICE_SHELL
device_service.c
Expand Down
25 changes: 2 additions & 23 deletions subsys/shell/modules/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,6 @@
# Copyright (c) 2016 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

config KERNEL_SHELL
bool "Kernel shell"
default y if !SHELL_MINIMAL
imply INIT_STACKS
imply THREAD_MONITOR
imply THREAD_NAME
imply THREAD_STACK_INFO
help
This shell provides access to basic kernel data like version, uptime
and other useful information.

config KERNEL_SHELL_REBOOT_DELAY
int "Delay between reception of shell reboot command and reboot (ms)"
depends on KERNEL_SHELL
depends on REBOOT
default 0
help
This delay allows time for the shell to successfully echo the reboot
command input before the reboot abruptly terminates it. This can help
external systems that interact with the shell and require the reboot
command's echo to successfully complete to synchronise with the
device.

config DEVICE_SHELL
bool "Device shell"
default y if !SHELL_MINIMAL
Expand All @@ -45,3 +22,5 @@ config DEVMEM_SHELL
select POSIX_C_LIB_EXT
help
This shell command provides read/write access to physical memory.

rsource "kernel_service/Kconfig"
Loading

0 comments on commit 65e1bc6

Please sign in to comment.