All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: Jan Kiszka <jan.kiszka@domain.hid>
Cc: Xenomai Help <xenomai@xenomai.org>, Jeff Weber <jweber@domain.hid>
Subject: Re: [Xenomai-help] enable/disable all interrupts from user space
Date: Fri, 27 Oct 2006 23:11:46 +0200	[thread overview]
Message-ID: <1161983506.4983.48.camel@domain.hid> (raw)
In-Reply-To: <45420A72.8000700@domain.hid>

On Fri, 2006-10-27 at 15:32 +0200, Jan Kiszka wrote:
> Jeff Weber wrote:
> > How do I enable/disable all interrupts (Linux and Xenomai) from user space?  
> > (native skin preferred)
> 
> For x86:
> 
> iopl(3);
> __asm__ __volatile__("cli/sti");
> 

Gasp...

> Ugly hack, typical a sign that something should be moved somewhere
> else... (there are a few exceptions, though)
> 
> We once had some discussion if we shouldn't export domain stalling
> features to user-space in order to support things like X-servers that
> currently come with such code, toasting any RT kernel. May come one day,
> but this will be primarily for legacy non-RT code.

Providing "cli" emulation to X-Servers would only make sense in order to
stall the Linux domain; controlling the interrupt shield dynamically
using the T_SHIELD bit would allow that already. If I understand
correctly, we are talking about stalling the Xenomai domain too, and
this is a completely different story. The day we would provide such
"feature" as an official API, we would trigger tons of misuses of this
hack, a bit like we have now with the T_PRIMARY bit, a number of people
sprinkle over their code to control the task exec mode, which is most of
the time utterly sub-optimal, and automatically handled by the nucleus
already. IOW, I'm not convinced at all that adding such API would be the
right thing to do.

For the time being, it should be possible to write a simple kernel
module using either the native or RTDM API from kernel space, which
would handle such requests from user-space. For instance, one could use
rt_task_notify() from user-space to signal a helper task in a kernel
module that carries out the job, depending on the signal received. The
same goes for a trivial RTDM driver only implementing the ioctl()
support for the same purpose.

> 
> Jan
> 
> _______________________________________________
> Xenomai-help mailing list
> Xenomai-help@domain.hid
> https://mail.gna.org/listinfo/xenomai-help
-- 
Philippe.




  parent reply	other threads:[~2006-10-27 21:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-26 21:39 [Xenomai-help] enable/disable all interrupts from user space Jeff Weber
2006-10-27 13:32 ` Jan Kiszka
2006-10-27 16:08   ` Jeff Weber
2006-10-27 16:24     ` Jan Kiszka
2006-10-27 21:11   ` Philippe Gerum [this message]
2006-10-27 21:31     ` Jan Kiszka
2006-10-27 22:03       ` Philippe Gerum

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=1161983506.4983.48.camel@domain.hid \
    --to=rpm@xenomai.org \
    --cc=jan.kiszka@domain.hid \
    --cc=jweber@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.