|
|
1.1 root 1:
2: #include "dmp_defs.h"
3:
4: /*********************************************************************
5: *
6: * MONITOR FOR THE DEMAND PAGING TESTS
7: *
8: * 11-Feb-85 : written
9: *
10: *********************************************************************/
11:
12: monitor()
13: {
14: int sbtst_indx;
15: asm("moval (fp),_monitor_fp"); /* save the frame pointer */
16: asm("moval (sp),_monitor_sp"); /* save the stack pointer */
17: force_loop = FALSE; /* clear the force loop flag */
18: cycle = 0; /* clear the cycle count */
19: errcnt = 0; /* clear the error count */
20: /*
21: * Print the Header information and enable the Data Cache if desired
22: */
23: if( prt_hdrs ) {
24: writes("\nFPP Demand Paging Test");
25: if( no_fpp_wcs )
26: writes(" - FPP is NOT installed");
27: else
28: writes(" - FPP is installed");
29: if( user_mode )
30: writes(". User Mode");
31: else
32: writes(". Kernal Mode");
33: }
34: if( en_data_cache ) {
35: asm("mtpr $1,$25"); /* purge all data cache pages */
36: asm("mtpr $1,$27"); /* enable the data cache */
37: if( prt_hdrs )
38: writes(", Data Cache Enabled:\n");
39: } else {
40: asm("mtpr $2,$27"); /* disable the data cache */
41: if( prt_hdrs )
42: writes(", Data Cache Disabled:\n");
43: }
44: if( count )
45: nonstop = FALSE; /* user specfied # of cycles */
46: else
47: nonstop = TRUE; /* continuous testing */
48: /*
49: * Check to see if they've asked for PUSHD in the Kernal mode ( a no no )
50: */
51: valid_test = TRUE;
52: if( (run_list) && (!user_mode) ) {
53: sbtst_indx = run_list -1;
54: if( inst_tbl[sbtst_indx].inst_code == PUSHD_OP_CODE ) {
55: writes(
56: "PUSHD is not a valid instruction in the Kernal Mode\n");
57: valid_test = FALSE;
58: }
59: }
60: if( valid_test ) {
61: for( cycle = 1; ( (cycle <= count) || nonstop ); cycle++ ) {
62: if( (prt_hdrs) && (cycle != 1) )
63: writec('.'); /* show we're still running */
64: if( (run_list > 0) && (run_list <= NO_INSTRUCTIONS) ) {
65: test_no = run_list;
66: sbtst_indx = run_list - 1;
67: if( (prt_hdrs) && (cycle == 1) )
68: writes( inst_tbl[ sbtst_indx ].name );
69: sched_test( sbtst_indx );
70: }
71: else /* test ALL applicable instructions */
72: {
73: for(sbtst_indx=0;sbtst_indx<NO_INSTRUCTIONS;sbtst_indx++) {
74: test_no = sbtst_indx + 1;
75: if( (user_mode) ||
76: (inst_tbl[sbtst_indx].inst_code != PUSHD_OP_CODE) ) {
77: if( (prt_hdrs) && (cycle == 1) ) {
78: if( (inst_tbl[sbtst_indx].inst_code==LDD_OP_CODE) ||
79: (inst_tbl[sbtst_indx].inst_code==CVDF_OP_CODE) )
80: writec('\n'); /* start a new line */
81: writes( inst_tbl[ sbtst_indx ].name );
82: }
83: sched_test( sbtst_indx );
84: asm("tst_all_return:");;
85: } /* end of IF (not PUSHD in Kernal mode) */
86: } /* end of FOR (each instruction) */
87: } /* end of ELSE test all instructions */
88: asm("tst_one_return:");;
89: } /* end of test cycles */
90: cycle--; /* correct cycle count */
91: } /* end of IF (valid test) */
92: if( prt_hdrs ) {
93: /* if( !error ) */
94: writec('\n'); /* new line if no current errors */
95: writes("Cycles Complete = ");
96: writed( cycle );
97: if( valid_test ) {
98: if( errcnt ) {
99: writes(", Error Count = " );
100: writed( errcnt );
101: writes(", Test Complete\n");
102: } else {
103: writes(", TEST PASSED -NO ERRORS!!! \n");
104: }
105: } /* end of IF (valid test) */
106: }; /* end of IF (print headers) */
107: asm("movl _errcnt,r0"); /* set error count for halt */
108: asm("bneq 1f");
109: asm("tstl _valid_test"); /* were any tests run? */
110: asm("beql 1f"); /* r0 = 0 if no tests run */
111: asm("movl $0xCAFEBABE,r0");; /* set the no-error flag */
112: asm("1:");
113: asm("movl _OPTIONS,r1"); /* restore options to r1 */
114: asm("movl _cycle,r2"); /* move cycle count to r2 */
115: asm("halt");; /* ALL DONE - HALT */
116: /*
117: * This is the return from an unexpected fpp event
118: */
119: asm(".globl _mon_ret");
120: asm("_mon_ret:");
121: asm("movl _monitor_fp,fp"); /* restore the frame ptr */
122: asm("movl _monitor_sp,sp"); /* restore the stack ptr */
123: asm("tstl _run_list"); /* test all instructions? */
124: asm("beql 1f");
125: asm("jmp tst_one_return"); /* go to next test cycle */
126: asm("1:");
127: asm("jmp tst_all_return"); /* test next instruction */
128: asm(".align 2");
129: asm(".globl return");
130: asm("return:");
131: asm(".long _mon_ret"); /* pointer to return addr */
132: }
133:
134:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.