From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.177]) by ozlabs.org (Postfix) with ESMTP id 8C7DDDDDFF for ; Tue, 25 Mar 2008 10:03:53 +1100 (EST) Received: by wa-out-1112.google.com with SMTP id m28so3697161wag.13 for ; Mon, 24 Mar 2008 16:03:51 -0700 (PDT) Message-ID: Date: Tue, 25 Mar 2008 10:03:51 +1100 From: "Tehn Yit Chin" To: "Scott Wood" Subject: Re: interrupt handlers PowerPC via GCC In-Reply-To: <47E29C60.10300@freescale.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_13317_14760976.1206399831442" References: <47E29C60.10300@freescale.com> Cc: linuxppc-embedded@ozlabs.org List-Id: Linux on Embedded PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , ------=_Part_13317_14760976.1206399831442 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 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 > ------=_Part_13317_14760976.1206399831442 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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

------=_Part_13317_14760976.1206399831442--