Re: in_irq()

From: davide.rossetti (Davide.Rossetti@roma1.infn.it)
Date: Wed Dec 04 2002 - 11:08:55 EST


On Tue, 3 Dec 2002, Madhavi wrote:

>
> Hi
>
> I am using a UP system with CONFIG_SMP=y in .config with linux 2.4.19
> kernel.
>
> I have this piece of code:
>
> spin_lock_irqsave(&some_lock, flags);
> in_irq();
> spin_unlock_irqrestore(&some_lock, flags);
>
> I have read somewhere (I think its given in the Unreliable Guide to
> kernel locking) that in_irq() returns true when the interrupts
> are blocked. So, I was expecting in_irq() to return true here. But, it is
> returning 0 here.

I think it is intended to return true only if you are in an interrupt
context.... that is in the context of a iterrupt handler...

ciao

-- 
______/ Rossetti Davide   INFN - Roma I - APE group \______________
 pho +390649914507/412   web: http://apegate.roma1.infn.it/~rossetti
 fax +390649914423     email: davide.rossetti@roma1.infn.it        

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Dec 07 2002 - 22:00:19 EST