Annotation of cci/d/io/restart.c, revision 1.1

1.1     ! root        1: #include "preg.h"
        !             2: 
        !             3: extern long pfint, pfcnt, memflg;
        !             4: extern long sbr, slr, p0br, p0lr, p1br, p1lr, p2br, p2lr, ipl, mme, Pcbb;
        !             5: extern long Isp, Sisr, scbb, ksp;
        !             6: 
        !             7: #define        NBPG    1024
        !             8: #define        TP0BR   0x100
        !             9: #define        TP0LR   0x200
        !            10: #define        TP1BR   0x300
        !            11: #define        TP1LR   0x400
        !            12: #define        TP2BR   0x500
        !            13: #define        TP2LR   0x600
        !            14: #define        TKSP    0x700
        !            15: #define KMEM   64
        !            16: 
        !            17: 
        !            18: pfsetup(baddr)
        !            19: register long *baddr;
        !            20: {      register long ix;
        !            21: 
        !            22:        /* write pattern into 64K of memory */
        !            23:        writes("** writing patterns to 64K bytes of memory...\n");
        !            24:        for(ix=0;ix<((NBPG/4)*KMEM) ;ix++) baddr[ix] = ix;
        !            25: }
        !            26: 
        !            27: 
        !            28: prest(baddr)
        !            29: register long *baddr;
        !            30: {      register long ix;
        !            31: 
        !            32:        writes("** Power restarted...\n");
        !            33:        if (pfint==0) {
        !            34:                writes("   Tahoe did not receive power fail interrupt.\n");
        !            35:                }
        !            36:        if (memflg != 0xcafebabe) {
        !            37:                writes("   Memory is not backed up on when power fails\n");
        !            38:                return(0);
        !            39:                }
        !            40:        writes("   Count is "); writeh(pfcnt);
        !            41: 
        !            42:        /* Check if memory is backed up */
        !            43:        writes("   Checking patterns written to memory previously...\n");
        !            44:        for(ix=0;ix<((NBPG/4)*KMEM) ;ix++) {
        !            45:                if (baddr[ix] != ix) {
        !            46:                        writes("** Memory error, begin address ");
        !            47:                        writeh(baddr); writes(", longword no. "); writeh(ix);
        !            48:                        writes(", actual "); writeh(baddr[ix]);
        !            49:                        break;
        !            50:                        }
        !            51:                }
        !            52:        chk_pr();               /* Check privilege registes */
        !            53: }
        !            54: 
        !            55: chk_pr()
        !            56: {      register long actual;
        !            57: 
        !            58:        actual = mfpr(SBR);
        !            59:        if (actual != sbr) pferr("\n   SBR error ",actual,sbr);
        !            60:        actual = mfpr(SLR);
        !            61:        if (actual != slr) pferr("\n   SLR error ",actual,slr);
        !            62:        actual = mfpr(P0BR);
        !            63:        if (actual != p0br) pferr("\n   P0BR error ",actual,p0br);
        !            64:        actual = mfpr(P0LR);
        !            65:        if (actual != p0lr) pferr("\n   P0LR error ",actual,p0lr);
        !            66:        actual = mfpr(P1BR);
        !            67:        if (actual != p1br) pferr("\n   P1BR error ",actual,p1br);
        !            68:        actual = mfpr(P1LR);
        !            69:        if (actual != p1lr) pferr("\n   P1LR error ",actual,p1lr);
        !            70:        actual = mfpr(P2BR);
        !            71:        if (actual != p2br) pferr("\n   P2BR error ",actual,p2br);
        !            72:        actual = mfpr(P2LR);
        !            73:        if (actual != p2lr) pferr("\n   P2LR error ",actual,p2lr);
        !            74:        actual = mfpr(IPL);
        !            75:        if (actual != ipl) pferr("\n   IPL error ",actual,ipl);
        !            76:        actual = mfpr(MME);
        !            77:        if (actual != mme) pferr("\n   MME error ",actual,mme);
        !            78:        actual = mfpr(PCBB);
        !            79:        if (actual != Pcbb) pferr("\n   PCBB error ",actual,Pcbb);
        !            80:        actual = mfpr(ISP);
        !            81:        if (actual != Isp) pferr("\n   ISP error ",actual,Isp);
        !            82:        actual = mfpr(SISR);
        !            83:        if (actual != Sisr) pferr("\n   SISR error ",actual,Sisr);
        !            84:        actual = mfpr(SCBB);
        !            85:        if (actual != scbb) pferr("\n   SCBB error ",actual,scbb);
        !            86:        actual = mfpr(KSP);
        !            87:        if (actual != ksp) pferr("\n   KSP error ",actual,ksp);
        !            88: }
        !            89: 
        !            90: 
        !            91: mfpr(pn)
        !            92: long pn;
        !            93: {      register long r12;
        !            94: 
        !            95:        asm("mfpr 4(fp),r12");
        !            96:        return(r12);
        !            97: }
        !            98: 
        !            99: pferr(str,actual,expected)
        !           100: char *str;
        !           101: long actual, expected;
        !           102: {
        !           103:        writes(str); writes("** actual "); writeh(actual); 
        !           104:        writes(" , expected "); writeh(expected);
        !           105: }

unix.superglobalmegacorp.com

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