improved signal handling
This commit is contained in:
		
							parent
							
								
									79e3ac1a26
								
							
						
					
					
						commit
						211f5d2ad8
					
				
					 3 changed files with 80 additions and 45 deletions
				
			
		|  | @ -11,55 +11,38 @@ all:	$(INTS) em | |||
| em:	em.c | ||||
| 	$(CC) -o em -I../../../h em.c | ||||
| 
 | ||||
| em2_t---:	$(FILES) compile | ||||
| 	cat $(FILES) | $(CPP) -P $(FLTRAP) -Dopfreq=0 -Dlast=1 -Dcount=0 -Dtest=1 -Dflow=0 -Dprof=0 >tmp.s | ||||
| 	./compile -o em2_t--- tmp.s | ||||
| 	rm -f tmp.s | ||||
| tmp.s:	$(FILES) | ||||
| 	cat $(FILES) > tmp.s | ||||
| 
 | ||||
| em2_----:	$(FILES) compile | ||||
| 	cat $(FILES) | $(CPP) -P $(FLTRAP) -Dopfreq=0 -Dlast=0 -Dcount=0 -Dtest=0 -Dflow=0 -Dprof=0 >tmp.s | ||||
| 	./compile -o em2_---- tmp.s | ||||
| 	rm -f tmp.s | ||||
| em2_t---:	tmp.s compile | ||||
| 	./compile -o em2_t--- -P $(FLTRAP) -Dopfreq=0 -Dlast=1 -Dcount=0 -Dtest=1 -Dflow=0 -Dprof=0 tmp.s | ||||
| 
 | ||||
| em2_t-cp:	$(FILES) compile | ||||
| 	cat $(FILES) | $(CPP) -P $(FLTRAP) -Dopfreq=0 -Dlast=1 -Dcount=1 -Dtest=1 -Dflow=0 -Dprof=1 >tmp.s | ||||
| 	./compile -o em2_t-cp tmp.s | ||||
| 	rm -f tmp.s | ||||
| em2_----:	tmp.s compile | ||||
| 	./compile -o em2_---- -P $(FLTRAP) -Dopfreq=0 -Dlast=0 -Dcount=0 -Dtest=0 -Dflow=0 -Dprof=0 tmp.s | ||||
| 
 | ||||
| em2_t-c-:	$(FILES) compile | ||||
| 	cat $(FILES) | $(CPP) -P $(FLTRAP) -Dopfreq=0 -Dlast=1 -Dcount=1 -Dtest=1 -Dflow=0 -Dprof=0 >tmp.s | ||||
| 	./compile -o em2_t-c- tmp.s | ||||
| 	rm -f tmp.s | ||||
| em2_t-cp:	tmp.s compile | ||||
| 	./compile -o em2_t-cp -P $(FLTRAP) -Dopfreq=0 -Dlast=1 -Dcount=1 -Dtest=1 -Dflow=0 -Dprof=1 tmp.s | ||||
| 
 | ||||
| em2_t--p:	$(FILES) compile | ||||
| 	cat $(FILES) | $(CPP) -P $(FLTRAP) -Dopfreq=0 -Dlast=1 -Dcount=0 -Dtest=1 -Dflow=0 -Dprof=1 >tmp.s | ||||
| 	./compile -o em2_t--p tmp.s | ||||
| 	rm -f tmp.s | ||||
| em2_t-c-:	tmp.s compile | ||||
| 	./compile -o em2_t-c- -P $(FLTRAP) -Dopfreq=0 -Dlast=1 -Dcount=1 -Dtest=1 -Dflow=0 -Dprof=0 tmp.s | ||||
| 
 | ||||
| em4_t---:	$(FILES) compile | ||||
| 	cat $(FILES) | $(CPP) -P $(FLTRAP) -Dlword -Dopfreq=0 -Dlast=1 -Dcount=0 -Dtest=1 -Dflow=0 -Dprof=0 >tmp.s | ||||
| 	./compile -o em4_t--- tmp.s | ||||
| 	rm -f tmp.s | ||||
| em2_t--p:	tmp.s compile | ||||
| 	./compile -o em2_t--p -P $(FLTRAP) -Dopfreq=0 -Dlast=1 -Dcount=0 -Dtest=1 -Dflow=0 -Dprof=1 tmp.s | ||||
| 
 | ||||
| em4_----:	$(FILES) compile | ||||
| 	cat $(FILES) | $(CPP) -P $(FLTRAP) -Dlword -Dopfreq=0 -Dlast=0 -Dcount=0 -Dtest=0 -Dflow=0 -Dprof=0 >tmp.s | ||||
| 	./compile -o em4_---- tmp.s | ||||
| 	rm -f tmp.s | ||||
| em4_t---:	tmp.s compile | ||||
| 	./compile -o em4_t--- -P $(FLTRAP) -Dlword -Dopfreq=0 -Dlast=1 -Dcount=0 -Dtest=1 -Dflow=0 -Dprof=0 tmp.s | ||||
| 
 | ||||
| em4_t-cp:	$(FILES) compile | ||||
| 	cat $(FILES) | $(CPP) -P $(FLTRAP) -Dlword -Dopfreq=0 -Dlast=1 -Dcount=1 -Dtest=1 -Dflow=0 -Dprof=1 >tmp.s | ||||
| 	./compile -o em4_t-cp tmp.s | ||||
| 	rm -f tmp.s | ||||
| em4_----:	tmp.s compile | ||||
| 	./compile -o em4_---- -P $(FLTRAP) -Dlword -Dopfreq=0 -Dlast=0 -Dcount=0 -Dtest=0 -Dflow=0 -Dprof=0 tmp.s | ||||
| 
 | ||||
| em4_t-c-:	$(FILES) compile | ||||
| 	cat $(FILES) | $(CPP) -P $(FLTRAP) -Dlword -Dopfreq=0 -Dlast=1 -Dcount=1 -Dtest=1 -Dflow=0 -Dprof=0 >tmp.s | ||||
| 	./compile -o em4_t-c- tmp.s | ||||
| 	rm -f tmp.s | ||||
| em4_t-cp:	tmp.s compile | ||||
| 	./compile -o em4_t-cp -P $(FLTRAP) -Dlword -Dopfreq=0 -Dlast=1 -Dcount=1 -Dtest=1 -Dflow=0 -Dprof=1 tmp.s | ||||
| 
 | ||||
| em4_t--p:	$(FILES) compile | ||||
| 	cat $(FILES) | $(CPP) -P $(FLTRAP) -Dlword -Dopfreq=0 -Dlast=1 -Dcount=0 -Dtest=1 -Dflow=0 -Dprof=1 >tmp.s | ||||
| 	./compile -o em4_t--p tmp.s | ||||
| 	rm -f tmp.s | ||||
| em4_t-c-:tmp.s compile | ||||
| 	./compile -o em4_t-c- -P $(FLTRAP) -Dlword -Dopfreq=0 -Dlast=1 -Dcount=1 -Dtest=1 -Dflow=0 -Dprof=0 tmp.s | ||||
| 
 | ||||
| em4_t--p:	tmp.s compile | ||||
| 	./compile -o em4_t--p -P $(FLTRAP) -Dlword -Dopfreq=0 -Dlast=1 -Dcount=0 -Dtest=1 -Dflow=0 -Dprof=1 tmp.s | ||||
| 
 | ||||
| compile:	Makefile | ||||
| 		case `ack_sys` in sun*) MACH=sun2;; pmds*) MACH=pmds4;; \
 | ||||
|  |  | |||
|  | @ -23,6 +23,9 @@ | |||
| !--------------------------------------------------------------------------- | ||||
| 
 | ||||
| _m_a_i_n: | ||||
| #ifdef __BSD4_2 | ||||
| 		jsr	getmask | ||||
| #endif | ||||
| 		move.l	sp,d0 | ||||
| 		add.l	#0x10000,d0		! rough guess. What is the | ||||
| 						! real top ??? | ||||
|  |  | |||
|  | @ -20,11 +20,11 @@ _sigtrp:	move.l	(sp)+,d2	!save return address | |||
| 		move.l	(a1),d2		!previous trap number in d2 | ||||
| 		comp	#256,d1		!-2 and -1 special | ||||
| 		bcc	1f | ||||
| 		move.l	#sig_adr-4,d3 | ||||
| 		add.l	a0,d3		!Get the pointer to the trap-  | ||||
| 		add.l	#sig_adr-4,a0 | ||||
| 		move.l	(a0),d3		!Get the pointer to the trap-  | ||||
| 		bne	2f		!procedure to give as argument to | ||||
| sig_bad:	mov	22,-(sp)	!_Xsignal. If pointer 0 trapping is | ||||
| 		mov	22,-(sp)	!not legal | ||||
| sig_bad:	mov	#22,-(sp)	!_Xsignal. If pointer 0 trapping is | ||||
| 		mov	#22,-(sp)	!not legal | ||||
| 		jmp	(a4) | ||||
| 1:		comp	#-3,d1		!-2:reset default , -3: ignore | ||||
| 		bmi	sig_bad | ||||
|  | @ -48,34 +48,58 @@ sig_trp:	.data4	-2  ;	.data4	-2  ;	.data4	-2  ;	.data4	-2 | |||
| !the next procedures map the catched signal to em errors. The em error | ||||
| !procedure will handle this. | ||||
| sig1:		pea	retutrap | ||||
| #ifdef __BSD4_2 | ||||
| 		jsr	setmask | ||||
| #endif | ||||
| 		move.l	sig_trp,d0 | ||||
| 		mov	d0,-(sp) | ||||
| 		bra	error | ||||
| sig2: 		pea	retutrap | ||||
| #ifdef __BSD4_2 | ||||
| 		jsr	setmask | ||||
| #endif | ||||
| 		move.l	sig_trp+4,d0 | ||||
| 		mov	d0,-(sp) | ||||
| 		bra	error | ||||
| sig3:		pea	retutrap | ||||
| #ifdef __BSD4_2 | ||||
| 		jsr	setmask | ||||
| #endif | ||||
| 		move.l	sig_trp+8,d0 | ||||
| 		mov	d0,-(sp) | ||||
| 		bra	error | ||||
| sig8: 		pea	retutrap | ||||
| #ifdef __BSD4_2 | ||||
| 		jsr	setmask | ||||
| #endif | ||||
| 		move.l	sig_trp+28,d0 | ||||
| 		mov	d0,-(sp) | ||||
| 		bra	error | ||||
| sig13:		pea	retutrap | ||||
| #ifdef __BSD4_2 | ||||
| 		jsr	setmask | ||||
| #endif | ||||
| 		move.l	sig_trp+48,d0 | ||||
| 		mov	d0,-(sp) | ||||
| 		bra	error | ||||
| sig14:		pea	retutrap | ||||
| #ifdef __BSD4_2 | ||||
| 		jsr	setmask | ||||
| #endif | ||||
| 		move.l	sig_trp+52,d0 | ||||
| 		mov	d0,-(sp) | ||||
| 		bra	error | ||||
| sig15:		pea	retutrap | ||||
| #ifdef __BSD4_2 | ||||
| 		jsr	setmask | ||||
| #endif | ||||
| 		move.l	sig_trp+56,d0 | ||||
| 		mov	d0,-(sp) | ||||
| 		bra	error | ||||
| sig16:		pea	retutrap | ||||
| #ifdef __BSD4_2 | ||||
| 		jsr	setmask | ||||
| #endif | ||||
| 		move.l	sig_trp+60,d0 | ||||
| 		mov	d0,-(sp) | ||||
| 		bra	error | ||||
|  | @ -83,13 +107,38 @@ retutrap:	add.l	#4,sp		!remove signumber | |||
| 		rtr | ||||
| 
 | ||||
| sig12:		pea	sig12 | ||||
| #ifdef __BSD4_2 | ||||
| 		jsr	setmask | ||||
| #endif | ||||
| 		mov	#12,-(sp) | ||||
| 		bsr	_Xsignal | ||||
| 		bsr	e_badmon | ||||
| 		rtr | ||||
| sig11:		move.l	4(a5),d0 | ||||
| sig11: | ||||
| #ifdef __BSD4_2 | ||||
| 		jsr	setmask | ||||
| #endif		 | ||||
| 		move.l	4(a5),d0 | ||||
| 		sub.l	sp,d0 | ||||
| 		bcs	e_memflt	!in this case error handling possible | ||||
| 		move.l	ml,sp		!refresh stack and stop . | ||||
| 		bra	notrap1 | ||||
| 
 | ||||
| #ifdef __BSD4_2 | ||||
| setmask: | ||||
| 		move.l	mask,-(sp) | ||||
| 		jsr	_sigsetmask | ||||
| 		add.l	#4,sp | ||||
| 		rts | ||||
| 
 | ||||
| getmask: | ||||
| 		clr.l	-(sp) | ||||
| 		jsr	_sigblock | ||||
| 		add.l	#4,sp | ||||
| 		move.l	d0,mask | ||||
| 		rts | ||||
| 
 | ||||
| .sect .data | ||||
| mask:	 | ||||
| 	.data4 0 | ||||
| #endif | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue