Test that addressing is fine. Every location is populated with its own * address, and finally verified. This test is very fast but may detect * ASAP big issues with the memory subsystem. */
| 91 | * address, and finally verified. This test is very fast but may detect |
| 92 | * ASAP big issues with the memory subsystem. */ |
| 93 | int memtest_addressing(unsigned long *l, size_t bytes, int interactive) { |
| 94 | unsigned long words = bytes/sizeof(unsigned long); |
| 95 | unsigned long j, *p; |
| 96 | |
| 97 | /* Fill */ |
| 98 | p = l; |
| 99 | for (j = 0; j < words; j++) { |
| 100 | *p = (unsigned long)p; |
| 101 | p++; |
| 102 | if ((j & 0xffff) == 0 && interactive) |
| 103 | memtest_progress_step(j,words*2,'A'); |
| 104 | } |
| 105 | /* Test */ |
| 106 | p = l; |
| 107 | for (j = 0; j < words; j++) { |
| 108 | if (*p != (unsigned long)p) { |
| 109 | if (interactive) { |
| 110 | printf("\n*** MEMORY ADDRESSING ERROR: %p contains %lu\n", |
| 111 | (void*) p, *p); |
| 112 | exit(1); |
| 113 | } |
| 114 | return 1; |
| 115 | } |
| 116 | p++; |
| 117 | if ((j & 0xffff) == 0 && interactive) |
| 118 | memtest_progress_step(j+words,words*2,'A'); |
| 119 | } |
| 120 | return 0; |
| 121 | } |
| 122 | |
| 123 | /* Fill words stepping a single page at every write, so we continue to |
| 124 | * touch all the pages in the smallest amount of time reducing the |
no test coverage detected