summaryrefslogtreecommitdiff
path: root/src/kernel/arch/i386/driver
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/arch/i386/driver')
-rw-r--r--src/kernel/arch/i386/driver/ps2.c12
-rw-r--r--src/kernel/arch/i386/driver/ps2.h2
-rw-r--r--src/kernel/arch/i386/driver/serial.c15
-rw-r--r--src/kernel/arch/i386/driver/serial.h2
4 files changed, 18 insertions, 13 deletions
diff --git a/src/kernel/arch/i386/driver/ps2.c b/src/kernel/arch/i386/driver/ps2.c
index 666fa76..8955100 100644
--- a/src/kernel/arch/i386/driver/ps2.c
+++ b/src/kernel/arch/i386/driver/ps2.c
@@ -28,14 +28,15 @@ size_t ps2_read(uint8_t *buf, size_t len) {
return ring_get((void*)&backlog, buf, len);
}
-int vfs_ps2_accept(struct vfs_request *req) {
+void vfs_ps2_accept(struct vfs_request *req) {
// when you fix something here go also fix it in the COM1 driver
static uint8_t buf[32]; // pretty damn stupid
int ret;
switch (req->type) {
case VFSOP_OPEN:
// allows opening /ps2/anything, TODO don't
- return vfsreq_finish(req, 0); // fake file handle, whatever
+ vfsreq_finish(req, 0); // fake file handle, whatever
+ break;
case VFSOP_READ:
if (ps2_ready()) {
// TODO FUKKEN MESS
@@ -48,13 +49,14 @@ int vfs_ps2_accept(struct vfs_request *req) {
ret = ps2_read(buf, ret);
virt_cpy_to(req->caller->pages, req->output.buf, buf, ret);
} else ret = -1;
- return vfsreq_finish(req, ret);
+ vfsreq_finish(req, ret);
} else {
blocked_on = req;
- return -1;
}
+ break;
default:
- return vfsreq_finish(req, -1);
+ vfsreq_finish(req, -1);
+ break;
}
}
diff --git a/src/kernel/arch/i386/driver/ps2.h b/src/kernel/arch/i386/driver/ps2.h
index 1bbc2f1..c5d0ce1 100644
--- a/src/kernel/arch/i386/driver/ps2.h
+++ b/src/kernel/arch/i386/driver/ps2.h
@@ -8,5 +8,5 @@ bool ps2_ready(void);
void ps2_recv(uint8_t scancode);
size_t ps2_read(uint8_t *buf, size_t max_len);
-int vfs_ps2_accept(struct vfs_request *);
+void vfs_ps2_accept(struct vfs_request *);
bool vfs_ps2_ready(struct vfs_backend *);
diff --git a/src/kernel/arch/i386/driver/serial.c b/src/kernel/arch/i386/driver/serial.c
index 4e274d8..170cc4d 100644
--- a/src/kernel/arch/i386/driver/serial.c
+++ b/src/kernel/arch/i386/driver/serial.c
@@ -69,12 +69,13 @@ void serial_write(const char *buf, size_t len) {
}
-int vfs_com1_accept(struct vfs_request *req) {
+void vfs_com1_accept(struct vfs_request *req) {
static uint8_t buf[32];
int ret;
switch (req->type) {
case VFSOP_OPEN:
- return vfsreq_finish(req, 0);
+ vfsreq_finish(req, 0);
+ break;
case VFSOP_READ:
if (serial_ready()) {
if (req->caller) {
@@ -86,11 +87,11 @@ int vfs_com1_accept(struct vfs_request *req) {
ret = serial_read(buf, ret);
virt_cpy_to(req->caller->pages, req->output.buf, buf, ret);
} else ret = -1;
- return vfsreq_finish(req, ret);
+ vfsreq_finish(req, ret);
} else {
blocked_on = req;
- return -1;
}
+ break;
case VFSOP_WRITE:
if (req->caller) {
struct virt_iter iter;
@@ -100,9 +101,11 @@ int vfs_com1_accept(struct vfs_request *req) {
serial_write(iter.frag, iter.frag_len);
ret = iter.prior;
} else ret = -1;
- return vfsreq_finish(req, ret);
+ vfsreq_finish(req, ret);
+ break;
default:
- return vfsreq_finish(req, -1);
+ vfsreq_finish(req, -1);
+ break;
}
}
diff --git a/src/kernel/arch/i386/driver/serial.h b/src/kernel/arch/i386/driver/serial.h
index e7f9b7c..6aff142 100644
--- a/src/kernel/arch/i386/driver/serial.h
+++ b/src/kernel/arch/i386/driver/serial.h
@@ -11,5 +11,5 @@ size_t serial_read(char *buf, size_t len);
void serial_write(const char *buf, size_t len);
-int vfs_com1_accept(struct vfs_request *);
+void vfs_com1_accept(struct vfs_request *);
bool vfs_com1_ready(struct vfs_backend *);