X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=bsd-user%2Fsignal.c;h=b6beab659e154442e2284bf1b0bfed3c416f53d9;hb=d314ae93f1724fa2f5e9636aa6483acf9fa7505f;hp=ad22ba9d90dd520e5f34e6006a381e57dc034253;hpb=5cbe64110dbe27f82d30552001acdc5eeaade11c;p=mirror_qemu.git diff --git a/bsd-user/signal.c b/bsd-user/signal.c index ad22ba9d90..b6beab659e 100644 --- a/bsd-user/signal.c +++ b/bsd-user/signal.c @@ -19,7 +19,9 @@ */ #include "qemu/osdep.h" +#include "qemu/log.h" #include "qemu.h" +#include "gdbstub/user.h" #include "signal-common.h" #include "trace.h" #include "hw/core/tcg-cpu-ops.h" @@ -42,7 +44,7 @@ static inline int sas_ss_flags(TaskState *ts, unsigned long sp) } /* - * The BSD ABIs use the same singal numbers across all the CPU architectures, so + * The BSD ABIs use the same signal numbers across all the CPU architectures, so * (unlike Linux) these functions are just the identity mapping. This might not * be true for XyzBSD running on AbcBSD, which doesn't currently work. */ @@ -222,6 +224,7 @@ static inline void host_to_target_siginfo_noswap(target_siginfo_t *tinfo, * We have to go based on the signal number now to figure out * what's valid. */ + si_type = QEMU_SI_NOINFO; if (has_trapno(sig)) { tinfo->_reason._fault._trapno = info->_reason._fault._trapno; si_type = QEMU_SI_FAULT; @@ -238,14 +241,16 @@ static inline void host_to_target_siginfo_noswap(target_siginfo_t *tinfo, #endif /* * Unsure that this can actually be generated, and our support for - * capsicum is somewhere between weak and non-existant, but if we get + * capsicum is somewhere between weak and non-existent, but if we get * one, then we know what to save. */ +#ifdef QEMU_SI_CAPSICUM if (sig == TARGET_SIGTRAP) { tinfo->_reason._capsicum._syscall = info->_reason._capsicum._syscall; si_type = QEMU_SI_CAPSICUM; } +#endif break; } tinfo->si_code = deposit32(si_code, 24, 8, si_type); @@ -295,10 +300,12 @@ static void tswap_siginfo(target_siginfo_t *tinfo, const target_siginfo_t *info) /* Note: Not generated on FreeBSD */ __put_user(info->_reason._poll._band, &tinfo->_reason._poll._band); break; +#ifdef QEMU_SI_CAPSICUM case QEMU_SI_CAPSICUM: __put_user(info->_reason._capsicum._syscall, &tinfo->_reason._capsicum._syscall); break; +#endif default: g_assert_not_reached(); } @@ -312,7 +319,7 @@ int block_signals(void) /* * It's OK to block everything including SIGSEGV, because we won't run any * further guest code before unblocking signals in - * process_pending_signals(). We depend on the FreeBSD behaivor here where + * process_pending_signals(). We depend on the FreeBSD behavior here where * this will only affect this thread's signal mask. We don't use * pthread_sigmask which might seem more correct because that routine also * does odd things with SIGCANCEL to implement pthread_cancel(). @@ -341,7 +348,8 @@ static int core_dump_signal(int sig) } /* Abort execution with signal. */ -static void QEMU_NORETURN dump_core_and_abort(int target_sig) +static G_NORETURN +void dump_core_and_abort(int target_sig) { CPUArchState *env = thread_cpu->env_ptr; CPUState *cpu = env_cpu(env); @@ -779,10 +787,7 @@ static int reset_signal_mask(target_ucontext_t *ucontext) TaskState *ts = (TaskState *)thread_cpu->opaque; for (i = 0; i < TARGET_NSIG_WORDS; i++) { - if (__get_user(target_set.__bits[i], - &ucontext->uc_sigmask.__bits[i])) { - return -TARGET_EFAULT; - } + __get_user(target_set.__bits[i], &ucontext->uc_sigmask.__bits[i]); } target_to_host_sigset_internal(&blocked, &target_set); ts->signal_mask = blocked;