[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 16/22] bsd-user/freebsd/os-syscall.c: Tracing and error boilerpla
From: |
Warner Losh |
Subject: |
[PATCH 16/22] bsd-user/freebsd/os-syscall.c: Tracing and error boilerplate |
Date: |
Tue, 1 Feb 2022 04:14:49 -0700 |
Add in the tracing and this system call not implemented boilerplate.
Signed-off-by: Warner Losh <imp@bsdimp.com>
---
bsd-user/freebsd/os-syscall.c | 27 ++++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)
diff --git a/bsd-user/freebsd/os-syscall.c b/bsd-user/freebsd/os-syscall.c
index d49945f0fcc..fcfa6221182 100644
--- a/bsd-user/freebsd/os-syscall.c
+++ b/bsd-user/freebsd/os-syscall.c
@@ -200,7 +200,32 @@ abi_long do_freebsd_syscall(void *cpu_env, int num,
abi_long arg1,
abi_long arg5, abi_long arg6, abi_long arg7,
abi_long arg8)
{
- return 0;
+ CPUState *cpu = env_cpu(cpu_env);
+ abi_long ret;
+
+#ifdef DEBUG
+ gemu_log("freebsd syscall %d\n", num);
+#endif
+ trace_guest_user_syscall(cpu, num, arg1, arg2, arg3, arg4, arg5, arg6,
arg7, arg8);
+ if (do_strace) {
+ print_freebsd_syscall(num, arg1, arg2, arg3, arg4, arg5, arg6);
+ }
+
+ switch (num) {
+ default:
+ gemu_log("qemu: unsupported syscall: %d\n", num);
+ ret = -TARGET_ENOSYS;
+ break;
+ }
+
+#ifdef DEBUG
+ gemu_log(" = %ld\n", ret);
+#endif
+ if (do_strace) {
+ print_freebsd_syscall_ret(num, ret);
+ }
+ trace_guest_user_syscall_ret(cpu, num, ret);
+ return ret;
}
void syscall_init(void)
--
2.33.1
- Re: [PATCH 13/22] bsd-user/bsd-file.h: Implementation details for the filesystem calls, (continued)
- [PATCH 15/22] bsd-user/freebsd/os-syscall.c: unlock_iovec, Warner Losh, 2022/02/01
- [PATCH 17/22] bsd-user: introduce target.h, Warner Losh, 2022/02/01
- [PATCH 21/22] bsd-user/bsd-file.h: Meat of the write system calls, Warner Losh, 2022/02/01
- [PATCH 16/22] bsd-user/freebsd/os-syscall.c: Tracing and error boilerplate,
Warner Losh <=
- [PATCH 07/22] bsd-user/x86_64/target_arch_thread.h: Assume a FreeBSD target, Warner Losh, 2022/02/01
- [PATCH 22/22] bsd-user/freebsd/os-syscall.c: Implement exit, Warner Losh, 2022/02/01