From 13db03fcc4a476c8881ccafe0852e72410c67b3a Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Thu, 19 Feb 2015 22:57:53 +0100 Subject: Add kernel worker threads for handling various tasks (eg. interrupts) --- src/kernel/user/syscall.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/kernel/user') 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; -- cgit v1.2.3