aboutsummaryrefslogtreecommitdiff
path: root/kernel/inc
diff options
context:
space:
mode:
authorMarvin Borner2021-06-18 22:30:25 +0200
committerMarvin Borner2021-06-18 22:30:25 +0200
commit02a0c882275959c0fbd58754418ecc1218821e76 (patch)
tree7174e4c11a030b6bd7081a71ffa3bd6eee194c4e /kernel/inc
parentb3d8e50aab8f3587f510db13ac8dcbb82e287998 (diff)
Renamed device prefix from 'io_' to 'dev_'
Diffstat (limited to 'kernel/inc')
-rw-r--r--kernel/inc/dev.h32
-rw-r--r--kernel/inc/fs.h4
-rw-r--r--kernel/inc/io.h32
3 files changed, 34 insertions, 34 deletions
diff --git a/kernel/inc/dev.h b/kernel/inc/dev.h
new file mode 100644
index 0000000..fc5e424
--- /dev/null
+++ b/kernel/inc/dev.h
@@ -0,0 +1,32 @@
+// MIT License, Copyright (c) 2021 Marvin Borner
+
+#ifndef dev_H
+#define dev_H
+
+#include <def.h>
+#include <drivers/int.h>
+#include <proc.h>
+#include <sys.h>
+
+struct dev_dev {
+ res (*read)(void *buf, u32 offset, u32 count) NONNULL;
+ res (*write)(const void *buf, u32 offset, u32 count) NONNULL;
+ res (*control)(u32 request, void *arg1, void *arg2, void *arg3);
+ res (*ready)(void);
+};
+
+void dev_install(void);
+void dev_add(enum dev_type type, struct dev_dev *dev) NONNULL;
+
+// No NONNULL on syscalls
+res dev_control(enum dev_type type, u32 request, void *arg1, void *arg2, void *arg3);
+res dev_write(enum dev_type type, const void *buf, u32 offset, u32 count);
+res dev_read(enum dev_type type, void *buf, u32 offset, u32 count);
+res dev_poll(u32 *devs);
+res dev_ready(enum dev_type type);
+
+void dev_block(enum dev_type type, struct proc *proc) NONNULL;
+void dev_unblock(enum dev_type type);
+void dev_unblock_pid(u32 pid);
+
+#endif
diff --git a/kernel/inc/fs.h b/kernel/inc/fs.h
index 1ea4b21..42cf21a 100644
--- a/kernel/inc/fs.h
+++ b/kernel/inc/fs.h
@@ -11,12 +11,12 @@
* Device
*/
-enum dev_type { DEV_BLOCK, DEV_CHAR };
+enum vfs_dev_type { DEV_BLOCK, DEV_CHAR };
struct vfs_dev {
u32 id;
char name[8];
- enum dev_type type;
+ enum vfs_dev_type type;
struct vfs *vfs;
void *data;
res (*read)(void *buf, u32 offset, u32 count, struct vfs_dev *dev) NONNULL;
diff --git a/kernel/inc/io.h b/kernel/inc/io.h
deleted file mode 100644
index c20a6f7..0000000
--- a/kernel/inc/io.h
+++ /dev/null
@@ -1,32 +0,0 @@
-// MIT License, Copyright (c) 2021 Marvin Borner
-
-#ifndef IO_H
-#define IO_H
-
-#include <def.h>
-#include <drivers/int.h>
-#include <proc.h>
-#include <sys.h>
-
-struct io_dev {
- res (*read)(void *buf, u32 offset, u32 count) NONNULL;
- res (*write)(const void *buf, u32 offset, u32 count) NONNULL;
- res (*control)(u32 request, void *arg1, void *arg2, void *arg3);
- res (*ready)(void);
-};
-
-void io_install(void);
-void io_add(enum io_type io, struct io_dev *dev) NONNULL;
-
-// No NONNULL on syscalls
-res io_control(enum io_type io, u32 request, void *arg1, void *arg2, void *arg3);
-res io_write(enum io_type io, const void *buf, u32 offset, u32 count);
-res io_read(enum io_type io, void *buf, u32 offset, u32 count);
-res io_poll(u32 *devs);
-res io_ready(enum io_type io);
-
-void io_block(enum io_type io, struct proc *proc) NONNULL;
-void io_unblock(enum io_type io);
-void io_unblock_pid(u32 pid);
-
-#endif