[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-arm-kernel
Subject:    Re: pending interrupts
From:       Russell King - ARM Linux <linux () arm ! linux ! org ! uk>
Date:       2004-09-15 19:23:09
Message-ID: 20040915202309.A31707 () flint ! arm ! linux ! org ! uk
[Download RAW message or body]

On Wed, Sep 15, 2004 at 10:43:44AM +0200, Matthias Welwarsky wrote:
> On Tuesday 14 September 2004 19:04, Nicolas Pitre wrote:
> > On Tue, 14 Sep 2004, Matthias Welwarsky wrote:
> > > Also, it's a little difficult to
> > > write the FIQ code in C, since you lack a stack :)
> >
> > FIQ handlers are always written in assembly, of course.
> 
> Well, yes, however the badness of writing them in C is highly overrated. If 
> you can trick your compiler into not using a stack and only the banked 
> registers, it is entirely possible.

You can use a stack if you want to, provided the FIQ handler sets one
up itself and keeps FIQs disabled for the duration of the handler.
The real issue is that FIQ handlers, no matter what language, must NOT
use _any_ kernel locking semantic either directly or indirectly.

Why?  None of the kernel locking functions are FIQ safe.  To make them
FIQ safe would immediately degrade the advantages of FIQs, effectively
making them exactly the same as IRQs.

So, do what you want with FIQs, but be _very_ careful about how you
implement them, and _carefully_ consider how you safely pass any data
from them to other parts of the kernel.  But remember - FIQ means
_F_A_S_T_ interrupt.

-------------------------------------------------------------------
Subscription options: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
FAQ:       http://www.arm.linux.org.uk/armlinux/mlfaq.php
Etiquette: http://www.arm.linux.org.uk/armlinux/mletiquette.php
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic