Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Sep 2011 14:25:48 +0200
From:      Ivan Voras <ivoras@freebsd.org>
To:        freebsd-hackers@freebsd.org
Subject:   Re: Sharing device driver between kernel and user space
Message-ID:  <j5cl4i$n5m$1@dough.gmane.org>
In-Reply-To: <E1R6Fvx-0005sO-00.geoffrey-levand-mail-ru@f177.mail.ru>
References:  <E1R65Aj-0003Fj-00.geoffrey-levand-mail-ru@f57.mail.ru> <201109202202.19481.hselasky@c2i.net> <E1R6Fvx-0005sO-00.geoffrey-levand-mail-ru@f177.mail.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigA9ACA5241980A903A14E5E64
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On 21/09/2011 08:05, geoffrey levand wrote:
> I think you misunderstood what i need. If i got it right then cuse4bsd =
allows user applications to create char devices, right ?
> I do not want to create character devices from user space. My VUART ker=
nel
> module should provide the character device for user space. What i need =
is a way to synchronize access
> to VUART data between kernel and user space. The kernel device driver s=
hould provide 2 interfaces: one for user space
>  (through char dev) and the other for kernel land. The problem is how t=
o synchronize the access to VUART data between 2
> lands because VUART cannot be shared by both simultaneously.

I'm not sure I understand your question but what exactly is the problem
here? As the userland will access the device through the char device,
you need kernel code which services this device's requests. This kernel
code can use any number of synchronization operations provided by the
kernel to protect access to any and all needed resources.

In other words, you should have a single point of entry to the device in
the kernel anyway (e.g. a module, a header file, whatever) and then you
may need just a simple sx(9) lock or a sema(9) semaphore, assuming the
device access needs sleeping, or mutex(9) if it doesn't.



--------------enigA9ACA5241980A903A14E5E64
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk5519IACgkQldnAQVacBcgwWACeO64/8QOZVbYcpr7hlLAnKIuu
A3cAn24SYUw4255MeHd9XnbYgdb/mMfR
=r7GV
-----END PGP SIGNATURE-----

--------------enigA9ACA5241980A903A14E5E64--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?j5cl4i$n5m$1>