linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* interrupt handler and gnu
@ 2000-06-12 17:14 Ken Maier
  2000-06-12 17:57 ` Gabriel Paubert
  0 siblings, 1 reply; 2+ messages in thread
From: Ken Maier @ 2000-06-12 17:14 UTC (permalink / raw)
  To: linuxppc-embedded


How do I get the gnu compiler to save processor state for a interrupt handler?
I have tried #pragma interrupt but it didn't work.  I'm compiling for the 8260
pqII.  I have started writing the code myself.  Do I need to save the fp regs?
Any help will be welcomed.

Thanks,
Ken Maier

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: interrupt handler and gnu
  2000-06-12 17:14 interrupt handler and gnu Ken Maier
@ 2000-06-12 17:57 ` Gabriel Paubert
  0 siblings, 0 replies; 2+ messages in thread
From: Gabriel Paubert @ 2000-06-12 17:57 UTC (permalink / raw)
  To: Ken Maier; +Cc: linuxppc-embedded


On Mon, 12 Jun 2000, Ken Maier wrote:

>
> How do I get the gnu compiler to save processor state for a interrupt handler?

Simple, you don't. The compiler does not even know that some registers
exist (XER, SRR0, SRR1, SR0-SR15), also don't forget that entering the
interrupt may involve switching stack and you decide how to do it, not the
processor. Basically you have to save:

SRR0, SRR1, CR, LR, CTR, XER, R0-R12 (R1 is the stack so it depends),
perhaps R13 (system convention dependant). Don't forget that the interrupt
handler starts with the MMU disabled which is definitely not what you want
to access I/O.

Ok, that's for a minimalistsic system. In a linux device driver, you
kindly ask the kernel to call a function you specify when a given
interrupt occurs. The kernel handles all the gory details for you,
reenables the MMU, fetches the interrupt vector and dispatches to the
registered routines (see request_irq and free_irq).

> I have tried #pragma interrupt but it didn't work.  I'm compiling for the 8260
> pqII.  I have started writing the code myself.  Do I need to save the fp regs?
> Any help will be welcomed.

You normally don't need to save the FP regs, using FP in the kernel is
strictly prohibited (and the MSR will have the FP bit reset to prevent you
from accidentally using FP).

	Regards,
	Gabriel.


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-06-12 17:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-06-12 17:14 interrupt handler and gnu Ken Maier
2000-06-12 17:57 ` Gabriel Paubert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).