|
|
Power 6/32 Unix version 1.2b
/*
This is test Marching Ones and Zero Test
*/
#include "definitions"
#define size (sizeof(testcase)/4) /* number of patterns */
extern long maxmem,endprog;
extern struct OPTIONS OPTIONS;
stest1()
{ register long *mcr = (long *)0xffffb000;
if (OPTIONS.header)
writes("\n\n** Subtest1 : Marching patterns.");
writes("\nECC off");
*mcr = 0; /* Turn ECC off */
subtest1(); /* Execute subtest 1 */
writes("\nECC on");
*mcr = 0xc3; /* Turn ECC on */
subtest1(); /* Execute subtest 1 */
*mcr = 0; /* Turn ECC off */
}
subtest1()
{
register long *curadd,*addr,pattern;
int cnt,patno;
static unsigned testcase[] = { 0x00000000,
0xffffffff,
0xa5a5a5a5,
0x5a5a5a5a,
0x55555555,
0xaaaaaaaa,
0x0000ffff,
0xffff0000 };
for(cnt = size, patno = 0;(cnt-- ); patno++ ) {
pattern = testcase[patno]; /* fill memory */
for (curadd=(long *)endprog;curadd <= (long *)maxmem;curadd++)
*curadd = pattern;
for (curadd=(long *)endprog;curadd <= (long *)maxmem;curadd++) {
error1: if (*curadd != pattern)
if (error(curadd,pattern)) goto error1;
*curadd = ~pattern;
}
for (curadd=(long *)maxmem;curadd >= (long *)endprog;curadd--) {
error2: if (*curadd != (~pattern))
if (error(curadd,~pattern)) goto error2;
*curadd = ~pattern;
}
}
}
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.