- 19 7月, 2018 1 次提交
-
-
由 Michal Simek 提交于
Use enum command_ret_t types in cmd_process_error(). Signed-off-by: NMichal Simek <michal.simek@xilinx.com> Reviewed-by: NSimon Glass <sjg@chromum.org>
-
- 07 5月, 2018 1 次提交
-
-
由 Tom Rini 提交于
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: NTom Rini <trini@konsulko.com>
-
- 30 11月, 2017 1 次提交
-
-
由 Heinrich Schuchardt 提交于
When copying the command line buffer the target array should at least have the same size. Cf. definition of console_buffer in common/cli_readline.c. Signed-off-by: NHeinrich Schuchardt <xypron.glpk@gmx.de>
-
- 02 4月, 2016 1 次提交
-
-
由 Simon Glass 提交于
Command parsing and processing code is not needed when the command line is disabled. Remove this code in that case. Signed-off-by: NSimon Glass <sjg@chromium.org> Reviewed-by: NTom Rini <trini@konsulko.com>
-
- 20 11月, 2015 1 次提交
-
-
由 Simon Glass 提交于
The console includes a global variable and several functions that are only used by a small subset of U-Boot files. Before adding more functions, move the definitions into their own header file. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
- 28 8月, 2015 1 次提交
-
-
由 Kun-Hua Huang 提交于
Add nds32 ag101p generic board support. Signed-off-by: NKun-Hua Huang <kunhua@andestech.com>
-
- 05 8月, 2015 1 次提交
-
-
由 Peng Fan 提交于
Add '\n' for debug msg. Signed-off-by: NPeng Fan <Peng.Fan@freescale.com> Cc: Tom Rini <trini@konsulko.com> Cc: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Simon Glass <sjg@chromium.org> Acked-by: NSimon Glass <sjg@chromium.org>
-
- 28 10月, 2014 1 次提交
-
-
由 Masahiro Yamada 提交于
- Do not insert a whitespace between a function name and an open paranthesis - Fix comment style - Do not split an error message into multiple lines even if it exceeds 80 columns - Do not split "for" statement where it fits in 80 columns - Do not use assignment in if condition Signed-off-by: NMasahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: NSimon Glass <sjg@chromium.org>
-
- 05 3月, 2014 2 次提交
-
-
由 York Sun 提交于
Add 64-bit data for memory commands, such as md, mw, mm, cmp. The new size ".q " is introduced. For 64-bit architecture, 64-bit data is enabled by default, by detecting compiler __LP64__. It is optional for other architectures. Signed-off-by: NYork Sun <yorksun@freescale.com>
-
由 Simon Glass 提交于
U-Boot now uses errors defined in include/errno.h which are negative integers. Commands which fail need to report the error and return 1 to indicate failure. Add this functionality in cmd_process_error(). For now this merely reports the error number. It would be possible also to produce a helpful error message by storing the error strings in U-Boot. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
- 14 1月, 2014 1 次提交
-
-
由 Andrew Gabbasov 提交于
Compiling of full list of commands does not advance the counter, so it always results in an empty list. This seems to be (inadvertently?) introduced by commit 6c7c946c. Signed-off-by: NAndrew Gabbasov <andrew_gabbasov@mentor.com>
-
- 24 7月, 2013 1 次提交
-
-
由 Wolfgang Denk 提交于
Signed-off-by: NWolfgang Denk <wd@denx.de> [trini: Fixup common/cmd_io.c] Signed-off-by: NTom Rini <trini@ti.com>
-
- 04 2月, 2013 1 次提交
-
-
由 Richard Genoud 提交于
As far as every arch has a get_timer function, run_command_and_time_it code can now disappear. Signed-off-by: NRichard Genoud <richard.genoud@gmail.com> Acked-By: NChe-Liang Chiou <clchiou@chromium.org> [trini: s/ulong/unsigned long/ in command.h portion] Signed-off-by: NTom Rini <trini@ti.com>
-
- 08 11月, 2012 1 次提交
-
-
由 Anatolij Gustschin 提交于
commit 199adb60 "common/misc: sparse fixes" broke the help command trying to fix the sparse error "command.c:44:38: error: bad constant expression". As Henrik points out, the fix was bad because the commit used CONFIG_SYS_MAXARGS whereas the code intended to use the maximum number of commands (not arguments to a command). Revert command.c changes to the original code as asked by Wolfgang. Reported-by: NHenrik Nordström <henrik@henriknordstrom.net> Signed-off-by: NAnatolij Gustschin <agust@denx.de>
-
- 05 11月, 2012 1 次提交
-
-
由 Kim Phillips 提交于
command.c:44:38: error: bad constant expression dlmalloc.c:1468:2: warning: Using plain integer as NULL pointer dlmalloc.c:1468:5: warning: Using plain integer as NULL pointer dlmalloc.c:2176:12: warning: Using plain integer as NULL pointer dlmalloc.c:2179:31: warning: Using plain integer as NULL pointer dlmalloc.c:2382:14: warning: Using plain integer as NULL pointer dlmalloc.c:2436:14: warning: Using plain integer as NULL pointer dlmalloc.c:2582:31: warning: Using plain integer as NULL pointer dlmalloc.c:2585:17: warning: Using plain integer as NULL pointer dlmalloc.c:2646:14: warning: Using plain integer as NULL pointer dlmalloc.c:2659:19: warning: Using plain integer as NULL pointer dlmalloc.c:2692:19: warning: Using plain integer as NULL pointer dlmalloc.c:2707:19: warning: Using plain integer as NULL pointer dlmalloc.c:2708:14: warning: Using plain integer as NULL pointer dlmalloc.c:2786:31: warning: Using plain integer as NULL pointer dlmalloc.c:2801:12: warning: Using plain integer as NULL pointer dlmalloc.c:2801:22: warning: Using plain integer as NULL pointer dlmalloc.c:2926:27: warning: Using plain integer as NULL pointer dlmalloc.c:2928:14: warning: Using plain integer as NULL pointer dlmalloc.c:2929:12: warning: Using plain integer as NULL pointer dlmalloc.c:3075:14: warning: Using plain integer as NULL pointer hush.c:292:14: warning: symbol 'last_return_code' was not declared. Should it be static? hush.c:293:5: warning: symbol 'nesting_level' was not declared. Should it be static? hush.c:2175:20: warning: Using plain integer as NULL pointer hush.c:2175:34: warning: Using plain integer as NULL pointer hush.c:2210:41: warning: Using plain integer as NULL pointer hush.c:2216:45: warning: Using plain integer as NULL pointer hush.c:2249:25: warning: Using plain integer as NULL pointer hush.c:2332:13: warning: symbol 'new_pipe' was not declared. Should it be static? hush.c:2390:5: warning: symbol 'reserved_word' was not declared. Should it be static? hush.c:2927:5: warning: symbol 'parse_stream' was not declared. Should it be static? hush.c:3127:6: warning: symbol 'mapset' was not declared. Should it be static? hush.c:3133:6: warning: symbol 'update_ifs_map' was not declared. Should it be static? hush.c:3161:5: warning: symbol 'parse_stream_outer' was not declared. Should it be static? hush.c:3295:34: warning: Using plain integer as NULL pointer hush.c:3631:5: warning: symbol 'do_showvar' was not declared. Should it be static image.c:1282:29: warning: Using plain integer as NULL pointer image.c:1315:41: warning: Using plain integer as NULL pointer image.c:1330:25: warning: Using plain integer as NULL pointer image.c:1706:25: warning: Using plain integer as NULL pointer main.c:510:10: warning: symbol 'hist_num' was not declared. Should it be static? main.c:512:5: warning: symbol 'hist_list' was not declared. Should it be static? main.c:513:6: warning: symbol 'hist_lines' was not declared. Should it be static? usb_storage.c:195:6: warning: symbol 'usb_show_progress' was not declared. Should it be static? usb_storage.c:440:48: warning: Using plain integer as NULL pointer usb_storage.c:503:5: warning: symbol 'usb_stor_BBB_comdat' was not declared. Should it be static? usb_storage.c:551:5: warning: symbol 'usb_stor_CB_comdat' was not declared. Should it be static? usb_storage.c:629:55: warning: Using plain integer as NULL pointer usb_storage.c:620:5: warning: symbol 'usb_stor_CBI_get_status' was not declared. Should it be static? usb_storage.c:675:43: warning: Using plain integer as NULL pointer usb_storage.c:668:5: warning: symbol 'usb_stor_BBB_clear_endpt_stall' was not declared. Should it be static? usb_storage.c:679:5: warning: symbol 'usb_stor_BBB_transport' was not declared. Should it be static? usb_storage.c:801:5: warning: symbol 'usb_stor_CB_transport' was not declared. Sh xyzModem.c:104:1: warning: symbol 'CYGACC_COMM_IF_GETC_TIMEOUT' was not declared. Should it be static? xyzModem.c:122:1: warning: symbol 'CYGACC_COMM_IF_PUTC' was not declared. Should it be static? xyzModem.c:169:1: warning: symbol 'parse_num' was not declared. Should it be stat note: hush.c's nesting_level deleted because not used. Signed-off-by: NKim Phillips <kim.phillips@freescale.com>
-
- 22 10月, 2012 1 次提交
-
-
由 Marek Vasut 提交于
This patch converts the old method of creating a list of command onto the new LG-arrays code. The old u_boot_cmd section is converted to new u_boot_list_cmd subsection and LG-array macros used as needed. Minor adjustments had to be made to the common code to work with the LG-array macros, mostly the fixup_cmdtable() calls are now passed the ll_entry_start and ll_entry_count instead of linker-generated symbols. The command.c had to be adjusted as well so it would use the newly introduced LG-array API instead of directly using linker-generated symbols. Signed-off-by: NMarek Vasut <marex@denx.de> Cc: Joe Hershberger <joe.hershberger@gmail.com> Cc: Mike Frysinger <vapier@gentoo.org>
-
- 07 3月, 2012 2 次提交
-
-
由 Simon Glass 提交于
We currently have the same code in hush.c and main.c. This brings the code into one place. As an added feature, if the command function returns CMD_RET_USAGE then cmd_process() will print a usage message for the command before returning the standard failure code of 1. ARM code size increases about 32 bytes with this clean-up. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
We should aim for a single point of entry to the commands, whichever parser is used. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
- 24 10月, 2011 1 次提交
-
-
由 Daniel Schwierzeck 提交于
In commit fa28bd2e patch v1 was applied instead of v2. This is an incremental patch to update that commit to version 2. Signed-off-by: NDaniel Schwierzeck <daniel.schwierzeck@googlemail.com>
-
- 18 10月, 2011 1 次提交
-
-
由 Jason Hobbs 提交于
These are various places I found that checked for conditions equivalent to isblank. Signed-off-by: NJason Hobbs <jason.hobbs@calxeda.com>
-
- 16 10月, 2011 1 次提交
-
-
由 Daniel Schwierzeck 提交于
The command auto-completion does not work on architectures relying on CONFIG_NEEDS_MANUAL_RELOC like MIPS. Cause is the missing function pointer fixup for cmd_tbl_t::complete function in fixup_cmdtable(). This patch adds the missing pointer fixup in case of CONFIG_AUTO_COMPLETE is defined. Signed-off-by: NDaniel Schwierzeck <daniel.schwierzeck@googlemail.com>
-
- 26 7月, 2011 1 次提交
-
-
由 Mike Frysinger 提交于
The usage helper doesn't modify the command, so constify its input arg. Signed-off-by: NMike Frysinger <vapier@gentoo.org>
-
- 10 1月, 2011 1 次提交
-
-
由 Mike Frysinger 提交于
Currently, only basic completion is supported (no globs), but this is what we had previously. Signed-off-by: NMike Frysinger <vapier@gentoo.org>
-
- 29 11月, 2010 1 次提交
-
-
由 Mike Frysinger 提交于
Rather than add runtime overhead of installing completion handlers, do it statically at build time. This requires a new build time helper macro to declare a command and the completion handler at the same time. Then we convert the env related funcs over to this. This gives an opportunity to also unify the U_BOOT_CMD macros. Signed-off-by: NMike Frysinger <vapier@gentoo.org>
-
- 28 11月, 2010 1 次提交
-
-
由 Thomas Weber 提交于
Guard strchr/strlen from being called with NULL pointer. This line is crashing when command "env" is called without subcommand. The cmd is NULL in this case because the calling function "do_env" decremented the argc without checking if there are still arguments available. Signed-off-by: NThomas Weber <weber@corscience.de>
-
- 30 10月, 2010 1 次提交
-
-
由 Wolfgang Denk 提交于
By now, the majority of architectures have working relocation support, so the few remaining architectures have become exceptions. To make this more obvious, we make working relocation now the default case, and flag the remaining cases with CONFIG_NEEDS_MANUAL_RELOC. Signed-off-by: NWolfgang Denk <wd@denx.de> Tested-by: NHeiko Schocher <hs@denx.de> Tested-by: NReinhard Meyer <u-boot@emk-elektronik.de>
-
- 20 9月, 2010 2 次提交
-
-
由 Heiko Schocher 提交于
fixup_cmdtable() did all work for fixing up the cmdtable, if CONFIG_RELOC_FIXUP_WORKS is not defined. CONFIG_RELOC_FIXUP_WORKS is missing for i386! I talked with Graeme Russ, and he will fix this soon. Portions of this work were supported by funding from the CE Linux Forum. Signed-off-by: NHeiko Schocher <hs@denx.de>
-
由 Wolfgang Denk 提交于
Motivation: * Old environment code used a pessimizing implementation: - variable lookup used linear search => slow - changed/added variables were added at the end, i. e. most frequently used variables had the slowest access times => slow - each setenv() would calculate the CRC32 checksum over the whole environment block => slow * "redundant" envrionment was locked down to two copies * No easy way to implement features like "reset to factory defaults", or to select one out of several pre-defined (previously saved) sets of environment settings ("profiles") * No easy way to import or export environment settings ====================================================================== API Changes: - Variable names starting with '#' are no longer allowed I didn't find any such variable names being used; it is highly recommended to follow standard conventions and start variable names with an alphanumeric character - "printenv" will now print a backslash at the end of all but the last lines of a multi-line variable value. Multi-line variables have never been formally defined, allthough there is no reason not to use them. Now we define rules how to deal with them, allowing for import and export. - Function forceenv() and the related code in saveenv() was removed. At the moment this is causing build problems for the only user of this code (schmoogie - which has no entry in MAINTAINERS); may be fixed later by implementing the "env set -f" feature. Inconsistencies: - "printenv" will '\\'-escape the '\n' in multi-line variables, while "printenv var" will not do that. ====================================================================== Advantages: - "printenv" output much better readable (sorted) - faster! - extendable (additional variable properties can be added) - new, powerful features like "factory reset" or easy switching between several different environment settings ("profiles") Disadvantages: - Image size grows by typically 5...7 KiB (might shrink a bit again on systems with redundant environment with a following patch series) ====================================================================== Implemented: - env command with subcommands: - env print [arg ...] same as "printenv": print environment - env set [-f] name [arg ...] same as "setenv": set (and delete) environment variables ["-f" - force setting even for read-only variables - not implemented yet.] - end delete [-f] name not implemented yet ["-f" - force delete even for read-only variables] - env save same as "saveenv": save environment - env export [-t | -b | -c] addr [size] export internal representation (hash table) in formats usable for persistent storage or processing: -t: export as text format; if size is given, data will be padded with '\0' bytes; if not, one terminating '\0' will be added (which is included in the "filesize" setting so you can for exmple copy this to flash and keep the termination). -b: export as binary format (name=value pairs separated by '\0', list end marked by double "\0\0") -c: export as checksum protected environment format as used for example by "saveenv" command addr: memory address where environment gets stored size: size of output buffer With "-c" and size is NOT given, then the export command will format the data as currently used for the persistent storage, i. e. it will use CONFIG_ENV_SECT_SIZE as output block size and prepend a valid CRC32 checksum and, in case of resundant environment, a "current" redundancy flag. If size is given, this value will be used instead of CONFIG_ENV_SECT_SIZE; again, CRC32 checksum and redundancy flag will be inserted. With "-b" and "-t", always only the real data (including a terminating '\0' byte) will be written; here the optional size argument will be used to make sure not to overflow the user provided buffer; the command will abort if the size is not sufficient. Any remainign space will be '\0' padded. On successful return, the variable "filesize" will be set. Note that filesize includes the trailing/terminating '\0' byte(s). Usage szenario: create a text snapshot/backup of the current settings: => env export -t 100000 => era ${backup_addr} +${filesize} => cp.b 100000 ${backup_addr} ${filesize} Re-import this snapshot, deleting all other settings: => env import -d -t ${backup_addr} - env import [-d] [-t | -b | -c] addr [size] import external format (text or binary) into hash table, optionally deleting existing values: -d: delete existing environment before importing; otherwise overwrite / append to existion definitions -t: assume text format; either "size" must be given or the text data must be '\0' terminated -b: assume binary format ('\0' separated, "\0\0" terminated) -c: assume checksum protected environment format addr: memory address to read from size: length of input data; if missing, proper '\0' termination is mandatory - env default -f reset default environment: drop all environment settings and load default environment - env ask name [message] [size] same as "askenv": ask for environment variable - env edit name same as "editenv": edit environment variable - env run same as "run": run commands in an environment variable ====================================================================== TODO: - drop default env as implemented now; provide a text file based initialization instead (eventually using several text files to incrementally build it from common blocks) and a tool to convert it into a binary blob / object file. - It would be nice if we could add wildcard support for environment variables; this is needed for variable name auto-completion, but it would also be nice to be able to say "printenv ip*" or "printenv *addr*" - Some boards don't link any more due to the grown code size: DU405, canyonlands, sequoia, socrates. => cc: Matthias Fuchs <matthias.fuchs@esd-electronics.com>, Stefan Roese <sr@denx.de>, Heiko Schocher <hs@denx.de> - Dropping forceenv() causes build problems on schmoogie => cc: Sergey Kubushyn <ksi@koi8.net> - Build tested on PPC and ARM only; runtime tested with NOR and NAND flash only => needs testing!! Signed-off-by: NWolfgang Denk <wd@denx.de> Cc: Matthias Fuchs <matthias.fuchs@esd-electronics.com>, Cc: Stefan Roese <sr@denx.de>, Cc: Heiko Schocher <hs@denx.de> Cc: Sergey Kubushyn <ksi@koi8.net>
-
- 25 7月, 2010 1 次提交
-
-
由 Wolfgang Denk 提交于
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: NWolfgang Denk <wd@denx.de>
-
- 05 7月, 2010 1 次提交
-
-
由 Wolfgang Denk 提交于
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: NWolfgang Denk <wd@denx.de> Acked-by: NMike Frysinger <vapier@gentoo.org>
-
- 06 5月, 2010 1 次提交
-
-
由 Trübenbach, Ralf 提交于
Enable the auto completion (with TAB) of the environment variable name after the editenv command. Signed-off-by: NRalf Trübenbach <ralf.truebenbach@men.de>
-
- 23 11月, 2009 1 次提交
-
-
由 Peter Tyser 提交于
command.c should contain common code related to commands, not miscellaneous command implementations. Signed-off-by: NPeter Tyser <ptyser@xes-inc.com>
-
- 13 6月, 2009 2 次提交
-
-
由 Wolfgang Denk 提交于
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: NWolfgang Denk <wd@denx.de>
-
由 Wolfgang Denk 提交于
In case of incorrect command invocations U-Boot used to print pretty useless "usage" messages, for example: => nand markbad Usage: nand - NAND sub-system In the result, the user would have to run the "help" command to get the (available) information about correct command usage. Change this, so that this information gets always printed. Note that this changes the user interface of all commands, but hopefully to the better. Signed-off-by: NWolfgang Denk <wd@denx.de>
-
- 28 3月, 2009 1 次提交
-
-
由 Detlev Zundel 提交于
Other commands implementing subcommands can reuse this code nicely. Signed-off-by: NDetlev Zundel <dzu@denx.de> Signed-off-by: NAndreas Pfefferle <ap@denx.de>
-
- 28 1月, 2009 2 次提交
-
-
由 Peter Tyser 提交于
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: NPeter Tyser <ptyser@xes-inc.com>
-
由 Peter Tyser 提交于
Signed-off-by: NPeter Tyser <ptyser@xes-inc.com>
-
- 19 10月, 2008 2 次提交
-
-
Signed-off-by: NJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
-
由 Kumar Gala 提交于
Sub-command can benefit from using the same table and search functions that top level commands have. Expose this functionality by refactoring find_cmd() and introducing find_cmd_tbl() that sub-command processing can call. Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
-
- 11 9月, 2008 1 次提交
-
-
add CMD_DATA_SIZE macro to enable it Signed-off-by: NJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
-