diff options
author | Ian Moffett <ian@osmora.org> | 2024-07-24 20:03:09 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2024-07-24 20:03:09 -0400 |
commit | 5b55fd174ae878567846cc14af1bb9c35b668dd0 (patch) | |
tree | 2b8a17ae1b5a00e785c1cd1846e4e12092ead72f /sys/include | |
parent | d0f86d075bf5d59471d90503a24e30b57b44a1e5 (diff) |
kernel: device: Add read/write stubs
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/include')
-rw-r--r-- | sys/include/sys/device.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/include/sys/device.h b/sys/include/sys/device.h index e0aef23..b1de7d3 100644 --- a/sys/include/sys/device.h +++ b/sys/include/sys/device.h @@ -40,6 +40,10 @@ typedef uint8_t devmajor_t; typedef uint8_t dev_t; +/* Device operation typedefs */ +typedef int(*dev_read_t)(dev_t, struct sio_txn *, int); +typedef int(*dev_write_t)(dev_t, struct sio_txn *, int); + struct cdevsw { int(*read)(dev_t dev, struct sio_txn *sio, int flags); int(*write)(dev_t dev, struct sio_txn *sio, int flags); @@ -56,5 +60,12 @@ dev_t dev_alloc(devmajor_t major); devmajor_t dev_alloc_major(void); int dev_register(devmajor_t major, dev_t dev, void *devsw); +int dev_noread(void); +int dev_nowrite(void); + +/* Device operation stubs */ +#define noread ((dev_read_t)dev_noread) +#define nowrite ((dev_write_t)dev_nowrite) + #endif /* _KERNEL */ #endif /* !_SYS_DEVICE_H_ */ |