Commit graph

11 commits

Author SHA1 Message Date
Warner Losh 2a63c3be15 Remove $FreeBSD$: one-line .c comment pattern
Remove /^/[*/]\s*\$FreeBSD\$.*\n/
2023-08-16 11:54:29 -06:00
Hans Petter Selasky 58a8f6e9ec cuse(3): Allow allocating a memory buffer of exactly 2 GBytes.
The manual page date will be bumped separately.

MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-07-20 10:41:11 +02:00
Hans Petter Selasky d14b53ee31 cuse(3): Allow shared memory allocations up to, but excluding 2 GBytes.
Currently the cuse(3) mmap(2) offset is split into 128 banks of 16 Mbytes.
Allow cuse(3) to make allocations that span multiple banks at the expense
of any fragmentation issues that may arise. Typically mmap(2) buffers are
well below 16 Mbytes. This allows 8K video resolution to work using webcamd.

Reviewed by:	markj @
Differential Revision:	https://reviews.freebsd.org/D35830
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-07-20 10:41:11 +02:00
Hans Petter Selasky 2ca43c3dba cuse(3): Make cuse_vmfree() NULL safe.
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-07-20 10:41:11 +02:00
Hans Petter Selasky 2c28cd09d9 cuse(3): Remove PAGE_SIZE from libcuse.
To allow for a dynamic page size on arm64 remove the static value from libcuse.

Differential Revision:	https://reviews.freebsd.org/D35585
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-06-25 12:01:59 +02:00
Pedro F. Giffuni 1c5fd754bd libcuse: make more use of the howmany() macro when available.
We have a howmany() macro in the <sys/param.h> header that is
convenient to re-use as it makes things easier to read.
2016-04-26 01:20:16 +00:00
Hans Petter Selasky beebd9aac8 Make CUSE usable with platforms where the size of "unsigned long" is
different from the size of a pointer.
2015-12-22 09:55:44 +00:00
Hans Petter Selasky fc6e35c65c Fix compiler locking diagnostic warnings.
PR:	194289
2014-10-13 19:05:18 +00:00
Ed Schouten 8da5129816 Add lock annotations to libcuse.
- Add annotations to the lock/unlock function to indicate that the
  function is allowed to lock and unlock the underlying pthread mutex.

- Add __guarded_by() annotations to the global variables.

Approved by:	hselasky@
2014-09-01 19:56:28 +00:00
Hans Petter Selasky 8958a2f085 Fix destruction of character devices by passing correct pointer to
kernel in IOCTL request.

Submitted by:	Andrey Zholos <aaz@q-fu.com>
2014-06-16 14:02:14 +00:00
Hans Petter Selasky fa0f6e62c6 Initial import of character device in userspace support for FreeBSD.
The CUSE library is a wrapper for the devfs kernel functionality which
is exposed through /dev/cuse . In order to function the CUSE kernel
code must either be enabled in the kernel configuration file or loaded
separately as a module. Currently none of the committed items are
connected to the default builds, except for installing the needed
header files. The CUSE code will be connected to the default world and
kernel builds in a follow-up commit.

The CUSE module was written by Hans Petter Selasky, somewhat inspired
by similar functionality found in FUSE. The CUSE library can be used
for many purposes. Currently CUSE is used when running Linux kernel
drivers in user-space, which need to create a character device node to
communicate with its applications. CUSE has full support for almost
all devfs functionality found in the kernel:
 - kevents
 - read
 - write
 - ioctl
 - poll
 - open
 - close
 - mmap
 - private per file handle data

Requested by several people. Also see "multimedia/cuse4bsd-kmod" in
ports.
2014-05-23 08:46:28 +00:00