Annotation of cci/d/entry/M_error.c, revision 1.1.1.1

1.1       root        1: 
                      2: /*     For error reporting
                      3: */
                      4: long test_no;
                      5: long subtst;
                      6: long ercode;
                      7: long actual;
                      8: long expected;
                      9: long stpc;
                     10: long no_opr;
                     11: long opr[4];
                     12: long error_cnt;
                     13: 
                     14: /*     For looping
                     15: */
                     16: long cycle;
                     17: long forever;
                     18: long force_lp, scoplp;
                     19: 
                     20: /*     For messages
                     21: */
                     22: long display;
                     23: long heading;
                     24: long op_mode;          /* 1 : Tahoe, 0 : CP */
                     25: 
                     26: /*     Counters
                     27: */
                     28: long prog_cnt;
                     29: long test_cnt;
                     30: extern struct TEST_TBL {
                     31:        short run;
                     32:        short loop;
                     33:        char *name;
                     34: } test_tbl[];
                     35: 
                     36: M_error()
                     37: {
                     38:        if (op_mode == 1) tahoe_err();
                     39:           else         /* Gives everythings to CP */
                     40:                cp_err();
                     41: }
                     42: 
                     43: tahoe_err()
                     44: {      register long dummy;
                     45: 
                     46:        if (display) disp_err();
                     47:        if (forever && !display) scoplp = 1;  
                     48:        if (forever) { 
                     49:                        force_lp = 1;   /* Checked in each subtest */
                     50:                        longjmp();
                     51:                        }
                     52:        dummy =1;
                     53:        asm("halt");
                     54: }
                     55: 
                     56: disp_err()
                     57: {      long ix;
                     58: 
                     59:        writes("\n      ** Test no ("); writeh(test_no); writes(") "); 
                     60:        writes(test_tbl[test_no-1].name);
                     61:        writes("Subtest "); writed(subtst);
                     62:        if (ercode==1)  writes("\nUnexpected result.");
                     63:                else if (ercode==2) writes("\nFlag error.");
                     64:                        else if (ercode==3) writes("\nOperand modified.");
                     65:        writes("\n** Actual "); writeh(actual);
                     66:        writes(", Expected "); writeh(expected);
                     67:        for (ix=0;ix<no_opr;ix++) {
                     68:                writes("\nOperand");writed(ix+1); writes(" ");writeh(opr[ix]);
                     69:                }
                     70:        writec('\n');
                     71: }
                     72: 
                     73: long tname;
                     74: cp_err()
                     75: {      long dummy;
                     76:        if (forever) { 
                     77:                force_lp = 1;   /* Checked in each subtest */ 
                     78:                scoplp = 1;
                     79:                longjmp();
                     80:                }
                     81:        tname = (long)test_tbl[test_no-1].name;
                     82:        asm("movl _test_no,r0");
                     83:        asm("movl _stpc,r1");
                     84:        asm("movl _subtst,r2");
                     85:        asm("movl _ercode,r3");
                     86:        asm("movl _actual,r4");
                     87:        asm("movl _expected,r5");
                     88:        asm("movl _no_opr,r6");
                     89:        asm("movl _opr,r7");
                     90:        asm("movl _opr + 4,r8");
                     91:        asm("movl _opr + 8,r9");
                     92:        asm("movl _opr + 12,r10");
                     93:        asm("movl _tname,r11");
                     94:        asm("halt");
                     95: }
                     96: 
                     97: lp_init()
                     98: {
                     99:        /* Clear all vars for looping */
                    100:        error_cnt=subtst=ercode=actual=expected=stpc=no_opr=0;
                    101:        opr[0]=opr[1]=opr[2]=opr[3]=0;
                    102: 
                    103: }
                    104: 
                    105: End()
                    106: {
                    107:        writes("\nTest completed with "); writed(error_cnt);
                    108:        writes(" errors\n");
                    109: }
                    110: 
                    111: pr_hd()
                    112: {      long ix;
                    113: 
                    114:        if (heading && op_mode) {
                    115:                writes("        ** Test no ("); writeh(test_no); writes(") "); 
                    116:                writes(test_tbl[test_no-1].name);
                    117:                }
                    118: }
                    119: 

unix.superglobalmegacorp.com

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