summaryrefslogtreecommitdiffstats
path: root/lib/libc/i386/gen/makecontext.c
diff options
context:
space:
mode:
authormini <mini@FreeBSD.org>2002-09-16 19:24:31 +0000
committermini <mini@FreeBSD.org>2002-09-16 19:24:31 +0000
commit94a57caeb217b8a70c593972f7402cca3de08a19 (patch)
treed8c9e1b0aea4c7e3e7e927ab702b36e7f94d9096 /lib/libc/i386/gen/makecontext.c
parent1fe838905f946528b59f70ab7069f09b1cbe7ddf (diff)
downloadFreeBSD-src-94a57caeb217b8a70c593972f7402cca3de08a19.zip
FreeBSD-src-94a57caeb217b8a70c593972f7402cca3de08a19.tar.gz
Save and restore FPU state properly in ucontext_t's.
Reviewed by: deischen, julian Approved by: -arch
Diffstat (limited to 'lib/libc/i386/gen/makecontext.c')
-rw-r--r--lib/libc/i386/gen/makecontext.c10
1 files changed, 5 insertions, 5 deletions
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 <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:
*
OpenPOWER on IntegriCloud