Skip to content

Commit

Permalink
added sys_clock_settime_hdlr, #116
Browse files Browse the repository at this point in the history
  • Loading branch information
brabo committed Mar 8, 2017
1 parent c33aa9f commit 45a615d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions kernel/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,16 @@ int sys_gettimeofday_hdlr(uint32_t arg1, uint32_t arg2, uint32_t arg3, uint32_t
return 0;
}

int sys_clock_settime_hdlr(uint32_t arg1, uint32_t arg2, uint32_t arg3, uint32_t arg4, uint32_t arg5)
{
if (arg1) {
struct timeval_kernel *now = (struct timeval_kernel *)arg1;
unsigned int temp = (now->tv_sec * 1000) + (now->tv_usec / 1000 / 1000);
jiffies = temp;
}
return 0;
}

int sys_reboot_hdlr(void)
{
scb_reset_system(); /* Never returns. */
Expand Down
1 change: 1 addition & 0 deletions kernel/syscall_table_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
["pthread_mutex_trylock", 1, "sys_pthread_mutex_trylock_hdlr"],
["pthread_mutex_unlock", 1, "sys_pthread_mutex_unlock_hdlr"],
["pthread_kill", 2, "sys_pthread_kill_hdlr"],
["clock_settime", 1, "sys_clock_settime_hdlr"],
]

#
Expand Down

0 comments on commit 45a615d

Please sign in to comment.