Annotation of cci/d/fpevent/monitor.c, revision 1.1.1.1

1.1       root        1: 
                      2: #include "evt_defs.h"
                      3: 
                      4: /*********************************************************************
                      5: *
                      6: *      MONITOR FOR THE FPP EVENTS TESTS
                      7: *
                      8: *  22-Mar-85 : written
                      9: *  10-Jul-85 : don't run pipe test if running all tests on a specified op-code
                     10: *  16-Jul-85 : added NO-FPP test capability
                     11: *********************************************************************/
                     12: monitor()
                     13: {
                     14: struct test_t *test_tbl;               /* pointer to the test table to use */
                     15: int no_subtests;                       /* number of tests in the table */
                     16:        force_loop = FALSE;             /* clear the 'force loop' flag */
                     17:        valid_test = FALSE;             /* clear the 'a test was run' flag */
                     18:        cycle = 0;                      /* clear the cycle count */
                     19:        errcnt = 0;                     /* clear the error count */
                     20:        error  = FALSE;                 /* clear the current error flag */
                     21:        if( no_fpp_wcs ) {
                     22:             test_tbl = no_fpp_test_tbl;        /* use the NO-FPP tests */
                     23:             no_subtests = no_fpp_test_cnt;
                     24:        } else {
                     25:             test_tbl = fpp_test_tbl;           /* use the FPP tests */
                     26:             no_subtests = fpp_test_cnt;
                     27:        }
                     28: /*
                     29:  * Print the Header information and enable the Data Cache if desired
                     30: */
                     31:        if( prt_hdrs ) {
                     32:            writes("\nFPP Events Test");
                     33:            if( no_fpp_wcs )
                     34:                 writes(" - FPP is NOT installed");
                     35:            else
                     36:                 writes(" - FPP is installed");
                     37:        }
                     38:        if( en_data_cache ) {
                     39:            if( prt_hdrs )
                     40:                writes(",  Data Cache Enabled: ");
                     41:            asm("mtpr $1,$25");                 /* purge all data cache pages */
                     42:            asm("mtpr $1,$27");;                /* enable the data cache */
                     43:        } else {
                     44:            if( prt_hdrs )
                     45:                writes(", Data Cache Disabled: ");
                     46:            asm("mtpr $2,$27");                 /* disable the data cache */
                     47:        }
                     48: /*
                     49:  * Check the run list to see if a specific test is called for
                     50: */
                     51:        for( cycle = 1; ( (cycle <= count) || nonstop ); cycle++ ) {
                     52:            if( (prt_hdrs) && (cycle != 1) )    /* show we're still running */
                     53:                writec('.');
                     54:            if( (run_list > 0) && (run_list <= no_subtests) ) {
                     55:                test_no = run_list;
                     56:                test_index = run_list - 1;
                     57:                if( (prt_hdrs) && (cycle == 1) ) {
                     58: /*          if( !error )                       /*              */
                     59:                          writec('\n');
                     60:                     writes( test_tbl[ test_index ].name );
                     61:                };
                     62:                (test_tbl[ test_index ].test)();
                     63:            } 
                     64:             else    /* run all tests */
                     65:            {
                     66:                for(test_index=0; test_index<no_subtests; test_index++) {
                     67:                    test_no = test_index + 1;
                     68:                    if( (no_fpp_wcs) ||    /* don't run pipe test w/ FPP WCS */
                     69:                        (!evt_inst) ||     /*   and a specified instruction  */
                     70:                        (test_index != pipe_test_index) ) {
                     71:                           if( (prt_hdrs) && (cycle == 1) ) {
                     72: /*                             if( !error )            /*              */
                     73:                                     writec('\n');
                     74:                                writes( test_tbl[ test_index ].name );
                     75:                           };
                     76:                           (test_tbl[ test_index ].test)();
                     77:                    }
                     78:                }
                     79:            }   /* end of test-all-instructions */
                     80:        }    /* end of test cycles - done with the test */
                     81:        cycle--;                        /* correct cycle count */
                     82:        if( prt_hdrs ) {
                     83: /*         if( !error )                /*                              */
                     84:                 writec('\n');;         /* new line if no current errors */
                     85:            if( valid_test ) {          /* were any tests actually run? */
                     86:                 writes("Cycles Complete = ");
                     87:                 writed( cycle );
                     88:                 if( errcnt ) {
                     89:                     writes(",  Error Count = " );
                     90:                     writed( errcnt );
                     91:                     writes(",  Test Complete\n");
                     92:                 } else 
                     93:                     writes(",  TEST PASSED -NO ERRORS!!! \n");
                     94:            } else {
                     95:                 writes("FPEVENT: no tests were run with instruction ");
                     96:                 writeh( evt_inst );
                     97:                 writec('\n');
                     98:            }
                     99:        };
                    100: /*
                    101:  * Set up the registers to halt
                    102: */
                    103:        asm("movl _errcnt,r0");         /* set error count for halt */
                    104:        asm("bneq 1f");
                    105:        asm("tstl _valid_test");        /* were any tests run?      */
                    106:        asm("beql 1f");                 /* r0 = 0 if no tests run   */
                    107:        asm("movl $0xCAFEBABE,r0");;    /* set the no-error flag    */
                    108:        asm("1:");
                    109:        asm("movl _OPTIONS,r1");        /* restore options to r1    */
                    110:        asm("movl _cycle,r2");          /* move cycle count to r2   */
                    111:        asm("movl _evt_inst,r3");       /* move inst op-code to r3  */
                    112:        asm("halt");;
                    113: }
                    114:  
                    115: 

unix.superglobalmegacorp.com

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