aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/user
diff options
context:
space:
mode:
authorAlex Auvolat <alex.auvolat@ens.fr>2015-02-19 22:57:53 +0100
committerAlex Auvolat <alex.auvolat@ens.fr>2015-02-19 22:57:53 +0100
commit13db03fcc4a476c8881ccafe0852e72410c67b3a (patch)
tree2064def0c74cb78cf2a532766b4e1d28e571ab41 /src/kernel/user
parentadc5a421917dd6e23a2fc01dc9fb2a9f881c291d (diff)
downloadkogata-13db03fcc4a476c8881ccafe0852e72410c67b3a.tar.gz
kogata-13db03fcc4a476c8881ccafe0852e72410c67b3a.zip
Add kernel worker threads for handling various tasks (eg. interrupts)
Diffstat (limited to 'src/kernel/user')
-rw-r--r--src/kernel/user/syscall.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/kernel/user/syscall.c b/src/kernel/user/syscall.c
index 6fdd633..f1f5f86 100644
--- a/src/kernel/user/syscall.c
+++ b/src/kernel/user/syscall.c
@@ -43,6 +43,11 @@ static uint32_t yield_sc(sc_args_t args) {
return 0;
}
+static uint32_t usleep_sc(sc_args_t args) {
+ usleep(args.a);
+ return 0;
+}
+
static uint32_t dbg_print_sc(sc_args_t args) {
char* msg = sc_copy_string(args.a, args.b);
if (msg == 0) return -1;
@@ -287,6 +292,7 @@ void setup_syscall_table() {
sc_handlers[SC_EXIT] = exit_sc;
sc_handlers[SC_YIELD] = yield_sc;
sc_handlers[SC_DBG_PRINT] = dbg_print_sc;
+ sc_handlers[SC_USLEEP] = usleep_sc;
sc_handlers[SC_MMAP] = mmap_sc;
sc_handlers[SC_MMAP_FILE] = mmap_file_sc;