diff options
author | jhb <jhb@FreeBSD.org> | 2011-12-14 22:22:19 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2011-12-14 22:22:19 +0000 |
commit | 6d1299a388490b22f5d0619237868efafa3f3428 (patch) | |
tree | 99542359d8ee93e187d91428fb4d8a6e2d87bc67 /sys/sys | |
parent | 83d1e21dd2a8af164c5792531d349adad212dee8 (diff) | |
download | FreeBSD-src-6d1299a388490b22f5d0619237868efafa3f3428.zip FreeBSD-src-6d1299a388490b22f5d0619237868efafa3f3428.tar.gz |
Add a helper API to allow in-kernel code to map portions of shared memory
objects created by shm_open(2) into the kernel's address space. This
provides a convenient way for creating shared memory buffers between
userland and the kernel without requiring custom character devices.
Diffstat (limited to 'sys/sys')
-rw-r--r-- | sys/sys/mman.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/sys/mman.h b/sys/sys/mman.h index 379ed14..4033023 100644 --- a/sys/sys/mman.h +++ b/sys/sys/mman.h @@ -181,6 +181,8 @@ typedef __size_t size_t; #ifdef _KERNEL #include <vm/vm.h> +struct file; + struct shmfd { size_t shm_size; vm_object_t shm_object; @@ -188,6 +190,7 @@ struct shmfd { uid_t shm_uid; gid_t shm_gid; mode_t shm_mode; + int shm_kmappings; /* * Values maintained solely to make this a better-behaved file @@ -203,6 +206,8 @@ struct shmfd { int shm_mmap(struct shmfd *shmfd, vm_size_t objsize, vm_ooffset_t foff, vm_object_t *obj); +int shm_map(struct file *fp, size_t size, off_t offset, void **memp); +int shm_unmap(struct file *fp, void *mem, size_t size); #else /* !_KERNEL */ |