File:  [Power 6/32 Unix Tahoe 4.2BSD] / cci / d / dmp4 / bad_trans_stack.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"

/*************************************************************************
*
*	This routine is called when the stack is corrupted during a page
*   fault. We assume that it's corrupted - the instruction PC that caused 
*   the page fault isn't the instruction under test. If someone else is
*   causing page faults then we're all screwed up anyway.
*   This routine will print an error message if they are enabled. 
*
*  stack: fault type     = xxxxxxxx,  error after fault #xx
*         fault address  = xxxxxxxx,  total faults expected = xx
*         instruction PC = xxxxxxxx,  expected PC = xxxxxxxx
*         PSL on stack   = xxxxxxxx
*
*************************************************************************/
bad_trans_stack()
{
	if( prt_error ) {
	     prt_dmp_er_msg(" - STACK CORRUPTED AFTER A PAGE FAULT");
	     writes("stack: fault type     = ");
	     write32h( pop_val_1 );
	     writes(",  error after fault #");
	     writed( no_page_faults );
	     writes("\n       fault address  = ");
	     write32h( pop_val_2 );
	     writes(",  total faults expected = ");
	     writed( exp_page_faults );
	     writes("\n       instruction PC = ");
	     write32h( pop_val_3 );
	     writes(",  expected PC = ");
	     write32h( code_addr );
	     writes("\n       PSL on stack   = ");
	     write32h( pop_val_4 );
	     writec('\n');
	}
	if( halt_flg ) {
	     asm("movl _test_no,r0");		/* r0  = test number       */
	     asm("movl _addr_code,r1");		/* r1  = addr mode code    */
	     asm("movl $8,r2");			/* r2  = error code  ( 8 ) */
	     asm("movl _cycle,r3");		/* r3  = cycle count       */
	     asm("movl _pop_val_1,r4");		/* r4  = fault type        */
	     asm("movl _pop_val_2,r5");		/* r5  = fault address     */
	     asm("movl _pop_val_3,r6");		/* r6  = PC on stack       */
	     asm("movl _pop_val_4,r7");		/* r7  = psl on stack      */
	     asm("movl _code_addr,r8");		/* r8  = PC expected       */
	     asm("movl _no_page_faults,r9");	/* r9  = last page fault   */
	     asm("movl _exp_page_faults,r10");	/* r10 = # faults expected */
	     asm("movl _index,r11");		/* r11 = data index        */
	     asm("halt");
	}
	if( loop_on_err )
	     force_loop = TRUE;		/* set loop flag */
	asm("jmp _ex_code_return");	/* return to "run_code" */
}



unix.superglobalmegacorp.com

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