www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/05/06/03:27:24

Date: Tue, 6 May 1997 10:07:24 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Gregary J Boyles <boylesgj AT lion DOT cs DOT latrobe DOT edu DOT au>
cc: djgpp AT delorie DOT com
Subject: Re: Help needed with ISR wrapper design.
In-Reply-To: <5kculb$quo@lion.cs.latrobe.edu.au>
Message-ID: <Pine.SUN.3.91.970506100657.13952B-100000@is>
MIME-Version: 1.0

On 2 May 1997, Gregary J Boyles wrote:

> I have attempted to emulate Alaric Williams's ISR wrappers.

I didn't see anybody reply, so I will try.  But please take the info
below with a grain of salt, since I've never done myself some of these
things.

> Now I assume ___djgpp_base_address corresponds to the our_ds in your
> wrappers.

No.  `___djgpp_base_address' is the *base address* of the CS and DS
selectors.  So you will need to get the base address of the descriptor
that the CS selector points to.  (A selector and its base address are
NOT the same!)

> and that in my initialization function I will have to do the following:
> 
>         extern short int our_ds;
>         our_ds=_my_ds();

I think you should use `__djgpp_ds_alias' instead of `_my_ds'.  That's
because the DS selector is invalidated when there is a signal (such as
SIGINT) pending, whereas the alias is always valid.  Since you can
never be sure in an interrupt handler whether a signal is pending, it
is safer to use the alias.

I think one of the reasons Martynas put the variables into the code
segment is that CS is always valid when your code runs.

Sorry, I cannot help you with the rest of your questions.

- Raw text -


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