summary refs log tree commit diff stats
path: root/bsd-user/signal.c
diff options
context:
space:
mode:
authorWarner Losh <imp@bsdimp.com>2022-02-01 13:30:30 -0700
committerWarner Losh <imp@bsdimp.com>2022-02-01 14:43:20 -0700
commiteb9d35f686ed1279d57463d9e6f289988f594c19 (patch)
tree737a326c29f18b1445bf273eb4d857a3d2f96d8e /bsd-user/signal.c
parent3bbe296c1c7a6ddce7a294e006b8c4a53b385292 (diff)
downloadfocaccia-qemu-eb9d35f686ed1279d57463d9e6f289988f594c19.tar.gz
focaccia-qemu-eb9d35f686ed1279d57463d9e6f289988f594c19.zip
bsd-user/signal.c: Only copy the _capsicum for FreeBSD_version > 1400026
The capsicum signal stuff is new with FreeBSD 14, rev 1400026, so only
define QEMU_SI_CAPSICUM there. Only copy _capsicum when QEMU_SI_CAPSICUM
is defined. Default to no info being passed for signals we make no guess
about.

Signed-off-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'bsd-user/signal.c')
-rw-r--r--bsd-user/signal.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/bsd-user/signal.c b/bsd-user/signal.c
index ad22ba9d90..0bc6d2edbd 100644
--- a/bsd-user/signal.c
+++ b/bsd-user/signal.c
@@ -222,6 +222,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;
@@ -241,11 +242,13 @@ static inline void host_to_target_siginfo_noswap(target_siginfo_t *tinfo,
          * capsicum is somewhere between weak and non-existant, 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 +298,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();
     }