summaryrefslogtreecommitdiff
path: root/zephyr/shim/include/zephyr_console_shim.h
diff options
context:
space:
mode:
Diffstat (limited to 'zephyr/shim/include/zephyr_console_shim.h')
-rw-r--r--zephyr/shim/include/zephyr_console_shim.h19
1 files changed, 9 insertions, 10 deletions
diff --git a/zephyr/shim/include/zephyr_console_shim.h b/zephyr/shim/include/zephyr_console_shim.h
index 5880c3f400..42ac3e693b 100644
--- a/zephyr/shim/include/zephyr_console_shim.h
+++ b/zephyr/shim/include/zephyr_console_shim.h
@@ -1,4 +1,4 @@
-/* Copyright 2020 The Chromium OS Authors. All rights reserved.
+/* Copyright 2020 The ChromiumOS Authors
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
@@ -10,7 +10,7 @@
struct zephyr_console_command {
/* Handler for the command. argv[0] will be the command name. */
- int (*handler)(int argc, char **argv);
+ int (*handler)(int argc, const char **argv);
#ifdef CONFIG_SHELL_HELP
/* Description of args */
const char *argdesc;
@@ -20,9 +20,7 @@ struct zephyr_console_command {
};
#ifdef CONFIG_SHELL_HELP
-#define _HELP_ARGS(A, H) \
- .argdesc = A, \
- .help = H,
+#define _HELP_ARGS(A, H) .argdesc = A, .help = H,
#else
#define _HELP_ARGS(A, H)
#endif
@@ -38,17 +36,16 @@ struct zephyr_console_command {
* Return: the return value from the handler.
*/
int zshim_run_ec_console_command(const struct zephyr_console_command *command,
- size_t argc, char **argv);
+ size_t argc, const char **argv);
/* Internal wrappers for DECLARE_CONSOLE_COMMAND_* macros. */
#define _ZEPHYR_SHELL_COMMAND_SHIM_2(NAME, ROUTINE_ID, ARGDESC, HELP, \
WRAPPER_ID, ENTRY_ID) \
static const struct zephyr_console_command ENTRY_ID = { \
- .handler = ROUTINE_ID, \
- _HELP_ARGS(ARGDESC, HELP) \
+ .handler = ROUTINE_ID, _HELP_ARGS(ARGDESC, HELP) \
}; \
static int WRAPPER_ID(const struct shell *shell, size_t argc, \
- char **argv) \
+ const char **argv) \
{ \
return zshim_run_ec_console_command(&ENTRY_ID, argc, argv); \
} \
@@ -79,7 +76,9 @@ int zshim_run_ec_console_command(const struct zephyr_console_command *command,
*
* @s: The pointer to the string.
* @len: The size of the string.
+ *
+ * Return: the number of bytes consumed.
*/
-void console_buf_notify_chars(const char *s, size_t len);
+size_t console_buf_notify_chars(const char *s, size_t len);
#endif /* __CROS_EC_ZEPHYR_CONSOLE_SHIM_H */