From owner-svn-src-all@FreeBSD.ORG Mon Jul 12 00:54:41 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 948D7106564A; Mon, 12 Jul 2010 00:54:41 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82D828FC21; Mon, 12 Jul 2010 00:54:41 +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 o6C0sfiR041249; Mon, 12 Jul 2010 00:54:41 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6C0sfs2041246; Mon, 12 Jul 2010 00:54:41 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201007120054.o6C0sfs2041246@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 12 Jul 2010 00:54:41 +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: r209921 - in head/usr.bin: truss xlint/arch/powerpc64 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: Mon, 12 Jul 2010 00:54:41 -0000 Author: nwhitehorn Date: Mon Jul 12 00:54:41 2010 New Revision: 209921 URL: http://svn.freebsd.org/changeset/base/209921 Log: Teach truss and xlint how to operate on 64-bit PowerPC systems. Added: head/usr.bin/truss/powerpc64-fbsd.c - copied, changed from r209845, head/usr.bin/truss/powerpc-fbsd.c head/usr.bin/xlint/arch/powerpc64/ - copied from r209845, head/usr.bin/xlint/arch/powerpc/ Modified: head/usr.bin/xlint/arch/powerpc64/targparam.h Copied and modified: head/usr.bin/truss/powerpc64-fbsd.c (from r209845, head/usr.bin/truss/powerpc-fbsd.c) ============================================================================== --- head/usr.bin/truss/powerpc-fbsd.c Fri Jul 9 11:27:33 2010 (r209845, copy source) +++ head/usr.bin/truss/powerpc64-fbsd.c Mon Jul 12 00:54:41 2010 (r209921) @@ -118,9 +118,6 @@ powerpc_syscall_entry(struct trussinfo * unsigned int regargs; struct syscall *sc; - /* Account for a 64-bit argument with corresponding alignment. */ - nargs += 2; - cpid = trussinfo->curthread->tid; clear_fsc(); @@ -137,14 +134,10 @@ powerpc_syscall_entry(struct trussinfo * regargs = NARGREG; syscall_num = regs.fixreg[0]; args = ®s.fixreg[3]; - if (syscall_num == SYS_syscall) { + if (syscall_num == SYS_syscall || syscall_num == SYS___syscall) { args = ®s.fixreg[4]; regargs -= 1; syscall_num = regs.fixreg[3]; - } else if (syscall_num == SYS___syscall) { - args = ®s.fixreg[5]; - regargs -= 2; - syscall_num = regs.fixreg[4]; } fsc.number = syscall_num; @@ -172,7 +165,7 @@ powerpc_syscall_entry(struct trussinfo * memmove(&fsc.args[0], args, regargs * sizeof(fsc.args[0])); iorequest.piod_op = PIOD_READ_D; - iorequest.piod_offs = (void *)(regs.fixreg[1] + 8); + iorequest.piod_offs = (void *)(regs.fixreg[1] + 48); iorequest.piod_addr = &fsc.args[regargs]; iorequest.piod_len = (nargs - regargs) * sizeof(fsc.args[0]); ptrace(PT_IO, cpid, (caddr_t)&iorequest, 0); @@ -292,14 +285,6 @@ powerpc_syscall_exit(struct trussinfo *t asprintf(&fsc.s_args[i], "0x%lx", fsc.args[i]); } else { /* - * On 32-bit big-endian, the low word of a 64-bit return is - * in the greater address. Switch to this. XXX note that - * print_syscall_ret can't handle 64-bit return values (llseek) - */ - if (sc->ret_type == 2) - retval = regs.fixreg[4]; - - /* * Here, we only look for arguments that have OUT masked in -- * otherwise, they were handled in the syscall_entry function. */ Modified: head/usr.bin/xlint/arch/powerpc64/targparam.h ============================================================================== --- head/usr.bin/xlint/arch/powerpc/targparam.h Fri Jul 9 11:27:33 2010 (r209845) +++ head/usr.bin/xlint/arch/powerpc64/targparam.h Mon Jul 12 00:54:41 2010 (r209921) @@ -29,13 +29,15 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ */ /* * Machine-dependent target parameters for lint1. */ -#include "ilp32.h" +#include "lp64.h" /* * Should be set to 1 if the difference of two pointers is of type long @@ -43,8 +45,8 @@ * kept in sync with the compiler! */ -#define PTRDIFF_IS_LONG 0 -#define SIZEOF_IS_ULONG 0 +#define PTRDIFF_IS_LONG 1 +#define SIZEOF_IS_ULONG 1 #define FLOAT_SIZE (4 * CHAR_BIT) #define DOUBLE_SIZE (8 * CHAR_BIT)