summaryrefslogtreecommitdiffstats
path: root/board/esd
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2010-06-28 22:00:46 +0200
committerWolfgang Denk <wd@denx.de>2010-07-04 23:55:42 +0200
commit54841ab50c20d6fa6c9cc3eb826989da3a22d934 (patch)
tree400f22f0a12ff0ae6c472bed6ac648befc1744a2 /board/esd
parentb218ccb5435e64ac2318bb8b6c9594ef1cc724cd (diff)
downloadbootable_bootloader_goldelico_gta04-54841ab50c20d6fa6c9cc3eb826989da3a22d934.zip
bootable_bootloader_goldelico_gta04-54841ab50c20d6fa6c9cc3eb826989da3a22d934.tar.gz
bootable_bootloader_goldelico_gta04-54841ab50c20d6fa6c9cc3eb826989da3a22d934.tar.bz2
Make sure that argv[] argument pointers are not modified.
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 <wd@denx.de> Acked-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'board/esd')
-rw-r--r--board/esd/apc405/apc405.c2
-rw-r--r--board/esd/ar405/ar405.c8
-rw-r--r--board/esd/ash405/ash405.c2
-rw-r--r--board/esd/canbt/canbt.c2
-rw-r--r--board/esd/cms700/cms700.c2
-rw-r--r--board/esd/common/auto_update.c2
-rw-r--r--board/esd/common/cmd_loadpci.c2
-rw-r--r--board/esd/common/lcd.c2
-rw-r--r--board/esd/common/xilinx_jtag/micro.c2
-rw-r--r--board/esd/cpci2dp/cpci2dp.c2
-rw-r--r--board/esd/cpci405/cpci405.c8
-rw-r--r--board/esd/cpci5200/cpci5200.c2
-rw-r--r--board/esd/cpci750/cpci750.c6
-rw-r--r--board/esd/cpci750/sdram_init.c2
-rw-r--r--board/esd/cpciiser4/cpciiser4.c2
-rw-r--r--board/esd/dasa_sim/cmd_dasa_sim.c2
-rw-r--r--board/esd/du405/du405.c2
-rw-r--r--board/esd/du440/du440.c16
-rw-r--r--board/esd/hh405/hh405.c4
-rw-r--r--board/esd/ocrtc/cmd_ocrtc.c4
-rw-r--r--board/esd/pci405/cmd_pci405.c2
-rw-r--r--board/esd/pci405/pci405.c4
-rw-r--r--board/esd/pf5200/pf5200.c6
-rw-r--r--board/esd/plu405/plu405.c4
-rw-r--r--board/esd/pmc405de/pmc405de.c8
-rw-r--r--board/esd/pmc440/cmd_pmc440.c18
-rw-r--r--board/esd/tasreg/tasreg.c14
-rw-r--r--board/esd/vme8349/caddy.c2
-rw-r--r--board/esd/voh405/voh405.c4
-rw-r--r--board/esd/wuh405/wuh405.c2
30 files changed, 69 insertions, 69 deletions
diff --git a/board/esd/apc405/apc405.c b/board/esd/apc405/apc405.c
index 72c0907..b58c1eb 100644
--- a/board/esd/apc405/apc405.c
+++ b/board/esd/apc405/apc405.c
@@ -37,7 +37,7 @@ DECLARE_GLOBAL_DATA_PTR;
#undef FPGA_DEBUG
-extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
+extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
extern void lxt971_no_sleep(void);
extern ulong flash_get_size (ulong base, int banknum);
diff --git a/board/esd/ar405/ar405.c b/board/esd/ar405/ar405.c
index a632cb4..21b2432 100644
--- a/board/esd/ar405/ar405.c
+++ b/board/esd/ar405/ar405.c
@@ -30,7 +30,7 @@
DECLARE_GLOBAL_DATA_PTR;
/*cmd_boot.c*/
-extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
+extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
extern void lxt971_no_sleep(void);
/* ------------------------------------------------------------------------- */
@@ -196,7 +196,7 @@ int checkboard (void)
/*
* Some test routines
*/
-int do_digtest(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_digtest(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
int i;
int k;
@@ -257,7 +257,7 @@ struct io {
short dummy;
};
-int do_anatest(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_anatest(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
short val;
int i;
@@ -353,7 +353,7 @@ void cyclicInt(void *ptr)
}
-int do_inctest(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_inctest(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
ulong *incin;
int i;
diff --git a/board/esd/ash405/ash405.c b/board/esd/ash405/ash405.c
index 0615959..03c4098 100644
--- a/board/esd/ash405/ash405.c
+++ b/board/esd/ash405/ash405.c
@@ -33,7 +33,7 @@
#define FPGA_DEBUG
#endif
-extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
+extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
extern void lxt971_no_sleep(void);
/* fpga configuration data - gzip compressed and generated by bin2c */
diff --git a/board/esd/canbt/canbt.c b/board/esd/canbt/canbt.c
index 5a3f61d..bfec548 100644
--- a/board/esd/canbt/canbt.c
+++ b/board/esd/canbt/canbt.c
@@ -30,7 +30,7 @@
DECLARE_GLOBAL_DATA_PTR;
/*cmd_boot.c*/
-extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
+extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
/* ------------------------------------------------------------------------- */
diff --git a/board/esd/cms700/cms700.c b/board/esd/cms700/cms700.c
index 391fbf4..20346e1 100644
--- a/board/esd/cms700/cms700.c
+++ b/board/esd/cms700/cms700.c
@@ -157,7 +157,7 @@ int eeprom_write_enable (unsigned dev_addr, int state)
return state;
}
-int do_eep_wren (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_eep_wren (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
int query = argc == 1;
int state = 0;
diff --git a/board/esd/common/auto_update.c b/board/esd/common/auto_update.c
index c4a49e2..4dfea71 100644
--- a/board/esd/common/auto_update.c
+++ b/board/esd/common/auto_update.c
@@ -492,7 +492,7 @@ int do_auto_update(void)
return 0;
}
-int auto_update(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int auto_update(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
do_auto_update();
diff --git a/board/esd/common/cmd_loadpci.c b/board/esd/common/cmd_loadpci.c
index eecae0a..87da27d 100644
--- a/board/esd/common/cmd_loadpci.c
+++ b/board/esd/common/cmd_loadpci.c
@@ -37,7 +37,7 @@ extern int do_source (cmd_tbl_t *, int, int, char *[]);
/*
* Command loadpci: wait for signal from host and boot image.
*/
-int do_loadpci(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_loadpci(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
u32 *ptr = 0;
int count = 0;
diff --git a/board/esd/common/lcd.c b/board/esd/common/lcd.c
index 5c50b4c..9109b64 100644
--- a/board/esd/common/lcd.c
+++ b/board/esd/common/lcd.c
@@ -339,7 +339,7 @@ int lcd_init(uchar *lcd_reg, uchar *lcd_mem, S1D_REGS *regs, int reg_count,
return lcd_bmp(logo_bmp);
}
-int do_esdbmp(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_esdbmp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
ulong addr;
#ifdef CONFIG_VIDEO_SM501
diff --git a/board/esd/common/xilinx_jtag/micro.c b/board/esd/common/xilinx_jtag/micro.c
index 414e821..9823e5e 100644
--- a/board/esd/common/xilinx_jtag/micro.c
+++ b/board/esd/common/xilinx_jtag/micro.c
@@ -1828,7 +1828,7 @@ int xsvfExecute(void)
* ppzArgv - array of ptrs to strings (command-line arguments).
* Returns: int - Legacy return value: 1 = success; 0 = error.
*****************************************************************************/
-int do_cpld(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_cpld(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
int iErrorCode;
char* pzXsvfFileName;
diff --git a/board/esd/cpci2dp/cpci2dp.c b/board/esd/cpci2dp/cpci2dp.c
index 6d9814f..00456a7 100644
--- a/board/esd/cpci2dp/cpci2dp.c
+++ b/board/esd/cpci2dp/cpci2dp.c
@@ -149,7 +149,7 @@ int eeprom_write_enable (unsigned dev_addr, int state) {
#endif
#if defined(CONFIG_SYS_EEPROM_WREN)
-int do_eep_wren (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_eep_wren (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
int query = argc == 1;
int state = 0;
diff --git a/board/esd/cpci405/cpci405.c b/board/esd/cpci405/cpci405.c
index 24db883..51d3355 100644
--- a/board/esd/cpci405/cpci405.c
+++ b/board/esd/cpci405/cpci405.c
@@ -32,7 +32,7 @@
DECLARE_GLOBAL_DATA_PTR;
-extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
+extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
extern void __ft_board_setup(void *blob, bd_t *bd);
#undef FPGA_DEBUG
@@ -650,7 +650,7 @@ int OWReadByte(void)
return result;
}
-int do_onewire(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_onewire(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
unsigned short val;
int result;
@@ -698,7 +698,7 @@ U_BOOT_CMD(
/*
* Write backplane ip-address...
*/
-int do_get_bpip(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_get_bpip(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
bd_t *bd = gd->bd;
char *buf;
@@ -756,7 +756,7 @@ U_BOOT_CMD(
/*
* Set and print backplane ip...
*/
-int do_set_bpip(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_set_bpip(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
char *buf;
char str[32];
diff --git a/board/esd/cpci5200/cpci5200.c b/board/esd/cpci5200/cpci5200.c
index 36fcf7f..abac217 100644
--- a/board/esd/cpci5200/cpci5200.c
+++ b/board/esd/cpci5200/cpci5200.c
@@ -265,7 +265,7 @@ int board_eth_init(bd_t *bis)
return pci_eth_init(bis);
}
-int do_writepci(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_writepci(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
{
unsigned int addr;
unsigned int size;
diff --git a/board/esd/cpci750/cpci750.c b/board/esd/cpci750/cpci750.c
index a199d46..f9f7c7f 100644
--- a/board/esd/cpci750/cpci750.c
+++ b/board/esd/cpci750/cpci750.c
@@ -562,7 +562,7 @@ int display_mem_map (void)
/*
* Command loadpci: wait for signal from host and boot image.
*/
-int do_loadpci(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_loadpci(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
volatile unsigned int *ptr;
int count = 0;
@@ -1056,7 +1056,7 @@ void board_prebootm_init ()
dcache_disable ();
}
-int do_show_config(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_show_config(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
{
unsigned int reset_sample_low;
unsigned int reset_sample_high;
@@ -1091,7 +1091,7 @@ U_BOOT_CMD(
"Show Marvell strapping register (ResetSampleLow ResetSampleHigh)"
);
-int do_pldver(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_pldver(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
printf("PLD version:0x%02x\n", in_8((void *)CONFIG_SYS_PLD_VER));
diff --git a/board/esd/cpci750/sdram_init.c b/board/esd/cpci750/sdram_init.c
index 5347958..615e32a 100644
--- a/board/esd/cpci750/sdram_init.c
+++ b/board/esd/cpci750/sdram_init.c
@@ -1811,7 +1811,7 @@ int set_dfcdlInit (void)
return (0);
}
-int do_show_ecc(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_show_ecc(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
unsigned int ecc_counter;
unsigned int ecc_addr;
diff --git a/board/esd/cpciiser4/cpciiser4.c b/board/esd/cpciiser4/cpciiser4.c
index ee90e2c..dcea50e 100644
--- a/board/esd/cpciiser4/cpciiser4.c
+++ b/board/esd/cpciiser4/cpciiser4.c
@@ -30,7 +30,7 @@ DECLARE_GLOBAL_DATA_PTR;
/*cmd_boot.c*/
-extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
+extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
extern void lxt971_no_sleep(void);
diff --git a/board/esd/dasa_sim/cmd_dasa_sim.c b/board/esd/dasa_sim/cmd_dasa_sim.c
index 675e507..aa74376 100644
--- a/board/esd/dasa_sim/cmd_dasa_sim.c
+++ b/board/esd/dasa_sim/cmd_dasa_sim.c
@@ -204,7 +204,7 @@ static void clearPci9054 (void)
/* ------------------------------------------------------------------------- */
int do_pci9054 (cmd_tbl_t * cmdtp, int flag, int argc,
- char *argv[])
+ char * const argv[])
{
if (strcmp (argv[1], "info") == 0) {
showPci9054 ();
diff --git a/board/esd/du405/du405.c b/board/esd/du405/du405.c
index f475d11..aa7ee92 100644
--- a/board/esd/du405/du405.c
+++ b/board/esd/du405/du405.c
@@ -32,7 +32,7 @@ DECLARE_GLOBAL_DATA_PTR;
/*cmd_boot.c*/
-extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
+extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
extern void lxt971_no_sleep(void);
diff --git a/board/esd/du440/du440.c b/board/esd/du440/du440.c
index 111cce5..ba3c97c 100644
--- a/board/esd/du440/du440.c
+++ b/board/esd/du440/du440.c
@@ -409,7 +409,7 @@ int dcf77_status(void)
return mv;
}
-int do_dcf77(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_dcf77(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
int mv;
u32 pin, pinold;
@@ -490,7 +490,7 @@ int usbhub_init(void)
return ret;
}
-int do_hubinit(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_hubinit(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
usbhub_init();
return 0;
@@ -573,7 +573,7 @@ int boot_eeprom_write (unsigned dev_addr,
return rcode;
}
-int do_setup_boot_eeprom(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_setup_boot_eeprom(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
ulong sdsdp[4];
@@ -673,7 +673,7 @@ int eeprom_write_enable (unsigned dev_addr, int state)
return state;
}
-int do_eep_wren (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_eep_wren (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
int query = argc == 1;
int state = 0;
@@ -727,7 +727,7 @@ static int pld_interrupt(u32 arg)
return rc;
}
-int do_waitpwrirq(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_waitpwrirq(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
got_pldirq = 0;
@@ -795,7 +795,7 @@ int dvi_init(void)
return ret;
}
-int do_dviinit(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_dviinit(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
dvi_init();
return 0;
@@ -810,7 +810,7 @@ U_BOOT_CMD(
* TODO: 'time' command might be useful for others as well.
* Move to 'common' directory.
*/
-int do_time(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_time(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
unsigned long long start, end;
char c, cmd[CONFIG_SYS_CBSIZE];
@@ -874,7 +874,7 @@ unsigned int prng(unsigned int max)
return Y;
}
-int do_gfxdemo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_gfxdemo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
unsigned int color;
unsigned int x, y, dx, dy;
diff --git a/board/esd/hh405/hh405.c b/board/esd/hh405/hh405.c
index 4251d51..ca7868c 100644
--- a/board/esd/hh405/hh405.c
+++ b/board/esd/hh405/hh405.c
@@ -236,7 +236,7 @@ static const SMI_REGS init_regs_1024x768 [] =
#define FPGA_DEBUG
#endif
-extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
+extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
extern void lxt971_no_sleep(void);
/* fpga configuration data - gzip compressed and generated by bin2c */
@@ -733,7 +733,7 @@ int eeprom_write_enable (unsigned dev_addr, int state)
return state;
}
-int do_eep_wren (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_eep_wren (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
int query = argc == 1;
int state = 0;
diff --git a/board/esd/ocrtc/cmd_ocrtc.c b/board/esd/ocrtc/cmd_ocrtc.c
index 5f3254d..b59689b 100644
--- a/board/esd/ocrtc/cmd_ocrtc.c
+++ b/board/esd/ocrtc/cmd_ocrtc.c
@@ -33,7 +33,7 @@
/*
* Set device number on pci board
*/
-int do_setdevice(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_setdevice(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
int idx = 1; /* start at 1 (skip device 0) */
pci_dev_t bdf = 0;
@@ -62,7 +62,7 @@ U_BOOT_CMD(
/*
* Get device number on pci board
*/
-int do_getdevice(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_getdevice(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
u32 device;
char str[32];
diff --git a/board/esd/pci405/cmd_pci405.c b/board/esd/pci405/cmd_pci405.c
index 1d14611..2fc9fda 100644
--- a/board/esd/pci405/cmd_pci405.c
+++ b/board/esd/pci405/cmd_pci405.c
@@ -39,7 +39,7 @@ extern int do_bootm (cmd_tbl_t *, int, int, char *[]);
/*
* Command loadpci: wait for signal from host and boot image.
*/
-int do_loadpci(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_loadpci(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
unsigned int *ptr = 0;
int count = 0;
diff --git a/board/esd/pci405/pci405.c b/board/esd/pci405/pci405.c
index 5364857..b0d7663 100644
--- a/board/esd/pci405/pci405.c
+++ b/board/esd/pci405/pci405.c
@@ -34,7 +34,7 @@
DECLARE_GLOBAL_DATA_PTR;
/* Prototypes */
-int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
+int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
unsigned long fpga_done_state(void);
unsigned long fpga_init_state(void);
@@ -356,7 +356,7 @@ int wpeeprom(int wp)
return wp_state;
}
-int do_wpeeprom(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_wpeeprom(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
int wp = -1;
if (argc >= 2) {
diff --git a/board/esd/pf5200/pf5200.c b/board/esd/pf5200/pf5200.c
index 4e64e83..83dbfcb 100644
--- a/board/esd/pf5200/pf5200.c
+++ b/board/esd/pf5200/pf5200.c
@@ -288,7 +288,7 @@ void power_set_reset(int power)
}
}
-int do_poweroff(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_poweroff(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
{
power_set_reset(1);
return (0);
@@ -325,7 +325,7 @@ int phypower(int flag)
return (status);
}
-int do_phypower(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_phypower(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
{
int status;
@@ -340,7 +340,7 @@ int do_phypower(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
U_BOOT_CMD(phypower, 2, 2, do_phypower,
"Switch power of ethernet phy", "");
-int do_writepci(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_writepci(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
{
unsigned int addr;
unsigned int size;
diff --git a/board/esd/plu405/plu405.c b/board/esd/plu405/plu405.c
index 0f7fa69..3a8a4cf 100644
--- a/board/esd/plu405/plu405.c
+++ b/board/esd/plu405/plu405.c
@@ -32,7 +32,7 @@
DECLARE_GLOBAL_DATA_PTR;
-extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
+extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
extern void lxt971_no_sleep(void);
/* fpga configuration data - gzip compressed and generated by bin2c */
@@ -322,7 +322,7 @@ int eeprom_write_enable(unsigned dev_addr, int state)
return state;
}
-int do_eep_wren(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_eep_wren(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
int query = argc == 1;
int state = 0;
diff --git a/board/esd/pmc405de/pmc405de.c b/board/esd/pmc405de/pmc405de.c
index 3725ece..b84e08a 100644
--- a/board/esd/pmc405de/pmc405de.c
+++ b/board/esd/pmc405de/pmc405de.c
@@ -374,7 +374,7 @@ int eeprom_write_enable(unsigned dev_addr, int state)
return state;
}
-int do_eep_wren(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_eep_wren(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
int query = argc == 1;
int state = 0;
@@ -417,7 +417,7 @@ U_BOOT_CMD(eepwren, 2, 0, do_eep_wren,
#include <environment.h>
extern env_t *env_ptr;
-int do_painit(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_painit(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
u32 pram, nextbase, base;
char *v;
@@ -477,7 +477,7 @@ U_BOOT_CMD(
);
#endif /* CONFIG_PRAM */
-int do_selfreset(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_selfreset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
struct ppc4xx_gpio *gpio0 = (struct ppc4xx_gpio *)GPIO_BASE;
setbits_be32(&gpio0->tcr, CONFIG_SYS_GPIO_SELFRST_N);
@@ -489,7 +489,7 @@ U_BOOT_CMD(
""
);
-int do_resetout(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_resetout(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
struct pmc405de_cpld *cpld =
(struct pmc405de_cpld *)CONFIG_SYS_CPLD_BASE;
diff --git a/board/esd/pmc440/cmd_pmc440.c b/board/esd/pmc440/cmd_pmc440.c
index 476e940..200d7ee 100644
--- a/board/esd/pmc440/cmd_pmc440.c
+++ b/board/esd/pmc440/cmd_pmc440.c
@@ -67,7 +67,7 @@ int fpga_interrupt(u32 arg)
return rc;
}
-int do_waithci(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_waithci(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
pmc440_fpga_t *fpga = (pmc440_fpga_t *)FPGA_BA;
@@ -118,7 +118,7 @@ void dump_fifo(pmc440_fpga_t *fpga, int f, int *n)
}
}
-int do_fifo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_fifo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
pmc440_fpga_t *fpga = (pmc440_fpga_t *)FPGA_BA;
int i;
@@ -269,7 +269,7 @@ U_BOOT_CMD(
"'fifo' or 'address'"
);
-int do_setup_bootstrap_eeprom(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_setup_bootstrap_eeprom(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
ulong sdsdp[5];
ulong delay;
@@ -344,7 +344,7 @@ U_BOOT_CMD(
#include <environment.h>
extern env_t *env_ptr;
-int do_painit(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_painit(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
u32 pram, nextbase, base;
char *v;
@@ -404,7 +404,7 @@ U_BOOT_CMD(
);
#endif /* CONFIG_PRAM */
-int do_selfreset(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_selfreset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
in_be32((void*)CONFIG_SYS_RESET_BASE);
return 0;
@@ -415,7 +415,7 @@ U_BOOT_CMD(
""
);
-int do_resetout(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_resetout(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
pmc440_fpga_t *fpga = (pmc440_fpga_t *)FPGA_BA;
@@ -452,7 +452,7 @@ U_BOOT_CMD(
""
);
-int do_inta(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_inta(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
if (is_monarch()) {
printf("This command is only supported in non-monarch mode\n");
@@ -485,7 +485,7 @@ U_BOOT_CMD(
);
/* test-only */
-int do_pmm(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_pmm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
ulong pciaddr;
@@ -518,7 +518,7 @@ U_BOOT_CMD(
);
#if defined(CONFIG_SYS_EEPROM_WREN)
-int do_eep_wren(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_eep_wren(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
int query = argc == 1;
int state = 0;
diff --git a/board/esd/tasreg/tasreg.c b/board/esd/tasreg/tasreg.c
index bd9fb2f..270caac 100644
--- a/board/esd/tasreg/tasreg.c
+++ b/board/esd/tasreg/tasreg.c
@@ -29,7 +29,7 @@
/* Prototypes */
-int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
+int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
int i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len);
int i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len);
@@ -219,7 +219,7 @@ int i2c_probe(uchar addr);
/*
*/
-int do_iploop(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_iploop(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
ulong addr;
@@ -254,7 +254,7 @@ U_BOOT_CMD(
/*
*/
-int do_codec(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_codec(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
uchar buf[8];
@@ -307,7 +307,7 @@ U_BOOT_CMD(
/*
*/
-int do_saa(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_saa(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
ulong addr;
ulong instr;
@@ -340,7 +340,7 @@ U_BOOT_CMD(
/*
*/
-int do_iwrite(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_iwrite(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
ulong addr;
ulong data0;
@@ -379,7 +379,7 @@ U_BOOT_CMD(
/*
*/
-int do_iread(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_iread(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
ulong addr;
ulong cnt;
@@ -411,7 +411,7 @@ U_BOOT_CMD(
/*
*/
-int do_ireadl(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_ireadl(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
ulong addr;
uchar buf[32];
diff --git a/board/esd/vme8349/caddy.c b/board/esd/vme8349/caddy.c
index bda4117..ca8357d 100644
--- a/board/esd/vme8349/caddy.c
+++ b/board/esd/vme8349/caddy.c
@@ -53,7 +53,7 @@ void generate_answer(struct caddy_cmd *cmd, uint32_t status, uint32_t *result)
caddy_interface->answer_in = ptr;
}
-int do_caddy(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_caddy(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
unsigned long base_addr;
uint32_t ptr;
diff --git a/board/esd/voh405/voh405.c b/board/esd/voh405/voh405.c
index a5600de..6ed493e 100644
--- a/board/esd/voh405/voh405.c
+++ b/board/esd/voh405/voh405.c
@@ -33,7 +33,7 @@
#define FPGA_DEBUG
#endif
-extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
+extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
extern void lxt971_no_sleep(void);
/* fpga configuration data - gzip compressed and generated by bin2c */
@@ -356,7 +356,7 @@ int eeprom_write_enable (unsigned dev_addr, int state)
return state;
}
-int do_eep_wren (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_eep_wren (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
int query = argc == 1;
int state = 0;
diff --git a/board/esd/wuh405/wuh405.c b/board/esd/wuh405/wuh405.c
index 01966ee..704cd02 100644
--- a/board/esd/wuh405/wuh405.c
+++ b/board/esd/wuh405/wuh405.c
@@ -32,7 +32,7 @@
#define FPGA_DEBUG
#endif
-extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
+extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
/* fpga configuration data - gzip compressed and generated by bin2c */
const unsigned char fpgadata[] =