+ memtest_progress_step(w+iwords*off,words,'R');
+ }
+ }
+}
+
+/* Like memtest_fill_random() but uses the two specified values to fill
+ * memory, in an alternated way (v1|v2|v1|v2|...) */
+void memtest_fill_value(unsigned long *l, size_t bytes, unsigned long v1,
+ unsigned long v2, char sym)
+{
+ unsigned long step = 4096/sizeof(unsigned long);
+ unsigned long words = bytes/sizeof(unsigned long)/2;
+ unsigned long iwords = words/step; /* words per iteration */
+ unsigned long off, w, *l1, *l2, v;
+
+ assert((bytes & 4095) == 0);
+ for (off = 0; off < step; off++) {
+ l1 = l+off;
+ l2 = l1+words;
+ v = (off & 1) ? v2 : v1;
+ for (w = 0; w < iwords; w++) {
+#ifdef MEMTEST_32BIT
+ *l1 = *l2 = ((unsigned long) v) |
+ (((unsigned long) v) << 16);
+#else
+ *l1 = *l2 = ((unsigned long) v) |
+ (((unsigned long) v) << 16) |
+ (((unsigned long) v) << 32) |
+ (((unsigned long) v) << 48);
+#endif
+ l1 += step;
+ l2 += step;
+ if ((w & 0xffff) == 0)
+ memtest_progress_step(w+iwords*off,words,sym);