X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=common%2Fcmd_bedbug.c;h=87b108f84254b8ab7e5ab939dda671d720d8186e;hb=e3150460a4fd3a7126bcbf1e225610e0d494c8fe;hp=e6277c940860b8b301a3bd8cc683e2737b73442b;hpb=cb5473205206c7f14cbb1e747f28ec75b48826e2;p=karo-tx-uboot.git
diff --git a/common/cmd_bedbug.c b/common/cmd_bedbug.c
index e6277c9408..87b108f842 100644
--- a/common/cmd_bedbug.c
+++ b/common/cmd_bedbug.c
@@ -15,7 +15,6 @@ DECLARE_GLOBAL_DATA_PTR;
extern void show_regs __P ((struct pt_regs *));
extern int run_command __P ((const char *, int));
-extern char console_buffer[];
ulong dis_last_addr = 0; /* Last address disassembled */
ulong dis_last_len = 20; /* Default disassembler length */
@@ -73,7 +72,7 @@ void bedbug_init (void)
* Entry point from the interpreter to the disassembler. Repeated calls
* will resume from the last disassembled address.
* ====================================================================== */
-int do_bedbug_dis (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_bedbug_dis (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
{
ulong addr; /* Address to start disassembly from */
ulong len; /* # of instructions to disassemble */
@@ -84,10 +83,8 @@ int do_bedbug_dis (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
addr = dis_last_addr;
len = dis_last_len;
- if (argc < 2) {
- printf ("Usage:\n%s\n", cmdtp->usage);
- return 1;
- }
+ if (argc < 2)
+ return cmd_usage(cmdtp);
if ((flag & CMD_FLAG_REPEAT) == 0) {
/* New command */
@@ -107,15 +104,15 @@ int do_bedbug_dis (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
} /* do_bedbug_dis */
U_BOOT_CMD (ds, 3, 1, do_bedbug_dis,
- "ds - disassemble memory\n",
- "ds
[# instructions]\n");
+ "disassemble memory",
+ "ds [# instructions]");
/* ======================================================================
* Entry point from the interpreter to the assembler. Assembles
* instructions in consecutive memory locations until a '.' (period) is
* entered on a line by itself.
* ====================================================================== */
-int do_bedbug_asm (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_bedbug_asm (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
{
long mem_addr; /* Address to assemble into */
unsigned long instr; /* Machine code for text */
@@ -125,10 +122,8 @@ int do_bedbug_asm (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
/* -------------------------------------------------- */
int rcode = 0;
- if (argc < 2) {
- printf ("Usage:\n%s\n", cmdtp->usage);
- return 1;
- }
+ if (argc < 2)
+ return cmd_usage(cmdtp);
printf ("\nEnter '.' when done\n");
mem_addr = simple_strtoul (argv[1], NULL, 16);
@@ -160,14 +155,14 @@ int do_bedbug_asm (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
} /* do_bedbug_asm */
U_BOOT_CMD (as, 2, 0, do_bedbug_asm,
- "as - assemble memory\n", "as \n");
+ "assemble memory", "as ");
/* ======================================================================
* Used to set a break point from the interpreter. Simply calls into the
* CPU-specific break point set routine.
* ====================================================================== */
-int do_bedbug_break (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_bedbug_break (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
{
/* -------------------------------------------------- */
if (bug_ctx.do_break)
@@ -177,11 +172,11 @@ int do_bedbug_break (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
} /* do_bedbug_break */
U_BOOT_CMD (break, 3, 0, do_bedbug_break,
- "break - set or clear a breakpoint\n",
+ "set or clear a breakpoint",
" - Set or clear a breakpoint\n"
"break - Break at an address\n"
"break off - Disable breakpoint.\n"
- "break show - List breakpoints.\n");
+ "break show - List breakpoints.");
/* ======================================================================
* Called from the debug interrupt routine. Simply calls the CPU-specific
@@ -263,7 +258,7 @@ void bedbug_main_loop (unsigned long addr, struct pt_regs *regs)
* stopped flag in the context so that the breakpoint routine will
* return.
* ====================================================================== */
-int do_bedbug_continue (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_bedbug_continue (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
{
/* -------------------------------------------------- */
@@ -277,8 +272,8 @@ int do_bedbug_continue (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
} /* do_bedbug_continue */
U_BOOT_CMD (continue, 1, 0, do_bedbug_continue,
- "continue- continue from a breakpoint\n",
- " - continue from a breakpoint.\n");
+ "continue from a breakpoint",
+ "");
/* ======================================================================
* Interpreter command to continue to the next instruction, stepping into
@@ -286,7 +281,7 @@ U_BOOT_CMD (continue, 1, 0, do_bedbug_continue,
* the address passes control to the CPU-specific set breakpoint routine
* for the current breakpoint number.
* ====================================================================== */
-int do_bedbug_step (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_bedbug_step (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
{
unsigned long addr; /* Address to stop at */
@@ -308,8 +303,8 @@ int do_bedbug_step (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
} /* do_bedbug_step */
U_BOOT_CMD (step, 1, 1, do_bedbug_step,
- "step - single step execution.\n",
- " - single step execution.\n");
+ "single step execution.",
+ "");
/* ======================================================================
* Interpreter command to continue to the next instruction, stepping over
@@ -317,7 +312,7 @@ U_BOOT_CMD (step, 1, 1, do_bedbug_step,
* the address passes control to the CPU-specific set breakpoint routine
* for the current breakpoint number.
* ====================================================================== */
-int do_bedbug_next (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_bedbug_next (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
{
unsigned long addr; /* Address to stop at */
@@ -339,14 +334,14 @@ int do_bedbug_next (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
} /* do_bedbug_next */
U_BOOT_CMD (next, 1, 1, do_bedbug_next,
- "next - single step execution, stepping over subroutines.\n",
- " - single step execution, stepping over subroutines.\n");
+ "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.
* ====================================================================== */
-int do_bedbug_stack (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_bedbug_stack (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
{
unsigned long sp; /* Stack pointer */
unsigned long func; /* LR from stack */
@@ -384,14 +379,14 @@ int do_bedbug_stack (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
} /* do_bedbug_stack */
U_BOOT_CMD (where, 1, 1, do_bedbug_stack,
- "where - Print the running stack.\n",
- " - Print the running stack.\n");
+ "Print the running stack.",
+ "");
/* ======================================================================
* Interpreter command to dump the registers. Calls the CPU-specific
* show registers routine.
* ====================================================================== */
-int do_bedbug_rdump (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_bedbug_rdump (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
{
/* -------------------------------------------------- */
@@ -405,7 +400,7 @@ int do_bedbug_rdump (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
} /* do_bedbug_rdump */
U_BOOT_CMD (rdump, 1, 1, do_bedbug_rdump,
- "rdump - Show registers.\n", " - Show registers.\n");
+ "Show registers.", "");
/* ====================================================================== */