1: SIGDORTI = 1000 2: rtt = 6 3: iot = 4 4: emt = 104000 5: .signal = 48. 6: .globl _sigsys, __sigcatch, _mvectors, cerror 7: .globl __ovno 8: NSIG = 32 9: _sigsys: 10: mov r5,-(sp) 11: mov sp,r5 12: mov 6(r5),-(sp) / push signal action 13: mov 4(r5),-(sp) / push signal number 14: sys .signal+200 15: bes 1f 16: cmp (sp)+,(sp)+ 17: mov (sp)+,r5 18: rts pc 19: 1: 20: cmp (sp)+,(sp)+ 21: jmp cerror 22: 23: _mvectors: / these vectors are treated as an array in C 24: jsr r0,1f / dummy there is no signal 0 25: jsr r0,1f / for signal 1 26: jsr r0,1f / for signal 2 etc... 27: jsr r0,1f 28: jsr r0,1f 29: jsr r0,1f 30: jsr r0,1f 31: jsr r0,1f 32: jsr r0,1f 33: jsr r0,1f 34: jsr r0,1f 35: jsr r0,1f 36: jsr r0,1f 37: jsr r0,1f 38: jsr r0,1f 39: jsr r0,1f 40: jsr r0,1f 41: jsr r0,1f 42: jsr r0,1f 43: jsr r0,1f 44: jsr r0,1f 45: jsr r0,1f 46: jsr r0,1f 47: jsr r0,1f 48: jsr r0,1f 49: jsr r0,1f 50: jsr r0,1f 51: jsr r0,1f 52: jsr r0,1f 53: jsr r0,1f 54: jsr r0,1f 55: jsr r0,1f 56: jsr r0,1f / for signal 32 57: 1: 58: mov __ovno,-(sp) / save previous overlay 59: mov r1,-(sp) / r0 is already on stack from jsr r0,... 60: sub $_mvectors+4,r0 / if sig is == 1, r0 will be _mvectors + 8 61: asr r0 / divide by 4 to get signal number 62: asr r0 63: mov r0,-(sp) / make an extra copy so sigcatch can clobber it 64: mov r0,-(sp) / this one is sigcatch's argument 65: jsr pc,*$__sigcatch / we know sigcatch will save regs 2-5! 66: tst (sp)+ / discard argument 67: mov (sp)+,r1 / get back signal number 68: tst r0 / if zero we do nothing - just rtt 69: bne 1f 70: mov (sp)+,r1 71: mov (sp)+,r0 / previous overlay 72: emt / it to be loaded 73: mov r0,__ovno / and restore 74: mov (sp)+,r0 / restore last of registers 75: rtt 76: / here we are re-enabling the signal with the value returned by sigcatch 77: 1: 78: bis $SIGDORTI,r1 / tell kernel to simulate rti upon return 79: mov 4(sp),-(sp) / mov saved r0 down 80: mov 2(sp),-(sp) / mov saved r1 down, leaving two words for arg 81: mov r0,10(sp) / mov action on stack. 82: mov 6(sp),r0 / previous overlay... 83: emt / ... loaded 84: mov r0,__ovno / and restored 85: mov r1,6(sp) / mov sig num to top (after r0 r1 popped) 86: mov (sp)+,r1 87: mov (sp)+,r0 / restore last of registers 88: tst (sp)+ / clear saved ovno 89: / now all registers are totally restored 90: / and signal syscall args are on top of stack 91: / so that when system simulates the rti it 92: / will first pop off args to the syscall 93: sys .signal+200 / set signals and rti (kernel shouldn't 94: / smash ANY register here 95: iot / should never happen - lets find out!