summaryrefslogtreecommitdiff
path: root/mem.c
diff options
context:
space:
mode:
authorH.J. Lu <hongjiu.lu@intel.com>2012-04-17 11:05:04 -0700
committerDmitry V. Levin <ldv@altlinux.org>2012-04-18 15:02:40 +0000
commit085e42886052190d3e515ca865546b527f59cdd1 (patch)
treef09fae3b106d16477db384dccf3b0e430e7dd52e /mem.c
parent2bb4581ee501f6803df258ebb74c63a18a48422b (diff)
downloadstrace-085e42886052190d3e515ca865546b527f59cdd1.tar.gz
strace-085e42886052190d3e515ca865546b527f59cdd1.tar.bz2
strace-085e42886052190d3e515ca865546b527f59cdd1.tar.xz
x32: add ia32 support
* Makefile.am (EXTRA_DIST): Add linux/x32/errnoent1.h, linux/x32/ioctlent1.h, linux/x32/signalent1.h and linux/x32/syscallent1.h. * configure.ac: Remove AC_GNU_SOURCE, obsoleted by AC_USE_SYSTEM_EXTENSIONS. * defs.h (SUPPORTED_PERSONALITIES): Set to 2 for X32. (PERSONALITY1_WORDSIZE): Set to 4 for X32. * file.c (stat64): New struct for X32. (sys_lseek32): New function for X32. (stat64): Undef. (sys_fstat64): Likewise. (sys_stat64): Likewise. (realprintstat64): New function for X32. (sys_fstat64): Likewise. (sys_stat64): Likewise. * mem.c (sys_old_mmap): New function for X32. * pathtrace.c (pathtrace_match): Also check sys_old_mmap for X32. * syscall.c (update_personality): Add X32 support. (get_scno): Support currpers == 1 for X32. * linux/syscall.h (sys_lseek32): New function prototype for X32. * linux/x32/errnoent1.h: New file. * linux/x32/ioctlent1.h: Likewise. * linux/x32/signalent1.h: Likewise. * linux/x32/syscallent1.h: Likewise.
Diffstat (limited to 'mem.c')
-rw-r--r--mem.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/mem.c b/mem.c
index 8e34f96..0279030 100644
--- a/mem.c
+++ b/mem.c
@@ -311,6 +311,40 @@ sys_mmap(struct tcb *tcp)
#endif /* !HAVE_LONG_LONG_OFF_T */
#if _LFS64_LARGEFILE || HAVE_LONG_LONG_OFF_T
+# if defined(X32)
+int sys_old_mmap(struct tcb *tcp)
+{
+ long u_arg[6];
+ if (umoven(tcp, tcp->u_arg[0], sizeof(u_arg), (char *) u_arg) == -1)
+ return 0;
+ if (entering(tcp)) {
+ /* addr */
+ if (!u_arg[0])
+ tprints("NULL, ");
+ else
+ tprintf("%#lx, ", u_arg[0]);
+ /* len */
+ tprintf("%lu, ", u_arg[1]);
+ /* prot */
+ printflags(mmap_prot, u_arg[2], "PROT_???");
+ tprints(", ");
+ /* flags */
+# ifdef MAP_TYPE
+ printxval(mmap_flags, u_arg[3] & MAP_TYPE, "MAP_???");
+ addflags(mmap_flags, u_arg[3] & ~MAP_TYPE);
+# else
+ printflags(mmap_flags, u_arg[3], "MAP_???");
+# endif
+ /* fd */
+ tprints(", ");
+ printfd(tcp, u_arg[4]);
+ /* offset */
+ tprintf(", %#lx", u_arg[5]);
+ }
+ return RVAL_HEX;
+}
+# endif
+
/* TODO: comment which arches use this routine.
* For one, does ALPHA on Linux use this??
* From code it seems that it might use 7 or 8 registers,