This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Interrupts with GCC/EGCS
- To: Michael Schwingen <rincewind at discworld dot dascon dot de>
- Subject: Re: Interrupts with GCC/EGCS
- From: Jeffrey A Law <law at hurl dot cygnus dot com>
- Date: Wed, 17 Mar 1999 22:02:09 -0700
- cc: crossgcc at cygnus dot com, egcs-patches at cygnus dot com
- Reply-To: law at cygnus dot com
In message <19990312205334.E471@tubul.dascon.de>you write:
> > Some time ago I asked about interrupt keywords with egcs. Jeff kindly
> > responded with the above message.
> > How do if the interrupt keyword exists for a particular target. I am
> > interested in 68k and powerpc.
>
> Hm - I just did that. The patch could need some testing, but on my test
> cases, it seemed to work fine.
It basically looks correct.
> It is mostly stolen from the NEC V850 target
Seems reasonable.
> - note that #pragma interrupt
> and __attribute((interrupt)) in the Hitachi SH target (where I looked first
> for example code) seem to be broken because they use global variables ...
I don't follow how the use of a global variable necessarily makes the code
wrong? Can you give more details?
> > What is the syntax to the attribute ? Is it the same for all supported
> > targets or is it target dependent ?
>
> I used __attribute__((interrupt)). When set on a function, all modified
> registers are saved and the function terminates using rte instead of
> rts/rtd.
Sounds correct.
> Note that you can not call an interrupt function from normal code, and it
> might not be a good idea to declare them anything except void(void).
Right.
> I'll attach the patch, comments are welcome. The patch is against
> egcs-1.1b, but other versions should work, too.
Looks basically correct. To get it installed we'll need a copyright
assignment. Once the copyright assignment has been filed, I'll look at it
in more detail.
http://www.cygnus.com/egcs/contribute.html
jeff