Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Jul 2010 00:54:41 +0000 (UTC)
From:      Nathan Whitehorn <nwhitehorn@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r209921 - in head/usr.bin: truss xlint/arch/powerpc64
Message-ID:  <201007120054.o6C0sfs2041246@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 = &regs.fixreg[3];
-  if (syscall_num == SYS_syscall) {
+  if (syscall_num == SYS_syscall || syscall_num == SYS___syscall) {
     args = &regs.fixreg[4];
     regargs -= 1;
     syscall_num = regs.fixreg[3];
-  } else if (syscall_num == SYS___syscall) {
-    args = &regs.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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201007120054.o6C0sfs2041246>