m68k & Interrupts

Guido Pohl pjpapohl@cs.tu-berlin.de
Sun Sep 13 15:22:00 GMT 1998


Hi ho,
I would like to have some suggestions about the dealings with
interrupts  under gcc.
I am new to gcc, so please be patient and start with Adam & Eva 8-)! 
(Formerly, I used hitech tools which support a special function type for
interrupts.)

What is the best way to handle the interrupt service routines? I really
do not mean assembler for the interrupt routines itself ;-)!

One possible solution. that I can think of, is to use somekind of a
wrapper function written in assembler, which one and only function is to
call the actual c-function.

+--------------------------------+ m68k vector table
| pointer to assembler function  |
+--------------------------------+


+-- assembler function -----+
| jsr c-function  ----------|----+
| rte                       |    |
+---------------------------+    |
                                 |
                                / 
+-- c-funktion -------------+  /
| (do the interrupt);       | <
| return;                   |
+---------------------------+

Another way would be to write a header and trailer for the c-function
that clean up the stack. The header would fake the stack, i.e. it would
put the status register on the stack. The trailer would then have an rte
after it cleaned up the stack frame of the c-function.

Well, both of this ideas are not really worked out. And I would prefer
to here from someone that have experiences with interrupt handling for
Motorolas venerable 68000.

Ok - thanks in advance.

Guido Pohl



More information about the crossgcc mailing list