[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 16/20] bsd-user: Implement SIGSYS on arm
From: |
Warner Losh |
Subject: |
[PATCH v3 16/20] bsd-user: Implement SIGSYS on arm |
Date: |
Tue, 11 Apr 2023 11:09:51 -0600 |
When a system call returns ENOSYS, send a SIGSYS to the process (to
generate a core dump).
Signed-off-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
bsd-user/arm/target_arch_cpu.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/bsd-user/arm/target_arch_cpu.h b/bsd-user/arm/target_arch_cpu.h
index 517d0087644..c4b21fef713 100644
--- a/bsd-user/arm/target_arch_cpu.h
+++ b/bsd-user/arm/target_arch_cpu.h
@@ -127,6 +127,14 @@ static inline void target_cpu_loop(CPUARMState *env)
env->regs[15] -= env->thumb ? 2 : 4;
break;
}
+ /*
+ * Emulate BSD's sigsys behavior on unimplemented system calls.
+ * XXX may need to gate this somehow or arrange for sigsys to
be
+ * masked in some use cases.
+ */
+ if (ret == -TARGET_ENOSYS) {
+ force_sig_fault(TARGET_SIGSYS, SI_KERNEL, env->regs[15]);
+ }
if ((unsigned int)ret >= (unsigned int)(-515)) {
ret = -ret;
cpsr_write(env, CPSR_C, CPSR_C, CPSRWriteByInstr);
--
2.40.0
- [PATCH v3 02/20] bsd-user: Ifdef a few MAP_ constants for NetBSD / OpenBSD., (continued)
- [PATCH v3 02/20] bsd-user: Ifdef a few MAP_ constants for NetBSD / OpenBSD., Warner Losh, 2023/04/11
- [PATCH v3 01/20] bsd-user: Make print_* public, Warner Losh, 2023/04/11
- [PATCH v3 04/20] bsd-user: Move system FreeBSD call table to freebsd/os-syscall.c, Warner Losh, 2023/04/11
- [PATCH v3 06/20] bsd-user: Remove OpenBSD specific syscall printing, Warner Losh, 2023/04/11
- [PATCH v3 12/20] bsd-user: Implement do_sysctl_kern_proc_vmmap, Warner Losh, 2023/04/11
- [PATCH v3 05/20] bsd-user: Remove NetBSD specific syscall printing, Warner Losh, 2023/04/11
- [PATCH v3 03/20] bsd-user: Cleanup style., Warner Losh, 2023/04/11
- [PATCH v3 09/20] bsd-user: h2g_rusage, Warner Losh, 2023/04/11
- [PATCH v3 13/20] bsd-user: Implement sysctl kern.proc, except kern.proc.full_path, Warner Losh, 2023/04/11
- [PATCH v3 14/20] bsd-user: Implement core dumps, Warner Losh, 2023/04/11
- [PATCH v3 16/20] bsd-user: Implement SIGSYS on arm,
Warner Losh <=
- [PATCH v3 20/20] bsd-user: Eliminate USE_ELF_CORE_DUMP, Warner Losh, 2023/04/11
- [PATCH v3 15/20] bsd-user: Add SIGSYS to core dump signals., Warner Losh, 2023/04/11
- [PATCH v3 08/20] bsd-user: Remove useless mmap definitions, Warner Losh, 2023/04/11
- [PATCH v3 10/20] bsd-user: Implement do_sysctl_kern_getprocs, Warner Losh, 2023/04/11
- [PATCH v3 17/20] bsd-user: Remove host-os.h, Warner Losh, 2023/04/11
- [PATCH v3 07/20] bsd-user: Move system call include to os-syscall.h, Warner Losh, 2023/04/11
- [PATCH v3 18/20] bsd-user: Automatically generate syscall_nr.h, Warner Losh, 2023/04/11