Annotation of cci/d/dmp4/chk_trans_acc.c, revision 1.1

1.1     ! root        1: 
        !             2: #include "dmp_defs.h"
        !             3: 
        !             4: 
        !             5: /************************************************************************
        !             6: *              Verify the accmulator after a page fault
        !             7: *
        !             8: *  The accumulator should not be changed until after all of the instruction
        !             9: *  was read from valid memory. This routine is called from the Page Fault
        !            10: *  handler to make sure that the accumulator is still unmodified. This
        !            11: *  is to detect if any instructions are getting executed from an invalid
        !            12: *  page of memory. 
        !            13: *  The "no-fpp" firmware will not clear double precision "bad 0's".
        !            14: *
        !            15: ************************************************************************/
        !            16: chk_trans_acc()
        !            17: {
        !            18:        if( acc_ld_size == DBL ) {
        !            19:             asm("std _trans_acc");             /* store the DBL Acc. */
        !            20:        } else {
        !            21:             asm("stf _trans_acc");             /* store the SGL Acc. */
        !            22:        }
        !            23:        if( (dbl_ld_acc.m & 0x7f800000) || 
        !            24:            ( (no_fpp_wcs) && (precision == DBL) ) ) {
        !            25:             exp_trans_acc.m = dbl_ld_acc.m;
        !            26:             exp_trans_acc.l = dbl_ld_acc.l;
        !            27:        } else {                                /* zero accumulator */
        !            28:             exp_trans_acc.m = 0;               /* clear any bad 0's */
        !            29:             exp_trans_acc.l = 0;
        !            30:        }
        !            31:        if( (trans_acc.m != exp_trans_acc.m) ||     /* compare current Acc */
        !            32:            ( (acc_ld_size == DBL) &&               /*   to the Acc loaded */
        !            33:              (trans_acc.l != exp_trans_acc.l) ) ) {
        !            34:             errcnt++;                          /* bump the error count    */
        !            35:             trans_acc_error = TRUE;            /* set the error flag      */
        !            36:             if( prt_error )
        !            37:                  prt_trans_acc_er();           /* print an error message  */
        !            38:             if( halt_flg )
        !            39:                  trans_acc_er_hlt();           /* halt on the error       */
        !            40:             if( loop_on_err )
        !            41:                  force_loop = TRUE;            /* set the error loop flag */
        !            42:        }
        !            43: }
        !            44: 
        !            45: 
        !            46: 
        !            47: 
        !            48: /************************************************************************
        !            49: *      print a Accumulator Corrupted After a Page Fault error message
        !            50: *
        !            51: * The message will be of the form:
        !            52: * cycle: xx. DMP test xx. <inst>. Bad Acc. after a page fault, index = xx
        !            53: * addressing mode: <addressing mode description>
        !            54: * inst buf= xx xx xx xx xx xx xx xx xx xx xx -page faults on byte(s) 0, x 
        !            55: *   Acc loaded = xxxxxxxx xxxxxxxx,  operand 1 = xxxxxxxx xxxxxxxx
        !            56: *   Acc stored = xxxxxxxx xxxxxxxx,  operand 2 = xxxxxxxx xxxxxxxx
        !            57: * Acc expected = xxxxxxxx xxxxxxxx,  error after page fault #xx
        !            58: ************************************************************************/
        !            59: prt_trans_acc_er()
        !            60: {
        !            61: 
        !            62:        prt_dmp_er_msg( trans_acc_er_msg );     /* print the error msg */
        !            63:        writes("  Acc loaded = ");
        !            64:        write32h( dbl_ld_acc.m );
        !            65:        if( acc_ld_size == DBL ) {
        !            66:             writec(' ');
        !            67:             write32h( dbl_ld_acc.l );
        !            68:        }
        !            69:        writes(", ");
        !            70:        if( no_ops ) {
        !            71:             writes("  operand 1 = ");
        !            72:             write32h( dbl_value_1.m );
        !            73:             if( acc_ld_size == DBL ) {
        !            74:                  writec(' ');
        !            75:                  write32h( dbl_value_1.l );
        !            76:             }
        !            77:             writec('\n');
        !            78:        }
        !            79:        writes("  Acc stored = ");
        !            80:        write32h( trans_acc.m );
        !            81:        if( acc_ld_size == DBL ) {
        !            82:             writec(' ');
        !            83:             write32h( trans_acc.l );
        !            84:        }
        !            85:        if( no_ops == 2 ) {
        !            86:             writes(",   operand 2 = ");
        !            87:             write32h( dbl_value_2.m );
        !            88:             if( acc_ld_size == DBL ) {
        !            89:                  writec(' ');
        !            90:                  write32h( dbl_value_2.l );
        !            91:             }
        !            92:        }
        !            93:        writes("\nAcc expected = ");
        !            94:        write32h( exp_trans_acc.m );
        !            95:        if( acc_ld_size == DBL ) {
        !            96:             writec(' ');
        !            97:             write32h( exp_trans_acc.l );
        !            98:        }
        !            99:        writes(",   error after page fault #");
        !           100:        writed( no_page_faults );
        !           101:        writec('\n');
        !           102: }
        !           103: 
        !           104: 
        !           105: 
        !           106: 
        !           107: /*************************************************************************
        !           108: *
        !           109: *      Error Halt for a bad Accumulator after a page fault
        !           110: *
        !           111: *************************************************************************/
        !           112: trans_acc_er_hlt()
        !           113: {
        !           114:        sgl_value_1 = dbl_ld_acc.m;
        !           115:        sgl_value_2 = dbl_ld_acc.l;
        !           116:        sgl_value_3 = trans_acc.m;
        !           117:        sgl_value_4 = trans_acc.l;
        !           118:        sgl_value_5 = exp_trans_acc.m;
        !           119:        sgl_value_6 = exp_trans_acc.l;
        !           120:        asm("movl _test_no,r0");                /* r0  = test number       */
        !           121:        asm("movl _addr_code,r1");              /* r1  = addr mode code    */
        !           122:        asm("movl $6,r2");                      /* r2  = error code (6)    */
        !           123:        asm("movl _cycle,r3");                  /* r3  = cycle count       */
        !           124:        asm("movl _sgl_value_1,r4");            /* r4  = MS of initial Acc  */
        !           125:        asm("movl _sgl_value_2,r5");            /* r5  = LS of initial Acc  */
        !           126:        asm("movl _sgl_value_3,r6");            /* r6  = MS of final Acc    */
        !           127:        asm("movl _sgl_value_4,r7");            /* r7  = LS of final Acc    */
        !           128:        asm("movl _sgl_value_5,r8");            /* r8  = MS of expected Acc */
        !           129:        asm("movl _sgl_value_6,r9");            /* r9  = LS of expected Acc */
        !           130:        asm("movl _no_page_faults,r10");        /* r10 = pg fault # of err. */
        !           131:        asm("movl _dbl_value_1,r11");           /* r11 = MS of operand 1    */
        !           132:        asm("movl _dbl_value_1+4,r12");         /* r12 = LS of operand 1    */
        !           133:        asm("movl _dbl_value_2,r13");           /* r13 = MS of operand 2    */
        !           134:        asm("halt");                            /* halt                     */
        !           135: }

unix.superglobalmegacorp.com

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