Skip to content
Snippets Groups Projects
  1. Jul 04, 2010
    • Wolfgang Denk's avatar
      Make sure that argv[] argument pointers are not modified. · 54841ab5
      Wolfgang Denk authored
      
      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: default avatarWolfgang Denk <wd@denx.de>
      Acked-by: default avatarMike Frysinger <vapier@gentoo.org>
      54841ab5
  2. Jul 26, 2009
  3. Jun 12, 2009
    • Wolfgang Denk's avatar
      General help message cleanup · a89c33db
      Wolfgang Denk authored
      
      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: default avatarWolfgang Denk <wd@denx.de>
      a89c33db
  4. Mar 27, 2009
  5. Mar 20, 2009
  6. Jan 28, 2009
  7. Dec 06, 2008
  8. Nov 02, 2008
  9. Oct 18, 2008
  10. Apr 18, 2008
    • Mike Frysinger's avatar
      allow ports to override bootelf behavior · 017e9b79
      Mike Frysinger authored
      Change the bootelf setup function into a dedicated weak function called
      do_bootelf_exec.  This way ports can control the behavior however they
      like before/after calling the ELF entry point.
      017e9b79
  11. Apr 13, 2008
    • Mike Frysinger's avatar
      disable caches before booting an app for Blackfin apps · 1f1d88dd
      Mike Frysinger authored
      
      It isn't generally save to execute applications outside of U-Boot with caches
      enabled due to the way the Blackfin processor handles caches (requires
      software assistance).  This patch disables caches before booting an ELF or
      just booting raw code.  The previous discussion on the patch was that we
      wanted to use weaks instead, but that proved to not be feasible when multiple
      symbols are involved, which puts us back at the ifdef solution.  I've
      minimized the ugliness by moving the setup step outside of the main function.
      
      Signed-off-by: default avatarMike Frysinger <vapier@gentoo.org>
      1f1d88dd
  12. Nov 21, 2007
  13. Jul 10, 2007
  14. Jul 08, 2007
  15. Jul 03, 2007
  16. Nov 29, 2006
  17. Mar 31, 2006
  18. Aug 01, 2005
  19. Dec 16, 2004
  20. Mar 23, 2004
    • Wolfgang Denk's avatar
      * Patches by Thomas Viehweger, 16 Mar 2004: · 4b9206ed
      Wolfgang Denk authored
        - show PCI clock frequency on MPC8260 systems
        - add FCC_PSMR_RMII flag for HiP7 processors
        - in do_jffs2_fsload(), take load address from load_addr if not set
          explicit, update load_addr otherwise
        - replaced printf by putc/puts when no formatting is needed
          (smaller code size, faster execution)
      4b9206ed
  21. Jul 01, 2003
  22. Jun 27, 2003
  23. Feb 28, 2003
  24. Nov 11, 2002
    • Wolfgang Denk's avatar
      * Patch by Andreas Oberritter, 09 Nov 2002: · eb9401e3
      Wolfgang Denk authored
        Change behaviour of NetLoop(): return -1 for errors, filesize
        otherwise; return code 0 is valid an means no file loaded - in this
        case the environment still gets updated!
      
      * Patches by Jon Diekema, 9 Nov 2002:
        - improve ADC/DAC clocking on the SACSng board to align
          the failing edges of LRCLK and SCLK
        - sbc8260 configuration tweaks
        - add status LED support for 82xx systems
        - wire sspi/sspo commands into command handler; improved error
          handlering
        - add timestamp support and alternate memory test to the
          SACSng configuration
      eb9401e3
  25. Sep 20, 2002
Loading