summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2014-04-10 20:01:27 -0600
committerTom Rini <trini@ti.com>2014-05-29 17:45:31 -0400
commite1bf824dfd6881f6f633238c275bfa1e5d83c433 (patch)
tree4d43bd0b4d0fdae2f737c2ad9670005300dea87f /common
parent6493ccc7cf2357081267effffa7d345e50d68d00 (diff)
downloadblackbird-obmc-uboot-e1bf824dfd6881f6f633238c275bfa1e5d83c433.tar.gz
blackbird-obmc-uboot-e1bf824dfd6881f6f633238c275bfa1e5d83c433.zip
Add cli_ prefix to readline functions
This makes it clear where the code resides. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/cli_hush.c4
-rw-r--r--common/cli_readline.c7
-rw-r--r--common/cli_simple.c6
-rw-r--r--common/cmd_bedbug.c28
-rw-r--r--common/cmd_dcr.c2
-rw-r--r--common/cmd_i2c.c2
-rw-r--r--common/cmd_mem.c2
-rw-r--r--common/cmd_nvedit.c4
-rw-r--r--common/cmd_pci.c2
-rw-r--r--common/menu.c5
10 files changed, 32 insertions, 30 deletions
diff --git a/common/cli_hush.c b/common/cli_hush.c
index 91e495690c..a612bfbef5 100644
--- a/common/cli_hush.c
+++ b/common/cli_hush.c
@@ -1007,9 +1007,9 @@ static void get_user_input(struct in_str *i)
#endif
i->__promptme = 1;
if (i->promptmode == 1) {
- n = readline(CONFIG_SYS_PROMPT);
+ n = cli_readline(CONFIG_SYS_PROMPT);
} else {
- n = readline(CONFIG_SYS_PROMPT_HUSH_PS2);
+ n = cli_readline(CONFIG_SYS_PROMPT_HUSH_PS2);
}
#ifdef CONFIG_BOOT_RETRY_TIME
if (n == -2) {
diff --git a/common/cli_readline.c b/common/cli_readline.c
index cea0b7c81b..df446b8c83 100644
--- a/common/cli_readline.c
+++ b/common/cli_readline.c
@@ -484,7 +484,7 @@ static int cread_line(const char *const prompt, char *buf, unsigned int *len,
/****************************************************************************/
-int readline(const char *const prompt)
+int cli_readline(const char *const prompt)
{
/*
* If console_buffer isn't 0-length the user will be prompted to modify
@@ -492,11 +492,12 @@ int readline(const char *const prompt)
*/
console_buffer[0] = '\0';
- return readline_into_buffer(prompt, console_buffer, 0);
+ return cli_readline_into_buffer(prompt, console_buffer, 0);
}
-int readline_into_buffer(const char *const prompt, char *buffer, int timeout)
+int cli_readline_into_buffer(const char *const prompt, char *buffer,
+ int timeout)
{
char *p = buffer;
#ifdef CONFIG_CMDLINE_EDITING
diff --git a/common/cli_simple.c b/common/cli_simple.c
index 0610615ea5..3039cfcca1 100644
--- a/common/cli_simple.c
+++ b/common/cli_simple.c
@@ -19,7 +19,7 @@
debug_cond(DEBUG_PARSER, fmt, ##args)
-int parse_line(char *line, char *argv[])
+int cli_simple_parse_line(char *line, char *argv[])
{
int nargs = 0;
@@ -238,7 +238,7 @@ int cli_simple_run_command(const char *cmd, int flag)
process_macros(token, finaltoken);
/* Extract arguments */
- argc = parse_line(finaltoken, argv);
+ argc = cli_simple_parse_line(finaltoken, argv);
if (argc == 0) {
rc = -1; /* no command at all */
continue;
@@ -272,7 +272,7 @@ void cli_loop(void)
reset_cmd_timeout();
}
#endif
- len = readline(CONFIG_SYS_PROMPT);
+ len = cli_readline(CONFIG_SYS_PROMPT);
flag = 0; /* assume no special flags for now */
if (len > 0)
diff --git a/common/cmd_bedbug.c b/common/cmd_bedbug.c
index f1a70ef202..bdcf712d11 100644
--- a/common/cmd_bedbug.c
+++ b/common/cmd_bedbug.c
@@ -20,7 +20,7 @@ extern int run_command __P ((const char *, int));
ulong dis_last_addr = 0; /* Last address disassembled */
ulong dis_last_len = 20; /* Default disassembler length */
CPU_DEBUG_CTX bug_ctx; /* Bedbug context structure */
-
+
/* ======================================================================
* U-Boot's puts function does not append a newline, so the bedbug stuff
@@ -34,7 +34,7 @@ int bedbug_puts (const char *str)
printf ("%s\r\n", str);
return 0;
} /* bedbug_puts */
-
+
/* ======================================================================
@@ -66,7 +66,7 @@ void bedbug_init (void)
return;
} /* bedbug_init */
-
+
/* ======================================================================
@@ -107,7 +107,7 @@ int do_bedbug_dis (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
U_BOOT_CMD (ds, 3, 1, do_bedbug_dis,
"disassemble memory",
"ds <address> [# instructions]");
-
+
/* ======================================================================
* Entry point from the interpreter to the assembler. Assembles
* instructions in consecutive memory locations until a '.' (period) is
@@ -135,7 +135,7 @@ int do_bedbug_asm (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
F_RADHEX);
sprintf (prompt, "%08lx: ", mem_addr);
- readline (prompt);
+ cli_readline(prompt);
if (console_buffer[0] && strcmp (console_buffer, ".")) {
if ((instr =
@@ -157,7 +157,7 @@ int do_bedbug_asm (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
U_BOOT_CMD (as, 2, 0, do_bedbug_asm,
"assemble memory", "as <address>");
-
+
/* ======================================================================
* Used to set a break point from the interpreter. Simply calls into the
* CPU-specific break point set routine.
@@ -178,7 +178,7 @@ U_BOOT_CMD (break, 3, 0, do_bedbug_break,
"break <address> - Break at an address\n"
"break off <bp#> - Disable breakpoint.\n"
"break show - List breakpoints.");
-
+
/* ======================================================================
* Called from the debug interrupt routine. Simply calls the CPU-specific
* breakpoint handling routine.
@@ -193,7 +193,7 @@ void do_bedbug_breakpoint (struct pt_regs *regs)
return;
} /* do_bedbug_breakpoint */
-
+
/* ======================================================================
@@ -226,7 +226,7 @@ void bedbug_main_loop (unsigned long addr, struct pt_regs *regs)
/* A miniature main loop */
while (bug_ctx.stopped) {
- len = readline (prompt_str);
+ len = cli_readline(prompt_str);
flag = 0; /* assume no special flags for now */
@@ -251,7 +251,7 @@ void bedbug_main_loop (unsigned long addr, struct pt_regs *regs)
return;
} /* bedbug_main_loop */
-
+
/* ======================================================================
@@ -275,7 +275,7 @@ int do_bedbug_continue (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv
U_BOOT_CMD (continue, 1, 0, do_bedbug_continue,
"continue from a breakpoint",
"");
-
+
/* ======================================================================
* Interpreter command to continue to the next instruction, stepping into
* subroutines. Works by calling the find_next_addr() routine to compute
@@ -306,7 +306,7 @@ int do_bedbug_step (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
U_BOOT_CMD (step, 1, 1, do_bedbug_step,
"single step execution.",
"");
-
+
/* ======================================================================
* Interpreter command to continue to the next instruction, stepping over
* subroutines. Works by calling the find_next_addr() routine to compute
@@ -337,7 +337,7 @@ int do_bedbug_next (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
U_BOOT_CMD (next, 1, 1, do_bedbug_next,
"single step execution, stepping over subroutines.",
"");
-
+
/* ======================================================================
* Interpreter command to print the current stack. This assumes an EABI
* architecture, so it starts with GPR R1 and works back up the stack.
@@ -382,7 +382,7 @@ int do_bedbug_stack (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
U_BOOT_CMD (where, 1, 1, do_bedbug_stack,
"Print the running stack.",
"");
-
+
/* ======================================================================
* Interpreter command to dump the registers. Calls the CPU-specific
* show registers routine.
diff --git a/common/cmd_dcr.c b/common/cmd_dcr.c
index c5bcb8b89d..4fddd804ab 100644
--- a/common/cmd_dcr.c
+++ b/common/cmd_dcr.c
@@ -63,7 +63,7 @@ int do_setdcr (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
do {
value = get_dcr (dcrn);
printf ("%04x: %08lx", dcrn, value);
- nbytes = readline (" ? ");
+ nbytes = cli_readline(" ? ");
if (nbytes == 0) {
/*
* <CR> pressed as only input, don't modify current
diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c
index 8ccde68110..7158b5a2db 100644
--- a/common/cmd_i2c.c
+++ b/common/cmd_i2c.c
@@ -613,7 +613,7 @@ mod_i2c_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char * const arg
printf(" %08lx", data);
}
- nbytes = readline (" ? ");
+ nbytes = cli_readline(" ? ");
if (nbytes == 0) {
/*
* <CR> pressed as only input, don't modify current
diff --git a/common/cmd_mem.c b/common/cmd_mem.c
index 4b8738b4f0..15a4b84efd 100644
--- a/common/cmd_mem.c
+++ b/common/cmd_mem.c
@@ -1150,7 +1150,7 @@ mod_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char * const argv[])
else
printf(" %02x", *((u8 *)ptr));
- nbytes = readline (" ? ");
+ nbytes = cli_readline(" ? ");
if (nbytes == 0 || (nbytes == 1 && console_buffer[0] == '-')) {
/* <CR> pressed as only input, don't modify current
* location and move to next. "-" pressed will go back.
diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index a1e98c6d95..e6c33956e7 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -409,7 +409,7 @@ int do_env_ask(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return 1;
/* prompt for input */
- len = readline(message);
+ len = cli_readline(message);
if (size < len)
console_buffer[size] = '\0';
@@ -592,7 +592,7 @@ static int do_env_edit(cmd_tbl_t *cmdtp, int flag, int argc,
else
buffer[0] = '\0';
- if (readline_into_buffer("edit: ", buffer, 0) < 0)
+ if (cli_readline_into_buffer("edit: ", buffer, 0) < 0)
return 1;
return setenv(argv[1], buffer);
diff --git a/common/cmd_pci.c b/common/cmd_pci.c
index ddda207e58..1ed55cedb1 100644
--- a/common/cmd_pci.c
+++ b/common/cmd_pci.c
@@ -346,7 +346,7 @@ pci_cfg_modify (pci_dev_t bdf, ulong addr, ulong size, ulong value, int incrflag
printf(" %02x", val1);
}
- nbytes = readline (" ? ");
+ nbytes = cli_readline(" ? ");
if (nbytes == 0 || (nbytes == 1 && console_buffer[0] == '-')) {
/* <CR> pressed as only input, don't modify current
* location and move to next. "-" pressed will go back.
diff --git a/common/menu.c b/common/menu.c
index 88d4697254..94afeb2900 100644
--- a/common/menu.c
+++ b/common/menu.c
@@ -197,8 +197,9 @@ static inline int menu_interactive_choice(struct menu *m, void **choice)
menu_display(m);
if (!m->item_choice) {
- readret = readline_into_buffer("Enter choice: ", cbuf,
- m->timeout / 10);
+ readret = cli_readline_into_buffer("Enter choice: ",
+ cbuf,
+ m->timeout / 10);
if (readret >= 0) {
choice_item = menu_item_by_key(m, cbuf);
OpenPOWER on IntegriCloud