Source code for the Trusted Boot Module.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tbm-mcu/include/shell.h

32 lines
851 B

#pragma once
struct console;
struct cmd {
const char *cmd;
const char *desc;
void (* exec)(struct console *con, size_t argc, const char **argv);
};
struct shell {
char line[128];
struct cmd *cmds;
const char *prompt;
struct console *con;
};
size_t count_args(const char *line);
char **parse_args(const char *line, size_t *argc);
void cmd_exec(struct cmd *cmds, struct console *con, size_t argc,
const char **argv);
void cmd_parse(struct cmd *cmds, struct console *con, const char *line);
int shell_init(struct shell *shell, struct cmd *cmds,
struct console *con, const char *prompt);
int shell_parse(struct shell *shell);
void do_flash_cmd(struct console *con, size_t argc, const char **argv);
void do_ftl_cmd(struct console *con, size_t argc, const char **argv);
void do_mufs_cmd(struct console *con, size_t argc, const char **argv);