This is the mail archive of the crossgcc@cygnus.com mailing list for the crossgcc project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
David Williams wrote: > > Hi all, > > There was a discussion on this mailing list about a month and a half ago > about having an interrupt attribute for functions. I am coding some > interrupt handlers for a 68000 target (DragonBall) and would like to use > the interrupt attribute for functions that will be interrupt handlers. > > 1. Is this supported for 68K targets? Our next release of gcc (based upon egcs-1.1.2) will include support for the interrupt attribute, on 68k targets. > 2. Is there already some source code for set and get interrupt vectors for > 68K targets? The easiest way to 'get' and 'set' vectors is to simply define the vector table as an array of pointer to function returning void, eg extern void (*exceptiontable) (void) [256]; To set a vector, let's say the 'divide by zero' vector: exceptiontable [5] = MyDivByZeroHandler; (I suppose it's obvious, but the table must be located in RAM for this to work.) Our next compiler release will include a linker script for ROM-based 68k systems which (among other things) creates an exception vector table in ROM. If user code defines a handler for a particular vector, then the linker will set that vector to the address of the user code; otherwise the vector is set to the address of a user-defined 'default' handler. This avoids having to 'get' and 'set' vectors at run time. Scott Howard scott@objsw.com _______________________________________________ New CrossGCC FAQ: http://www.objsw.com/CrossGCC _______________________________________________ To remove yourself from the crossgcc list, send mail to crossgcc-request@cygnus.com with the text 'unsubscribe' (without the quotes) in the body of the message.