summary refs log tree commit diff stats
path: root/bsd-user/arm/signal.c
diff options
context:
space:
mode:
authorWarner Losh <imp@bsdimp.com>2022-01-24 01:29:53 -0700
committerWarner Losh <imp@bsdimp.com>2022-01-28 15:52:38 -0700
commit7f96d0a93c9f252fc65b0ad49121a62889ec560e (patch)
tree10bee802dc87c32f573f57b99db1a287dc628f9d /bsd-user/arm/signal.c
parent224474622e61f24c4b991fca03e32113eaac91cb (diff)
downloadfocaccia-qemu-7f96d0a93c9f252fc65b0ad49121a62889ec560e.tar.gz
focaccia-qemu-7f96d0a93c9f252fc65b0ad49121a62889ec560e.zip
bsd-user/arm/signal.c: get_mcontext should zero vfp data
FreeBSD's get_mcontext doesn't return any vfp data. Instead, it zeros
out the vfp feilds (and all the spare fields). Impelement this
behavior. We're still missing the sysarch(ARM_GET_VFPCONTEXT) syscall,
though.

Signed-off-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'bsd-user/arm/signal.c')
-rw-r--r--bsd-user/arm/signal.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/bsd-user/arm/signal.c b/bsd-user/arm/signal.c
index 9026343b47..2b1dd745d1 100644
--- a/bsd-user/arm/signal.c
+++ b/bsd-user/arm/signal.c
@@ -109,6 +109,15 @@ abi_long get_mcontext(CPUARMState *env, target_mcontext_t *mcp, int flags)
     gr[TARGET_REG_LR] = tswap32(env->regs[14]);
     gr[TARGET_REG_PC] = tswap32(env->regs[15]);
 
+    /*
+     * FreeBSD's get_mcontext doesn't save VFP info, but sets the pointer and
+     * size to zero.  Applications that need the VFP state use
+     * sysarch(ARM_GET_VFPSTATE) and are expected to adjust mcontext after that.
+     */
+    mcp->mc_vfp_size = 0;
+    mcp->mc_vfp_ptr = 0;
+    memset(&mcp->mc_spare, 0, sizeof(mcp->mc_spare));
+
     return 0;
 }