Interrupts with GCC/EGCS

Jeffrey A Law law@hurl.cygnus.com
Wed Mar 17 21:02:00 GMT 1999


  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


More information about the Gcc-patches mailing list