[cc65] Changed semantics of callirq and interruptors

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2005-04-25 22:27:46
After some discussion with Oliver Schmidt, who works on the Apple ][
implementation, I've decided to change the semantics of interruptors when used
together with callirq, the standard routine that calls all interruptors in a
program. An interruptor must now return with carry set if the interrupt was
handled, and carry clear if not. "Handled" means that the interrupt source is
no longer active. callirq will stop calling interruptors after the first call
to one that claims to have handled the interrupt.

Since the interrupt entries of all loadable drivers are called via an
interruptor in the wrapper code, above is also true for the IRQ entries in the
drivers. Existing drivers have already been changed.

On most platforms, the standard IRQ is just used as a timer. If your
interruptor does nothing with the interrupt source, but just uses the
interrupt to do some background tasks, just add a clc instruction to existing
code, and you're set. Code that does things like serial interrupts needs a sec
instruction if the interrupt has been handled.

Since .interruptor together with a linker config does nothing but generate a
table with handler addresses, above changes do mean nothing if you aren't also
using the callirq routine which comes with the C library.

I'm not sure if this will have an impact on Contiki somehow. If you're a
Contiki developer, please check the code.

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz@musoftware.de
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Mon Apr 25 22:27:59 2005

This archive was generated by hypermail 2.1.8 : 2005-04-25 22:28:02 CEST