From bd0aed0ae0298baf571e058e9e5df39dcab57ca5 Mon Sep 17 00:00:00 2001 From: Enrik Berkhan Date: Wed, 23 Jan 2008 12:12:01 +0100 Subject: Avoid memtest at scratch address When the tested address equals the scratch location, memtest will fail. Signed-Off-By: Enrik Berkhan --- commands/memtest.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'commands/memtest.c') diff --git a/commands/memtest.c b/commands/memtest.c index 2c0dd3c7e0..a1d2df03eb 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) { -- cgit v1.2.3