From: Jan Kiszka <jan.kiszka@domain.hid>
To: Rodrigo Rosenfeld Rosas <lbocseg@domain.hid>
Cc: xenomai-core <xenomai@xenomai.org>
Subject: Re: [Xenomai-core] [PATCH] provide rtdm_mmap_to_user / rtdm_munmap
Date: Wed, 15 Feb 2006 01:30:21 +0100 [thread overview]
Message-ID: <43F2761D.2050702@domain.hid> (raw)
In-Reply-To: <200602141114.23856.lbocseg@domain.hid>
[-- Attachment #1: Type: text/plain, Size: 2201 bytes --]
Rodrigo Rosenfeld Rosas wrote:
> Em Terça 14 Fevereiro 2006 05:55, você escreveu:
>> Rodrigo Rosenfeld Rosas wrote:
>>> I forgot to mention, I have one more problem. Since I call mmap on
>>> driver initialization (thus before any rtdm_dev_open), I do not have any
>>> rtdm_user_info_t, so I need to use current instead, but I'm not sure if
>>> this will work. Maybe mmap needs the 'current' struct of the user
>>> program... I don't know this very well... If that is true, so I'll have
>>> to do the maps in a non-rt context anyway...
>> You cannot mmap before you know precisely for which user this should
>> take place.
>
> Do you mean that if I use the 'current' and current->mm struct of the driver,
> when mmaping, the user won't be able to use the returned pointer?
To mmap you need to know the target process, more precisely its mm. This
is typically derived from the invocation context of the service call
("current" is a pointer to the current process). But init_module runs in
the context of modprobe. Even worse, the process later opening and
mapping some buffer may not even exist at that time!
>
>> During init, it's the insmod/modprobe process - likely not
>> the one you are interested in.
>
> Actually, that is the way I was planning for making the maping in a
> deterministic way...
>
>> So the earliest point for mmap is device
>> open. If this is too late for you, then now finally forget about this
>> pre-mmapping and turn it into a normal function for secondary mode. It
>> will be hard anyway to find a user who will notice the difference.
>
> That is not a question of noting any difference or not... An application can
> works great most of the time but it can fail under some not common
> circunstances. The user will need to know, at least, that he will can not
> rely on rt-capabilities when doing that and will be forced to do that only on
> initialization. But that is ok for most cases. I think I'll do that (I do not
> have other options at all :) ).
Just place enough warning signs in your documentation around the
mmap-wrapper you provide, saying that no one should expect bounded
delays from this service.
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]
next prev parent reply other threads:[~2006-02-15 0:30 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-14 13:14 [Xenomai-core] [PATCH] provide rtdm_mmap_to_user / rtdm_munmap Rodrigo Rosenfeld Rosas
2006-02-14 19:13 ` Philippe Gerum
2006-02-15 0:30 ` Jan Kiszka [this message]
2006-02-15 14:53 ` Rodrigo Rosenfeld Rosas
2006-02-16 17:14 ` Rodrigo Rosenfeld Rosas
2006-02-23 15:07 ` [Xenomai-help] rtdm_mmap_to_user() Alessio Igor Bogani
[not found] ` <200602231443.05861.lbocseg@domain.hid>
2006-02-23 23:38 ` Jan Kiszka
2006-02-25 19:43 ` [Xenomai-core] RTDM w/MMAP demo online (was: " Hannes Mayer
-- strict thread matches above, loose matches on Subject: below --
2006-02-10 0:09 [Xenomai-core] [PATCH] provide rtdm_mmap_to_user / rtdm_munmap Jan Kiszka
2006-02-10 0:37 ` Jan Kiszka
2006-02-10 20:58 ` Rodrigo Rosenfeld Rosas
2006-02-10 21:28 ` Rodrigo Rosenfeld Rosas
2006-02-11 0:35 ` Jan Kiszka
2006-02-11 13:11 ` Rodrigo Rosenfeld Rosas
2006-02-11 13:29 ` Jan Kiszka
2006-02-11 19:44 ` Rodrigo Rosenfeld Rosas
2006-02-12 22:45 ` Jan Kiszka
2006-02-13 3:22 ` Rodrigo Rosenfeld Rosas
2006-02-14 0:39 ` Jan Kiszka
2006-02-14 2:04 ` Rodrigo Rosenfeld Rosas
2006-02-14 7:55 ` 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=43F2761D.2050702@domain.hid \
--to=jan.kiszka@domain.hid \
--cc=lbocseg@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.