Sharing device driver between kernel and user space

Ivan Voras ivoras at freebsd.org
Wed Sep 21 14:24:09 UTC 2011


On 21 September 2011 16:09, geoffrey levand <geoffrey.levand at mail.ru> wrote:
> Sure i can use the synchronization primitives, the problem is that the response to a request sent to PS3 VUART port is not
> available immediately, and i have to disallow kernel access to the PS3 VUART while i'm waiting for the response in user
> space. I send request with write syscall from user space and wait for response 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,  i have to skip them. But kernel should not interfer 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 events, 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.


More information about the freebsd-hackers mailing list