On Fri, 12 May -1, Erik Mouw wrote:
> Nicolas Pitre also wrote a memory tester to one of the arm-linux lists,
> but I can't find it in my archive (Nico?).
I posted it to sa1100-linux. I wish someone still has it in his archives
because the version I posted was specially cleaned and commented...
However I don't know if and where I put it.
Nicolas
/*
* Test sequence length of 32 bit CRC polynomial.
*
*/
#include <stdio.h>
#include <stdlib.h>
#define POLY (0x04c11db7U)
int main(void)
{
unsigned long a = 0xffffffff;
int i = 0, j = 0;
do {
if(!(i&(1024*1024-1))) {
j++;
printf("%d MB.\r",j);
}
// printf("%.8x,", a);
// if((i%8)==7)
// printf("\n");
if(a&0x80000000) {
a <<= 1;
a |= 1;
a ^= POLY;
}
else {
a <<=1;
a |= 1;
}
i++;
} while(0xffffffff != a);
printf("\nSequence length is %d.\n", i);
return 0;
}