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

Re: [MiNT] TimerA interrupt handler



On 04/01/2013 18:51, markus@mubf.de wrote:
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)

Usually, you don't need that. In before calling an interrupt handler, the 68000 (and ColdFire) adjusts the IPL level so that you can be interrupted only by interrupts with higher priorities (try to look at sr during an interrupt). Interrupts with the same or lower priorities will be delayed until the IPL is lowered (usually, on rte). Manually adjusting the IPL in an interrupt handler (I mean hacking sr) is only required if you want to disable interrupts with higher priorities.

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

This is probably more sensible. And more portable.

--
Vincent Rivière