Annotation of cci/d/mem/test1.c, revision 1.1.1.1

1.1       root        1: /* 
                      2:        This is test Marching Ones and Zero Test
                      3: */
                      4: 
                      5: #include  "definitions"
                      6: #define        size    (sizeof(testcase)/4)            /* number of patterns */
                      7: extern long    maxmem,endprog;
                      8: extern struct OPTIONS OPTIONS;
                      9: 
                     10: stest1()
                     11: {      register long *mcr = (long *)0xffffb000;
                     12: 
                     13:   if (OPTIONS.header)
                     14:        writes("\n\n** Subtest1 : Marching patterns.");
                     15:        writes("\nECC off");
                     16:        *mcr = 0;                       /* Turn ECC off */
                     17:        subtest1();                     /* Execute subtest 1 */
                     18:        writes("\nECC on");
                     19:        *mcr = 0xc3;                    /* Turn ECC on */
                     20:        subtest1();                     /* Execute subtest 1 */
                     21:        *mcr = 0;                       /* Turn ECC off */
                     22: }
                     23: 
                     24: subtest1()
                     25: {
                     26:   register long *curadd,*addr,pattern;
                     27:   int  cnt,patno;
                     28: 
                     29:   static unsigned testcase[] =  { 0x00000000,
                     30:                                0xffffffff,
                     31:                                0xa5a5a5a5,
                     32:                                0x5a5a5a5a,
                     33:                                0x55555555,
                     34:                                0xaaaaaaaa,
                     35:                                0x0000ffff,
                     36:                                0xffff0000 };
                     37: 
                     38:   for(cnt = size, patno = 0;(cnt-- ); patno++ ) {
                     39:        pattern = testcase[patno];              /* fill memory */
                     40:        for (curadd=(long *)endprog;curadd <= (long *)maxmem;curadd++)
                     41:                *curadd = pattern;
                     42:        for (curadd=(long *)endprog;curadd <= (long *)maxmem;curadd++) {
                     43: error1:                if (*curadd != pattern)
                     44:                        if (error(curadd,pattern)) goto error1;
                     45:                 *curadd = ~pattern;
                     46:                }
                     47:        for (curadd=(long *)maxmem;curadd >= (long *)endprog;curadd--) {
                     48: error2:                if (*curadd != (~pattern))
                     49:                        if (error(curadd,~pattern)) goto error2;
                     50:                *curadd = ~pattern;
                     51:                }
                     52:        }
                     53: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.