|
|
1.1 ! root 1: /* ! 2: ! 3: Adjacent Cell Disturb Test ! 4: ! 5: */ ! 6: ! 7: #include "definitions" ! 8: #define size (sizeof(testcase)/4) ! 9: extern int maxmem,endprog; ! 10: extern struct OPTIONS OPTIONS; ! 11: ! 12: stest3() ! 13: { ! 14: register long *mcr = (long *)0xffffb000; ! 15: ! 16: if (OPTIONS.header) ! 17: writes("\n** Subtest3 : Adjacent cell disturbance test."); ! 18: writes("\nECC off"); ! 19: *mcr = 0; ! 20: subtest3(); ! 21: writes("\nECC on"); ! 22: *mcr = 3; ! 23: subtest3(); ! 24: *mcr = 0; ! 25: } ! 26: ! 27: subtest3() ! 28: { ! 29: ! 30: register long pattern; ! 31: register long *curadd,*first,*last; ! 32: int cnt,loop,patno; ! 33: ! 34: static unsigned testcase[] = { 0x00000000, ! 35: 0xffffffff}; ! 36: ! 37: for(loop = size, patno = 0; (loop-- ); patno++ ) { ! 38: pattern = testcase[patno]; /* background filled */ ! 39: for(curadd = (long *)endprog;curadd <= (long *)maxmem;curadd++) ! 40: *curadd = pattern; ! 41: for(curadd=(long *)endprog;curadd <= (long *)maxmem;curadd++) { ! 42: /* ! 43: complement test cell and check ! 44: adjacent cells (before) ! 45: */ ! 46: start: *curadd = ~pattern; ! 47: last = curadd; ! 48: for(last--,cnt = 2;(cnt--) && ! 49: (last >= (long *)endprog);last--) { ! 50: error1: if (*last != pattern) ! 51: if (error(last,pattern)) goto error1; ! 52: } ! 53: /* ! 54: check adjacent cells (after) ! 55: */ ! 56: first = curadd; ! 57: for(first++,cnt = 2;(cnt--) && ! 58: (first <= (long *)maxmem);first++ ) { ! 59: error2: if (*first != pattern) ! 60: if (error(first,pattern)) goto error2; ! 61: } ! 62: if (*curadd != ~pattern) ! 63: if (error(curadd,~pattern)) goto start; ! 64: *curadd = pattern; ! 65: } ! 66: } ! 67: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.