summaryrefslogtreecommitdiffstats
path: root/commands/memtest.c
diff options
context:
space:
mode:
authorEnrik Berkhan <Enrik.Berkhan@ge.com>2008-01-23 12:12:01 +0100
committerWolfram Sang <w.sang@pengutronix.de>2008-01-23 12:13:23 +0100
commitbd0aed0ae0298baf571e058e9e5df39dcab57ca5 (patch)
tree7c2e5894c511e076bb90f957fe9097ebfcd97df8 /commands/memtest.c
parent5c2afd89e1e0d2cddbc634890cae377f4392990e (diff)
downloadbarebox-bd0aed0ae0298baf571e058e9e5df39dcab57ca5.tar.gz
Avoid memtest at scratch address
When the tested address equals the scratch location, memtest will fail. Signed-Off-By: Enrik Berkhan <Enrik.Berkhan@ge.com>
Diffstat (limited to 'commands/memtest.c')
-rw-r--r--commands/memtest.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/commands/memtest.c b/commands/memtest.c
index 2c0dd3c..a1d2df0 100644
--- a/commands/memtest.c
+++ b/commands/memtest.c
@@ -48,7 +48,7 @@ static int mem_test(ulong _start, ulong _end, ulong pattern_unused)
vu_long temp;
vu_long anti_pattern;
vu_long num_words;
-#ifdef GFG_MEMTEST_SCRATCH
+#ifdef CFG_MEMTEST_SCRATCH
vu_long *dummy = (vu_long*)CFG_MEMTEST_SCRATCH;
#else
vu_long *dummy = 0; /* yes, this is address 0x0, not NULL */
@@ -67,6 +67,7 @@ static int mem_test(ulong _start, ulong _end, ulong pattern_unused)
0xaaaaaaaa, /* alternating 1/0 */
};
+ /* XXX: enforce alignment of start and end? */
for (;;) {
if (ctrlc()) {
putchar ('\n');
@@ -94,6 +95,8 @@ static int mem_test(ulong _start, ulong _end, ulong pattern_unused)
* pattern and ~pattern).
*/
addr = start;
+ /* XXX */
+ if (addr == dummy) ++addr;
for (j = 0; j < sizeof(bitpattern)/sizeof(bitpattern[0]); j++) {
val = bitpattern[j];
for(; val != 0; val <<= 1) {