From owner-freebsd-arch Sat Feb 16 10:42:19 2002 Delivered-To: freebsd-arch@freebsd.org Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by hub.freebsd.org (Postfix) with ESMTP id 2AEE537B404 for ; Sat, 16 Feb 2002 10:42:17 -0800 (PST) Received: (from dillon@localhost) by apollo.backplane.com (8.11.6/8.9.1) id g1GIgFF89658; Sat, 16 Feb 2002 10:42:15 -0800 (PST) (envelope-from dillon) Date: Sat, 16 Feb 2002 10:42:15 -0800 (PST) From: Matthew Dillon Message-Id: <200202161842.g1GIgFF89658@apollo.backplane.com> To: Peter Wemm Cc: Dan Eischen , arch@FreeBSD.ORG Subject: MFC makecontext(), getcontext(), setcontext()?, also would be nice to have some cleanups References: <20020206195918.6350039F1@overcee.wemm.org> Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG It would be nice if getcontext() and setcontext() could be told not to screw around with the signal mask, similar to what sigsetjmp() and siglongjmp() do if the savemask is empty. Perhaps something like this: BEFORE: 2: PIC_PROLOGUE pushl $0 /* oset = NULL */ pushl %eax /* set = &ucp->uc_sigmask */ pushl $3 /* how = SIG_SETMASK */ call PIC_PLT(CNAME(_sigprocmask)) addl $12, %esp PIC_EPILOGUE AFTER: 2: PIC_PROLOGUE testl (%eax) <<<<<<<<<<< ADD jz 21f <<<<<<<<<<< ADD pushl $0 /* oset = NULL */ pushl %eax /* set = &ucp->uc_sigmask */ pushl $3 /* how = SIG_SETMASK */ call PIC_PLT(CNAME(_sigprocmask)) addl $12, %esp PIC_EPILOGUE testl %eax,%eax jnz 5f 21: <<<<<<<<<<< ADD (make same change in both setcontext() and getcontext()) This way these calls could be used to replace the alternate signal stack, sigsetjmp()/setlongjmp() junk that has to be done now in roll-your-own threads systems. Any objections to me doing this? I would also like to MFC these functions to -stable at some point. -Matt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message