From 16ff9902468088a0a559b3db95421355ef60d366 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 26 Feb 2014 15:59:15 -0700 Subject: Add cmd_process_error() to report and process errors 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: Simon Glass --- common/command.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'common/command.c') diff --git a/common/command.c b/common/command.c index 597ab4c..26c37f2 100644 --- a/common/command.c +++ b/common/command.c @@ -538,3 +538,13 @@ enum command_ret_t cmd_process(int flag, int argc, char * const argv[], rc = cmd_usage(cmdtp); return rc; } + +int cmd_process_error(cmd_tbl_t *cmdtp, int err) +{ + if (err) { + printf("Command '%s' failed: Error %d\n", cmdtp->name, err); + return 1; + } + + return 0; +} -- cgit v1.1 From 4d1fd7f1ae6cf4e6e4e1cad975f1dcdea62b6d83 Mon Sep 17 00:00:00 2001 From: York Sun Date: Wed, 26 Feb 2014 17:03:19 -0800 Subject: Add 64-bit data support for memory commands 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: York Sun --- common/command.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'common/command.c') diff --git a/common/command.c b/common/command.c index 26c37f2..746b7e3 100644 --- a/common/command.c +++ b/common/command.c @@ -421,6 +421,10 @@ int cmd_get_data_size(char* arg, int default_size) return 2; case 'l': return 4; +#ifdef CONFIG_SYS_SUPPORT_64BIT_DATA + case 'q': + return 8; +#endif case 's': return -2; default: -- cgit v1.1