|
|
Power 6/32 Unix version 1.2b
/*
Adjacent Cell Disturb Test
*/
#include "definitions"
#define size (sizeof(testcase)/4)
extern int maxmem,endprog;
extern struct OPTIONS OPTIONS;
stest3()
{
register long *mcr = (long *)0xffffb000;
if (OPTIONS.header)
writes("\n** Subtest3 : Adjacent cell disturbance test.");
writes("\nECC off");
*mcr = 0;
subtest3();
writes("\nECC on");
*mcr = 3;
subtest3();
*mcr = 0;
}
subtest3()
{
register long pattern;
register long *curadd,*first,*last;
int cnt,loop,patno;
static unsigned testcase[] = { 0x00000000,
0xffffffff};
for(loop = size, patno = 0; (loop-- ); patno++ ) {
pattern = testcase[patno]; /* background filled */
for(curadd = (long *)endprog;curadd <= (long *)maxmem;curadd++)
*curadd = pattern;
for(curadd=(long *)endprog;curadd <= (long *)maxmem;curadd++) {
/*
complement test cell and check
adjacent cells (before)
*/
start: *curadd = ~pattern;
last = curadd;
for(last--,cnt = 2;(cnt--) &&
(last >= (long *)endprog);last--) {
error1: if (*last != pattern)
if (error(last,pattern)) goto error1;
}
/*
check adjacent cells (after)
*/
first = curadd;
for(first++,cnt = 2;(cnt--) &&
(first <= (long *)maxmem);first++ ) {
error2: if (*first != pattern)
if (error(first,pattern)) goto error2;
}
if (*curadd != ~pattern)
if (error(curadd,~pattern)) goto start;
*curadd = pattern;
}
}
}
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.