From owner-svn-src-all@FreeBSD.ORG Thu Feb 4 05:50:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 062FC106566B; Thu, 4 Feb 2010 05:49:59 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B42EB8FC1A; Thu, 4 Feb 2010 05:49:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o145nxwK025868; Thu, 4 Feb 2010 05:49:59 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o145nxvd025866; Thu, 4 Feb 2010 05:49:59 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201002040549.o145nxvd025866@svn.freebsd.org> From: Neel Natu Date: Thu, 4 Feb 2010 05:49:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203475 - head/lib/libc/mips/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Thu, 04 Feb 2010 05:50:00 -0000 Author: neel Date: Thu Feb 4 05:49:59 2010 New Revision: 203475 URL: http://svn.freebsd.org/changeset/base/203475 Log: Reinstate the ptrace patch to restore the 'gp' register after calling a function. I made a mistake in assuming that the .cprestore directive will cause the assembler to automatically restore 'gp' after the 'jalr'. The .cprestore directive does its magic only after 'jal' and 'bal' instructions - not the 'jalr'. Pointed out by: c.jayachandran@gmail.com Modified: head/lib/libc/mips/sys/ptrace.S Modified: head/lib/libc/mips/sys/ptrace.S ============================================================================== --- head/lib/libc/mips/sys/ptrace.S Thu Feb 4 05:25:59 2010 (r203474) +++ head/lib/libc/mips/sys/ptrace.S Thu Feb 4 05:49:59 2010 (r203475) @@ -56,6 +56,9 @@ LEAF(ptrace) #endif la t9, _C_LABEL(__error) # locate address of errno jalr t9 +#ifdef __ABICALLS__ + lw gp, 16(sp) +#endif sw zero, 0(v0) lw ra, 32(sp) addu sp, sp, 40