1. 20 1月, 2018 1 次提交
  2. 12 8月, 2017 1 次提交
  3. 14 4月, 2016 1 次提交
  4. 19 1月, 2016 1 次提交
  5. 13 11月, 2015 1 次提交
  6. 17 8月, 2013 1 次提交
  7. 09 10月, 2012 2 次提交
  8. 10 1月, 2011 1 次提交
  9. 25 7月, 2010 1 次提交
  10. 05 7月, 2010 1 次提交
    • W
      Make sure that argv[] argument pointers are not modified. · 54841ab5
      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>
      54841ab5
  11. 13 6月, 2009 1 次提交
    • W
      General help message cleanup · a89c33db
      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>
      a89c33db
  12. 28 1月, 2009 2 次提交
  13. 20 12月, 2008 1 次提交
    • P
      Add support for PCA953x I2C gpio devices · e92739d3
      Peter Tyser 提交于
      Initial support for NXP's 4 and 8 bit I2C gpio expanders
      (eg pca9537, pca9557, etc). The CONFIG_PCA953X define
      enables support for the devices while the CONFIG_CMD_PCA953X
      define enables the pca953x command. The CONFIG_CMD_PCA953X_INFO
      define enables an 'info' sub-command which provides summary
      information for the given pca953x device.
      Signed-off-by: NPeter Tyser <ptyser@xes-inc.com>
      e92739d3