[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 6/7] Added case staements for time functions
From: |
Ajeets6 |
Subject: |
[PATCH 6/7] Added case staements for time functions |
Date: |
Sat, 22 Apr 2023 21:49:33 +0530 |
From: Warner Losh <imp@bsdimp.com>
+Added cases for nanosleep(2),clock_nanosleep(2),clock_gettime(2) and
clock_getres(2)
+Updated meson.build
Signed-off-by: Warner Losh <imp@bsdimp.com>
Signed-off-by: Ajeets6 <itachis6234@gmail.com>
---
bsd-user/freebsd/meson.build | 1 +
bsd-user/freebsd/os-syscall.c | 20 ++++++++++++++++++++
2 files changed, 21 insertions(+)
diff --git a/bsd-user/freebsd/meson.build b/bsd-user/freebsd/meson.build
index f87c788e84..2eb0ed4d96 100644
--- a/bsd-user/freebsd/meson.build
+++ b/bsd-user/freebsd/meson.build
@@ -1,4 +1,5 @@
bsd_user_ss.add(files(
'os-sys.c',
'os-syscall.c',
+ 'os-time.c',
))
diff --git a/bsd-user/freebsd/os-syscall.c b/bsd-user/freebsd/os-syscall.c
index c8f998ecec..8fd6eb05cb 100644
--- a/bsd-user/freebsd/os-syscall.c
+++ b/bsd-user/freebsd/os-syscall.c
@@ -46,6 +46,8 @@
#include "bsd-file.h"
#include "bsd-proc.h"
+/* *BSD dependent syscall shims */
+#include "os-time.h"
/* I/O */
safe_syscall3(int, open, const char *, path, int, flags, mode_t, mode);
@@ -507,6 +509,24 @@ static abi_long freebsd_syscall(void *cpu_env, int num,
abi_long arg1,
case TARGET_FREEBSD_NR_sysarch: /* sysarch(2) */
ret = do_freebsd_sysarch(cpu_env, arg1, arg2);
break;
+ /*
+ * time related system calls.
+ */
+ case TARGET_FREEBSD_NR_nanosleep: /* nanosleep(2) */
+ ret = do_freebsd_nanosleep(arg1, arg2);
+ break;
+
+ case TARGET_FREEBSD_NR_clock_nanosleep: /* clock_nanosleep(2) */
+ ret = do_freebsd_clock_nanosleep(arg1, arg2, arg3, arg4);
+ break;
+
+ case TARGET_FREEBSD_NR_clock_gettime: /* clock_gettime(2) */
+ ret = do_freebsd_clock_gettime(arg1, arg2);
+ break;
+
+ case TARGET_FREEBSD_NR_clock_getres: /* clock_getres(2) */
+ ret = do_freebsd_clock_getres(arg1, arg2);
+ break;
default:
qemu_log_mask(LOG_UNIMP, "Unsupported syscall: %d\n", num);
--
2.34.1
- [PATCH 1/7] Create os-time.c and add t2h_freebsd_timeval, Ajeets6, 2023/04/22
- [PATCH 5/7] Created qemu-os.h for function prototype, Ajeets6, 2023/04/22
- [PATCH 2/7] Create os-time.h and modify os-time.c, Ajeets6, 2023/04/22
- [PATCH 6/7] Added case staements for time functions,
Ajeets6 <=
- [PATCH 4/7] Added clock_gettime(2) and clock_getres(2), Ajeets6, 2023/04/22
- [PATCH 3/7] Add clock_nanosleep, Ajeets6, 2023/04/22
- [PATCH 7/7] Added safe_syscalls for time functions., Ajeets6, 2023/04/22