aboutsummaryrefslogtreecommitdiff
path: root/kernel/features/syscall.c
diff options
context:
space:
mode:
authorMarvin Borner2021-02-09 21:48:59 +0100
committerMarvin Borner2021-02-09 21:54:24 +0100
commit58b4e00736c0f2f13a3e96b5fcb3c00623ed35be (patch)
tree2286b0c26d6706f8da46f8c3d31ff3761fcfca15 /kernel/features/syscall.c
parent59894afa1bc0f4efc85917710adf2e93d7e17a5e (diff)
Quite many message queue fixes and impl start
Diffstat (limited to 'kernel/features/syscall.c')
-rw-r--r--kernel/features/syscall.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/kernel/features/syscall.c b/kernel/features/syscall.c
index 8140313..80c3e9e 100644
--- a/kernel/features/syscall.c
+++ b/kernel/features/syscall.c
@@ -12,14 +12,6 @@
#include <sys.h>
#include <timer.h>
-void syscall_yield(struct regs *r)
-{
- proc_yield(r);
- sti();
- while (1)
- hlt();
-}
-
void syscall_handler(struct regs *r)
{
enum sys num = r->eax;
@@ -49,7 +41,7 @@ void syscall_handler(struct regs *r)
r->eax = (u32)vfs_read((char *)r->ebx, (void *)r->ecx, r->edx, r->esi);
} else {
proc_wait_for(vfs_find_dev((char *)r->ebx)->id, PROC_WAIT_DEV, vfs_read);
- syscall_yield(r);
+ proc_yield(r);
}
break;
}
@@ -60,7 +52,7 @@ void syscall_handler(struct regs *r)
case SYS_POLL: {
s32 ret = vfs_poll((const char **)r->ebx);
if (ret == PROC_MAX_WAIT_IDS + 1)
- syscall_yield(r);
+ proc_yield(r);
else
r->eax = ret;
break;
@@ -80,6 +72,7 @@ void syscall_handler(struct regs *r)
((u32 *)proc->regs.useresp)[1] = (u32)argv;
if (r->eax)
proc_exit(proc, (int)r->eax);
+ proc_yield(r);
break;
}
case SYS_EXIT: {