summaryrefslogtreecommitdiffstats
path: root/common/cmd_cache.c
Commit message (Collapse)AuthorAgeFilesLines
* common: commands: make commands staticJeroen Hofstee2014-07-181-2/+2
| | | | | | | Since most commands are not public, make them static. This prevents warnings that no common prototype is available. Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
* Add GPL-2.0+ SPDX-License-Identifier to source filesWolfgang Denk2013-07-241-17/+1
| | | | | | Signed-off-by: Wolfgang Denk <wd@denx.de> [trini: Fixup common/cmd_io.c] Signed-off-by: Tom Rini <trini@ti.com>
* Cleanup cache command printsJoe Hershberger2012-10-031-1/+1
| | | | | | Only print when queried, not every time the setting is changed. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
* Fix checkpatch.pl complaints in cmd_cache.cJoe Hershberger2012-10-031-21/+26
| | | | | | Old code that is not compliant. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
* cmd_cache: use cache/invalidate functions available in common.hStefan Kristiansson2012-03-061-8/+8
| | | | | | | | | | flush_dcache()/flush_icache() aren't defined in common.h, flush_dcache_all()/invalidate_icache_all() however are. Let the icache and dcache commands use those instead. Signed-off-by: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi> Acked-by: Mike Frysinger <vapier@gentoo.org>
* Convert cmd_usage() calls in common to use a return valueSimon Glass2012-03-061-2/+2
| | | | | | | | | Change all files in common/ to use CMD_RET_USAGE instead of calling cmd_usage() directly. I'm not completely sure about this patch since the code since impact is small (100 byte or so on ARM) and it might need splitting into smaller patches. But for now here it is. Signed-off-by: Simon Glass <sjg@chromium.org>
* command/cmd_cache.c: Add optional flush argumentsMatthew McClintock2011-07-261-9/+28
| | | | | | | | | It might be desirable to have the ability to flush icache/dcache within u-boot, this patch gives each arch the ability to provide a flush_dcache/flush_icache function to let u-boot flush caches from the prompt Signed-off-by: Matthew McClintock <msm@freescale.com>
* cmd_usage(): simplify return code handlingWolfgang Denk2010-07-241-12/+2
| | | | | | | | | | | | | | | | Lots of code use this construct: cmd_usage(cmdtp); return 1; Change cmd_usage() let it return 1 - then we can replace all these ocurrances by return cmd_usage(cmdtp); This fixes a few places with incorrect return code handling, too. Signed-off-by: Wolfgang Denk <wd@denx.de>
* Make sure that argv[] argument pointers are not modified.Wolfgang Denk2010-07-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The hush shell dynamically allocates (and re-allocates) memory for the argument strings in the "char *argv[]" argument vector passed to commands. Any code that modifies these pointers will cause serious corruption of the malloc data structures and crash U-Boot, so make sure the compiler can check that no such modifications are being done by changing the code into "char * const argv[]". This modification is the result of debugging a strange crash caused after adding a new command, which used the following argument processing code which has been working perfectly fine in all Unix systems since version 6 - but not so in U-Boot: int main (int argc, char **argv) { while (--argc > 0 && **++argv == '-') { /* ====> */ while (*++*argv) { switch (**argv) { case 'd': debug++; break; ... default: usage (); } } } ... } The line marked "====>" will corrupt the malloc data structures and usually cause U-Boot to crash when the next command gets executed by the shell. With the modification, the compiler will prevent this with an error: increment of read-only location '*argv' N.B.: The code above can be trivially rewritten like this: while (--argc > 0 && **++argv == '-') { char *arg = *argv; while (*++arg) { switch (*arg) { ... Signed-off-by: Wolfgang Denk <wd@denx.de> Acked-by: Mike Frysinger <vapier@gentoo.org>
* Remove superfluous preprocessor tests from some cmd_*.c files.Robert P. J. Day2009-12-021-4/+0
| | | | | | | | | | A small number of common/cmd_*.c files contain preprocessor tests that are apparently superfluous since those same tests are used in the Makefile to control the compilation of those files. Those tests are clearly redundant as long as they surround the entirety of the source in those files. Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
* General help message cleanupWolfgang Denk2009-06-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many of the help messages were not really helpful; for example, many commands that take no arguments would not print a correct synopsis line, but "No additional help available." which is not exactly wrong, but not helpful either. Commit ``Make "usage" messages more helpful.'' changed this partially. But it also became clear that lots of "Usage" and "Help" messages (fields "usage" and "help" in struct cmd_tbl_s respective) were actually redundant. This patch cleans this up - for example: Before: => help dtt dtt - Digital Thermometer and Thermostat Usage: dtt - Read temperature from digital thermometer and thermostat. After: => help dtt dtt - Read temperature from Digital Thermometer and Thermostat Usage: dtt Signed-off-by: Wolfgang Denk <wd@denx.de>
* Command usage cleanupPeter Tyser2009-01-281-2/+2
| | | | | | | | Remove command name from all command "usage" fields and update common/command.c to display "name - usage" instead of just "usage". Also remove newlines from command usage fields. Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
* Standardize command usage messages with cmd_usage()Peter Tyser2009-01-281-4/+4
| | | | Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
* common/: Remove lingering references to CFG_CMD_* symbols.Jon Loeliger2007-07-101-1/+1
| | | | | | | | Fixed some broken instances of "#ifdef CMD_CFG_IDE" too. Those always evaluated TRUE, and thus were always compiled even when IDE really wasn't defined/wanted. Signed-off-by: Jon Loeliger <jdl@freescale.com>
* common/cmd_[af]*: Remove obsolete references to CONFIG_COMMANDS.Jon Loeliger2007-07-081-1/+1
| | | | Signed-off-by: Jon Loeliger <jdl@freescale.com>
* common/cmd_[a-f]* : Augment CONFIG_COMMANDS tests with defined(CONFIG_CMD_*).Jon Loeliger2007-07-041-1/+1
| | | | | | | | | | | | | | This is a compatibility step that allows both the older form and the new form to co-exist for a while until the older can be removed entirely. All transformations are of the form: Before: #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) After: #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) || defined(CONFIG_CMD_AUTOSCRIPT) Signed-off-by: Jon Loeliger <jdl@freescale.com>
* Patch by Kenneth Johansson, 30 Jun 2003:wdenk2003-07-011-4/+4
| | | | get rid of MK_CMD_ENTRY macro; update doc/README.command
* * Code cleanup:wdenk2003-06-271-1/+15
| | | | | | | | | - remove trailing white space, trailing empty lines, C++ comments, etc. - split cmd_boot.c (separate cmd_bdinfo.c and cmd_load.c) * Patches by Kenneth Johansson, 25 Jun 2003: - major rework of command structure (work done mostly by Michal Cendrowski and Joakim Kristiansen)
* Initial revisionwdenk2002-08-271-0/+98
OpenPOWER on IntegriCloud