improve signal handling of Floating Point Exception
This commit is contained in:
		
							parent
							
								
									6beb10355e
								
							
						
					
					
						commit
						b37c8b0b24
					
				
					 2 changed files with 23 additions and 2 deletions
				
			
		|  | @ -25,8 +25,8 @@ a2: | ||||||
| 	pushl	r0 | 	pushl	r0 | ||||||
| 	pushl	r2 | 	pushl	r2 | ||||||
| 	pushl	r1 | 	pushl	r1 | ||||||
| #	movl	$m1,ap | 	movl	$m1,ap | ||||||
| #	chmk	(ap)+		# catch floating point exception | 	chmk	(ap)+		# catch floating point exception | ||||||
| 	calls	$3,_m_a_i_n | 	calls	$3,_m_a_i_n | ||||||
| 	movl	$m2,ap | 	movl	$m2,ap | ||||||
| 	movl	r0,6(ap) | 	movl	r0,6(ap) | ||||||
|  |  | ||||||
|  | @ -38,6 +38,13 @@ a2: | ||||||
| sig8: | sig8: | ||||||
| 	.word	0x0000
 | 	.word	0x0000
 | ||||||
| 	pushl	8(ap) | 	pushl	8(ap) | ||||||
|  | 	movl	$m3,ap | ||||||
|  | 	chmk	(ap)+		# restore default handler | ||||||
|  | 	movl	$m5,ap | ||||||
|  | 	chmk	(ap)+		# get current signal mask | ||||||
|  | 	andl3	d0,$0xffffff7f,m4+6	# and remove the 8th bit | ||||||
|  | 	movl	$m4,ap | ||||||
|  | 	chmk	(ap)+		# and  | ||||||
| 	movl	(sp)+,ap | 	movl	(sp)+,ap | ||||||
| 	pushl	tab [ap] | 	pushl	tab [ap] | ||||||
| 	jsb	.trp | 	jsb	.trp | ||||||
|  | @ -52,6 +59,20 @@ m1: | ||||||
| 	.long	8
 | 	.long	8
 | ||||||
| 	.long	m1a
 | 	.long	m1a
 | ||||||
| 	.long	0
 | 	.long	0
 | ||||||
|  | m3: | ||||||
|  | 	.word	SYS_sigvec
 | ||||||
|  | 	.long	3
 | ||||||
|  | 	.long	8
 | ||||||
|  | 	.long	0
 | ||||||
|  | 	.long	0
 | ||||||
|  | m4: | ||||||
|  | 	.word	SYS_sigsetmask
 | ||||||
|  | 	.long	1
 | ||||||
|  | 	.long	0
 | ||||||
|  | m5: | ||||||
|  | 	.word	SYS_sigblock
 | ||||||
|  | 	.long	1
 | ||||||
|  | 	.long	0
 | ||||||
| m1a: | m1a: | ||||||
| 	.long	sig8
 | 	.long	sig8
 | ||||||
| 	.long	0
 | 	.long	0
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue