From 90b48b3e6c6cf7bfc1fbbb141c84c7e62a6817fe Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Tue, 17 Jun 2025 02:28:24 -0400 Subject: kernel: time: Introduce SYS_sleep Add SYS_sleep to put a thread to sleep for some time through a timespec Signed-off-by: Ian Moffett --- sys/include/sys/syscall.h | 1 + sys/include/sys/time.h | 6 ++++++ 2 files changed, 7 insertions(+) (limited to 'sys/include') diff --git a/sys/include/sys/syscall.h b/sys/include/sys/syscall.h index 37e2286..6d9dae6 100644 --- a/sys/include/sys/syscall.h +++ b/sys/include/sys/syscall.h @@ -52,6 +52,7 @@ #define SYS_munmap 11 #define SYS_access 12 #define SYS_lseek 13 +#define SYS_sleep 14 #if defined(_KERNEL) /* Syscall return value and arg type */ diff --git a/sys/include/sys/time.h b/sys/include/sys/time.h index fb98b9d..8563fc7 100644 --- a/sys/include/sys/time.h +++ b/sys/include/sys/time.h @@ -31,6 +31,9 @@ #define _SYS_TIME_H_ #include +#if defined(_KERNEL) +#include +#endif /* _KERNEL */ struct timeval { time_t tv_sec; @@ -48,4 +51,7 @@ struct date { uint8_t hour; }; +#if defined(_KERNEL) +scret_t sys_sleep(struct syscall_args *scargs); +#endif #endif /* !_SYS_TIME_H_ */ -- cgit v1.2.3