From 939f7fbaca27591595fde9600212d03916ead09f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 28 Oct 2003 13:29:29 +0000 Subject: [PATCH] Implemented the set_real_time_clock() syscall. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5186 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/core/syscalls.c | 14 ++++++++++++-- src/kernel/libroot/os/syscalls.S | 3 +++ src/kernel/libroot/os/time.c | 4 ++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/kernel/core/syscalls.c b/src/kernel/core/syscalls.c index f26f9fd3c5..ca79426496 100644 --- a/src/kernel/core/syscalls.c +++ b/src/kernel/core/syscalls.c @@ -4,6 +4,7 @@ ** Distributed under the terms of the NewOS License. */ + #include #include #include @@ -24,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -47,12 +49,14 @@ #define arg14 (((uint32 *)arg_buffer)[14]) #define arg15 (((uint32 *)arg_buffer)[15]) -int syscall_dispatcher(unsigned long call_num, void *arg_buffer, uint64 *call_ret) + +int +syscall_dispatcher(unsigned long call_num, void *arg_buffer, uint64 *call_ret) { // dprintf("syscall_dispatcher: thread 0x%x call 0x%x, arg0 0x%x, arg1 0x%x arg2 0x%x arg3 0x%x arg4 0x%x\n", // thread_get_current_thread_id(), call_num, arg0, arg1, arg2, arg3, arg4); - switch(call_num) { + switch (call_num) { case SYSCALL_NULL: *call_ret = 0; break; @@ -402,6 +406,12 @@ int syscall_dispatcher(unsigned long call_num, void *arg_buffer, uint64 *call_re (size_t *)arg3, (void *)arg4, (size_t)arg5); break; + + // time calls + case SYSCALL_SET_REAL_TIME_CLOCK: + _user_set_real_time_clock((uint32)arg0); + break; + /* removed until net code has goneback into build case SYSCALL_SOCKET: *call_ret = socket((int)arg0, (int)arg1, (int)arg2, false); diff --git a/src/kernel/libroot/os/syscalls.S b/src/kernel/libroot/os/syscalls.S index 2e43c62185..f7f782280a 100644 --- a/src/kernel/libroot/os/syscalls.S +++ b/src/kernel/libroot/os/syscalls.S @@ -124,6 +124,9 @@ SYSCALL6(sys_start_watching, 118) SYSCALL6(sys_stop_watching, 119) SYSCALL2(sys_stop_notifying, 120) +/* time calls */ +SYSCALL1(_kern_set_real_time_clock, 138) + /* VM calls */ SYSCALL6(_kern_create_area, 29) SYSCALL5(_kern_clone_area, 30) diff --git a/src/kernel/libroot/os/time.c b/src/kernel/libroot/os/time.c index 8868854385..d27d8a9e00 100644 --- a/src/kernel/libroot/os/time.c +++ b/src/kernel/libroot/os/time.c @@ -1,5 +1,5 @@ /* -** Copyright 2002, Axel Dörfler, axeld@pinc-software.de. All rights reserved. +** Copyright 2002-2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved. ** Distributed under the terms of the OpenBeOS License. */ @@ -19,7 +19,7 @@ real_time_clock(void) void set_real_time_clock(uint32 secs) { - // ToDo: set_real_time_clock() + _kern_set_real_time_clock(secs); }