diff options
author | Jonathan Mini <mini@FreeBSD.org> | 2002-09-16 19:24:31 +0000 |
---|---|---|
committer | Jonathan Mini <mini@FreeBSD.org> | 2002-09-16 19:24:31 +0000 |
commit | f990583656178b1520a28b726c285a2f3fe4b353 (patch) | |
tree | d8c9e1b0aea4c7e3e7e927ab702b36e7f94d9096 /lib/libc/i386/gen/makecontext.c | |
parent | b3466b3fe0de26be46280e72646a742c1d89a42f (diff) | |
download | src-f990583656178b1520a28b726c285a2f3fe4b353.tar.gz src-f990583656178b1520a28b726c285a2f3fe4b353.zip |
Save and restore FPU state properly in ucontext_t's.
Reviewed by: deischen, julian
Approved by: -arch
Notes
Notes:
svn path=/head/; revision=103406
Diffstat (limited to 'lib/libc/i386/gen/makecontext.c')
-rw-r--r-- | lib/libc/i386/gen/makecontext.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/libc/i386/gen/makecontext.c b/lib/libc/i386/gen/makecontext.c index e1eb90fde43e..a6fc6adaf621 100644 --- a/lib/libc/i386/gen/makecontext.c +++ b/lib/libc/i386/gen/makecontext.c @@ -29,11 +29,11 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/signal.h> +#include <sys/ucontext.h> #include <errno.h> #include <stdarg.h> #include <stdlib.h> -#include <ucontext.h> #include <unistd.h> /* 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: * |