--- cci/d/event/rsvins_evt.s 2019/07/28 12:24:19 1.1.1.1 +++ cci/d/event/rsvins_evt.s 2019/07/28 12:30:52 1.1.1.2 @@ -22,10 +22,12 @@ _rsv_evt: movl $-1,-(sp) /* Push marker on stack */ movab _pcb0,r1 mtpr r1,$PCBB /* Set PCBB to PCB_U0 */ - subl3 $24,_savvec0,_pcb0 /* Set PCB_KSP a few lwords below ISP */ + mfpr $KSP,_savvec9 /* Save kernal stack pointer */ + mfpr $USP,_savveca /* Save user stack pointer */ movab rtable,r5 /* R5 = addr reserved operand table */ movb (r5),resinstr /* Store reserved opcode */ mtpr $0xff,$PACC /* Purge all code cache */ + movpsl r6 /* r6 = saved psl */ movab resinstr,r7 /* R7 = PC that failed */ resinstr: @@ -50,8 +52,9 @@ vecvec5: # 1: movl (sp)+,r1 /* R1 = actual PSL pop from stack */ - cmpl $-1,r1 /* If -1, then it is not psl */ - bneq 1f + movl r6,r2 /* r2 = expected psl */ + cmpl r2,r1 + beql 1f movl $3,r0 /* Error : PSL is not pushed on stack */ jmp *badrtn # @@ -67,9 +70,16 @@ vecvec5: cmpb $0,resinstr /* Is this the last opcode ? */ beql 1f mtpr $0xff,$23 /* Purge all code cache */ + movpsl r6 brw resinstr /* Branch back and do again */ 1: - ret + + movl _savvec0,sp + mtpr _savvec0,$ISP /* Restore interrupt stack pointer */ + mtpr _savvec9,$KSP /* Restore kernal stack pointer */ + mtpr _savveca,$USP /* Restore user stack pointer */ + movl _savvec2,_scb+PINSTVEC /* Restore original vector */ + ret /* Return */ # # # WARNING : If reserved opcodes change, so do the following table