Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Sep 2011 16:23:28 +0200
From:      Ivan Voras <ivoras@freebsd.org>
To:        geoffrey levand <geoffrey.levand@mail.ru>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Re[2]: Sharing device driver between kernel and user space
Message-ID:  <CAF-QHFVNzFF8qS8ukZgOdjn3C97Op318dAj0CqnwAVm1AvVyiQ@mail.gmail.com>
In-Reply-To: <E1R6NU8-0005JS-00.geoffrey-levand-mail-ru@f285.mail.ru>
References:  <E1R65Aj-0003Fj-00.geoffrey-levand-mail-ru@f57.mail.ru> <E1R6Fvx-0005sO-00.geoffrey-levand-mail-ru@f177.mail.ru> <j5cl4i$n5m$1@dough.gmane.org> <E1R6NU8-0005JS-00.geoffrey-levand-mail-ru@f285.mail.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On 21 September 2011 16:09, geoffrey levand <geoffrey.levand@mail.ru> wrote=
:
> Sure i can use the synchronization primitives, the problem is that the re=
sponse to a request sent to PS3 VUART port is not
> available immediately, and i have to disallow kernel access to the PS3 VU=
ART while i'm waiting for the response in user
> space. I send request with write syscall from user space and wait for res=
ponse with read syscall. In the period of time
> between sending request and receiving response i could receive some other=
 packets from VUART port, e.g. some kind of
> event notification, =C2=A0i have to skip them. But kernel should not inte=
rfer until i get my response.
> So i would need to lock out the kernel during this time. I think i found =
a good solution for this problem, just use a IOCTL
> which tells kernel device driver to stop processing kernel requests and e=
vents, something like SET_USER_MODE.
> After that i can use it in user space.

Have you read sema(9)?

Or if returning EBUSY is acceptable when the resource is in use by
$whatever, maybe you just need a boolean variable.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAF-QHFVNzFF8qS8ukZgOdjn3C97Op318dAj0CqnwAVm1AvVyiQ>