From owner-svn-src-all@FreeBSD.ORG Wed Apr 10 02:40:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E6B16964; Wed, 10 Apr 2013 02:40:03 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DA1ACCD5; Wed, 10 Apr 2013 02:40:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3A2e3D4045384; Wed, 10 Apr 2013 02:40:03 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3A2e3XL045383; Wed, 10 Apr 2013 02:40:03 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201304100240.r3A2e3XL045383@svn.freebsd.org> From: David Xu Date: Wed, 10 Apr 2013 02:40:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249323 - head/lib/libthr/thread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Apr 2013 02:40:04 -0000 Author: davidxu Date: Wed Apr 10 02:40:03 2013 New Revision: 249323 URL: http://svnweb.freebsd.org/changeset/base/249323 Log: swapcontext wrapper can not be implemented in C, the stack pointer saved in the context becomes invalid when the function returns, same as setjmp, it must be implemented in assemble language, see discussions in PR misc/177624. Modified: head/lib/libthr/thread/thr_sig.c Modified: head/lib/libthr/thread/thr_sig.c ============================================================================== --- head/lib/libthr/thread/thr_sig.c Wed Apr 10 02:18:17 2013 (r249322) +++ head/lib/libthr/thread/thr_sig.c Wed Apr 10 02:40:03 2013 (r249323) @@ -737,13 +737,4 @@ _setcontext(const ucontext_t *ucp) return __sys_setcontext(&uc); } -__weak_reference(_swapcontext, swapcontext); -int -_swapcontext(ucontext_t *oucp, const ucontext_t *ucp) -{ - ucontext_t uc; - - (void) memcpy(&uc, ucp, sizeof(uc)); - remove_thr_signals(&uc.uc_sigmask); - return __sys_swapcontext(oucp, &uc); -} +__weak_reference(__sys_swapcontext, swapcontext);