Annotation of cci/d/macro4/addr_fault.c, revision 1.1

1.1     ! root        1: #include "fpp_defs.h"
        !             2: 
        !             3: 
        !             4: 
        !             5: /****************************************************************************
        !             6: *      Floating Point Test RESERVED_ADDRESS FAULT Handler
        !             7: *
        !             8: * The only way to this code is via an RESERVED ADDRESS fault and the 
        !             9: * EVENT handler. The fault may or may not be expected.
        !            10: *
        !            11: *  13-Feb-85   JJM: removed the messages from here & made code prettier
        !            12: ****************************************************************************/
        !            13: reserved_address()
        !            14: {
        !            15:        asm(".globl _res_addr_handler");        /* entry point              */
        !            16:        asm("_res_addr_handler:");
        !            17:        asm("movl _pre_event_fp,r13");          /* set the frame pointer    */
        !            18:        if( address_fault_expected ) 
        !            19:        {
        !            20:           asm("movl _post_event_sp,r14");      /* point SP to stack data   */
        !            21:           asm("movl (sp)+,_pop_val_1");        /* pop the PC of the instr. */
        !            22:           asm("movl (sp)+,_pop_val_2");        /* pop the pushed PSL       */
        !            23:           asm("movl _pre_event_sp,r14");       /* restore stack_pointer    */
        !            24: /*
        !            25:  * check the data on the stack
        !            26: */
        !            27:           if( (pop_val_1 != exp_pc) ||         /* expected PC ?            */
        !            28:               (pop_val_2 != exp_psl) )         /* expected PSL ?           */
        !            29:           {
        !            30:                 errcnt++;                      /* bump the error count     */
        !            31:                 if( prt_error ) 
        !            32:                 {
        !            33:                     writes("\ncyle: ");
        !            34:                     writed( cycle );
        !            35:                     writes(" FPP - ");
        !            36:                     writeh( test_no );
        !            37:                     writes(" - invalid stack after Reserved Addr fault");
        !            38:                     writes("\n addressing mode = ");
        !            39:                     writes( addressing_modes[addr_mode] );
        !            40:                     writes("\n stack PC = ");
        !            41:                     write32h( pop_val_1 );
        !            42:                     writes(", PSL = ");
        !            43:                     write32h( pop_val_2 );
        !            44:                     writes(",   exp PC = ");
        !            45:                     write32h( exp_pc );
        !            46:                     writes(",  PSL = ");
        !            47:                     write32h( exp_psl );
        !            48:                 }
        !            49:                 if ( halt_flg )                /* if halt on error         */
        !            50:                 {
        !            51:                    asm("movl _test_no,r0");    /* r0  = test number        */
        !            52:                    asm("movl $0,r1");          /* r1  = 0 (subtest number) */
        !            53:                    asm("movl $1,r2");          /* r2  = error code         */
        !            54:                    asm("movl _cycle,r3");      /* r3  = cycle count        */
        !            55:                    asm("movl _pop_val_1,r4");  /* r4  = actual PC on stack */
        !            56:                    asm("movl _pop_val_2,r5");  /* r5  = actual PSL on stck */
        !            57:                    asm("movl _exp_pc,r6");     /* r6  = expected PC        */
        !            58:                    asm("movl _exp_psl,r7");    /* r7  = expected PSL       */
        !            59:                    asm("_resaddr_hlt_1:");     /* PC after the halt        */
        !            60:                    asm("halt");                /* HALT ...                 */
        !            61:                 }
        !            62:                 if( loop_on_err ) 
        !            63:                 {
        !            64:                     force_loop = TRUE;         /* set the forced loop flag */
        !            65:                     asm("jmp *_loop_addr");    /* and go loop              */
        !            66:                 }
        !            67:            }  /* end of stack data error */
        !            68:        } 
        !            69:        else                    /* the address fault was not expected */
        !            70:        {
        !            71:            errcnt++;                           /* increment the error count */
        !            72:            if( prt_error ) 
        !            73:            {
        !            74:                writes("\ncyle: ");
        !            75:                writed( cycle );
        !            76:                writes(" FPP-");
        !            77:                writeh( test_no );
        !            78:                writes(" - invalid Reserved Addr fault");
        !            79:                writes("\n addressing mode = ");
        !            80:                writes( addressing_modes[addr_mode] );
        !            81:            }
        !            82:            if ( halt_flg )                     /* if halt on error         */
        !            83:            {
        !            84:                asm("movl _test_no,r0");        /* r0  = test number        */
        !            85:                asm("clrl r1");                 /* r1  = 0 (subtest number) */
        !            86:                asm("movl $2,r2");              /* r2  = error code         */
        !            87:                asm("movl _cycle,r3");          /* r3  = cycle count        */
        !            88:                asm("movl _addr_mode,r4");      /* r4  = addressing mode    */
        !            89:                asm(".globl _resaddr_hlt_2");
        !            90:                asm("_resaddr_hlt_2:");         /* PC after the halt        */
        !            91:                asm("halt");                    /* HALT ...                 */
        !            92:            } 
        !            93:            if( loop_on_err ) 
        !            94:            {
        !            95:                force_loop = TRUE;              /* We're going to loop  */
        !            96:                asm("jmp *_loop_addr");         /* loop forever         */
        !            97:            };
        !            98:        };  /* end of ELSE (unexpected fault) */
        !            99:        asm("jmp *_next_addr"); /* go to the next mode  */
        !           100: }
        !           101: 
        !           102: 
        !           103: 
        !           104: 
        !           105: 
        !           106: 
        !           107: 
        !           108: 
        !           109: /****************************************************************************
        !           110: *              No RESERVED_ADDRESS FAULT Occurred routine
        !           111: *
        !           112: * The only way to this code is if an expected RESERVED ADDRESS Fault did 
        !           113: * NOT occurr.
        !           114: ****************************************************************************/
        !           115: no_res_address()
        !           116: {
        !           117:        asm(".globl _no_res_addr_fault");
        !           118:        asm("_no_res_addr_fault:");             /* start of "no fault" stuff */
        !           119:        errcnt++;                               /* increment the error count */
        !           120:        if( prt_error ) 
        !           121:        {
        !           122:            writes("\ncyle: ");
        !           123:            writed( cycle );
        !           124:            writes(" FPP-");
        !           125:            writeh( test_no );
        !           126:            writes("  Expected Reserved Address fault did not occur");
        !           127:            writes("\n Addressing Mode = ");
        !           128:            writes( addressing_modes[addr_mode] );
        !           129:        }
        !           130:        if ( halt_flg )                         /* if halt on error         */
        !           131:        {
        !           132:            asm("movl _test_no,r0");            /* r0  = test number        */
        !           133:            asm("clrl r1");                     /* r1  = 0 (subtest number) */
        !           134:            asm("movl $3,r2");                  /* r2  = error code         */
        !           135:            asm("movl _cycle,r3");              /* r3  = cycle count        */
        !           136:            asm("movl _addr_mode,r4");          /* r4  = addressing mode    */
        !           137:            asm("_res_addr_hlt3:");             /* PC after the halt        */
        !           138:            asm("halt");                        /* HALT ...                 */
        !           139:        }
        !           140:        if( loop_on_err ) 
        !           141:        {
        !           142:            force_loop = TRUE;                  /* We're going to loop  */
        !           143:            asm("jmp *_loop_addr");             /* loop forever         */
        !           144:        } else
        !           145:            asm("jmp *_next_addr");;            /* go to the next mode  */
        !           146: }
        !           147: 
        !           148: 
        !           149: 
        !           150: 

unix.superglobalmegacorp.com

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