summaryrefslogtreecommitdiffstats
path: root/sys/amd64/ia32/ia32_signal.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2015-01-31 21:43:46 +0000
committerkib <kib@FreeBSD.org>2015-01-31 21:43:46 +0000
commit3bbc91d138d490edd1e55e311bae6c167da61fb8 (patch)
treec59ea8ad2996445d89d6f2338e4a25a24ab968a8 /sys/amd64/ia32/ia32_signal.c
parent1831e3d7dcde53b6f53b3d79d72dc59b8cc1420b (diff)
downloadFreeBSD-src-3bbc91d138d490edd1e55e311bae6c167da61fb8.zip
FreeBSD-src-3bbc91d138d490edd1e55e311bae6c167da61fb8.tar.gz
Do not qualify the mcontext_t *mcp argument for set_mcontext(9) as
const. On x86, even after the machine context is supposedly read into the struct ucontext, lazy FPU state save code might only mark the FPU data as hardware-owned. Later, set_fpcontext() needs to fetch the state from hardware, modifying the *mcp. The set_mcontext(9) is called from sigreturn(2) and setcontext(2) implementations and old create_thread(2) interface, which throw the *mcp out after the set_mcontext() call. Reported by: dim Discussed with: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week
Diffstat (limited to 'sys/amd64/ia32/ia32_signal.c')
-rw-r--r--sys/amd64/ia32/ia32_signal.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/amd64/ia32/ia32_signal.c b/sys/amd64/ia32/ia32_signal.c
index 75a0511..da01647 100644
--- a/sys/amd64/ia32/ia32_signal.c
+++ b/sys/amd64/ia32/ia32_signal.c
@@ -118,7 +118,7 @@ ia32_get_fpcontext(struct thread *td, struct ia32_mcontext *mcp,
}
static int
-ia32_set_fpcontext(struct thread *td, const struct ia32_mcontext *mcp,
+ia32_set_fpcontext(struct thread *td, struct ia32_mcontext *mcp,
char *xfpustate, size_t xfpustate_len)
{
int error;
@@ -197,7 +197,7 @@ ia32_get_mcontext(struct thread *td, struct ia32_mcontext *mcp, int flags)
* touch the cs selector.
*/
static int
-ia32_set_mcontext(struct thread *td, const struct ia32_mcontext *mcp)
+ia32_set_mcontext(struct thread *td, struct ia32_mcontext *mcp)
{
struct trapframe *tp;
char *xfpustate;
OpenPOWER on IntegriCloud