Gave VG_(do_syscall)() a more specific prototype:

  Int VG_(do_syscall) ( UInt, UWord, UWord, UWord, UWord, UWord, UWord );

to replace the previous:
  
  Int VG_(do_syscall) ( UInt, ... )

Reason being that sometimes you could get incorrect args passed, when
passing 32-bit ints on 64-bit platforms.  I also added macros
VG_(do_syscall[123456]) to make life easier, and converted all the
relevant calls.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3143 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/core.h b/coregrind/core.h
index 235d79b..012c2b0 100644
--- a/coregrind/core.h
+++ b/coregrind/core.h
@@ -1731,7 +1731,22 @@
    Exports of vg_syscall.S
    ------------------------------------------------------------------ */
 
-extern Int VG_(do_syscall) ( UInt, ... );
+// We use a full prototype rather than "..." here to ensure that all
+// arguments get converted to a UWord appropriately.  Not doing so can
+// cause problems when passing 32-bit integers on 64-bit platforms, because
+// the top 32-bits might not be zeroed appropriately, eg. as would happen
+// with the 6th arg on AMD64 which is passed on the stack.
+extern Int VG_(do_syscall) ( UInt, UWord, UWord, UWord, UWord, UWord, UWord );
+
+// Macros make life easier.
+#define vgPlain_do_syscall0(s)             VG_(do_syscall)((s),0,0,0,0,0,0)
+#define vgPlain_do_syscall1(s,a)           VG_(do_syscall)((s),(a),0,0,0,0,0)
+#define vgPlain_do_syscall2(s,a,b)         VG_(do_syscall)((s),(a),(b),0,0,0,0)
+#define vgPlain_do_syscall3(s,a,b,c)       VG_(do_syscall)((s),(a),(b),(c),0,0,0)
+#define vgPlain_do_syscall4(s,a,b,c,d)     VG_(do_syscall)((s),(a),(b),(c),(d),0,0)
+#define vgPlain_do_syscall5(s,a,b,c,d,e)   VG_(do_syscall)((s),(a),(b),(c),(d),(e),0)
+#define vgPlain_do_syscall6(s,a,b,c,d,e,f) VG_(do_syscall)((s),(a),(b),(c),(d),(e),(f))
+
 extern Int VG_(clone) ( Int (*fn)(void *), void *stack, Int flags, void *arg, 
 			Int *child_tid, Int *parent_tid);
 extern void VG_(sigreturn)(void);