05 Jul, 2010
1 commit
-
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
Acked-by: Mike Frysinger
22 Apr, 2010
1 commit
-
As discussed on the list, move "arch/ppc" to "arch/powerpc" to
better match the Linux directory structure.Please note that this patch also changes the "ppc" target in
MAKEALL to "powerpc" to match this new infrastructure. But "ppc"
is kept as an alias for now, to not break compatibility with
scripts using this name.Signed-off-by: Stefan Roese
Acked-by: Wolfgang Denk
Acked-by: Detlev Zundel
Acked-by: Kim Phillips
Cc: Peter Tyser
Cc: Anatolij Gustschin
18 Jan, 2010
1 commit
-
Convert the funcs to do the conversion inline so that we can do the copy
all at once with memcpy. This let's us push out an weird arch-specific
issue with accessing different regions of memory to the memcpy function
like the MMRs on Blackfin systems, and it should be a bit faster.Signed-off-by: Robin Getz
Signed-off-by: Mike Frysinger
12 Feb, 2009
1 commit
-
Move global '#ifdef CONFIG_xxx .... #endif' out of the .c files and into
the COBJS-$(CONFIG_xxx) in the Makefile. Also delete unused var in kgdb
code in the process.Signed-off-by: Mike Frysinger
28 Jan, 2009
1 commit
-
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
19 Oct, 2008
1 commit
-
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD
09 Mar, 2008
1 commit
-
and get rid of a couple of unneeded casts.
Signed-off-by: Wolfgang Denk
11 Jul, 2007
1 commit
-
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
09 Jul, 2007
1 commit
-
Signed-off-by: Jon Loeliger
04 Jul, 2007
1 commit
-
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
13 Oct, 2005
1 commit
02 Jul, 2003
1 commit
-
get rid of MK_CMD_ENTRY macro; update doc/README.command
28 Jun, 2003
1 commit
-
- 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)
27 Aug, 2002
1 commit