File:  [Power 6/32 Unix Tahoe 4.2BSD] / cci / d / dmp4 / chk_trans_acc.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Sun Jul 28 12:30:21 2019 UTC (7 years ago) by root
Branches: bsd, MAIN
CVS tags: v121, HEAD
Power 6/32 Unix version 1.21


#include "dmp_defs.h"


/************************************************************************
*		Verify the accmulator after a page fault
*
*  The accumulator should not be changed until after all of the instruction
*  was read from valid memory. This routine is called from the Page Fault
*  handler to make sure that the accumulator is still unmodified. This
*  is to detect if any instructions are getting executed from an invalid
*  page of memory. 
*  The "no-fpp" firmware will not clear double precision "bad 0's".
*
************************************************************************/
chk_trans_acc()
{
	if( acc_ld_size == DBL ) {
	     asm("std _trans_acc");		/* store the DBL Acc. */
	} else {
	     asm("stf _trans_acc");		/* store the SGL Acc. */
	}
	if( (dbl_ld_acc.m & 0x7f800000) || 
	    ( (no_fpp_wcs) && (precision == DBL) ) ) {
	     exp_trans_acc.m = dbl_ld_acc.m;
	     exp_trans_acc.l = dbl_ld_acc.l;
	} else {				/* zero accumulator */
	     exp_trans_acc.m = 0;		/* clear any bad 0's */
	     exp_trans_acc.l = 0;
	}
	if( (trans_acc.m != exp_trans_acc.m) ||     /* compare current Acc */
	    ( (acc_ld_size == DBL) &&	            /*   to the Acc loaded */
	      (trans_acc.l != exp_trans_acc.l) ) ) {
	     errcnt++;				/* bump the error count    */
	     trans_acc_error = TRUE;		/* set the error flag      */
	     if( prt_error )
		  prt_trans_acc_er();		/* print an error message  */
	     if( halt_flg )
		  trans_acc_er_hlt();		/* halt on the error       */
	     if( loop_on_err )
		  force_loop = TRUE;		/* set the error loop flag */
	}
}




/************************************************************************
*	print a Accumulator Corrupted After a Page Fault error message
*
* The message will be of the form:
* cycle: xx. DMP test xx. <inst>. Bad Acc. after a page fault, index = xx
* addressing mode: <addressing mode description>
* inst buf= xx xx xx xx xx xx xx xx xx xx xx -page faults on byte(s) 0, x 
*   Acc loaded = xxxxxxxx xxxxxxxx,  operand 1 = xxxxxxxx xxxxxxxx
*   Acc stored = xxxxxxxx xxxxxxxx,  operand 2 = xxxxxxxx xxxxxxxx
* Acc expected = xxxxxxxx xxxxxxxx,  error after page fault #xx
************************************************************************/
prt_trans_acc_er()
{

	prt_dmp_er_msg( trans_acc_er_msg );	/* print the error msg */
	writes("  Acc loaded = ");
	write32h( dbl_ld_acc.m );
	if( acc_ld_size == DBL ) {
	     writec(' ');
	     write32h( dbl_ld_acc.l );
	}
	writes(", ");
	if( no_ops ) {
	     writes("  operand 1 = ");
	     write32h( dbl_value_1.m );
	     if( acc_ld_size == DBL ) {
	          writec(' ');
	          write32h( dbl_value_1.l );
	     }
	     writec('\n');
	}
	writes("  Acc stored = ");
	write32h( trans_acc.m );
	if( acc_ld_size == DBL ) {
	     writec(' ');
	     write32h( trans_acc.l );
	}
	if( no_ops == 2 ) {
	     writes(",   operand 2 = ");
	     write32h( dbl_value_2.m );
	     if( acc_ld_size == DBL ) {
	          writec(' ');
	          write32h( dbl_value_2.l );
	     }
	}
	writes("\nAcc expected = ");
	write32h( exp_trans_acc.m );
	if( acc_ld_size == DBL ) {
	     writec(' ');
	     write32h( exp_trans_acc.l );
	}
	writes(",   error after page fault #");
	writed( no_page_faults );
	writec('\n');
}




/*************************************************************************
*
*	Error Halt for a bad Accumulator after a page fault
*
*************************************************************************/
trans_acc_er_hlt()
{
	sgl_value_1 = dbl_ld_acc.m;
	sgl_value_2 = dbl_ld_acc.l;
	sgl_value_3 = trans_acc.m;
	sgl_value_4 = trans_acc.l;
	sgl_value_5 = exp_trans_acc.m;
	sgl_value_6 = exp_trans_acc.l;
	asm("movl _test_no,r0");		/* r0  = test number       */
	asm("movl _addr_code,r1");		/* r1  = addr mode code    */
	asm("movl $6,r2");			/* r2  = error code (6)    */
	asm("movl _cycle,r3");			/* r3  = cycle count       */
	asm("movl _sgl_value_1,r4");		/* r4  = MS of initial Acc  */
	asm("movl _sgl_value_2,r5");		/* r5  = LS of initial Acc  */
	asm("movl _sgl_value_3,r6");		/* r6  = MS of final Acc    */
	asm("movl _sgl_value_4,r7");		/* r7  = LS of final Acc    */
	asm("movl _sgl_value_5,r8");		/* r8  = MS of expected Acc */
	asm("movl _sgl_value_6,r9");		/* r9  = LS of expected Acc */
	asm("movl _no_page_faults,r10");	/* r10 = pg fault # of err. */
	asm("movl _dbl_value_1,r11");		/* r11 = MS of operand 1    */
	asm("movl _dbl_value_1+4,r12");		/* r12 = LS of operand 1    */
	asm("movl _dbl_value_2,r13");		/* r13 = MS of operand 2    */
	asm("halt");				/* halt                     */
}

unix.superglobalmegacorp.com

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