From owner-p4-projects Sat Aug 31 13:27:55 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id F105037B401; Sat, 31 Aug 2002 13:27:47 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 831F237B400 for ; Sat, 31 Aug 2002 13:27:47 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2665243E4A for ; Sat, 31 Aug 2002 13:27:47 -0700 (PDT) (envelope-from mini@freebsd.org) Received: from freefall.freebsd.org (perforce@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.4/8.12.4) with ESMTP id g7VKRlJU009873 for ; Sat, 31 Aug 2002 13:27:47 -0700 (PDT) (envelope-from mini@freebsd.org) Received: (from perforce@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g7VKRklx009870 for perforce@freebsd.org; Sat, 31 Aug 2002 13:27:46 -0700 (PDT) Date: Sat, 31 Aug 2002 13:27:46 -0700 (PDT) Message-Id: <200208312027.g7VKRklx009870@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: perforce set sender to mini@freebsd.org using -f From: Jonathan Mini Subject: PERFORCE change 16862 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://people.freebsd.org/~peter/p4db/chv.cgi?CH=16862 Change 16862 by mini@mini_stylus on 2002/08/31 13:27:40 - Look for uc_flags in the right place. - A context is valid when mc_len == sizeof(mcontext_t), not when (mc_len - sizeof(mcontext_t) != 0 (i.e., je, not jnz). - Obey SKIPSIGMASK in getcontext() too. This makes getcontext()/setcontext() work again. Affected files ... .. //depot/projects/kse/lib/libc/i386/gen/getcontext.S#4 edit Differences ... ==== //depot/projects/kse/lib/libc/i386/gen/getcontext.S#4 (text+ko) ==== @@ -33,6 +33,7 @@ #define MC_SIZE 640 /* sizeof mcontext_t */ #define UC_MC_OFFSET 16 /* offset to mcontext from ucontext */ #define UC_MC_LEN_OFFSET 96 /* offset to mc_len from mcontext */ +#define UC_FLAGS_OFFSET 676 /* offset to uc_flags from ucontext */ #define MC_FLAGS_OFFSET 660 /* offset to uc_flags from ucontext */ #define MC_BUSY_OFFSET 656 /* offset to uc_busy from ucontext */ #define MC_LEN_OFFSET 80 /* offset to mc_len from mcontext */ @@ -58,10 +59,10 @@ movl $-1, %eax jmp 7f 1: cmpl $MC_SIZE, UC_MC_LEN_OFFSET(%eax) /* is context valid? */ - jnz 2f + je 2f movl $-1, %eax /* bzzzt, invalid context */ jmp 7f -2: testl $UCF_SKIPSIGMASK, MC_FLAGS_OFFSET(%edx) /* Restore sigmask? */ +2: testl $UCF_SKIPSIGMASK, UC_FLAGS_OFFSET(%eax) /* Restore sigmask? */ jnz 3f PIC_PROLOGUE pushl $0 /* oset = NULL */ @@ -118,9 +119,11 @@ cmpl $0, %eax /* check for null pointer */ jne 1f movl $-1, %eax - jmp 2f + jmp 3f movl 4(%esp), %eax /* get address of context and sigset */ -1: PIC_PROLOGUE +1: testl $UCF_SKIPSIGMASK, UC_FLAGS_OFFSET(%eax) /* Save sigmask? */ + jnz 2f + PIC_PROLOGUE pushl %eax /* oset = &ucp->uc_sigmask */ pushl $0 /* set = NULL */ pushl $3 /* how = SIG_SETMASK */ @@ -128,8 +131,8 @@ addl $12, %esp PIC_EPILOGUE testl %eax, %eax /* check for error */ - jnz 2f - pushl %edx /* save value of edx */ + jnz 3f +2: pushl %edx /* save value of edx */ movl 8(%esp), %edx /* get address of context */ addl $UC_MC_OFFSET, %edx /* add offset to mcontext */ movl %gs, 4(%edx) @@ -165,4 +168,4 @@ movl $MC_SIZE, MC_LEN_OFFSET(%edx) /* context is now valid */ movl 40(%edx), %edx /* restore edx -- is this needed? */ xorl %eax, %eax /* return 0 */ -2: ret +3: ret To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message