1 /* 2 * Copyright (c) 2024 Meta Platforms 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #ifndef ZEPHYR_SUBSYS_SHELL_MODULES_KERNEL_SERVICE_KERNEL_SHELL_H_ 8 #define ZEPHYR_SUBSYS_SHELL_MODULES_KERNEL_SERVICE_KERNEL_SHELL_H_ 9 10 #include <zephyr/shell/shell.h> 11 12 /* Add command to the set of kernel subcommands, see `SHELL_SUBCMD_ADD` */ 13 #define KERNEL_CMD_ARG_ADD(_syntax, _subcmd, _help, _handler, _mand, _opt) \ 14 SHELL_SUBCMD_ADD((kernel), _syntax, _subcmd, _help, _handler, _mand, _opt); 15 16 #define KERNEL_CMD_ADD(_syntax, _subcmd, _help, _handler) \ 17 KERNEL_CMD_ARG_ADD(_syntax, _subcmd, _help, _handler, 0, 0); 18 19 /* Add command to the set of `kernel thread` subcommands */ 20 #define KERNEL_THREAD_CMD_ARG_ADD(_syntax, _subcmd, _help, _handler, _mand, _opt) \ 21 SHELL_SUBCMD_ADD((thread), _syntax, _subcmd, _help, _handler, _mand, _opt); 22 23 #define KERNEL_THREAD_CMD_ADD(_syntax, _subcmd, _help, _handler) \ 24 KERNEL_THREAD_CMD_ARG_ADD(_syntax, _subcmd, _help, _handler, 0, 0); 25 26 /* Internal function to check if a thread pointer is valid */ 27 bool z_thread_is_valid(const struct k_thread *thread); 28 29 #endif /* ZEPHYR_SUBSYS_SHELL_MODULES_KERNEL_SERVICE_KERNEL_SHELL_H_ */ 30