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]

Re: ISR in C++


Ivan Porres Paltor wrote:
> 
> Hi!,
> 
> I am using g++ 2.7.2.3 for the Hitachi SH1 processor. ( sh-hms target ).
> 
> The compiler works fine, but I am trying to do a interrupt service
> routine in C++.

Thanks to the people that helped me with the previous post.
Now, I realized that my g++ ignores the "#pragma interrupt" directive.
I.e.:

#pragma interrupt
extern "C"
void isrCPP {
 //
};

The compiler accepts this code, but it does not save or restore the
registers and does not add a "Return-from-Interruption" op-code (rete in
the asm).

Is it a known bug? I am missing something?
Also, I am interested in a good OO mechanism to dispatch the interrupts.
If you know a good reference or you want to discuss about it please tell
me.  

Thanks,
Ivan


-- 
Ivan Porres Paltor                    Turku Centre for Computer Science
Åbo Akademi, Department of Computer Science  Phone: +358-2-2154033   
Lemminkäinengatan 14A                             
FIN-20520 Turku - Finland                    http://www.abo.fi/~iporres