Kernel-userspace shared mutex

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

G'day!

I'm building a system that consists of an 'interface' kernel module, and
a user daemon that does all the work, connected by megabytes of mmap()'d
memory:

              ______
             |     |
             |     |
             |daem-|
             | on  |
             |_____|
                ||
                || mmap()'d memory
             ___||___                  user space
  ___________|______| <- char dev_____
  |          |      |                |
  |          | modu-|                | kernel space
  |          |  le  |                |



I'm after a mutex mechanism that will protect this area, that's
accessible from both user-space and the kernel.

I originally thought spinlock_t would be a good candidate, until I
realised that the spinlock_t of the kernel, and that of
/usr/include/asm/spinlock.h were different.

The other option I can think of is to use atomic_t, and write my own
spinlock.. Which I have no problem doing; it would be a fairly brief
task, presumably.

Before I go ahead and do so, has anyone else been in a similar
situation, or heard of any similar system?
Could there be an alternative I've missed?

Cheers =)

Mike


- --
Mike Tyson <mike@xxxxxxxxxxxxx>
M: (+61) 0407 754 124
W: http://tzidesign.com

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iD8DBQFCr9mc/eih+gEb7pQRAvpZAJ41rk7LIaGi/09YqHO9tXvmmO6w9QCfZfAv
uQusvu/naNLfJPwRvRd7O3w=
=xVlC
-----END PGP SIGNATURE-----

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux