Re: Interrupts - the hard way

Senthil Kumar Selvaraj <[email protected]>
Newsgroups gmane.comp.hardware.avr.gcc
Message-ID <[email protected]>
On Thu, Apr 04, 2013 at 08:40:58AM -0300, Diego Izidoro wrote:
> Compiling with "-nodefaultlibs" should do the trick to remove the interrupt
> code generation, that's the easy part. What i want is to manually build the
> interrupt vector and implement the ISRs (complete with context saving and


I can point you to the related source code, if you're interested.

The vector table layout is in avr-libc (avr-libc/crt1/gcrt1.S) - there
is a vector macro defined for jumping to a handler, and then a bunch of
macro invocations corresponding to each interrupt.

> context restoring operations). It's kind of a challenge, where the compiler
> is supposedly more primitive and doesn't know what it is an interruption.
> 

The compiler knows about interrupts through the signal/interrupt attribute 
specified for the ISR. See gcc/config/avr/avr.c, and grep for signal.
You should find a few predicate functions (avr_signal_function_p,
avr_interrupt_function_p), and searching for their callers should get
you started.

Regards
Senthil
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.