diff options
author | dzwdz | 2022-05-05 22:12:55 +0200 |
---|---|---|
committer | dzwdz | 2022-05-05 22:12:55 +0200 |
commit | 9900cc737988f25db30b5876f066a78e73389205 (patch) | |
tree | 1bba6cfbe118855ba3d338aa3d881da3aa15ca9e /src/kernel/arch/i386/driver/ps2.c | |
parent | 740cacba5befeba212935b00f8ae95008f564293 (diff) |
kernel: syscalls now have to explicitly save the return value
thus they can opt out of doing that
so the calls which might return immediately but can return later don't
have to both regs_savereturn and return to the caller.
and because of that, the return values of a lot of VFS things have just
got way saner
Diffstat (limited to 'src/kernel/arch/i386/driver/ps2.c')
-rw-r--r-- | src/kernel/arch/i386/driver/ps2.c | 12 |
1 files changed, 7 insertions, 5 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; } } |