Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(640)

Side by Side Diff: lib/debugcommands/debugcommands.c

Issue 1348403002: Consistently use the STATIC_COMMAND macro every time we define a console command. (Closed) Base URL: https://github.com/travisg/lk.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/cksum/debug.c ('k') | lib/ffs/cmd.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2008-2012 Travis Geiselbrecht 2 * Copyright (c) 2008-2012 Travis Geiselbrecht
3 * 3 *
4 * Permission is hereby granted, free of charge, to any person obtaining 4 * Permission is hereby granted, free of charge, to any person obtaining
5 * a copy of this software and associated documentation files 5 * a copy of this software and associated documentation files
6 * (the "Software"), to deal in the Software without restriction, 6 * (the "Software"), to deal in the Software without restriction,
7 * including without limitation the rights to use, copy, modify, merge, 7 * including without limitation the rights to use, copy, modify, merge,
8 * publish, distribute, sublicense, and/or sell copies of the Software, 8 * publish, distribute, sublicense, and/or sell copies of the Software,
9 * and to permit persons to whom the Software is furnished to do so, 9 * and to permit persons to whom the Software is furnished to do so,
10 * subject to the following conditions: 10 * subject to the following conditions:
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 static int cmd_display_mem(int argc, const cmd_args *argv); 43 static int cmd_display_mem(int argc, const cmd_args *argv);
44 static int cmd_modify_mem(int argc, const cmd_args *argv); 44 static int cmd_modify_mem(int argc, const cmd_args *argv);
45 static int cmd_fill_mem(int argc, const cmd_args *argv); 45 static int cmd_fill_mem(int argc, const cmd_args *argv);
46 static int cmd_reset(int argc, const cmd_args *argv); 46 static int cmd_reset(int argc, const cmd_args *argv);
47 static int cmd_memtest(int argc, const cmd_args *argv); 47 static int cmd_memtest(int argc, const cmd_args *argv);
48 static int cmd_copy_mem(int argc, const cmd_args *argv); 48 static int cmd_copy_mem(int argc, const cmd_args *argv);
49 static int cmd_chain(int argc, const cmd_args *argv); 49 static int cmd_chain(int argc, const cmd_args *argv);
50 50
51 STATIC_COMMAND_START 51 STATIC_COMMAND_START
52 #if LK_DEBUGLEVEL > 0 52 #if LK_DEBUGLEVEL > 0
53 » { "dw", "display memory in words", &cmd_display_mem }, 53 » STATIC_COMMAND("dw", "display memory in words", &cmd_display_mem)
54 » { "dh", "display memory in halfwords", &cmd_display_mem }, 54 » STATIC_COMMAND("dh", "display memory in halfwords", &cmd_display_mem)
55 » { "db", "display memory in bytes", &cmd_display_mem }, 55 » STATIC_COMMAND("db", "display memory in bytes", &cmd_display_mem)
56 » { "mw", "modify word of memory", &cmd_modify_mem }, 56 » STATIC_COMMAND("mw", "modify word of memory", &cmd_modify_mem)
57 » { "mh", "modify halfword of memory", &cmd_modify_mem }, 57 » STATIC_COMMAND("mh", "modify halfword of memory", &cmd_modify_mem)
58 » { "mb", "modify byte of memory", &cmd_modify_mem }, 58 » STATIC_COMMAND("mb", "modify byte of memory", &cmd_modify_mem)
59 » { "fw", "fill range of memory by word", &cmd_fill_mem }, 59 » STATIC_COMMAND("fw", "fill range of memory by word", &cmd_fill_mem)
60 » { "fh", "fill range of memory by halfword", &cmd_fill_mem }, 60 » STATIC_COMMAND("fh", "fill range of memory by halfword", &cmd_fill_mem)
61 » { "fb", "fill range of memory by byte", &cmd_fill_mem }, 61 » STATIC_COMMAND("fb", "fill range of memory by byte", &cmd_fill_mem)
62 » { "mc", "copy a range of memory", &cmd_copy_mem }, 62 » STATIC_COMMAND("mc", "copy a range of memory", &cmd_copy_mem)
63 #endif 63 #endif
64 #if LK_DEBUGLEVEL > 1 64 #if LK_DEBUGLEVEL > 1
65 » { "mtest", "simple memory test", &cmd_memtest }, 65 » STATIC_COMMAND("mtest", "simple memory test", &cmd_memtest)
66 #endif 66 #endif
67 » { "chain", "chain load another binary", &cmd_chain }, 67 » STATIC_COMMAND("chain", "chain load another binary", &cmd_chain)
68 STATIC_COMMAND_END(mem); 68 STATIC_COMMAND_END(mem);
69 69
70 static int cmd_display_mem(int argc, const cmd_args *argv) 70 static int cmd_display_mem(int argc, const cmd_args *argv)
71 { 71 {
72 /* save the last address and len so we can continue where we left off */ 72 /* save the last address and len so we can continue where we left off */
73 static unsigned long address; 73 static unsigned long address;
74 static size_t len; 74 static size_t len;
75 75
76 if (argc < 3 && len == 0) { 76 if (argc < 3 && len == 0) {
77 printf("not enough arguments\n"); 77 printf("not enough arguments\n");
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 return -1; 282 return -1;
283 } 283 }
284 284
285 arch_chain_load((void *)argv[1].u, 0, 0, 0, 0); 285 arch_chain_load((void *)argv[1].u, 0, 0, 0, 0);
286 286
287 return 0; 287 return 0;
288 } 288 }
289 289
290 290
291 // vim: set noexpandtab: 291 // vim: set noexpandtab:
OLDNEW
« no previous file with comments | « lib/cksum/debug.c ('k') | lib/ffs/cmd.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698