- printf("\nFAILURE (read/write): @ 0x%.5lx:"
- " expected 0x%.5lx, actual 0x%.5lx)\n",
- start_addr + offset*sizeof(vu_long),
- anti_pattern, temp);
- errs++;
- if (ctrlc())
- return -1;
- }
- addr[offset] = 0;
- }
-
- return 0;
-}
-
-static uint32_t mem_test_quick(vu_long *buf, uint32_t start_addr, uint32_t end_addr,
- vu_long pattern, int iteration)
-{
- vu_long *end;
- vu_long *addr;
- uint32_t errs = 0;
- uint32_t incr, length;
- uint32_t val, readback;
-
- /* Alternate the pattern */
- incr = 1;
- if (iteration & 1) {
- incr = -incr;
- /*
- * Flip the pattern each time to make lots of zeros and
- * then, the next time, lots of ones. We decrement
- * the "negative" patterns and increment the "positive"
- * patterns to preserve this feature.
- */
- if (pattern & 0x80000000)
- pattern = -pattern; /* complement & increment */
- else
- pattern = ~pattern;
- }
- length = (end_addr - start_addr) / sizeof(uint32_t);
- end = buf + length;
- printf("\rPattern %08lX Writing..."
- "%12s"
- "\b\b\b\b\b\b\b\b\b\b",
- pattern, "");
-
- for (addr = buf, val = pattern; addr < end; addr++) {
- *addr = val;
- val += incr;
- }
-
- my_puts("Reading...");
-
- for (addr = buf, val = pattern; addr < end; addr++) {
- readback = *addr;
- if (readback != val) {
- uint32_t offset = addr - buf;
-
- printf("\nMem error @ 0x%08X: "
- "found %08lX, expected %08lX\n",
- (unsigned int)(uintptr_t)(start_addr + offset*sizeof(vu_long)),
- readback, val);
+ printf_P(PSTR("FAILURE (read/write) @ 0x%.5lx:"
+ " expected 0x%.2x, actual 0x%.2x)\n"),
+ start_addr, anti_pattern, temp);