[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] TimerA interrupt handler




On 04.01.2013 18:31, Vincent Rivière wrote:

Anyway, I agree that such compiler dependent features are dangerous when we don't know exactly what happens behind the scenes. Looking at the generated assembler code is always a good practice.

There's another trap you'll need to take care of. __attribute__((interrupt)) is perfect to write trap handlers and usually doesn't cause any headaches there.

If you want to write "real" interrupt handlers, however, you must be aware that there is no way (at least none that I knew of) to atomically adjust IPL on handler entry as the very first instruction (which you must do to be sure your interrupt handler doesn't get called while it's already handled) since there is no way to intercept the gcc function prologue generated (to mask interrupts writing to SR).

In my opinion "real" interrupt handlers are better written in pure asssembler.