From: Jan Kiszka <jan.kiszka@domain.hid>
To: Petr Cervenka <grugh@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] rtdm_event_timedwait non-realtime alternative
Date: Tue, 16 May 2006 16:59:19 +0200 [thread overview]
Message-ID: <4469E8C7.6060909@domain.hid> (raw)
In-Reply-To: <200605161633.15928@domain.hid>
[-- Attachment #1: Type: text/plain, Size: 2000 bytes --]
Petr Cervenka wrote:
> I sense, that there could be a problem. the rtdm_nrtsig_handler_t handler have only one argument (rtdm_nrtsig_t *). But I need to get a pointer to the device and/or the event which has happended and needs to be forwarded to tha waiter.
Yes, the nrtsig interface is a bit unhandy in this regard.
Recent restructuring of the Ipipe patch enabled cookie support also for
rtdm_nrtsig_t, but I refrained from extending the signal handler so far
as this would break existing drivers. Well, as the whole rtdm_nrtsig
interface is inline anyway, adding rtdm_nrtsig_init_ex and
rtdm_nrtsig_handler_ex_t might be a cheap option. You could try this
(untested!):
typedef void (*rtdm_nrtsig_handler_ex_t)(rtdm_nrtsig_t nrt_sig,
void *arg);
static inline int rtdm_nrtsig_init_ex(rtdm_nrtsig_t *nrt_sig,
rtdm_nrtsig_handler_ex_t handler,
void *arg)
{
*nrt_sig = rthal_alloc_virq();
if (*nrt_sig == 0)
return -EAGAIN;
rthal_virtualize_irq(rthal_root_domain, *nrt_sig,
(rthal_irq_handler_t)handler, arg, NULL,
IPIPE_HANDLE_MASK);
return 0;
}
Hmm, really simple, I should commit this...
> I hope there is a possibility to search all my devices (usualy one :-)) if the argument belongs to it, and then clear all pending "events" and call wake_up for appropriate wait queues.
> But it's not as simple as I wanted :-(, I hoped that I can avoid the waiting queues etc..
> Anyway thanks for help. I didn't know, that I can't use wake_up from RT interrupt handler.
You may want to wait a bit, I'm currently cooking something as I noticed
that we could also gain some benefit from such "dual-use" rtdm_event.
Our middleware's communication service (RTDM-based) currently requires
RT-receivers, but non-RT is on our which list for quite some time as well.
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]
prev parent reply other threads:[~2006-05-16 14:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-16 10:21 [Xenomai-help] rtdm_event_timedwait non-realtime alternative Petr Cervenka
2006-05-16 11:10 ` Jan Kiszka
2006-05-16 14:33 ` Petr Cervenka
2006-05-16 14:59 ` 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=4469E8C7.6060909@domain.hid \
--to=jan.kiszka@domain.hid \
--cc=grugh@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.