All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Smolorz <smolorz@domain.hid>
To: Johan Borkhuis <j.borkhuis@domain.hid>
Cc: Xenomai help <xenomai@xenomai.org>
Subject: Re: [Xenomai-help] Problem with semaphores in an RTDM driver
Date: Wed, 28 May 2008 11:03:42 +0200	[thread overview]
Message-ID: <483D1FEE.7050203@domain.hid> (raw)
In-Reply-To: <483D1D9A.7010209@domain.hid>

Johan Borkhuis wrote:
> I am trying to use semaphores inside my driver. It is a driver that can 
> be used as standard Linux driver and RTDM driver.
> 
> However, when I use rt_sem_p or rtdm_sem_timeddown in my read_nrt 
> function I get a -1 return value, indicating EPERM.

Your read_nrt function is only for non real-time tasks. So if you use a 
call to a service which requires primary execution mode of Xenomai it 
consequentially fails.

> When I look at the 
> thread state I see a value of 0x00400080, which indicates a standard 
> Linux thread. The rtdm-context is 0x00000001.
> The userspace thread has a thread state of 00300380.
> 
> What am I doing wrong here? How can I get a semaphore or other sync 
> mechanism to work inside my RTDM driver?

Use RTDM services inside the *_rt functions and plain Linux services 
inside the *_nrt functions of your driver.

-- 
Sebastian


  reply	other threads:[~2008-05-28  9:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-28  8:53 [Xenomai-help] Problem with semaphores in an RTDM driver Johan Borkhuis
2008-05-28  9:03 ` Sebastian Smolorz [this message]
2008-05-28  9:10 ` Jan Kiszka
2008-05-28 12:16   ` Johan Borkhuis
2008-05-28 12:30     ` 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=483D1FEE.7050203@domain.hid \
    --to=smolorz@domain.hid \
    --cc=j.borkhuis@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.