diff options
author | Ian Moffett <ian@osmora.org> | 2025-06-02 21:07:06 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-06-02 21:07:06 -0400 |
commit | 2d32815ffb72e43b45d08300c48ff8b602074374 (patch) | |
tree | fd8816f6dace2eaea59dc36ccea9d85e82aa3571 | |
parent | 50431ef3f4f0d1408049efa5a03cc98ff484290f (diff) |
kernel: device: Add mmap() hook for cdevsw
Signed-off-by: Ian Moffett <ian@osmora.org>
-rw-r--r-- | sys/include/sys/device.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/include/sys/device.h b/sys/include/sys/device.h index fcafdab..cb2a702 100644 --- a/sys/include/sys/device.h +++ b/sys/include/sys/device.h @@ -36,6 +36,7 @@ #include <sys/queue.h> #include <sys/proc.h> #include <sys/sio.h> +#include <vm/vm_obj.h> typedef uint8_t devmajor_t; @@ -47,6 +48,10 @@ typedef int(*dev_bsize_t)(dev_t); struct cdevsw { int(*read)(dev_t dev, struct sio_txn *sio, int flags); int(*write)(dev_t dev, struct sio_txn *sio, int flags); + paddr_t(*mmap)(dev_t dev, off_t off, int flags); + + /* Private */ + struct vm_object vmobj; }; struct bdevsw { |