From 94a57caeb217b8a70c593972f7402cca3de08a19 Mon Sep 17 00:00:00 2001 From: mini Date: Mon, 16 Sep 2002 19:24:31 +0000 Subject: Save and restore FPU state properly in ucontext_t's. Reviewed by: deischen, julian Approved by: -arch --- lib/libc/i386/gen/makecontext.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/libc/i386/gen/makecontext.c') diff --git a/lib/libc/i386/gen/makecontext.c b/lib/libc/i386/gen/makecontext.c index e1eb90f..a6fc6ad 100644 --- a/lib/libc/i386/gen/makecontext.c +++ b/lib/libc/i386/gen/makecontext.c @@ -29,11 +29,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include -#include #include /* Prototypes */ @@ -53,7 +53,7 @@ _ctx_done (ucontext_t *ucp) * to be restarted without being reinitialized (via * setcontext or swapcontext). */ - ucp->uc_mcontext.mc_flags = 0; + ucp->uc_mcontext.mc_len = 0; /* Set context to next one in link */ /* XXX - what to do for error, abort? */ @@ -80,14 +80,14 @@ __makecontext(ucontext_t *ucp, void (*start)(void), int argc, ...) * a void function. At least make sure that the context * isn't valid so it can't be used without an error. */ - ucp->uc_mcontext.mc_flags = 0; + ucp->uc_mcontext.mc_len = 0; } /* XXX - Do we want to sanity check argc? */ else if ((argc < 0) || (argc > NCARGS)) { - ucp->uc_mcontext.mc_flags = 0; + ucp->uc_mcontext.mc_len = 0; } /* Make sure the context is valid. */ - else if ((ucp->uc_mcontext.mc_flags & __UC_MC_VALID) != 0) { + else if (ucp->uc_mcontext.mc_len == sizeof(mcontext_t)) { /* * Arrange the stack as follows: * -- cgit v1.1