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.

Change-Id: Ideed0f3a84445bcb4fa6efef40a95f149f81b909
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/5874115
Tested-by: Tristan Honscheid <honscheid@google.com>
Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
Commit-Queue: Tristan Honscheid <honscheid@google.com>
  • Loading branch information
ycsin authored and Chromeos LUCI committed Sep 19, 2024
1 parent ed01468 commit cea1515
Show file tree
Hide file tree
Showing 22 changed files with 944 additions and 725 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 cea1515

Please sign in to comment.