All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] Understanding rtdm_lock_get
@ 2008-01-30 10:38 Laurent.POYART
  2008-01-30 11:41 ` Jan Kiszka
  0 siblings, 1 reply; 2+ messages in thread
From: Laurent.POYART @ 2008-01-30 10:38 UTC (permalink / raw)
  To: xenomai

Hi, 

Looking at the xenomai documentation, I saw that the rtdm_lock_get function
can be used in an interrupt service routine. 
This function seems to be base on spinlocks but in my mind, spinlock under
linux on the single CPU doesn't do anything (am I right?). Then I don't
really understand, how the lock mechanism works when there is a race
condition between the rtdm_lock_get in ISR and the rtdm_lock_get_irqsave
function used in an ioctl. Would it be possible to explain me briefly what
is doing rtdm_lock_get on the lock parameter in a single CPU context?

Complementary question:
does rtdm_lock_get_irqsave disables all interrupts?

Thanks in advance.
L.Poyart.


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

* Re: [Xenomai-help] Understanding rtdm_lock_get
  2008-01-30 10:38 [Xenomai-help] Understanding rtdm_lock_get Laurent.POYART
@ 2008-01-30 11:41 ` Jan Kiszka
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Kiszka @ 2008-01-30 11:41 UTC (permalink / raw)
  To: Laurent.POYART; +Cc: xenomai

Laurent.POYART@fr.thalesgroup.com wrote:
> Hi, 
> 
> Looking at the xenomai documentation, I saw that the rtdm_lock_get function
> can be used in an interrupt service routine. 
> This function seems to be base on spinlocks but in my mind, spinlock under
> linux on the single CPU doesn't do anything (am I right?). Then I don't
> really understand, how the lock mechanism works when there is a race
> condition between the rtdm_lock_get in ISR and the rtdm_lock_get_irqsave
> function used in an ioctl. Would it be possible to explain me briefly what
> is doing rtdm_lock_get on the lock parameter in a single CPU context?

On UP, rtdm_lock_get/put are void (that's in contrast to Linux where
spin_lock also disables local preemption so that you can call it from
interruptible contexts without risking deadlocks).

> 
> Complementary question:
> does rtdm_lock_get_irqsave disables all interrupts?

Yes, it does (for the local CPU, of course).

Jan

-- 
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux


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

end of thread, other threads:[~2008-01-30 11:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-30 10:38 [Xenomai-help] Understanding rtdm_lock_get Laurent.POYART
2008-01-30 11:41 ` Jan Kiszka

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.