www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/05/03/05:12:46

Date: Mon, 3 May 1999 12:09:33 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: DJ Delorie <dj AT delorie DOT com>, djgpp-workers AT delorie DOT com,
sandmann AT clio DOT rice DOT edu, Andris Pavenis <pavenis AT lanet DOT lv>
Subject: Re: __dpmi_int causes trouble in signals
In-Reply-To: <Pine.SUN.3.91.990503100043.4057N-100000@is>
Message-ID: <Pine.SUN.3.91.990503120210.13669A-100000@is>
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Mon, 3 May 1999, I wrote:

> 	cmpw	%cs:___djgpp_ds_alias,32(%ebp)   <<<< new line
> 	je	stack_ok                         <<<< new line

Sorry, this won't even assemble (blush).  Also, leaving the DS alias in 
SS is a bad idea, since the alias selector is freed by our exit code, so
if the signal handler exits, it will bomb right after freeing the alias.

Here's a solution that seems to work.  It forces the normal DS selector 
into SS if it finds SS holding the DS alias.  Comments?

*** src/libc/go32/exceptn.S~	Mon May  3 11:04:26 1999
--- src/libc/go32exceptn.S	Mon May  3 11:38:28 1999
***************
*** 127,132 ****
--- 127,138 ----
  	je	1f
  	cmpw	%ax,32(%ebp)
  	je	stack_ok
+ 	.byte	0x2e				/* CS: */
+ 	movw	___djgpp_ds_alias,%di
+ 	cmpw	%di,32(%ebp)
+ 	jne	1f
+ 	movw	%ax,32(%ebp)
+ 	jmp	stack_ok
  1:	movl	$exception_stack+8000, 28(%ebp)
  	movw	%ax, 32(%ebp)
  stack_ok:

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019