This is the mail archive of the crossgcc@cygnus.com mailing list for the crossgcc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

m68k & Interrupts


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