From 5b55fd174ae878567846cc14af1bb9c35b668dd0 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Wed, 24 Jul 2024 20:03:09 -0400 Subject: kernel: device: Add read/write stubs Signed-off-by: Ian Moffett --- sys/include/sys/device.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'sys/include') 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_ */ -- cgit v1.2.3