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

/*
 * Interrupt vector routines
*/ 

/*******************************************************************
*
*	 9-April-85  JJM  added clear ACC to RESOP & OVFL faults
*	30-April-85  JJM  removed clear ACC stuff do to arch. change
*
*******************************************************************/

#define	SCBVEC(name)	.align 2  \
		     	.globl _X/**/name \
			_X/**/name


#define	PANIC(msg)	clrl _waittime \
			pushab 1f \
			calls $1*4+4,_panic \
			halt  \
			1: .asciz msg

#define	PRINTF(n,msg)	pushab 1f; calls $(n+1)*4+4,_printf; MSG(msg)
#define	MSG(msg)	1: .asciz msg

#define	PUSHR		pushl r5; pushl r4; pushl r3; pushl r2;\
			pushl r1; pushl r0

#define	POPR		movl (sp)+,r0 \
			movl (sp)+,r1 \
			movl (sp)+,r2 \
			movl (sp)+,r3 \
			movl (sp)+,r4 \
			movl (sp)+,r5
/*
	*unknown interrupt
*/

SCBVEC(unknown):
	pushl 	$0
	callf	$8,_XTrap
	halt
/*
	
	*powerfail
	*psl & pc are saved on int stack.
	*This routine saves general registers,memory mgmt registers,
	*privileged registers, etc. in _dbuf & then executes halt.
	*
	*The restart location is saved at 0x00000c00. CPU 2 should
	*restart at the location specified after power is up.

*/

SCBVEC(powerfail):
	pushl 	$1
	callf	$8,_XTrap
	halt


/*
	*interval timer
*/

SCBVEC(hardclock):
	incl	_clock_event	/* set the diagnostic clock occurred flag */
	rei

/*
	*console terminal receive interrupt
*/

SCBVEC(cnrint):
	pushl 	$0xa
	callf	$8,_XTrap
	halt
/*
	*console terminal transmit interrupt
*/

SCBVEC(cnxint):
	rei		/* Just REI back !! */
/*
	*software generated interrupts
*/

SCBVEC(s15):
	pushl 	$0x10
	callf	$8,_XTrap
	halt
/*
	*software generated interrupts
*/

SCBVEC(s14):
	pushl 	$0x11
	callf	$8,_XTrap
	halt
/*
	*software generated interrupts
*/

SCBVEC(s13):
	pushl 	$0x12
	callf	$8,_XTrap
	halt
/*
	*software generated interrupts
*/

SCBVEC(s12):
	pushl 	$0x13
	callf	$8,_XTrap
	halt
/*
	*software generated interrupts
*/

SCBVEC(s11):
	pushl 	$0x14
	callf	$8,_XTrap
	halt
/*
	*software generated interrupts
*/

SCBVEC(s10):
	pushl 	$0x15
	callf	$8,_XTrap
	halt
/*
	*software generated interrupts
*/

SCBVEC(s9):
	pushl 	$0x16
	callf	$8,_XTrap
	halt
/*
	*software generated interrupts
*/

SCBVEC(s8):
	pushl 	$0x17
	callf	$8,_XTrap
	halt
/*
	*software generated interrupts
*/

SCBVEC(s7):
	pushl 	$0x18
	callf	$8,_XTrap
	halt
/*
	*software generated interrupts
*/

SCBVEC(s6):
	pushl 	$0x19
	callf	$8,_XTrap
	halt
/*
	*software generated interrupts
*/

SCBVEC(s5):
	pushl 	$0x1a
	callf	$8,_XTrap
	halt
/*
	*software generated interrupts
*/

SCBVEC(s4):
	pushl 	$0x1b
	callf	$8,_XTrap
	halt
/*
	*software generated interrupts
*/

SCBVEC(s3):
	pushl 	$0x1c
	callf	$8,_XTrap
	halt
/*
	*software generated interrupts
*/

SCBVEC(s2):
	pushl 	$0x1d
	callf	$8,_XTrap
	halt
/*
	*software generated interrupts
*/

SCBVEC(s1):
	pushl 	$0x1e
	callf	$8,_XTrap
	halt

/*
	*io interrupt
*/

SCBVEC(iovec14):
	halt
SCBVEC(iovec15):
	halt
SCBVEC(iovec16):
	halt
SCBVEC(iovec17):
	halt

/*	
	*EXCEPTIONS
*/

/*

	*buserror
	*psl, pc, and errorcode are pushed onto int stack.
	*ipl is raised to 0x1d.
	*buserror could be due to:
	*non-existent memory
	*versabus timeout
	*uncorrectable memory
	*versabus error (BERR)
	*versabus parity error

*/
SCBVEC(buserror):
	pushl 	$0x20
	callf	$8,_XTrap
	halt

/*
	*kernel stack not valid
	*happens only during the initiation of another exception or
	*interrupt.The process must be aborted.
	*pc & psl are pushed onto INTSTACK.
	* IPL is raised to 0x1f.
	*this routine calls _panic routine written in C which prints
	*the message & waits for the operator action.
*/

SCBVEC(kspnotval):
	pushl 	$0x31
	callf	$8,_XTrap
	halt
/* 	
* Trap and fault vector routines
*/ 
#define	TRAP(a)	pushl $a; brw alltraps

SCBVEC(prvinflt):
	movpsl	_psl_val		/* save the psl           */
	mtpr	$0x1f,$IPL		/* set the IPL to high */
	bitl $PSL_DBL,_psl_val  	/* check for DBL Acc.     */
	beql 1f 
	std	_post_evt_acc		/* save the DBL Acc.      */
	brb	2f
1:	stf	_post_evt_acc		/* save the SGL Acc.      */
2:	storer 	$0x1fff,_store_regs  	/* store regs 0 - 12      */
	moval	(r13),_post_event_fp	/* save the frame pointer */
	moval	(r14),_post_event_sp	/* save the stack pointer */
	pushl 	$0x2c
	callf	$8,_XTrap
	halt

/*********************************************************************
*		THE RESERVED OPERAND FAULT HANDLER
* On a Reserved Operand Fault we'll save the PSL, the accumulator, 
* and the register values and then go to the fpp's event routine.
*********************************************************************/
SCBVEC(resopflt):
 	mtpr $0x1f,$IPL   
 	movpsl _psl_val  		/* get the current PSL      */
	bitl $PSL_DBL,_psl_val  	/* check for DBL Acc.       */
	beql 1f 
	std _post_evt_acc  		/* save the DBL Accumulator */
	brw  2f
1:	stf _post_evt_acc  		/* save the SGL Accumulator */
	clrl _post_evt_acc+4 
2:
	storer $0x1fff,_store_regs  	/* store regs 0 - 12 */
	moval (r13),_post_event_fp	/* save the frame pointer */
	moval (r14),_post_event_sp	/* save the stack pointer */
	pushl 	$0x2d
	callf	$8,_XTrap
	halt


SCBVEC(resadflt):
	movpsl	_psl_val		/* save the psl           */
	mtpr	$0x1f,$IPL		/* set the IPL to high */
	bitl $PSL_DBL,_psl_val  	/* check for DBL Acc.     */
	beql 1f 
	std	_post_evt_acc		/* save the DBL Acc.      */
	brb	2f
1:	stf	_post_evt_acc		/* save the SGL Acc.      */
2:	storer 	$0x1fff,_store_regs  	/* store regs 0 - 12      */
	moval	(r13),_post_event_fp	/* save the frame pointer */
	moval	(r14),_post_event_sp	/* save the stack pointer */
	pushl 	$0x2e
	callf	$8,_XTrap
	halt

SCBVEC(bptflt):
	pushl 	$0x33
	callf	$8,_XTrap
	halt

SCBVEC(tracep):
	movpsl	_psl_val		/* save the psl           */
	mtpr	$0x1f,$IPL		/* set the IPL to high    */
	bitl $PSL_DBL,_psl_val  	/* check for DBL Acc.     */
	beql 1f 
	std	_post_evt_acc		/* save the DBL Acc.      */
	brb	2f
1:	stf	_post_evt_acc		/* save the SGL Acc.      */
2:	storer 	$0x1fff,_store_regs  	/* store regs 0 - 12      */
	pushl 	$0x32
	callf	$8,_XTrap
	halt

/*********************************************************************
*		THE ARITHMETIC TRAP HANDLER
* On an Overflow Fault we'll save the PSL, the accumulator, and the
* register values and then go to the fpp event routine.
*********************************************************************/
SCBVEC(arithtrap):
 	mtpr $0x1f,$IPL   
 	movpsl _psl_val  		/* get the current PSL      */
	bitl $PSL_DBL,_psl_val  	/* check for DBL Acc.       */
	beql 1f 
	std _post_evt_acc  		/* save the DBL Accumulator */
	brw  2f
1:
	stf _post_evt_acc  		/* save the SGL Accumulator */
	clrl _post_evt_acc+4 
2:
	storer 	$0x1fff,_store_regs  	/* store regs 0 - 12 */
	moval	(r13),_post_event_fp	/* save the frame pointer */
	moval	(r14),_post_event_sp	/* save the stack pointer */
	pushl 	$0x34
	callf	$8,_XTrap
	halt


SCBVEC(protflt):			/*access control violation*/
	movpsl	_psl_val		/* save the psl */
	moval	(r14),_post_event_sp	/* save the stack pointer */
	pushl 	$0x2f
	callf	$8,_XTrap
	halt
SCBVEC(transflt):
	pushl 	$0x30
	callf	$8,_XTrap
	halt
SCBVEC(alignflt):
	movpsl	_psl_val		/* save the psl           */
	mtpr	$0x1f,$IPL		/* set the IPL to high    */
	bitl $PSL_DBL,_psl_val  	/* check for DBL Acc.     */
	beql 1f 
	std	_post_evt_acc		/* save the DBL Acc.      */
	brb	2f
1:	stf	_post_evt_acc		/* save the SGL Acc.      */
2:	storer 	$0x1fff,_store_regs  	/* store regs 0 - 12      */
	pushl 	$0x35
	callf	$8,_XTrap
	halt
SCBVEC(fpp_emulate):			/* fpp emulation trap */
	movpsl	_psl_val		/* save the psl */
	storer 	$0x1fff,_store_regs  	/* store regs 0 - 12 */
	moval	(r13),_post_event_fp	/* save the frame pointer */
	moval	(r14),_post_event_sp	/* save the stack pointer */
	pushl	$0x37
	callf	$8,_XTrap
	halt

alltraps:
	halt

SCBVEC(kcall):			/*kcall*/
	pushl 	$0x2b
	callf	$8,_XTrap
	halt



unix.superglobalmegacorp.com

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