int test_burst (int argc, char *argv[])
{
unsigned long size = CACHE_LINE_SIZE;
- int res;
- int i;
+ unsigned int pass = 0;
+ int res = 0;
+ int i, j;
- if (argc == 2) {
+ if (argc == 3) {
char * d;
for (size = 0, d = argv[1]; *d >= '0' && *d <= '9'; d++) {
size *= 10;
test_usage();
return 1;
}
- } else if (argc > 2) {
+ for (d = argv[2]; *d >= '0' && *d <= '9'; d++) {
+ pass *= 10;
+ pass += *d - '0';
+ }
+ if (*d) {
+ test_usage();
+ return 1;
+ }
+ } else if (argc > 3) {
test_usage();
return 1;
}
test_desc(size);
- for (i = 0; i < sizeof(test_pattern) / sizeof(test_pattern[0]); i++) {
- res = test_burst_start(size, test_pattern[i]);
- if (res != 0) {
- goto Done;
+ for (j = 0; !pass || j < pass; j++) {
+ for (i = 0; i < sizeof(test_pattern) / sizeof(test_pattern[0]);
+ i++) {
+ res = test_burst_start(size, test_pattern[i]);
+ if (res != 0) {
+ goto Done;
+ }
}
+
+ printf ("Iteration #%d passed\n", j + 1);
+
+ if (tstc() && 0x03 == getc())
+ break;
}
Done:
return res;
int i, n;
int res = 1;
- printf ("Test pattern %08x ...", pattern);
+ printf ("Test pattern %08lx ...", pattern);
n = size / 4;
{
printf(
"The following tests will be conducted:\n"
- "1) Map %d-byte region of physical RAM at 0x%08x\n"
+ "1) Map %ld-byte region of physical RAM at 0x%08x\n"
" into two virtual regions:\n"
" one cached at 0x%08x and\n"
" the the other uncached at 0x%08x.\n",
p[1] = val;
p[2] = pattern;
- printf ("\nError at step %s, addr %08x: read %08x, pattern %08x",
- step, addr, val, pattern);
+ printf ("\nError at step %s, addr %08lx: read %08lx, pattern %08lx",
+ step, (unsigned long)addr, val, pattern);
}
static void signal_init(void)
static void test_usage(void)
{
- printf("Usage: go 0x40004 [size]\n");
+ printf("Usage: go 0x40004 [size] [count]\n");
}