Message ID | CAOMZO5CBmSMUfGL8UKGaLHaGPrTvhtry-cbxBqY3n2fxAaz6jQ@mail.gmail.com |
---|---|
State | Not Applicable |
Headers | show |
Am 14/04/2012 17:28, schrieb Fabio Estevam: > On Sat, Apr 14, 2012 at 12:24 PM, Fabio Estevam <festevam@gmail.com> wrote: > >> Something like the patch below? (Build tested only - no hardware handy >> right now) > > Sorry, I meant the patch below: > > --- a/common/cmd_mem.c > +++ b/common/cmd_mem.c > @@ -40,6 +40,8 @@ > #define PRINTF(fmt,args...) > #endif > > +DECLARE_GLOBAL_DATA_PTR; > + > static int mod_mem(cmd_tbl_t *, int, int, int, char * const []); > > /* Display values from last command. > @@ -656,8 +658,10 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, cha > > if (argc > 1) > start = (ulong *)simple_strtoul(argv[1], NULL, 16); > - else > + else { > start = (ulong *)CONFIG_SYS_MEMTEST_START; > + end = (ulong *)(gd->relocaddr -1 ); Something like this, but not exactly this. After sending my answer I remembered that the stack is *before* u-boot code, and not after as I wrote - using gd->relocaddr is wrong. We should subtract the memory reserve for stack and heap from this value. Stefano
Dear Stefano, In message <4F899F3B.2080103@denx.de> you wrote: > > Something like this, but not exactly this. After sending my answer I > remembered that the stack is *before* u-boot code, and not after as I > wrote - using gd->relocaddr is wrong. We should subtract the memory > reserve for stack and heap from this value. There is no builtin limit for the stack size in U-Boot. It gows downward unchecked. Best regards, Wolfgang Denk
Am 14/04/2012 22:15, schrieb Wolfgang Denk: > Dear Stefano, > > In message <4F899F3B.2080103@denx.de> you wrote: >> >> Something like this, but not exactly this. After sending my answer I >> remembered that the stack is *before* u-boot code, and not after as I >> wrote - using gd->relocaddr is wrong. We should subtract the memory >> reserve for stack and heap from this value. > > There is no builtin limit for the stack size in U-Boot. It gows > downward unchecked. I see, but then it seems to me that CONFIG_STACKSIZE is obsolete - right ? Best regards, Stefano Babic
--- a/common/cmd_mem.c +++ b/common/cmd_mem.c @@ -40,6 +40,8 @@ #define PRINTF(fmt,args...) #endif +DECLARE_GLOBAL_DATA_PTR; + static int mod_mem(cmd_tbl_t *, int, int, int, char * const []); /* Display values from last command. @@ -656,8 +658,10 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, cha if (argc > 1) start = (ulong *)simple_strtoul(argv[1], NULL, 16); - else + else { start = (ulong *)CONFIG_SYS_MEMTEST_START; + end = (ulong *)(gd->relocaddr -1 ); + } if (argc > 2) end = (ulong *)simple_strtoul(argv[2], NULL, 16);