All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Jan Kiszka <jan.kiszka@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-core] [PATCH 2/3] RTDM: Instrument rtdm_lock_get for proper use
Date: Wed, 03 Jun 2009 14:44:38 +0200	[thread overview]
Message-ID: <4A267036.8010507@domain.hid> (raw)
In-Reply-To: <20090603104015.13268.59718.stgit@domain.hid>

Jan Kiszka wrote:
> In case the user thinks rtdm_lock_get could be used like spin_lock or
> messes up the IRQ protection for other reasons, catch this with a
> XENO_BUGON.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@domain.hid>
> ---
> 
>  include/rtdm/rtdm_driver.h |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/include/rtdm/rtdm_driver.h b/include/rtdm/rtdm_driver.h
> index 058a9f8..fe42eea 100644
> --- a/include/rtdm/rtdm_driver.h
> +++ b/include/rtdm/rtdm_driver.h
> @@ -655,7 +655,15 @@ typedef unsigned long rtdm_lockctx_t;
>   *
>   * Rescheduling: never.
>   */
> +#ifdef DOXYGEN_CPP /* Beautify doxygen output */
>  #define rtdm_lock_get(lock)	rthal_spin_lock(lock)
> +#else /* This is how it really works */
> +#define rtdm_lock_get(lock)					\
> +	do {							\
> +		XENO_BUGON(RTDM, rthal_local_irq_test());	\
> +		rthal_spin_lock(lock);				\
> +	} while (0)
> +#endif

Why is it a problem to call rthal_spin_lock with irqs off?

I also belived that you can avoid the #ifdef DOXYGEN_CPP.

-- 
					    Gilles.


  reply	other threads:[~2009-06-03 12:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-03 10:40 [Xenomai-core] [PATCH 0/3] Pull request: Build fix and RTDM improvements Jan Kiszka
2009-06-03 10:40 ` [Xenomai-core] [PATCH 2/3] RTDM: Instrument rtdm_lock_get for proper use Jan Kiszka
2009-06-03 12:44   ` Gilles Chanteperdrix [this message]
2009-06-03 13:07     ` Jan Kiszka
2009-06-03 13:11       ` Gilles Chanteperdrix
2009-06-03 13:33         ` Jan Kiszka
2009-06-03 14:41           ` Gilles Chanteperdrix
2009-06-03 15:02             ` Jan Kiszka
2009-06-03 15:21               ` Gilles Chanteperdrix
2009-06-03 13:34       ` Philippe Gerum
2009-06-03 13:46         ` Jan Kiszka
2009-06-03 10:40 ` [Xenomai-core] [PATCH 1/3] nucleus: Add missing header for isspace Jan Kiszka
2009-06-03 10:40 ` [Xenomai-core] [PATCH 3/3] RTDM: Avoid namespace pollution in RTDM_EXECUTE_ATOMICALLY Jan Kiszka

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=4A267036.8010507@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=jan.kiszka@domain.hid \
    --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.