All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Minazzi <Paolo.Minazzi@mitrol.it>
To: xenomai@xenomai.org
Subject: [Xenomai] Make a block of code atomic
Date: Tue, 09 Jul 2013 13:40:40 +0200	[thread overview]
Message-ID: <51DBF6B8.1000000@mitrol.it> (raw)

Hi,

I would like to make a block of kernel code atomic, so that no one (both 
xenomai and Linux) can interrupt it.
I use the following :

#define my_local_irq_save(x)    ((x) = 
ipipe_test_and_stall_pipeline_head() & 1)
#define my_local_irq_restore(x) ipipe_restore_pipeline_head(x)

my_local_irq_save(flags);
< critical section >
my_local_irq_restore(flags);

It works well enough, but rarely an rtdm irq enter into my critical 
section.
The rtdm irq is registered in this way : rtdm_irq_request(&priv->irqHnd, 
ETH_PORT_IRQ_NUM(priv->port), irqHandler, RTDM_IRQTYPE_EDGE, "rtdm_eth", 
priv);

Is it normal ? Are you sure that it cannot happen ?

Thanks,
Paolo


             reply	other threads:[~2013-07-09 11:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-09 11:40 Paolo Minazzi [this message]
2013-07-10 11:37 ` [Xenomai] Make a block of code atomic Gilles Chanteperdrix
2013-07-10 11:46   ` Paolo Minazzi

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=51DBF6B8.1000000@mitrol.it \
    --to=paolo.minazzi@mitrol.it \
    --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.