This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: interrupt writing in gcc!


> Cliff Tsai wrote:
> 
> Hi:
>     I've used following writing method in other compiler for interrupt:
> 
>     void __interrupt ISR_XXX(void)
> 
>     But when used in gcc,an error occurs.
>     I wanna how to write a interrupt handler in gcc.

 Only some CPUs are supported with the GCC's '__attribute__((interrupt*))',
but where it is supported, defining:

  #define __interrupt  __attribute__((interrupt))

or

  #define __interrupt  __attribute__((interrupt_handler))

in the Hitachi-targets (they use this name for the attribute), shouldn't
be hard... With newlib as the C-library, a suitable place could be the
'<sys/config.h>', all newlib-headers seem to include it via the '<_ansi.h>'
or something... So putting a '#include <stdio.h>' or something into the
module sources with the ISR-functions, will enable you to use the old
method...

 When the attribute names differ between different targets, some kind of
'standard' for defining the ISR-functions in GCC could be voted... Your
vote probably could be for the '__interrupt', but I once suggested the
'ISR_FUNC' and have used it as my local standard...
 
 Ok, the most important thing would be you to tell the target CPU-type,
then we could tell whether there already is any support for ISR's or
what to do to get it, where to find the patches, whether to upgrade
(ARM is supported since November-2000 or something) and so on...

Cheers, Kai


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]