Sanjiv.Gupta at microchip.com
2009-Jul-21 15:07 UTC
[LLVMdev] LLVM and Interrupt Service Routines.
Hi, Apparently, there is no explicit support for ISRs in the llvm framework. I could not find a matching attribute that can be used to mark a function as an ISR, which codegen and optimizer can use accordingly. ISRs aren't called explicity from any function, so currently the optimizer deletes them. We are planning to introduce a new "interrupt" attribute (to be modeled similiar to "section" attribute) which one can use in different passes suitably. How does that sound? Or do we have something available already? - Sanjiv -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090721/f60dbdd7/attachment.html>
We've used the used attribute to ensure they are not deleted and had no problem. Andrew On Tue, Jul 21, 2009 at 10:07 AM, <Sanjiv.Gupta at microchip.com> wrote:> Hi, > Apparently, there is no explicit support for ISRs in the llvm framework. I > could not find a matching attribute that can be used to mark a function as > an ISR, which codegen and optimizer can use accordingly. ISRs aren't called > explicity from any function, so currently the optimizer deletes them. We are > planning to introduce a new "interrupt" attribute (to be modeled similiar to > "section" attribute) which one can use in different passes suitably. > How does that sound? Or do we have something available already? > > - Sanjiv > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >
Hello Sanjiv, Have you tried attribute((used))? --Sam> >From: "Sanjiv.Gupta at microchip.com" <Sanjiv.Gupta at microchip.com> >To: llvmdev at cs.uiuc.edu >Sent: Tuesday, July 21, 2009 10:07:53 AM >Subject: [LLVMdev] LLVM and Interrupt Service Routines. > > >Hi, >Apparently, there is no explicit support for ISRs >in the llvm framework. I could not find a matching attribute that can be >used to mark a function as an ISR, which codegen and optimizer can use >accordingly. ISRs aren't called explicity from any function, so currently the >optimizer deletes them. We are planning to introduce a new "interrupt" attribute >(to be modeled similiar to "section" attribute) which one can use in different >passes suitably. >How does that sound? Or do we have something available already? > >- Sanjiv >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090721/c9999aed/attachment.html>
Hi Sanjiv, Assuming that that support for Ada in LLVM is complete, I would look to see if there is something that is done there. Ada provides two pragmas (Interrupt_Handler & Attach_Handler) which allow you to both statically and dynamically attach interrupts to procedures. Alex Karahalios On Jul 21, 2009, at 8:07 AM, <Sanjiv.Gupta at microchip.com> <Sanjiv.Gupta at microchip.com > wrote:> Apparently, there is no explicit support for ISRs in the llvm > framework. I could not find a matching attribute that can be used > to mark a function as an ISR, which codegen and optimizer can use > accordingly. ISRs aren't called explicity from any function, so > currently the optimizer deletes them.-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090721/7ae0f0a2/attachment.html>
Anton recently added support for __attribute__((naked)) in r76198 and r76201. I'd imagine that the GCC "interrupt" and "isr" synonyms would go in similarly. How each target handles the code generation differences will be the interesting part. deep On Tue, Jul 21, 2009 at 3:07 PM, <Sanjiv.Gupta at microchip.com> wrote:> Hi, > Apparently, there is no explicit support for ISRs in the llvm framework. I > could not find a matching attribute that can be used to mark a function as > an ISR, which codegen and optimizer can use accordingly. ISRs aren't called > explicity from any function, so currently the optimizer deletes them. We are > planning to introduce a new "interrupt" attribute (to be modeled similiar to > "section" attribute) which one can use in different passes suitably. > How does that sound? Or do we have something available already? > > - Sanjiv > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >
> How each target handles the code generation > differences will be the interesting part.Why not use a target specific calling convention? An interrupt is like a normal function call, it only has a different calling convention.
Sanjiv.Gupta at microchip.com
2009-Jul-22 04:44 UTC
[LLVMdev] LLVM and Interrupt Service Routines.
________________________________ From: llvmdev-bounces at cs.uiuc.edu on behalf of Andrew Lenharth Sent: Tue 7/21/2009 8:43 PM To: LLVM Developers Mailing List Subject: Re: [LLVMdev] LLVM and Interrupt Service Routines.>We've used the used attribute to ensure they are not deleted and had no problem.>Andrewhow does code gen distinguish ISRs? - sanjiv On Tue, Jul 21, 2009 at 10:07 AM, <Sanjiv.Gupta at microchip.com> wrote:> Hi, > Apparently, there is no explicit support for ISRs in the llvm framework. I > could not find a matching attribute that can be used to mark a function as > an ISR, which codegen and optimizer can use accordingly. ISRs aren't called > explicity from any function, so currently the optimizer deletes them. We are > planning to introduce a new "interrupt" attribute (to be modeled similiar to > "section" attribute) which one can use in different passes suitably. > How does that sound? Or do we have something available already? > > - Sanjiv > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >_______________________________________________ LLVM Developers mailing list LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090721/5d10f0c7/attachment.html>
Hi Alex,> Assuming that that support for Ada in LLVM is complete, I would look to > see if there is something that is done there. Ada provides two pragmas > (Interrupt_Handler & Attach_Handler) which allow you to both statically > and dynamically attach interrupts to procedures.the interrupt handler itself is a parameterless procedure that does not return a value. As such, I guess calling conventions and so forth are not very relevant for it :) In any case llvm-gcc and gcc mainline seem to output the interrupt handler as an ordinary function on x86-32-linux. Ciao, Duncan.