parlib: Fix context detection in __prep_sighandler()
authorBarret Rhoden <brho@cs.berkeley.edu>
Tue, 19 Jun 2018 17:51:07 +0000 (13:51 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Tue, 19 Jun 2018 17:51:07 +0000 (13:51 -0400)
In commit f3f00eeae350 ("parlib: Fix aggressively-saved FP state for
signals"), we were checking the wrong context.  If the uthread was not
saved, its context was in VCPD.  That's why we have the ctx variable.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
user/parlib/signal.c

index e8d2351..4680411 100644 (file)
@@ -163,7 +163,7 @@ static void __prep_sighandler(struct uthread *uthread,
        uthread->sigstate.data = (struct sigdata*)stack;
        /* Parlib aggressively saves the FP state for HW and VM ctxs.  SW ctxs
         * should not have FP state saved. */
-       switch (uthread->u_ctx.type) {
+       switch (ctx->type) {
        case ROS_HW_CTX:
        case ROS_VM_CTX:
                assert(uthread->flags & UTHREAD_FPSAVED);