summaryrefslogtreecommitdiff
path: root/sys/include
diff options
context:
space:
mode:
Diffstat (limited to 'sys/include')
-rw-r--r--sys/include/sys/device.h11
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_ */