linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* interrupt handlers PowerPC via GCC
@ 2008-03-20  0:06 Tehn Yit Chin
  2008-03-20 17:18 ` Scott Wood
  0 siblings, 1 reply; 4+ messages in thread
From: Tehn Yit Chin @ 2008-03-20  0:06 UTC (permalink / raw)
  To: linuxppc-embedded

Hi all,

Apologies for such a basic question. I am trying to write an ISR on a
MPC551x. When I tried to use the interrupt attribute with
powerpc-eabi-gcc such as

_attribute_((interrupt_handler)) foobarISR(void)
{
}


it complains of a syntax error. Upon further investigation in the GCC,
it appears that the interrupt attribute is not supported by
powerpc-eabi-gcc.

Am I missing something fundamental here? How are the current interrupt
service routines created at the moment?

Any pointers would be appreciated.

tyc

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

* Re: interrupt handlers PowerPC via GCC
  2008-03-20  0:06 interrupt handlers PowerPC via GCC Tehn Yit Chin
@ 2008-03-20 17:18 ` Scott Wood
  2008-03-24 23:03   ` Tehn Yit Chin
  0 siblings, 1 reply; 4+ messages in thread
From: Scott Wood @ 2008-03-20 17:18 UTC (permalink / raw)
  To: Tehn Yit Chin; +Cc: linuxppc-embedded

Tehn Yit Chin wrote:
> Hi all,
> 
> Apologies for such a basic question. I am trying to write an ISR on a
> MPC551x. When I tried to use the interrupt attribute with
> powerpc-eabi-gcc such as
> 
> _attribute_((interrupt_handler)) foobarISR(void)
> {
> }

Assuming you're talking about an interrupt handler in Linux, you don't 
need to do anything like that.  The actual interrupt entry is assembly 
code.  Search existing drivers for "irqreturn_t" to find examples of 
what an interrupt handler looks like, and "request_irq" for how to hook 
the handler into the interrupt.

-Scott

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

* Re: interrupt handlers PowerPC via GCC
  2008-03-20 17:18 ` Scott Wood
@ 2008-03-24 23:03   ` Tehn Yit Chin
  2008-03-26  2:50     ` David H. Lynch Jr.
  0 siblings, 1 reply; 4+ messages in thread
From: Tehn Yit Chin @ 2008-03-24 23:03 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 1158 bytes --]

Hey Scott,

Thanks for the reply, I shall investigate further.

I wasn't talking about interrupt handlers in Linux as such, but using
powerpc-eabi-gcc to write an ISR for the MPC5516. (I guess that could be
off-topic on this mailing list, but I thought the folks on this mailing list
would probably know the answer pretty easily). I was hoping that gcc would
generate the prologue and epilogue code for me via the interrupt attributes.

Many thanks.
Tehn Yit Chin



On Fri, Mar 21, 2008 at 4:18 AM, Scott Wood <scottwood@freescale.com> wrote:

> Tehn Yit Chin wrote:
> > Hi all,
> >
> > Apologies for such a basic question. I am trying to write an ISR on a
> > MPC551x. When I tried to use the interrupt attribute with
> > powerpc-eabi-gcc such as
> >
> > _attribute_((interrupt_handler)) foobarISR(void)
> > {
> > }
>
> Assuming you're talking about an interrupt handler in Linux, you don't
> need to do anything like that.  The actual interrupt entry is assembly
> code.  Search existing drivers for "irqreturn_t" to find examples of
> what an interrupt handler looks like, and "request_irq" for how to hook
> the handler into the interrupt.
>
> -Scott
>

[-- Attachment #2: Type: text/html, Size: 1586 bytes --]

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

* Re: interrupt handlers PowerPC via GCC
  2008-03-24 23:03   ` Tehn Yit Chin
@ 2008-03-26  2:50     ` David H. Lynch Jr.
  0 siblings, 0 replies; 4+ messages in thread
From: David H. Lynch Jr. @ 2008-03-26  2:50 UTC (permalink / raw)
  To: Tehn Yit Chin; +Cc: linuxppc-embedded

Tehn Yit Chin wrote:
> Hey Scott,
>
> Thanks for the reply, I shall investigate further.
>
> I wasn't talking about interrupt handlers in Linux as such, but using
> powerpc-eabi-gcc to write an ISR for the MPC5516. (I guess that could be
> off-topic on this mailing list, but I thought the folks on this mailing list
> would probably know the answer pretty easily). I was hoping that gcc would
> generate the prologue and epilogue code for me via the interrupt attributes.
    I know nothing about GCC's interrupt attributes,
    however, there is no problem writing ISR's  from scratch (no OS)
    for the ppc. There are several boot loaders, monitors etc. out there
with examples.
     There is even one inside the Linux Kernel source - though it i
probably far more complex than you need.

    Somewhere I have something for the ppc405 I can send you - but most
ppc's are similar.


-- 
Dave Lynch 					  	    DLA Systems
Software Development:  				         Embedded Linux
717.627.3770 	       dhlii@dlasys.net 	  http://www.dlasys.net
fax: 1.253.369.9244 			           Cell: 1.717.587.7774
Over 25 years' experience in platforms, languages, and technologies too numerous to list.

"Any intelligent fool can make things bigger and more complex... It takes a touch of genius - and a lot of courage to move in the opposite direction."
Albert Einstein

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

end of thread, other threads:[~2008-03-26  2:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-20  0:06 interrupt handlers PowerPC via GCC Tehn Yit Chin
2008-03-20 17:18 ` Scott Wood
2008-03-24 23:03   ` Tehn Yit Chin
2008-03-26  2:50     ` David H. Lynch Jr.

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).