Date: Sat, 16 Feb 2002 10:42:15 -0800 (PST) From: Matthew Dillon <dillon@apollo.backplane.com> To: Peter Wemm <peter@wemm.org> Cc: Dan Eischen <eischen@vigrid.com>, arch@FreeBSD.ORG Subject: MFC makecontext(), getcontext(), setcontext()?, also would be nice to have some cleanups Message-ID: <200202161842.g1GIgFF89658@apollo.backplane.com> References: <20020206195918.6350039F1@overcee.wemm.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200202161842.g1GIgFF89658>