All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: Laurent.POYART@fr.thalesgroup.com
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] Understanding rtdm_lock_get
Date: Wed, 30 Jan 2008 12:41:10 +0100	[thread overview]
Message-ID: <47A06256.9020807@domain.hid> (raw)
In-Reply-To: <2F8EE677D406514ABE53EF9C0934A666042ABE27@domain.hid>

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


      reply	other threads:[~2008-01-30 11:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-30 10:38 [Xenomai-help] Understanding rtdm_lock_get Laurent.POYART
2008-01-30 11:41 ` Jan Kiszka [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47A06256.9020807@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=Laurent.POYART@fr.thalesgroup.com \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.