From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerry Van Baren Date: Tue, 13 Sep 2005 14:43:35 -0400 Subject: [U-Boot-Users] PATCH for cmd_mem.c:do_mem_mtest() In-Reply-To: <20050913182731.6D1F23529BB@atlas.denx.de> References: <20050913182731.6D1F23529BB@atlas.denx.de> Message-ID: <43271DD7.1050003@smiths-aerospace.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Wolfgang Denk wrote: > In message you wrote: > >>Not on MIPS (unless someone was daft enough to map it >>with the TLB). The code causes a TLB store miss exception. >>Since this is in 'common' code, I think it's a bug. > > > OK. > > But all you need to do is #define CFG_MEMTEST_SCRATCH in your board > config file, right? > > >>With a static define of the scratch address I can't test one of the >>memories correctly becuase the scratch address is pointing to the >>other memory, so the scratch writes don't serve their purpose. > > > OK, but this is a special case, isn't it? > > Would it be acceptable for you if we just move the initialization > > dummy = (vu_long*)CFG_MEMTEST_SCRATCH; > > below the computation of "end", so that you can use > > #define CFG_MEMTEST_SCRATCH (--end) > > in your board config file? > > Best regards, > > Wolfgang Denk I'm not sure you want that, exactly. You are affecting the variable "end" as a side effect in a macro which is generally a bad idea. A no side effect version would be: #define CFG_MEMTEST_SCRATCH (end - 1) You are also making assumptions on the type of end (the variable, that is). I'm assuming this is a 32 bit wide memory test, sorry for not verifying that. You may want to coerce "end" to make sure the "- 1" subtracts the proper number of bytes: #define CFG_MEMTEST_SCRATCH ((void *)end - 1) gvb