/* checks the memblock of <size> bytes from <startaddr> returns the address of the error or NULL if all is well  */
void* RAM_MemTest_CheckWalkBit(int mode, unsigned long startaddr, unsigned long size)
/* checks the memblock of <size> bytes from <startaddr> returns the address of the error or NULL if all is well  */
void* RAM_MemTest_CheckWalkBit(int mode, unsigned long startaddr, unsigned long size)
{
	volatile unsigned long *p, *pe;
	unsigned long actual, expected;
	unsigned long i;
	p = (unsigned long *) startaddr;
	pe = (unsigned long *) (startaddr + size);
	i = 0;
	while (p < pe) {
		actual = *p;
		expected = (1UL << i);
		if (actual != expected) {
			Write_Error (mode, (unsigned long) p, expected, actual);
			return ((void *) p);
		}
		i = (i + 1 + (((unsigned long) p) >> 7)) % 32;
		p++;
	}
	return (NULL);
}