Update Valgrind and TSan.

Rebased local changes on:
http://valgrind-variant.googlecode.com/svn/trunk@125
http://data-race-test.googlecode.com/svn/trunk@3717

Change-Id: I4d7a227ad72fb8e9998015a5fe26e00496ec1da3
diff --git a/main/include/Makefile.am b/main/include/Makefile.am
index 33d0857..9f3f4a0 100644
--- a/main/include/Makefile.am
+++ b/main/include/Makefile.am
@@ -12,12 +12,14 @@
 	pub_tool_debuginfo.h 		\
 	pub_tool_errormgr.h 		\
 	pub_tool_execontext.h 		\
+	pub_tool_gdbserver.h 		\
 	pub_tool_hashtable.h 		\
 	pub_tool_libcbase.h 		\
 	pub_tool_libcassert.h 		\
 	pub_tool_libcfile.h 		\
 	pub_tool_libcprint.h 		\
 	pub_tool_libcproc.h 		\
+	pub_tool_libcsetjmp.h 		\
 	pub_tool_libcsignal.h 		\
 	pub_tool_machine.h 		\
 	pub_tool_mallocfree.h 		\
@@ -44,20 +46,17 @@
 	vki/vki-posixtypes-ppc64-linux.h \
 	vki/vki-posixtypes-x86-linux.h	 \
 	vki/vki-posixtypes-arm-linux.h	 \
+	vki/vki-posixtypes-s390x-linux.h \
 	vki/vki-amd64-linux.h		\
 	vki/vki-ppc32-linux.h		\
 	vki/vki-ppc64-linux.h		\
 	vki/vki-x86-linux.h		\
 	vki/vki-arm-linux.h		\
+	vki/vki-s390x-linux.h		\
 	vki/vki-scnums-amd64-linux.h	\
 	vki/vki-scnums-ppc32-linux.h	\
 	vki/vki-scnums-ppc64-linux.h	\
 	vki/vki-scnums-x86-linux.h	\
 	vki/vki-scnums-arm-linux.h	\
+	vki/vki-scnums-s390x-linux.h	\
 	vki/vki-scnums-darwin.h
-
-noinst_HEADERS = \
-	vki/vki-ppc32-aix5.h		\
-	vki/vki-ppc64-aix5.h		\
-	vki/vki-scnums-aix5.h
-
diff --git a/main/include/Makefile.in b/main/include/Makefile.in
deleted file mode 100644
index 2750e25..0000000
--- a/main/include/Makefile.in
+++ /dev/null
@@ -1,532 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = include
-DIST_COMMON = $(nobase_pkginclude_HEADERS) $(noinst_HEADERS) \
-	$(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/configure.in
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-SOURCES =
-DIST_SOURCES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkgincludedir)"
-HEADERS = $(nobase_pkginclude_HEADERS) $(noinst_HEADERS)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-BOOST_CFLAGS = @BOOST_CFLAGS@
-BOOST_LIBS = @BOOST_LIBS@
-CC = @CC@
-CCAS = @CCAS@
-CCASDEPMODE = @CCASDEPMODE@
-CCASFLAGS = @CCASFLAGS@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFAULT_SUPP = @DEFAULT_SUPP@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DIFF = @DIFF@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FLAG_FNO_STACK_PROTECTOR = @FLAG_FNO_STACK_PROTECTOR@
-FLAG_M32 = @FLAG_M32@
-FLAG_M64 = @FLAG_M64@
-FLAG_MAIX32 = @FLAG_MAIX32@
-FLAG_MAIX64 = @FLAG_MAIX64@
-FLAG_MMMX = @FLAG_MMMX@
-FLAG_MSSE = @FLAG_MSSE@
-FLAG_NO_BUILD_ID = @FLAG_NO_BUILD_ID@
-FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
-FLAG_W_EXTRA = @FLAG_W_EXTRA@
-FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
-FLAG_W_NO_FORMAT_ZERO_LENGTH = @FLAG_W_NO_FORMAT_ZERO_LENGTH@
-FLAG_W_NO_UNINITIALIZED = @FLAG_W_NO_UNINITIALIZED@
-GDB = @GDB@
-GLIBC_VERSION = @GLIBC_VERSION@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-MPI_CC = @MPI_CC@
-OBJEXT = @OBJEXT@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PERL = @PERL@
-PKG_CONFIG = @PKG_CONFIG@
-PREFERRED_STACK_BOUNDARY = @PREFERRED_STACK_BOUNDARY@
-QTCORE_CFLAGS = @QTCORE_CFLAGS@
-QTCORE_LIBS = @QTCORE_LIBS@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VALT_LOAD_ADDRESS_PRI = @VALT_LOAD_ADDRESS_PRI@
-VALT_LOAD_ADDRESS_SEC = @VALT_LOAD_ADDRESS_SEC@
-VERSION = @VERSION@
-VGCONF_ARCH_PRI = @VGCONF_ARCH_PRI@
-VGCONF_ARCH_SEC = @VGCONF_ARCH_SEC@
-VGCONF_OS = @VGCONF_OS@
-VGCONF_PLATFORM_PRI_CAPS = @VGCONF_PLATFORM_PRI_CAPS@
-VGCONF_PLATFORM_SEC_CAPS = @VGCONF_PLATFORM_SEC_CAPS@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-# The "nobase" means that the vki/ path on some of them will be preserved
-# when they are installed into $(includedir)/valgrind.
-nobase_pkginclude_HEADERS = \
-	pub_tool_basics.h 		\
-	pub_tool_basics_asm.h 		\
-	pub_tool_aspacehl.h 		\
-	pub_tool_aspacemgr.h 		\
-	pub_tool_clientstate.h		\
-	pub_tool_clreq.h		\
-	pub_tool_cpuid.h 		\
-	pub_tool_debuginfo.h 		\
-	pub_tool_errormgr.h 		\
-	pub_tool_execontext.h 		\
-	pub_tool_hashtable.h 		\
-	pub_tool_libcbase.h 		\
-	pub_tool_libcassert.h 		\
-	pub_tool_libcfile.h 		\
-	pub_tool_libcprint.h 		\
-	pub_tool_libcproc.h 		\
-	pub_tool_libcsignal.h 		\
-	pub_tool_machine.h 		\
-	pub_tool_mallocfree.h 		\
-	pub_tool_options.h 		\
-	pub_tool_oset.h 		\
-	pub_tool_redir.h		\
-	pub_tool_replacemalloc.h	\
-	pub_tool_seqmatch.h		\
-	pub_tool_signals.h 		\
-	pub_tool_sparsewa.h		\
-	pub_tool_stacktrace.h 		\
-	pub_tool_threadstate.h 		\
-	pub_tool_tooliface.h 		\
-	pub_tool_vki.h			\
-	pub_tool_vkiscnums.h		\
-	pub_tool_vkiscnums_asm.h	\
-	pub_tool_wordfm.h		\
-	pub_tool_xarray.h		\
-	valgrind.h			\
-	vki/vki-linux.h			\
-	vki/vki-darwin.h		\
-	vki/vki-posixtypes-amd64-linux.h \
-	vki/vki-posixtypes-ppc32-linux.h \
-	vki/vki-posixtypes-ppc64-linux.h \
-	vki/vki-posixtypes-x86-linux.h	 \
-	vki/vki-posixtypes-arm-linux.h	 \
-	vki/vki-amd64-linux.h		\
-	vki/vki-ppc32-linux.h		\
-	vki/vki-ppc64-linux.h		\
-	vki/vki-x86-linux.h		\
-	vki/vki-arm-linux.h		\
-	vki/vki-scnums-amd64-linux.h	\
-	vki/vki-scnums-ppc32-linux.h	\
-	vki/vki-scnums-ppc64-linux.h	\
-	vki/vki-scnums-x86-linux.h	\
-	vki/vki-scnums-arm-linux.h	\
-	vki/vki-scnums-darwin.h
-
-noinst_HEADERS = \
-	vki/vki-ppc32-aix5.h		\
-	vki/vki-ppc64-aix5.h		\
-	vki/vki-scnums-aix5.h
-
-all: all-am
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign include/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-nobase_pkgincludeHEADERS: $(nobase_pkginclude_HEADERS)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)"
-	@list='$(nobase_pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \
-	$(am__nobase_list) | while read dir files; do \
-	  xfiles=; for file in $$files; do \
-	    if test -f "$$file"; then xfiles="$$xfiles $$file"; \
-	    else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \
-	  test -z "$$xfiles" || { \
-	    test "x$$dir" = x. || { \
-	      echo "$(MKDIR_P) '$(DESTDIR)$(pkgincludedir)/$$dir'"; \
-	      $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)/$$dir"; }; \
-	    echo " $(INSTALL_HEADER) $$xfiles '$(DESTDIR)$(pkgincludedir)/$$dir'"; \
-	    $(INSTALL_HEADER) $$xfiles "$(DESTDIR)$(pkgincludedir)/$$dir" || exit $$?; }; \
-	done
-
-uninstall-nobase_pkgincludeHEADERS:
-	@$(NORMAL_UNINSTALL)
-	@list='$(nobase_pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \
-	$(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \
-	test -n "$$files" || exit 0; \
-	echo " ( cd '$(DESTDIR)$(pkgincludedir)' && rm -f" $$files ")"; \
-	cd "$(DESTDIR)$(pkgincludedir)" && rm -f $$files
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(HEADERS)
-installdirs:
-	for dir in "$(DESTDIR)$(pkgincludedir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic mostlyclean-am
-
-distclean: distclean-am
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am: install-nobase_pkgincludeHEADERS
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-generic
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-nobase_pkgincludeHEADERS
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	ctags distclean distclean-generic distclean-tags distdir dvi \
-	dvi-am html html-am info info-am install install-am \
-	install-data install-data-am install-dvi install-dvi-am \
-	install-exec install-exec-am install-html install-html-am \
-	install-info install-info-am install-man \
-	install-nobase_pkgincludeHEADERS install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
-	pdf-am ps ps-am tags uninstall uninstall-am \
-	uninstall-nobase_pkgincludeHEADERS
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/main/include/pub_tool_aspacehl.h b/main/include/pub_tool_aspacehl.h
index 00f0093..6114631 100644
--- a/main/include/pub_tool_aspacehl.h
+++ b/main/include/pub_tool_aspacehl.h
@@ -7,7 +7,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2009-2010 Julian Seward
+   Copyright (C) 2009-2011 Julian Seward
       jseward@acm.org
 
    This program is free software; you can redistribute it and/or
diff --git a/main/include/pub_tool_aspacemgr.h b/main/include/pub_tool_aspacemgr.h
index 100b632..a2862c7 100644
--- a/main/include/pub_tool_aspacemgr.h
+++ b/main/include/pub_tool_aspacemgr.h
@@ -7,7 +7,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2000-2010 Julian Seward
+   Copyright (C) 2000-2011 Julian Seward
       jseward@acm.org
 
    This program is free software; you can redistribute it and/or
diff --git a/main/include/pub_tool_basics.h b/main/include/pub_tool_basics.h
index 6e92ff2..ae7bae6 100644
--- a/main/include/pub_tool_basics.h
+++ b/main/include/pub_tool_basics.h
@@ -7,7 +7,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2000-2010 Julian Seward 
+   Copyright (C) 2000-2011 Julian Seward 
       jseward@acm.org
 
    This program is free software; you can redistribute it and/or
@@ -109,9 +109,9 @@
 // - off_t is "used for file sizes".
 // At one point we were using it for memory offsets, but PtrdiffT should be
 // used in those cases.
-// Nb: on Linux and AIX, off_t is a signed word-sized int.  On Darwin it's
+// Nb: on Linux, off_t is a signed word-sized int.  On Darwin it's
 // always a signed 64-bit int.  So we defined our own Off64T as well.
-#if defined(VGO_linux) || defined(VGO_aix5)
+#if defined(VGO_linux)
 typedef Word                   OffT;      // 32             64
 #elif defined(VGO_darwin)
 typedef Long                   OffT;      // 64             64
@@ -145,20 +145,6 @@
       When _isError == True,  
          _err holds the error code.
 
-   AIX:
-      _res is the POSIX result of the syscall.
-      _err is the corresponding errno value.
-      _isError === _err==0
-
-      Unlike on Linux, it is possible for _err to be nonzero (thus an
-      error has occurred), nevertheless _res is also nonzero.  AIX
-      userspace does not appear to consistently inspect _err to
-      determine whether or not an error has occurred.  For example,
-      sys_open() will return -1 for _val if a file cannot be opened,
-      as well as the relevant errno value in _err, but AIX userspace
-      then consults _val to figure out if the syscall failed, rather
-      than looking at _err.  Hence we need to represent them both.
-
    Darwin:
       Interpretation depends on _mode:
       MACH, MDEP:
@@ -180,14 +166,6 @@
       Bool  _isError;
    }
    SysRes;
-#elif defined(VGO_aix5)
-typedef
-   struct {
-      UWord _res;
-      UWord _err;
-      Bool  _isError;
-   }
-   SysRes;
 #elif defined(VGO_darwin)
 typedef
    enum { 
@@ -231,10 +209,6 @@
               || (!sr1._isError && !sr2._isError));
 }
 
-#elif defined(VGO_aix5)
-#  error "need to define SysRes accessors on AIX5 (copy from 3.4.1 sources)"
-
-
 #elif defined(VGO_darwin)
 
 static inline Bool sr_isError ( SysRes sr ) {
@@ -292,7 +266,7 @@
 
 #if defined(VGA_x86) || defined(VGA_amd64) || defined (VGA_arm)
 #  define VG_LITTLEENDIAN 1
-#elif defined(VGA_ppc32) || defined(VGA_ppc64)
+#elif defined(VGA_ppc32) || defined(VGA_ppc64) || defined(VGA_s390x)
 #  define VG_BIGENDIAN 1
 #else
 #  error Unknown arch
@@ -302,7 +276,7 @@
 #if defined(VGA_x86)
 #  define VG_REGPARM(n)            __attribute__((regparm(n)))
 #elif defined(VGA_amd64) || defined(VGA_ppc32) \
-      || defined(VGA_ppc64) || defined(VGA_arm)
+      || defined(VGA_ppc64) || defined(VGA_arm) || defined(VGA_s390x)
 #  define VG_REGPARM(n)            /* */
 #else
 #  error Unknown arch
@@ -316,9 +290,9 @@
 #define VG_BUGS_TO "www.valgrind.org"
 
 /* Branch prediction hints. */
-#if 1 /*HAVE_BUILTIN_EXPECT*/
+#if defined(__GNUC__)
 #  define LIKELY(x)   __builtin_expect(!!(x), 1)
-#  define UNLIKELY(x) __builtin_expect((x), 0)
+#  define UNLIKELY(x) __builtin_expect(!!(x), 0)
 #else
 #  define LIKELY(x)   (x)
 #  define UNLIKELY(x) (x)
diff --git a/main/include/pub_tool_basics_asm.h b/main/include/pub_tool_basics_asm.h
index 84582af..a22be33 100644
--- a/main/include/pub_tool_basics_asm.h
+++ b/main/include/pub_tool_basics_asm.h
@@ -8,7 +8,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2000-2010 Julian Seward 
+   Copyright (C) 2000-2011 Julian Seward 
       jseward@acm.org
 
    This program is free software; you can redistribute it and/or
@@ -48,7 +48,7 @@
 
 #define VGAPPEND(str1,str2) str1##str2
  
-#if defined(VGO_linux) || defined(VGO_aix5)
+#if defined(VGO_linux)
 #  define VG_(str)    VGAPPEND( vgPlain_,          str)
 #  define ML_(str)    VGAPPEND( vgModuleLocal_,    str)
 #elif defined(VGO_darwin)
diff --git a/main/include/pub_tool_clientstate.h b/main/include/pub_tool_clientstate.h
index 81df4e5..76bf115 100644
--- a/main/include/pub_tool_clientstate.h
+++ b/main/include/pub_tool_clientstate.h
@@ -7,7 +7,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2000-2010 Julian Seward
+   Copyright (C) 2000-2011 Julian Seward
       jseward@acm.org
 
    This program is free software; you can redistribute it and/or
diff --git a/main/include/pub_tool_clreq.h b/main/include/pub_tool_clreq.h
index 33ae9bb..7643fb2 100644
--- a/main/include/pub_tool_clreq.h
+++ b/main/include/pub_tool_clreq.h
@@ -7,7 +7,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2000-2010 Julian Seward
+   Copyright (C) 2000-2011 Julian Seward
       jseward@acm.org
 
    This program is free software; you can redistribute it and/or
diff --git a/main/include/pub_tool_cpuid.h b/main/include/pub_tool_cpuid.h
index 51a7b12..1307546 100644
--- a/main/include/pub_tool_cpuid.h
+++ b/main/include/pub_tool_cpuid.h
@@ -7,7 +7,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2000-2010 Julian Seward
+   Copyright (C) 2000-2011 Julian Seward
       jseward@acm.org
 
    This program is free software; you can redistribute it and/or
@@ -34,7 +34,7 @@
 #if defined(VGA_x86) || defined(VGA_amd64)
 extern Bool VG_(has_cpuid) ( void );
 
-extern void VG_(cpuid) ( UInt eax,
+extern void VG_(cpuid) ( UInt eax, UInt ecx,
                          UInt* eax_ret, UInt* ebx_ret,
                          UInt* ecx_ret, UInt* edx_ret );
 #endif
diff --git a/main/include/pub_tool_debuginfo.h b/main/include/pub_tool_debuginfo.h
index 2259047..c0c96bf 100644
--- a/main/include/pub_tool_debuginfo.h
+++ b/main/include/pub_tool_debuginfo.h
@@ -7,7 +7,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2000-2010 Julian Seward
+   Copyright (C) 2000-2011 Julian Seward
       jseward@acm.org
 
    This program is free software; you can redistribute it and/or
@@ -202,18 +202,22 @@
 const DebugInfo* VG_(next_DebugInfo)    ( const DebugInfo *di );
 
 /* Functions for traversing all the symbols in a DebugInfo.  _howmany
-   tells how many there are.  _getidx retrieves the n'th, for n in 0
-   .. _howmany-1.  You may not modify the function name thereby
-   acquired; if you want to do so, first strdup it. */
+   tells how many symbol table entries there are.  _getidx retrieves
+   the n'th entry, for n in 0 .. _howmany-1.  You may not modify the
+   function names thereby acquired; if you want to do so, first strdup
+   them.  The primary name is returned in *pri_name, and *sec_names is
+   set either to NULL or to a NULL terminated vector containing
+   pointers to the secondary names. */
 Int  VG_(DebugInfo_syms_howmany) ( const DebugInfo *di );
 void VG_(DebugInfo_syms_getidx)  ( const DebugInfo *di, 
                                    Int idx,
-                                   /*OUT*/Addr*   avma,
-                                   /*OUT*/Addr*   tocptr,
-                                   /*OUT*/UInt*   size,
-                                   /*OUT*/HChar** name,
-                                   /*OUT*/Bool*   isText,
-                                   /*OUT*/Bool*   isIFunc );
+                                   /*OUT*/Addr*    avma,
+                                   /*OUT*/Addr*    tocptr,
+                                   /*OUT*/UInt*    size,
+                                   /*OUT*/UChar**  pri_name,
+                                   /*OUT*/UChar*** sec_names,
+                                   /*OUT*/Bool*    isText,
+                                   /*OUT*/Bool*    isIFunc );
 
 /* A simple enumeration to describe the 'kind' of various kinds of
    segments that arise from the mapping of object files. */
diff --git a/main/include/pub_tool_errormgr.h b/main/include/pub_tool_errormgr.h
index 42e6b8e..3d80ebf 100644
--- a/main/include/pub_tool_errormgr.h
+++ b/main/include/pub_tool_errormgr.h
@@ -7,7 +7,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2000-2010 Julian Seward
+   Copyright (C) 2000-2011 Julian Seward
       jseward@acm.org
 
    This program is free software; you can redistribute it and/or
diff --git a/main/include/pub_tool_execontext.h b/main/include/pub_tool_execontext.h
index 19c6d75..13df963 100644
--- a/main/include/pub_tool_execontext.h
+++ b/main/include/pub_tool_execontext.h
@@ -6,7 +6,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2000-2010 Julian Seward
+   Copyright (C) 2000-2011 Julian Seward
       jseward@acm.org
 
    This program is free software; you can redistribute it and/or
diff --git a/main/include/pub_tool_gdbserver.h b/main/include/pub_tool_gdbserver.h
new file mode 100644
index 0000000..87ba3e2
--- /dev/null
+++ b/main/include/pub_tool_gdbserver.h
@@ -0,0 +1,179 @@
+
+/*--------------------------------------------------------------------*/
+/*--- Handle remote gdb protocol.             pub_tool_gdbserver.h ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+   This file is part of Valgrind, a dynamic binary instrumentation
+   framework.
+
+   Copyright (C) 2011-2011 Philippe Waroquiers
+
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307, USA.
+
+   The GNU General Public License is contained in the file COPYING.
+*/
+
+#ifndef __PUB_TOOL_GDBSERVER_H
+#define __PUB_TOOL_GDBSERVER_H
+
+#include "libvex.h"
+#include "libvex_ir.h"
+
+//--------------------------------------------------------------------
+// PURPOSE: This module provides the support to have a gdb
+// connecting to a valgrind process using remote gdb protocol. It provides
+//  * A function to allow a tool (or the valgrind core) to
+//    wait for a gdb to connect and then handle gdb commands.
+//    Typically, this can be used to let the user debug the process
+//    when valgrind reports an error.
+//  * A function allowing to instrument the code to support gdb breakpoints.
+//  * A function allowing the tool to support watchpoints.
+//  * A utility function to help implementing the processing of the
+//    gdb_monitor_command strings.
+
+
+// Function to be used by tool or coregrind to allow a gdb to connect
+// to this process. 
+// Calling VG_(gdbserver) with tid > 0 means to let a debugger attach
+// to the valgrind process. gdbserver will report to gdb that the
+// process stopped in thread tid.
+// tid == 0 indicates to stop gdbserver and report to gdb
+// that the valgrind-ified process has exited.
+//--------------------------------------------------------------------
+extern void VG_(gdbserver) ( ThreadId tid );
+
+/* VG_(dyn_vgdb_error) gets its initial value from
+   VG_(clo_vgdb_error).  It can be changed after initial command
+   processing in order to enable/disable the call to VG_(gdbserver) in
+   m_errormgr.c.  The main reasons to change the below is either
+   because the user updates it via a monitor command or to
+   (temporarily) avoid calling gdbserver for error reporting during
+   monitor command handling.
+*/
+extern Int VG_(dyn_vgdb_error);
+
+/* defines the various kinds of breakpoints that gdbserver
+   might ask to insert/remove. Note that the below matches
+   the gdbserver protocol definition. The level of support
+   of the various breakpoint kinds depends on the tool.
+
+   For the moment, it is unclear how a tool would implement
+   hardware_breakpoint in valgrind  :).
+
+   software_breakpoint implies some (small) specific
+   instrumentation to be done for gdbserver. This instrumentation
+   is implemented for all tools in m_translate.c.
+
+   write/read/access watchpoints can only be done by tools
+   which are maintaining some notion of address accessibility
+   as part of their instrumentation. watchpoints can then
+   be done by marking the watched address(es) as not accessible.
+   But instead of giving back an error (or whatever the tool
+   wants to do with unaccessible mechanism), the tool must then
+   just call gdbserver. See memcheck for an example of reusing
+   accessibility for watchpoint support.
+*/
+typedef
+   enum {
+      software_breakpoint,
+      hardware_breakpoint,
+      write_watchpoint,
+      read_watchpoint,
+      access_watchpoint } PointKind;
+extern char* VG_(ppPointKind) (PointKind kind);
+
+
+/* watchpoint support --------------------------------------*/
+/* True if one or more bytes in [addr, addr+len[ are being watched by
+   gdbserver for write or read or access.
+   In addition, VG_(is_watched) will invoke gdbserver if
+   the access provided by the tool matches the watchpoint kind.
+   For this, the tool must pass the kind of access it has detected:
+      write_watchpoint indicates the tool has detected a write
+      read_watchpoint indicates the tool has detected a read
+      access_watchpoint indicates the tool has detected an access but does
+      not know if this is a read or a write
+*/
+extern Bool VG_(is_watched)(PointKind kind, Addr addr, Int szB);
+
+extern void VG_(needs_watchpoint) (
+   // indicates the given Addr/len is being watched (insert)
+   // or not watched anymore (! insert).
+   // gdbserver will maintain the list of watched addresses.
+   // The tool can use VG_(is_watched) to verify if an
+   // access to an Addr is in one of the watched intervals.
+   // Must return True if the watchpoint has been properly inserted or
+   // removed. False if not supported.
+   // Note that an address can only be watched for a single kind.
+   // The tool must be ready to be called successively with
+   // multiple kinds for the same addr and len and with
+   // different kinds. The last kind must replace the previous values.
+   // Behaviour with multiple watches having overlapping addr+len
+   // is undefined.
+   Bool (*watchpoint) (PointKind kind, Bool insert, Addr addr, SizeT len)
+);
+
+
+// can be used during the processing of the VG_USERREQ__GDB_MONITOR_COMMAND 
+// tool client request to output information to gdb or vgdb.
+extern UInt VG_(gdb_printf) ( const HChar *format, ... ) PRINTF_CHECK(1, 2);
+
+/* Utility functions to (e.g.) parse gdb monitor commands.
+
+   keywords is a set of keywords separated by a space
+   keyword_id will search for the keyword starting with the string input_word
+   and return its position.
+   It returns -1 if no keyword matches.
+   It returns -2 if two or more keywords are starting with input_word
+                 and none of these matches exactly input_word
+   Example with keywords = "hello world here is hell" :
+   input_word    result
+   ----------    ------
+   paradise   => -1
+   i          =>  3
+   hell       =>  4
+   hel        => -2
+   ishtar     => -1
+
+   report indicates when to output an error msg with VG_(gdb_printf).
+   kwd_report_none : no error is reported.
+   kwd_report_all : the error msg will show all possible keywords
+   kwd_report_duplicated_matches : the error msg will show only the
+     ambiguous matches.
+*/
+typedef
+   enum {
+      kwd_report_none,
+      kwd_report_all,
+      kwd_report_duplicated_matches } kwd_report_error;
+extern Int VG_(keyword_id) (Char* keywords, Char* input_word, 
+                            kwd_report_error report);
+
+/* Extract an address and (optionally) a size from the string
+   currently being parsed by strtok_r (see pub_tool_libcbase.h).
+   If no size in the string, keeps the current value of szB.
+   Returns address 0 and szB 0 if there is an error.  Reports to the
+   user problems via VG_(gdb_printf).  */
+extern void VG_(strtok_get_address_and_size) (Addr* address, 
+                                              SizeT* szB, 
+                                              Char **ssaveptr);
+
+#endif   // __PUB_TOOL_GDBSERVER_H
+
+/*--------------------------------------------------------------------*/
+/*--- end                                                          ---*/
+/*--------------------------------------------------------------------*/
diff --git a/main/include/pub_tool_hashtable.h b/main/include/pub_tool_hashtable.h
index 50c0844..d2a0d4a 100644
--- a/main/include/pub_tool_hashtable.h
+++ b/main/include/pub_tool_hashtable.h
@@ -7,7 +7,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2005-2010 Nicholas Nethercote
+   Copyright (C) 2005-2011 Nicholas Nethercote
       njn@valgrind.org
 
    This program is free software; you can redistribute it and/or
diff --git a/main/include/pub_tool_libcassert.h b/main/include/pub_tool_libcassert.h
index af92112..0aa2cb3 100644
--- a/main/include/pub_tool_libcassert.h
+++ b/main/include/pub_tool_libcassert.h
@@ -7,7 +7,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2000-2010 Julian Seward
+   Copyright (C) 2000-2011 Julian Seward
       jseward@acm.org
 
    This program is free software; you can redistribute it and/or
@@ -32,7 +32,7 @@
 #define __PUB_TOOL_LIBCBASSERT_H
 
 #define tl_assert(expr)                                                 \
-  ((void) ((expr) ? 0 :                                                 \
+  ((void) (LIKELY(expr) ? 0 :                                           \
            (VG_(assert_fail) (/*isCore?*/False, (const Char*)#expr,     \
                               (const Char*)__FILE__, __LINE__,          \
                               (const Char*)__PRETTY_FUNCTION__,         \
@@ -40,7 +40,7 @@
                               0)))
 
 #define tl_assert2(expr, format, args...)                               \
-  ((void) ((expr) ? 0 :                                                 \
+  ((void) (LIKELY(expr) ? 0 :                                           \
            (VG_(assert_fail) (/*isCore?*/False, (const Char*)#expr,     \
                               (const Char*)__FILE__, __LINE__,          \
                               (const Char*)__PRETTY_FUNCTION__,         \
diff --git a/main/include/pub_tool_libcbase.h b/main/include/pub_tool_libcbase.h
index 2897235..8034116 100644
--- a/main/include/pub_tool_libcbase.h
+++ b/main/include/pub_tool_libcbase.h
@@ -7,7 +7,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2000-2010 Julian Seward
+   Copyright (C) 2000-2011 Julian Seward
       jseward@acm.org
 
    This program is free software; you can redistribute it and/or
@@ -63,6 +63,8 @@
 // If you really want that behaviour, you can use "VG_(strtoll10)(str, NULL)".
 extern Long  VG_(strtoll10) ( Char* str, Char** endptr );
 extern Long  VG_(strtoll16) ( Char* str, Char** endptr );
+extern ULong  VG_(strtoull10) ( Char* str, Char** endptr );
+extern ULong  VG_(strtoull16) ( Char* str, Char** endptr );
 
 // Convert a string to a double.  After leading whitespace is ignored, a
 // '+' or '-' is allowed, and then it accepts a non-empty sequence of
@@ -97,6 +99,16 @@
 extern SizeT VG_(strspn)         ( const Char* s, const Char* accpt );
 extern SizeT VG_(strcspn)        ( const Char* s, const char* reject );
 
+/* strtok* functions and some parsing utilities. */
+extern Char* VG_(strtok_r)       (Char* s, const Char* delim, Char** saveptr);
+extern Char* VG_(strtok)         (Char* s, const Char* delim);
+
+/* Parse a 32- or 64-bit hex number, including leading 0x, from string
+   starting at *ppc, putting result in *result, and return True.  Or
+   fail, in which case *ppc and *result are undefined, and return
+   False. */
+extern Bool VG_(parse_Addr) ( UChar** ppc, Addr* result );
+
 /* Like strncpy(), but if 'src' is longer than 'ndest' inserts a '\0' as the
    last character. */
 extern void  VG_(strncpy_safely) ( Char* dest, const Char* src, SizeT ndest );
@@ -169,10 +181,13 @@
 extern void VG_(ssort)( void* base, SizeT nmemb, SizeT size,
                         Int (*compar)(void*, void*) );
 
-/* Returns the base-2 logarithm of x.  Returns -1 if x is not a power
-   of two.  Nb: VG_(log2)(1) == 0.  */
+/* Returns the base-2 logarithm of a 32 bit unsigned number.  Returns
+ -1 if it is not a power of two.  Nb: VG_(log2)(1) == 0. */
 extern Int VG_(log2) ( UInt x );
 
+/* Ditto for 64 bit unsigned numbers. */
+extern Int VG_(log2_64)( ULong x );
+
 // A pseudo-random number generator returning a random UInt.  If pSeed
 // is NULL, it uses its own seed, which starts at zero.  If pSeed is
 // non-NULL, it uses and updates whatever pSeed points at.
diff --git a/main/include/pub_tool_libcfile.h b/main/include/pub_tool_libcfile.h
index 5d1e85b..0acdc71 100644
--- a/main/include/pub_tool_libcfile.h
+++ b/main/include/pub_tool_libcfile.h
@@ -7,7 +7,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2000-2010 Julian Seward
+   Copyright (C) 2000-2011 Julian Seward
       jseward@acm.org
 
    This program is free software; you can redistribute it and/or
@@ -68,12 +68,16 @@
    ULong   ctime_nsec;
 };
 
+extern SysRes VG_(mknod)  ( const Char* pathname, Int mode, UWord dev );
 extern SysRes VG_(open)   ( const Char* pathname, Int flags, Int mode );
+/* fd_open words like the open(2) system call: 
+   returns fd if success, -1 otherwise */
+extern Int VG_(fd_open)  (const Char* pathname, Int flags, Int mode);
 extern void   VG_(close)  ( Int fd );
 extern Int    VG_(read)   ( Int fd, void* buf, Int count);
 extern Int    VG_(write)  ( Int fd, const void* buf, Int count);
 extern Int    VG_(pipe)   ( Int fd[2] );
-extern OffT   VG_(lseek)  ( Int fd, OffT offset, Int whence );
+extern Off64T VG_(lseek)  ( Int fd, Off64T offset, Int whence );
 extern Int    VG_(ftruncate) ( Int fd, OffT length );
 
 extern SysRes VG_(stat)   ( const Char* file_name, struct vg_stat* buf );
@@ -83,12 +87,17 @@
 extern Int    VG_(rename) ( const Char* old_name, const Char* new_name );
 extern Int    VG_(unlink) ( const Char* file_name );
 
+extern Int    VG_(poll) (struct vki_pollfd *fds, Int nfds, Int timeout);
+
 extern Int    VG_(readlink)( const Char* path, Char* buf, UInt bufsize );
 extern Int    VG_(getdents)( Int fd, struct vki_dirent *dirp, UInt count );
 
 extern Char*  VG_(basename)( const Char* path );
 extern Char*  VG_(dirname) ( const Char* path );
 
+/* Return the name of a directory for temporary files. */
+extern const HChar* VG_(tmpdir)(void);
+
 /* Copy the working directory at startup into buf[0 .. size-1], or return
    False if buf is too small. */
 extern Bool VG_(get_startup_wd) ( Char* buf, SizeT size );
diff --git a/main/include/pub_tool_libcprint.h b/main/include/pub_tool_libcprint.h
index 1621851..697bff3 100644
--- a/main/include/pub_tool_libcprint.h
+++ b/main/include/pub_tool_libcprint.h
@@ -7,7 +7,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2000-2010 Julian Seward
+   Copyright (C) 2000-2011 Julian Seward
       jseward@acm.org
 
    This program is free software; you can redistribute it and/or
@@ -86,28 +86,18 @@
 extern UInt VG_(vprintf)  ( const HChar *format, va_list vargs )
                           PRINTF_CHECK(1, 0);
 
-// The "_no_f_c" functions here are just like their non-"_no_f_c" counterparts
-// but without the PRINTF_CHECK, so they can be used with our non-standard %t
-// format specifier.
-
-// These are the same as the non "_xml" versions above, except the
-// output goes on the selected XML output channel instead of the
-// normal one.
 extern UInt VG_(printf_xml)  ( const HChar *format, ... )
                              PRINTF_CHECK(1, 2);
 
 extern UInt VG_(vprintf_xml) ( const HChar *format, va_list vargs )
                              PRINTF_CHECK(1, 0);
 
-extern UInt VG_(printf_xml_no_f_c) ( const HChar *format, ... );
-
 /* Yet another, totally general, version of vprintf, which hands all
    output bytes to CHAR_SINK, passing it OPAQUE as the second arg. */
 extern void VG_(vcbprintf)( void(*char_sink)(HChar, void* opaque),
                             void* opaque,
                             const HChar* format, va_list vargs );
 
-extern UInt VG_(message_no_f_c)( VgMsgKind kind, const HChar* format, ... );
 extern UInt VG_(message)( VgMsgKind kind, const HChar* format, ... )
    PRINTF_CHECK(2, 3);
 
diff --git a/main/include/pub_tool_libcproc.h b/main/include/pub_tool_libcproc.h
index 2770dda..190bd5a 100644
--- a/main/include/pub_tool_libcproc.h
+++ b/main/include/pub_tool_libcproc.h
@@ -7,7 +7,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2000-2010 Julian Seward
+   Copyright (C) 2000-2011 Julian Seward
       jseward@acm.org
 
    This program is free software; you can redistribute it and/or
@@ -58,11 +58,13 @@
 extern void VG_(execv)  ( Char* filename, Char** argv );
 
 /* ---------------------------------------------------------------------
-   Resource limits
+   Resource limits and capabilities
    ------------------------------------------------------------------ */
 
 extern Int VG_(getrlimit) ( Int resource, struct vki_rlimit *rlim );
 extern Int VG_(setrlimit) ( Int resource, const struct vki_rlimit *rlim );
+extern Int VG_(prctl) (Int option, 
+                       ULong arg2, ULong arg3, ULong arg4, ULong arg5);
 
 /* ---------------------------------------------------------------------
    pids, etc
diff --git a/main/include/pub_tool_libcsetjmp.h b/main/include/pub_tool_libcsetjmp.h
new file mode 100644
index 0000000..3c25365
--- /dev/null
+++ b/main/include/pub_tool_libcsetjmp.h
@@ -0,0 +1,125 @@
+
+/*--------------------------------------------------------------------*/
+/*--- A minimal setjmp/longjmp facility.     pub_tool_libcsetjmp.h ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+   This file is part of Valgrind, a dynamic binary instrumentation
+   framework.
+
+   Copyright (C) 2010-2011 Mozilla Inc
+
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307, USA.
+
+   The GNU General Public License is contained in the file COPYING.
+*/
+
+/* Contributed by Julian Seward <jseward@acm.org> */
+
+#ifndef __PUB_TOOL_LIBCSETJMP_H
+#define __PUB_TOOL_LIBCSETJMP_H
+
+//--------------------------------------------------------------------
+// PURPOSE: Provides a minimal setjmp/longjmp facility, that saves/
+// restores integer registers, but not necessarily anything more.
+//--------------------------------------------------------------------
+
+
+/* This provides an extremely minimal setjmp/longjmp facility, in
+   which only the host's integer registers are saved/restored.  Or at
+   least, that is the minimal guaranteed functionality.
+
+   Until Apr 2011 we used __builtin_setjmp and __builtin_longjmp, but
+   it appears that that is not always correctly implemented.  See
+   https://bugs.kde.org/show_bug.cgi?id=259977.  So this module wraps
+   those functions up and facilitates replacing them with our own
+   implementations where necessary.
+*/
+
+/* --- !!! --- EXTERNAL HEADERS start --- !!! --- */
+#include <setjmp.h>
+/* --- !!! --- EXTERNAL HEADERS end --- !!! --- */
+
+
+/* Don't use jmp_buf, __builtin_setjmp or __builtin_longjmp directly.
+   They don't always work reliably.  Instead use these macros, which
+   provide the opportunity to supply alternative implementations as
+   necessary.
+
+   Note that the abstraction is done with macros (ick) rather than
+   functions and typedefs, since wrapping __builtin_setjmp up in a
+   second function (eg, VG_(minimal_setjmp)) doesn't seem to work for
+   whatever reason -- returns via a VG_(minimal_longjmp) go wrong.
+
+   VG_MINIMAL_SETJMP stores the current integer register state in the
+   supplied argument, and returns zero.  VG_MINIMAL_LONGJMP resumes
+   with the previously saved state, and returns a nonzero, word-sized
+   value.  The caller must test all bits of the value in order to make
+   a zero/non-zero determination.
+*/
+
+#if defined(VGP_ppc32_linux)
+
+#define VG_MINIMAL_JMP_BUF(_name)        UInt _name [32+1+1]
+__attribute__((returns_twice))
+UWord VG_MINIMAL_SETJMP(VG_MINIMAL_JMP_BUF(_env));
+__attribute__((noreturn))
+void  VG_MINIMAL_LONGJMP(VG_MINIMAL_JMP_BUF(_env));
+
+
+#elif defined(VGP_ppc64_linux)
+
+#define VG_MINIMAL_JMP_BUF(_name)        ULong _name [32+1+1]
+__attribute__((returns_twice))
+UWord VG_MINIMAL_SETJMP(VG_MINIMAL_JMP_BUF(_env));
+__attribute__((noreturn))
+void  VG_MINIMAL_LONGJMP(VG_MINIMAL_JMP_BUF(_env));
+
+
+#elif defined(VGP_amd64_linux) || defined(VGP_amd64_darwin)
+
+#define VG_MINIMAL_JMP_BUF(_name)        ULong _name [16+1]
+__attribute__((returns_twice))
+UWord VG_MINIMAL_SETJMP(VG_MINIMAL_JMP_BUF(_env));
+__attribute__((noreturn))
+void  VG_MINIMAL_LONGJMP(VG_MINIMAL_JMP_BUF(_env));
+
+
+#elif defined(VGP_x86_linux) || defined(VGP_x86_darwin)
+
+#define VG_MINIMAL_JMP_BUF(_name)        UInt _name [8+1]
+__attribute__((returns_twice))
+__attribute__((regparm(1))) // this is critical; don't delete
+UWord VG_MINIMAL_SETJMP(VG_MINIMAL_JMP_BUF(_env));
+__attribute__((noreturn))
+__attribute__((regparm(1))) // ditto
+void  VG_MINIMAL_LONGJMP(VG_MINIMAL_JMP_BUF(_env));
+
+
+#else
+
+/* The default implementation. */
+#define VG_MINIMAL_JMP_BUF(_name) jmp_buf _name
+#define VG_MINIMAL_SETJMP(_env)   ((UWord)(__builtin_setjmp((_env))))
+#define VG_MINIMAL_LONGJMP(_env)  __builtin_longjmp((_env),1)
+
+#endif
+
+#endif   // __PUB_TOOL_LIBCSETJMP_H
+
+/*--------------------------------------------------------------------*/
+/*--- end                                    pub_tool_libcsetjmp.h ---*/
+/*--------------------------------------------------------------------*/
diff --git a/main/include/pub_tool_libcsignal.h b/main/include/pub_tool_libcsignal.h
index 025c84a..33043a0 100644
--- a/main/include/pub_tool_libcsignal.h
+++ b/main/include/pub_tool_libcsignal.h
@@ -7,7 +7,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2000-2010 Julian Seward
+   Copyright (C) 2000-2011 Julian Seward
       jseward@acm.org
 
    This program is free software; you can redistribute it and/or
diff --git a/main/include/pub_tool_machine.h b/main/include/pub_tool_machine.h
index 35b3c49..c86fff0 100644
--- a/main/include/pub_tool_machine.h
+++ b/main/include/pub_tool_machine.h
@@ -7,7 +7,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2000-2010 Julian Seward
+   Copyright (C) 2000-2011 Julian Seward
       jseward@acm.org
 
    This program is free software; you can redistribute it and/or
@@ -64,22 +64,11 @@
 #  define VG_CLREQ_SZB             20
 #  define VG_STACK_REDZONE_SZB      0
 
-#elif defined(VGP_ppc32_aix5)
-#  define VG_MIN_INSTR_SZB          4
-#  define VG_MAX_INSTR_SZB          4 
-#  define VG_CLREQ_SZB             20
-   /* The PowerOpen ABI actually says 220 bytes, but that is not an
-      8-aligned number, and frequently forces Memcheck's
-      mc_{new,die}_mem_stack_N routines into slow cases by losing
-      8-alignment of the area to be messed with.  So let's just say
-      224 instead.  Gdb has a similar kludge. */
-#  define VG_STACK_REDZONE_SZB    224
-
-#elif defined(VGP_ppc64_aix5)
-#  define VG_MIN_INSTR_SZB          4
-#  define VG_MAX_INSTR_SZB          4 
-#  define VG_CLREQ_SZB             20
-#  define VG_STACK_REDZONE_SZB    288 // is this right?
+#elif defined(VGP_s390x_linux)
+#  define VG_MIN_INSTR_SZB          2
+#  define VG_MAX_INSTR_SZB          6
+#  define VG_CLREQ_SZB             10
+#  define VG_STACK_REDZONE_SZB      0  // s390 has no redzone
 
 #elif defined(VGP_x86_darwin)
 #  define VG_MIN_INSTR_SZB          1  // min length of native instruction
diff --git a/main/include/pub_tool_mallocfree.h b/main/include/pub_tool_mallocfree.h
index 694e1f5..a71a1ff 100644
--- a/main/include/pub_tool_mallocfree.h
+++ b/main/include/pub_tool_mallocfree.h
@@ -8,7 +8,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2000-2010 Julian Seward
+   Copyright (C) 2000-2011 Julian Seward
       jseward@acm.org
 
    This program is free software; you can redistribute it and/or
diff --git a/main/include/pub_tool_options.h b/main/include/pub_tool_options.h
index 7f85492..c37c7be 100644
--- a/main/include/pub_tool_options.h
+++ b/main/include/pub_tool_options.h
@@ -7,7 +7,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2000-2010 Julian Seward
+   Copyright (C) 2000-2011 Julian Seward
       jseward@acm.org
 
    This program is free software; you can redistribute it and/or
@@ -54,6 +54,8 @@
       Char* val = &(qq_arg)[ VG_(strlen)(qq_option)+1 ]; \
       if      VG_STREQ(val, "yes") (qq_var) = True; \
       else if VG_STREQ(val, "no")  (qq_var) = False; \
+      else VG_(fmsg_bad_option)(qq_arg, "Invalid boolean value '%s'" \
+                                " (should be 'yes' or 'no')\n", val);    \
       True; \
     }) \
    )
@@ -146,6 +148,12 @@
 /* Show tool and core statistics */
 extern Bool VG_(clo_stats);
 
+/* wait for vgdb/gdb after reporting that amount of error.
+   Note that this is the initial value provided from the command line.
+   The real value is maintained in VG_(dyn_vgdb_error) and
+   can be changed dynamically.*/
+extern Int VG_(clo_vgdb_error);
+
 /* Emit all messages as XML? default: NO */
 /* If clo_xml is set, various other options are set in a non-default
    way.  See vg_main.c and mc_main.c. */
diff --git a/main/include/pub_tool_oset.h b/main/include/pub_tool_oset.h
index bc71daa..204e54b 100644
--- a/main/include/pub_tool_oset.h
+++ b/main/include/pub_tool_oset.h
@@ -7,7 +7,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2005-2010 Nicholas Nethercote
+   Copyright (C) 2005-2011 Nicholas Nethercote
       njn@valgrind.org
 
    This program is free software; you can redistribute it and/or
diff --git a/main/include/pub_tool_redir.h b/main/include/pub_tool_redir.h
index 9a23328..738f433 100644
--- a/main/include/pub_tool_redir.h
+++ b/main/include/pub_tool_redir.h
@@ -7,7 +7,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2000-2010 Julian Seward
+   Copyright (C) 2000-2011 Julian Seward
       jseward@acm.org
 
    This program is free software; you can redistribute it and/or
@@ -31,6 +31,8 @@
 #ifndef __PUB_TOOL_REDIR_H
 #define __PUB_TOOL_REDIR_H
 
+#include "config.h"           /* DARWIN_VERS */
+
 /* The following macros facilitate function replacement and wrapping.
 
    Function wrapping and function replacement are similar but not
@@ -51,6 +53,33 @@
    sure you use the VG_REPLACE_FN_ macros and not the VG_WRAP_FN_
    macros.
 
+   Finally there is the concept of prioritised behavioural equivalence
+   tags.  A tag is a 5-digit decimal number (00000 to 99999) encoded
+   in the name.  The top 4 digits are the equivalence class number,
+   and the last digit is a priority.
+
+   When processing redirections at library load time, if the set of
+   available specifications yields more than one replacement or
+   wrapper function for a given address, the system will try to
+   resolve the situation by examining the tags on the
+   replacements/wrappers.
+
+   If two replacement/wrapper functions have the same tag and
+   priority, then the redirection machinery will assume they have
+   identical behaviour and can choose between them arbitrarily.  If
+   they have the same tag but different priorities, then the one with
+   higher priority will be chosen.  If neither case holds, then the
+   redirection is ambiguous and the system will ignore one of them
+   arbitrarily, but print a warning when running at -v or above.
+
+   The tag is mandatory and must comprise 5 decimal digits.  The tag
+   00000 is special and means "does not have behaviour identical to any
+   other replacement/wrapper function".  Hence if you wish to write a
+   wrap/replacement function that is not subject to the above
+   resolution rules, use 00000 for the tag.  Tags 00001 through 00009
+   may not be used for any purpose.
+
+
    Replacement
    ~~~~~~~~~~~
    To write a replacement function, do this:
@@ -61,12 +90,16 @@
          ... body ...
       }
 
-   zEncodedSoname should be a Z-encoded soname (see below for Z-encoding
-   details) and fnname should be an unencoded fn name.  The resulting name is
+   zEncodedSoname should be a Z-encoded soname (see below for
+   Z-encoding details) and fnname should be an unencoded fn name.  A
+   default-safe equivalence tag of 00000 is assumed (see comments
+   above).  The resulting name is
 
-      _vgrZU_zEncodedSoname_fnname
+      _vgr00000ZU_zEncodedSoname_fnname
 
-   The "_vgrZU_" is a prefix that gets discarded upon decoding.
+   The "_vgr00000ZU_" is a prefix that gets discarded upon decoding.
+   It identifies this function as a replacement and specifies its
+   equivalence tag.
 
    It is also possible to write
 
@@ -80,7 +113,7 @@
    Z-encoded.  This can sometimes be necessary.  In this case the
    resulting function name is
 
-      _vgrZZ_zEncodedSoname_zEncodedFnname
+      _vgr00000ZZ_zEncodedSoname_zEncodedFnname
 
    When it sees this either such name, the core's symbol-table reading
    machinery and redirection machinery first Z-decode the soname and 
@@ -112,6 +145,16 @@
    underscores, since the intercept-handlers in m_redir.c detect the
    end of the soname by looking for the first trailing underscore.
 
+   To write function names which explicitly state the equivalence class
+   tag, use
+     VG_REPLACE_FUNCTION_EZU(5-digit-tag,zEncodedSoname,fnname)
+   or
+     VG_REPLACE_FUNCTION_EZZ(5-digit-tag,zEncodedSoname,zEncodedFnname)
+
+   As per comments above, the tag must be a 5 digit decimal number,
+   padded with leading zeroes, in the range 00010 to 99999 inclusive.
+
+
    Wrapping
    ~~~~~~~~
    This is identical to replacement, except that you should use the
@@ -119,6 +162,8 @@
 
       VG_WRAP_FUNCTION_ZU
       VG_WRAP_FUNCTION_ZZ
+      VG_WRAP_FUNCTION_EZU
+      VG_WRAP_FUNCTION_EZZ
 
    instead.
 
@@ -153,11 +198,34 @@
    args are fully macro-expanded before pasting them together. */
 #define VG_CONCAT4(_aa,_bb,_cc,_dd) _aa##_bb##_cc##_dd
 
-#define VG_REPLACE_FUNCTION_ZU(soname,fnname) VG_CONCAT4(_vgrZU_,soname,_,fnname)
-#define VG_REPLACE_FUNCTION_ZZ(soname,fnname) VG_CONCAT4(_vgrZZ_,soname,_,fnname)
+#define VG_CONCAT6(_aa,_bb,_cc,_dd,_ee,_ff) _aa##_bb##_cc##_dd##_ee##_ff
 
-#define VG_WRAP_FUNCTION_ZU(soname,fnname) VG_CONCAT4(_vgwZU_,soname,_,fnname)
-#define VG_WRAP_FUNCTION_ZZ(soname,fnname) VG_CONCAT4(_vgwZZ_,soname,_,fnname)
+/* The 4 basic macros. */
+#define VG_REPLACE_FUNCTION_EZU(_eclasstag,_soname,_fnname) \
+   VG_CONCAT6(_vgr,_eclasstag,ZU_,_soname,_,_fnname)
+
+#define VG_REPLACE_FUNCTION_EZZ(_eclasstag,_soname,_fnname) \
+   VG_CONCAT6(_vgr,_eclasstag,ZZ_,_soname,_,_fnname)
+
+#define VG_WRAP_FUNCTION_EZU(_eclasstag,_soname,_fnname) \
+   VG_CONCAT6(_vgw,_eclasstag,ZU_,_soname,_,_fnname)
+
+#define VG_WRAP_FUNCTION_EZZ(_eclasstag,_soname,_fnname) \
+   VG_CONCAT6(_vgw,_eclasstag,ZZ_,_soname,_,_fnname)
+
+/* Convenience macros defined in terms of the above 4. */
+#define VG_REPLACE_FUNCTION_ZU(_soname,_fnname) \
+   VG_CONCAT6(_vgr,00000,ZU_,_soname,_,_fnname)
+
+#define VG_REPLACE_FUNCTION_ZZ(_soname,_fnname) \
+   VG_CONCAT6(_vgr,00000,ZZ_,_soname,_,_fnname)
+
+#define VG_WRAP_FUNCTION_ZU(_soname,_fnname) \
+   VG_CONCAT6(_vgw,00000,ZU_,_soname,_,_fnname)
+
+#define VG_WRAP_FUNCTION_ZZ(_soname,_fnname) \
+   VG_CONCAT6(_vgw,00000,ZZ_,_soname,_,_fnname)
+
 
 /* --------- Some handy Z-encoded names. --------- */
 
@@ -174,15 +242,16 @@
 
 #if defined(VGO_linux)
 #  define  VG_Z_LIBC_SONAME  libcZdsoZa              // libc.so*
-#elif defined(VGP_ppc32_aix5)
-   /* AIX has both /usr/lib/libc.a and /usr/lib/libc_r.a. */
-#  define  VG_Z_LIBC_SONAME  libcZaZdaZLshrZdoZR     // libc*.a(shr.o)
-#elif defined(VGP_ppc64_aix5)
-#  define  VG_Z_LIBC_SONAME  libcZaZdaZLshrZu64ZdoZR // libc*.a(shr_64.o)
-#elif defined(VGO_darwin)
+
+#elif defined(VGO_darwin) && (DARWIN_VERS <= DARWIN_10_6)
 #  define  VG_Z_LIBC_SONAME  libSystemZdZaZddylib    // libSystem.*.dylib
+
+#elif defined(VGO_darwin) && (DARWIN_VERS == DARWIN_10_7)
+#  define  VG_Z_LIBC_SONAME  libsystemZucZaZddylib   // libsystem_c*.dylib
+
 #else
 #  error "Unknown platform"
+
 #endif
 
 /* --- Soname of the GNU C++ library. --- */
@@ -190,22 +259,9 @@
 // Valid on all platforms(?)
 #define  VG_Z_LIBSTDCXX_SONAME  libstdcZpZpZa           // libstdc++*
 
-/* --- Soname of XLC's C++ library. --- */
-
-/* AIX: xlC's C++ runtime library is called libC.a, and the
-   interesting symbols appear to be in ansicore_32.o or ansicore_64.o
-   respectively. */
-#if defined(VGP_ppc32_aix5)
-#  define  VG_Z_LIBC_DOT_A   libCZdaZLansicoreZu32ZdoZR // libC.a(ansicore_32.o)
-#elif defined(VGP_ppc64_aix5)
-#  define  VG_Z_LIBC_DOT_A   libCZdaZLansicoreZu64ZdoZR // libC.a(ansicore_64.o)
-#endif
-
 /* --- Soname of the pthreads library. --- */
 
-#if defined(ANDROID)
-#  define  VG_Z_LIBPTHREAD_SONAME  libcZdsoZa            // libc.so*
-#elif defined(VGO_linux) || defined(VGO_aix5)
+#if defined(VGO_linux)
 #  define  VG_Z_LIBPTHREAD_SONAME  libpthreadZdsoZd0     // libpthread.so.0
 #elif defined(VGO_darwin)
 #  define  VG_Z_LIBPTHREAD_SONAME  libSystemZdZaZddylib  // libSystem.*.dylib
diff --git a/main/include/pub_tool_replacemalloc.h b/main/include/pub_tool_replacemalloc.h
index 7db215d..1f07ac4 100644
--- a/main/include/pub_tool_replacemalloc.h
+++ b/main/include/pub_tool_replacemalloc.h
@@ -7,7 +7,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2000-2010 Julian Seward
+   Copyright (C) 2000-2011 Julian Seward
       jseward@acm.org
 
    This program is free software; you can redistribute it and/or
diff --git a/main/include/pub_tool_seqmatch.h b/main/include/pub_tool_seqmatch.h
index acce3be..cb025ec 100644
--- a/main/include/pub_tool_seqmatch.h
+++ b/main/include/pub_tool_seqmatch.h
@@ -8,7 +8,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2008-2010 OpenWorks Ltd
+   Copyright (C) 2008-2011 OpenWorks Ltd
       info@open-works.co.uk
 
    This program is free software; you can redistribute it and/or
diff --git a/main/include/pub_tool_signals.h b/main/include/pub_tool_signals.h
index 3ffefd5..0596315 100644
--- a/main/include/pub_tool_signals.h
+++ b/main/include/pub_tool_signals.h
@@ -7,7 +7,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2000-2010 Julian Seward
+   Copyright (C) 2000-2011 Julian Seward
       jseward@acm.org
 
    This program is free software; you can redistribute it and/or
diff --git a/main/include/pub_tool_sparsewa.h b/main/include/pub_tool_sparsewa.h
index d037043..5505a50 100644
--- a/main/include/pub_tool_sparsewa.h
+++ b/main/include/pub_tool_sparsewa.h
@@ -8,7 +8,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2008-2010 OpenWorks Ltd
+   Copyright (C) 2008-2011 OpenWorks Ltd
       info@open-works.co.uk
 
    This program is free software; you can redistribute it and/or
diff --git a/main/include/pub_tool_stacktrace.h b/main/include/pub_tool_stacktrace.h
index d22a824..fef6865 100644
--- a/main/include/pub_tool_stacktrace.h
+++ b/main/include/pub_tool_stacktrace.h
@@ -7,7 +7,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2000-2010 Julian Seward
+   Copyright (C) 2000-2011 Julian Seward
       jseward@acm.org
 
    This program is free software; you can redistribute it and/or
diff --git a/main/include/pub_tool_threadstate.h b/main/include/pub_tool_threadstate.h
index 1c15e4d..8fc3369 100644
--- a/main/include/pub_tool_threadstate.h
+++ b/main/include/pub_tool_threadstate.h
@@ -7,7 +7,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2000-2010 Julian Seward
+   Copyright (C) 2000-2011 Julian Seward
       jseward@acm.org
 
    This program is free software; you can redistribute it and/or
diff --git a/main/include/pub_tool_tooliface.h b/main/include/pub_tool_tooliface.h
index a752a21..da521c4 100644
--- a/main/include/pub_tool_tooliface.h
+++ b/main/include/pub_tool_tooliface.h
@@ -7,7 +7,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2000-2010 Julian Seward
+   Copyright (C) 2000-2011 Julian Seward
       jseward@acm.org
 
    This program is free software; you can redistribute it and/or
diff --git a/main/include/pub_tool_vki.h b/main/include/pub_tool_vki.h
index 73a4174..921c159 100644
--- a/main/include/pub_tool_vki.h
+++ b/main/include/pub_tool_vki.h
@@ -8,11 +8,11 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2000-2010 Julian Seward
+   Copyright (C) 2000-2011 Julian Seward
       jseward@acm.org
-   Copyright (C) 2005-2010 Nicholas Nethercote
+   Copyright (C) 2005-2011 Nicholas Nethercote
       njn@valgrind.org
-   Copyright (C) 2006-2010 OpenWorks LLP
+   Copyright (C) 2006-2011 OpenWorks LLP
       info@open-works.co.uk
 
    This program is free software; you can redistribute it and/or
@@ -47,10 +47,6 @@
 
 #if defined(VGO_linux)
 #  include "vki/vki-linux.h"
-#elif defined(VGP_ppc32_aix5)
-#  include "vki/vki-ppc32-aix5.h"
-#elif defined(VGP_ppc64_aix5)
-#  include "vki/vki-ppc64-aix5.h"
 #elif defined(VGO_darwin)
 #  include "vki/vki-darwin.h"
 #else
diff --git a/main/include/pub_tool_vkiscnums.h b/main/include/pub_tool_vkiscnums.h
index b8b5e88..4303d17 100644
--- a/main/include/pub_tool_vkiscnums.h
+++ b/main/include/pub_tool_vkiscnums.h
@@ -7,9 +7,9 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2005-2010 Nicholas Nethercote
+   Copyright (C) 2005-2011 Nicholas Nethercote
       njn@valgrind.org
-   Copyright (C) 2006-2010 OpenWorks LLP
+   Copyright (C) 2006-2011 OpenWorks LLP
       info@open-works.co.uk
 
    This program is free software; you can redistribute it and/or
@@ -37,7 +37,7 @@
 
 
 // This converts a syscall number into a string, suitable for printing.  It is
-// needed because some platforms (AIX, Darwin) munge sysnums in various ways.
+// needed because some platforms (Darwin) munge sysnums in various ways.
 // It is used in places where the sycall name will be printed alongside.
 extern Char* VG_(sysnum_string)      (Word sysnum, SizeT n_buf, Char* buf);
 
@@ -53,21 +53,6 @@
    ({ Char qq_zz_buf[64]; VG_(sysnum_string_extra)(sysnum, 64, qq_zz_buf); })
 
 
-#if defined(VGO_linux)
-   // Nothing.
-
-#elif defined(VGO_aix5)
-   // See the AIX5-specific case in pub_tool_vkiscnums_asm.h for an
-   // explanation of why we include this here rather than there.
-#  include "vki/vki-scnums-aix5.h"
-
-#elif defined(VGO_darwin)
-   // Nothing.
-
-#else
-#  error Unknown OS
-#endif
-
 #endif   // __PUB_TOOL_VKISCNUMS_H
 
 /*--------------------------------------------------------------------*/
diff --git a/main/include/pub_tool_vkiscnums_asm.h b/main/include/pub_tool_vkiscnums_asm.h
index bd8d497..018cb19 100644
--- a/main/include/pub_tool_vkiscnums_asm.h
+++ b/main/include/pub_tool_vkiscnums_asm.h
@@ -7,9 +7,9 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2005-2010 Nicholas Nethercote
+   Copyright (C) 2005-2011 Nicholas Nethercote
       njn@valgrind.org
-   Copyright (C) 2006-2010 OpenWorks LLP
+   Copyright (C) 2006-2011 OpenWorks LLP
       info@open-works.co.uk
 
    This program is free software; you can redistribute it and/or
@@ -45,15 +45,12 @@
 #elif defined(VGP_ppc64_linux)
 #  include "vki/vki-scnums-ppc64-linux.h"
 
+#elif defined(VGP_s390x_linux)
+#  include "vki/vki-scnums-s390x-linux.h"
+
 #elif defined(VGP_arm_linux)
 #  include "vki/vki-scnums-arm-linux.h"
 
-#elif defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5)
-   // Nothing:  vki-scnums-aix5.h only contains stuff suitable for inclusion
-   // in C files, not asm files.  So unlike all the other
-   // vki-scnums-PLATFORM.h files, we include it in pub_tool_vkiscnums.h
-   // rather than in include/pub_tool_vkiscnums_asm.h.
-
 #elif defined(VGP_x86_darwin) || defined(VGP_amd64_darwin)
 #  include "vki/vki-scnums-darwin.h"
 
diff --git a/main/include/pub_tool_wordfm.h b/main/include/pub_tool_wordfm.h
index 77027ad..bdc325b 100644
--- a/main/include/pub_tool_wordfm.h
+++ b/main/include/pub_tool_wordfm.h
@@ -9,13 +9,13 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2007-2010 Julian Seward
+   Copyright (C) 2007-2011 Julian Seward
       jseward@acm.org
 
    This code is based on previous work by Nicholas Nethercote
    (coregrind/m_oset.c) which is
 
-   Copyright (C) 2005-2010 Nicholas Nethercote
+   Copyright (C) 2005-2011 Nicholas Nethercote
        njn@valgrind.org
 
    which in turn was derived partially from:
diff --git a/main/include/pub_tool_xarray.h b/main/include/pub_tool_xarray.h
index cd1b02e..9b69987 100644
--- a/main/include/pub_tool_xarray.h
+++ b/main/include/pub_tool_xarray.h
@@ -7,7 +7,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2007-2010 OpenWorks LLP
+   Copyright (C) 2007-2011 OpenWorks LLP
       info@open-works.co.uk
 
    This program is free software; you can redistribute it and/or
@@ -79,8 +79,8 @@
 /* Lookup (by binary search) 'key' in the array.  Set *first to be the
    index of the first, and *last to be the index of the last matching
    value found.  If any values are found, return True, else return
-   False, and don't change *first or *last.  Bomb if the array is not
-   sorted. */
+   False, and don't change *first or *last.  first and/or last may be
+   NULL.  Bomb if the array is not sorted. */
 extern Bool VG_(lookupXA) ( XArray*, void* key, 
                             /*OUT*/Word* first, /*OUT*/Word* last );
 
@@ -138,15 +138,10 @@
 /* Convenience function: printf into an XArray of HChar, adding stuff
    at the end.  This is very convenient for concocting arbitrary
    length printf output in an XArray.  Note that the resulting string
-   is NOT zero-terminated.  Versions are provided with and without a
-   format check, the latter so the unknown (to gcc) "%t" can be used
-   without gcc complaining. */
+   is NOT zero-terminated. */
 extern void VG_(xaprintf)( XArray* dst, const HChar* format, ... )
                          PRINTF_CHECK(2, 3);
 
-extern void VG_(xaprintf_no_f_c)
-                         ( XArray* dst, const HChar* format, ... );
-
 #endif   // __PUB_TOOL_XARRAY_H
 
 /*--------------------------------------------------------------------*/
diff --git a/main/include/valgrind.h b/main/include/valgrind.h
index 0bae0aa..222a58e 100644
--- a/main/include/valgrind.h
+++ b/main/include/valgrind.h
@@ -12,7 +12,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2000-2010 Julian Seward.  All rights reserved.
+   Copyright (C) 2000-2011 Julian Seward.  All rights reserved.
 
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
@@ -108,8 +108,6 @@
    Misc note: how to find out what's predefined in gcc by default:
    gcc -Wp,-dM somefile.c
 */
-#undef PLAT_ppc64_aix5
-#undef PLAT_ppc32_aix5
 #undef PLAT_x86_darwin
 #undef PLAT_amd64_darwin
 #undef PLAT_x86_win32
@@ -118,16 +116,15 @@
 #undef PLAT_ppc32_linux
 #undef PLAT_ppc64_linux
 #undef PLAT_arm_linux
+#undef PLAT_s390x_linux
 
-#if defined(_AIX) && defined(__64BIT__)
-#  define PLAT_ppc64_aix5 1
-#elif defined(_AIX) && !defined(__64BIT__)
-#  define PLAT_ppc32_aix5 1
-#elif defined(__APPLE__) && defined(__i386__)
+
+#if defined(__APPLE__) && defined(__i386__)
 #  define PLAT_x86_darwin 1
 #elif defined(__APPLE__) && defined(__x86_64__)
 #  define PLAT_amd64_darwin 1
-#elif defined(__MINGW32__) || defined(__CYGWIN32__) || defined(_WIN32) && defined(_M_IX86)
+#elif defined(__MINGW32__) || defined(__CYGWIN32__) \
+      || (defined(_WIN32) && defined(_M_IX86))
 #  define PLAT_x86_win32 1
 #elif defined(__linux__) && defined(__i386__)
 #  define PLAT_x86_linux 1
@@ -139,6 +136,8 @@
 #  define PLAT_ppc64_linux 1
 #elif defined(__linux__) && defined(__arm__)
 #  define PLAT_arm_linux 1
+#elif defined(__linux__) && defined(__s390__) && defined(__s390x__)
+#  define PLAT_s390x_linux 1
 #else
 /* If we're not compiling for our target platform, don't generate
    any inline asms.  */
@@ -153,17 +152,41 @@
 /* in here of use to end-users -- skip to the next section.           */
 /* ------------------------------------------------------------------ */
 
+/*
+ * VALGRIND_DO_CLIENT_REQUEST(): a statement that invokes a Valgrind client
+ * request. Accepts both pointers and integers as arguments.
+ *
+ * VALGRIND_DO_CLIENT_REQUEST_STMT(): a statement that invokes a Valgrind
+ * client request that does not return a value.
+
+ * VALGRIND_DO_CLIENT_REQUEST_EXPR(): a C expression that invokes a Valgrind
+ * client request and whose value equals the client request result.  Accepts
+ * both pointers and integers as arguments.  Note that such calls are not
+ * necessarily pure functions -- they may have side effects.
+ */
+
+#define VALGRIND_DO_CLIENT_REQUEST(_zzq_rlval, _zzq_default,            \
+                                   _zzq_request, _zzq_arg1, _zzq_arg2,  \
+                                   _zzq_arg3, _zzq_arg4, _zzq_arg5)     \
+  do { (_zzq_rlval) = VALGRIND_DO_CLIENT_REQUEST_EXPR((_zzq_default),   \
+                        (_zzq_request), (_zzq_arg1), (_zzq_arg2),       \
+                        (_zzq_arg3), (_zzq_arg4), (_zzq_arg5)); } while (0)
+
+#define VALGRIND_DO_CLIENT_REQUEST_STMT(_zzq_request, _zzq_arg1,        \
+                           _zzq_arg2,  _zzq_arg3, _zzq_arg4, _zzq_arg5) \
+  do { (void) VALGRIND_DO_CLIENT_REQUEST_EXPR(0,                        \
+                    (_zzq_request), (_zzq_arg1), (_zzq_arg2),           \
+                    (_zzq_arg3), (_zzq_arg4), (_zzq_arg5)); } while (0)
+
 #if defined(NVALGRIND)
 
 /* Define NVALGRIND to completely remove the Valgrind magic sequence
    from the compiled code (analogous to NDEBUG's effects on
    assert()) */
-#define VALGRIND_DO_CLIENT_REQUEST(                               \
-        _zzq_rlval, _zzq_default, _zzq_request,                   \
+#define VALGRIND_DO_CLIENT_REQUEST_EXPR(                          \
+        _zzq_default, _zzq_request,                               \
         _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5)    \
-   {                                                              \
-      (_zzq_rlval) = (_zzq_default);                              \
-   }
+      (_zzq_default)
 
 #else  /* ! NVALGRIND */
 
@@ -217,10 +240,11 @@
                      "roll $3,  %%edi ; roll $13, %%edi\n\t"      \
                      "roll $29, %%edi ; roll $19, %%edi\n\t"
 
-#define VALGRIND_DO_CLIENT_REQUEST(                               \
-        _zzq_rlval, _zzq_default, _zzq_request,                   \
+#define VALGRIND_DO_CLIENT_REQUEST_EXPR(                          \
+        _zzq_default, _zzq_request,                               \
         _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5)    \
-  { volatile unsigned int _zzq_args[6];                           \
+  __extension__                                                   \
+  ({volatile unsigned int _zzq_args[6];                           \
     volatile unsigned int _zzq_result;                            \
     _zzq_args[0] = (unsigned int)(_zzq_request);                  \
     _zzq_args[1] = (unsigned int)(_zzq_arg1);                     \
@@ -235,8 +259,8 @@
                      : "a" (&_zzq_args[0]), "0" (_zzq_default)    \
                      : "cc", "memory"                             \
                     );                                            \
-    _zzq_rlval = _zzq_result;                                     \
-  }
+    _zzq_result;                                                  \
+  })
 
 #define VALGRIND_GET_NR_CONTEXT(_zzq_rlval)                       \
   { volatile OrigFn* _zzq_orig = &(_zzq_rlval);                   \
@@ -273,25 +297,36 @@
                      __asm rol edi, 3  __asm rol edi, 13          \
                      __asm rol edi, 29 __asm rol edi, 19
 
-#define VALGRIND_DO_CLIENT_REQUEST(                               \
-        _zzq_rlval, _zzq_default, _zzq_request,                   \
+#define VALGRIND_DO_CLIENT_REQUEST_EXPR(                          \
+        _zzq_default, _zzq_request,                               \
         _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5)    \
-  { volatile uintptr_t _zzq_args[6];                              \
-    volatile unsigned int _zzq_result;                            \
-    _zzq_args[0] = (uintptr_t)(_zzq_request);                     \
-    _zzq_args[1] = (uintptr_t)(_zzq_arg1);                        \
-    _zzq_args[2] = (uintptr_t)(_zzq_arg2);                        \
-    _zzq_args[3] = (uintptr_t)(_zzq_arg3);                        \
-    _zzq_args[4] = (uintptr_t)(_zzq_arg4);                        \
-    _zzq_args[5] = (uintptr_t)(_zzq_arg5);                        \
-    __asm { __asm lea eax, _zzq_args __asm mov edx, _zzq_default  \
-            __SPECIAL_INSTRUCTION_PREAMBLE                        \
-            /* %EDX = client_request ( %EAX ) */                  \
-            __asm xchg ebx,ebx                                    \
-            __asm mov _zzq_result, edx                            \
-    }                                                             \
-    _zzq_rlval = _zzq_result;                                     \
-  }
+    valgrind_do_client_request_expr((uintptr_t)(_zzq_default),    \
+        (uintptr_t)(_zzq_request), (uintptr_t)(_zzq_arg1),        \
+        (uintptr_t)(_zzq_arg2), (uintptr_t)(_zzq_arg3),           \
+        (uintptr_t)(_zzq_arg4), (uintptr_t)(_zzq_arg5))
+
+static __inline uintptr_t
+valgrind_do_client_request_expr(uintptr_t _zzq_default, uintptr_t _zzq_request,
+                                uintptr_t _zzq_arg1, uintptr_t _zzq_arg2,
+                                uintptr_t _zzq_arg3, uintptr_t _zzq_arg4,
+                                uintptr_t _zzq_arg5)
+{
+    volatile uintptr_t _zzq_args[6];
+    volatile unsigned int _zzq_result;
+    _zzq_args[0] = (uintptr_t)(_zzq_request);
+    _zzq_args[1] = (uintptr_t)(_zzq_arg1);
+    _zzq_args[2] = (uintptr_t)(_zzq_arg2);
+    _zzq_args[3] = (uintptr_t)(_zzq_arg3);
+    _zzq_args[4] = (uintptr_t)(_zzq_arg4);
+    _zzq_args[5] = (uintptr_t)(_zzq_arg5);
+    __asm { __asm lea eax, _zzq_args __asm mov edx, _zzq_default
+            __SPECIAL_INSTRUCTION_PREAMBLE
+            /* %EDX = client_request ( %EAX ) */
+            __asm xchg ebx,ebx
+            __asm mov _zzq_result, edx
+    }
+    return _zzq_result;
+}
 
 #define VALGRIND_GET_NR_CONTEXT(_zzq_rlval)                       \
   { volatile OrigFn* _zzq_orig = &(_zzq_rlval);                   \
@@ -326,10 +361,11 @@
                      "rolq $3,  %%rdi ; rolq $13, %%rdi\n\t"      \
                      "rolq $61, %%rdi ; rolq $51, %%rdi\n\t"
 
-#define VALGRIND_DO_CLIENT_REQUEST(                               \
-        _zzq_rlval, _zzq_default, _zzq_request,                   \
+#define VALGRIND_DO_CLIENT_REQUEST_EXPR(                          \
+        _zzq_default, _zzq_request,                               \
         _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5)    \
-  { volatile unsigned long long int _zzq_args[6];                 \
+    __extension__                                                 \
+    ({ volatile unsigned long long int _zzq_args[6];              \
     volatile unsigned long long int _zzq_result;                  \
     _zzq_args[0] = (unsigned long long int)(_zzq_request);        \
     _zzq_args[1] = (unsigned long long int)(_zzq_arg1);           \
@@ -344,8 +380,8 @@
                      : "a" (&_zzq_args[0]), "0" (_zzq_default)    \
                      : "cc", "memory"                             \
                     );                                            \
-    _zzq_rlval = _zzq_result;                                     \
-  }
+    _zzq_result;                                                  \
+    })
 
 #define VALGRIND_GET_NR_CONTEXT(_zzq_rlval)                       \
   { volatile OrigFn* _zzq_orig = &(_zzq_rlval);                   \
@@ -380,11 +416,12 @@
                      "rlwinm 0,0,3,0,0  ; rlwinm 0,0,13,0,0\n\t"  \
                      "rlwinm 0,0,29,0,0 ; rlwinm 0,0,19,0,0\n\t"
 
-#define VALGRIND_DO_CLIENT_REQUEST(                               \
-        _zzq_rlval, _zzq_default, _zzq_request,                   \
+#define VALGRIND_DO_CLIENT_REQUEST_EXPR(                          \
+        _zzq_default, _zzq_request,                               \
         _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5)    \
                                                                   \
-  {          unsigned int  _zzq_args[6];                          \
+    __extension__                                                 \
+  ({         unsigned int  _zzq_args[6];                          \
              unsigned int  _zzq_result;                           \
              unsigned int* _zzq_ptr;                              \
     _zzq_args[0] = (unsigned int)(_zzq_request);                  \
@@ -403,8 +440,8 @@
                      : "=b" (_zzq_result)                         \
                      : "b" (_zzq_default), "b" (_zzq_ptr)         \
                      : "cc", "memory", "r3", "r4");               \
-    _zzq_rlval = _zzq_result;                                     \
-  }
+    _zzq_result;                                                  \
+    })
 
 #define VALGRIND_GET_NR_CONTEXT(_zzq_rlval)                       \
   { volatile OrigFn* _zzq_orig = &(_zzq_rlval);                   \
@@ -441,13 +478,14 @@
                      "rotldi 0,0,3  ; rotldi 0,0,13\n\t"          \
                      "rotldi 0,0,61 ; rotldi 0,0,51\n\t"
 
-#define VALGRIND_DO_CLIENT_REQUEST(                               \
-        _zzq_rlval, _zzq_default, _zzq_request,                   \
+#define VALGRIND_DO_CLIENT_REQUEST_EXPR(                          \
+        _zzq_default, _zzq_request,                               \
         _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5)    \
                                                                   \
-  {          unsigned long long int  _zzq_args[6];                \
-    register unsigned long long int  _zzq_result __asm__("r3");   \
-    register unsigned long long int* _zzq_ptr __asm__("r4");      \
+  __extension__                                                   \
+  ({         unsigned long long int  _zzq_args[6];                \
+             unsigned long long int  _zzq_result;                 \
+             unsigned long long int* _zzq_ptr;                    \
     _zzq_args[0] = (unsigned long long int)(_zzq_request);        \
     _zzq_args[1] = (unsigned long long int)(_zzq_arg1);           \
     _zzq_args[2] = (unsigned long long int)(_zzq_arg2);           \
@@ -455,32 +493,37 @@
     _zzq_args[4] = (unsigned long long int)(_zzq_arg4);           \
     _zzq_args[5] = (unsigned long long int)(_zzq_arg5);           \
     _zzq_ptr = _zzq_args;                                         \
-    __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE               \
+    __asm__ volatile("mr 3,%1\n\t" /*default*/                    \
+                     "mr 4,%2\n\t" /*ptr*/                        \
+                     __SPECIAL_INSTRUCTION_PREAMBLE               \
                      /* %R3 = client_request ( %R4 ) */           \
-                     "or 1,1,1"                                   \
-                     : "=r" (_zzq_result)                         \
-                     : "0" (_zzq_default), "r" (_zzq_ptr)         \
-                     : "cc", "memory");                           \
-    _zzq_rlval = _zzq_result;                                     \
-  }
+                     "or 1,1,1\n\t"                               \
+                     "mr %0,3"     /*result*/                     \
+                     : "=b" (_zzq_result)                         \
+                     : "b" (_zzq_default), "b" (_zzq_ptr)         \
+                     : "cc", "memory", "r3", "r4");               \
+    _zzq_result;                                                  \
+  })
 
 #define VALGRIND_GET_NR_CONTEXT(_zzq_rlval)                       \
   { volatile OrigFn* _zzq_orig = &(_zzq_rlval);                   \
-    register unsigned long long int __addr __asm__("r3");         \
+    unsigned long long int __addr;                                \
     __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE               \
                      /* %R3 = guest_NRADDR */                     \
-                     "or 2,2,2"                                   \
-                     : "=r" (__addr)                              \
+                     "or 2,2,2\n\t"                               \
+                     "mr %0,3"                                    \
+                     : "=b" (__addr)                              \
                      :                                            \
-                     : "cc", "memory"                             \
+                     : "cc", "memory", "r3"                       \
                     );                                            \
     _zzq_orig->nraddr = __addr;                                   \
     __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE               \
                      /* %R3 = guest_NRADDR_GPR2 */                \
-                     "or 4,4,4"                                   \
-                     : "=r" (__addr)                              \
+                     "or 4,4,4\n\t"                               \
+                     "mr %0,3"                                    \
+                     : "=b" (__addr)                              \
                      :                                            \
-                     : "cc", "memory"                             \
+                     : "cc", "memory", "r3"                       \
                     );                                            \
     _zzq_orig->r2 = __addr;                                       \
   }
@@ -506,11 +549,12 @@
             "mov r12, r12, ror #3  ; mov r12, r12, ror #13 \n\t"  \
             "mov r12, r12, ror #29 ; mov r12, r12, ror #19 \n\t"
 
-#define VALGRIND_DO_CLIENT_REQUEST(                               \
-        _zzq_rlval, _zzq_default, _zzq_request,                   \
+#define VALGRIND_DO_CLIENT_REQUEST_EXPR(                          \
+        _zzq_default, _zzq_request,                               \
         _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5)    \
                                                                   \
-  { volatile unsigned int  _zzq_args[6];                          \
+  __extension__                                                   \
+  ({volatile unsigned int  _zzq_args[6];                          \
     volatile unsigned int  _zzq_result;                           \
     _zzq_args[0] = (unsigned int)(_zzq_request);                  \
     _zzq_args[1] = (unsigned int)(_zzq_arg1);                     \
@@ -527,8 +571,8 @@
                      : "=r" (_zzq_result)                         \
                      : "r" (_zzq_default), "r" (&_zzq_args[0])    \
                      : "cc","memory", "r3", "r4");                \
-    _zzq_rlval = _zzq_result;                                     \
-  }
+    _zzq_result;                                                  \
+  })
 
 #define VALGRIND_GET_NR_CONTEXT(_zzq_rlval)                       \
   { volatile OrigFn* _zzq_orig = &(_zzq_rlval);                   \
@@ -551,149 +595,75 @@
 
 #endif /* PLAT_arm_linux */
 
-/* ------------------------ ppc32-aix5 ------------------------- */
+/* ------------------------ s390x-linux ------------------------ */
 
-#if defined(PLAT_ppc32_aix5)
+#if defined(PLAT_s390x_linux)
 
 typedef
-   struct { 
-      unsigned int nraddr; /* where's the code? */
-      unsigned int r2;  /* what tocptr do we need? */
-   }
-   OrigFn;
-
-#define __SPECIAL_INSTRUCTION_PREAMBLE                            \
-                     "rlwinm 0,0,3,0,0  ; rlwinm 0,0,13,0,0\n\t"  \
-                     "rlwinm 0,0,29,0,0 ; rlwinm 0,0,19,0,0\n\t"
-
-#define VALGRIND_DO_CLIENT_REQUEST(                               \
-        _zzq_rlval, _zzq_default, _zzq_request,                   \
-        _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5)    \
-                                                                  \
-  {          unsigned int  _zzq_args[7];                          \
-    register unsigned int  _zzq_result;                           \
-    register unsigned int* _zzq_ptr;                              \
-    _zzq_args[0] = (unsigned int)(_zzq_request);                  \
-    _zzq_args[1] = (unsigned int)(_zzq_arg1);                     \
-    _zzq_args[2] = (unsigned int)(_zzq_arg2);                     \
-    _zzq_args[3] = (unsigned int)(_zzq_arg3);                     \
-    _zzq_args[4] = (unsigned int)(_zzq_arg4);                     \
-    _zzq_args[5] = (unsigned int)(_zzq_arg5);                     \
-    _zzq_args[6] = (unsigned int)(_zzq_default);                  \
-    _zzq_ptr = _zzq_args;                                         \
-    __asm__ volatile("mr 4,%1\n\t"                                \
-                     "lwz 3, 24(4)\n\t"                           \
-                     __SPECIAL_INSTRUCTION_PREAMBLE               \
-                     /* %R3 = client_request ( %R4 ) */           \
-                     "or 1,1,1\n\t"                               \
-                     "mr %0,3"                                    \
-                     : "=b" (_zzq_result)                         \
-                     : "b" (_zzq_ptr)                             \
-                     : "r3", "r4", "cc", "memory");               \
-    _zzq_rlval = _zzq_result;                                     \
+  struct {
+     unsigned long long int nraddr; /* where's the code? */
   }
+  OrigFn;
 
-#define VALGRIND_GET_NR_CONTEXT(_zzq_rlval)                       \
-  { volatile OrigFn* _zzq_orig = &(_zzq_rlval);                   \
-    register unsigned int __addr;                                 \
-    __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE               \
-                     /* %R3 = guest_NRADDR */                     \
-                     "or 2,2,2\n\t"                               \
-                     "mr %0,3"                                    \
-                     : "=b" (__addr)                              \
-                     :                                            \
-                     : "r3", "cc", "memory"                       \
-                    );                                            \
-    _zzq_orig->nraddr = __addr;                                   \
-    __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE               \
-                     /* %R3 = guest_NRADDR_GPR2 */                \
-                     "or 4,4,4\n\t"                               \
-                     "mr %0,3"                                    \
-                     : "=b" (__addr)                              \
-                     :                                            \
-                     : "r3", "cc", "memory"                       \
-                    );                                            \
-    _zzq_orig->r2 = __addr;                                       \
-  }
+/* __SPECIAL_INSTRUCTION_PREAMBLE will be used to identify Valgrind specific
+ * code. This detection is implemented in platform specific toIR.c
+ * (e.g. VEX/priv/guest_s390_decoder.c).
+ */
+#define __SPECIAL_INSTRUCTION_PREAMBLE                           \
+                     "lr 15,15\n\t"                              \
+                     "lr 1,1\n\t"                                \
+                     "lr 2,2\n\t"                                \
+                     "lr 3,3\n\t"
 
-#define VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                   \
-                     __SPECIAL_INSTRUCTION_PREAMBLE               \
-                     /* branch-and-link-to-noredir *%R11 */       \
-                     "or 3,3,3\n\t"
+#define __CLIENT_REQUEST_CODE "lr 2,2\n\t"
+#define __GET_NR_CONTEXT_CODE "lr 3,3\n\t"
+#define __CALL_NO_REDIR_CODE  "lr 4,4\n\t"
 
-#endif /* PLAT_ppc32_aix5 */
+#define VALGRIND_DO_CLIENT_REQUEST_EXPR(                         \
+       _zzq_default, _zzq_request,                               \
+       _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5)    \
+  __extension__                                                  \
+ ({volatile unsigned long long int _zzq_args[6];                 \
+   volatile unsigned long long int _zzq_result;                  \
+   _zzq_args[0] = (unsigned long long int)(_zzq_request);        \
+   _zzq_args[1] = (unsigned long long int)(_zzq_arg1);           \
+   _zzq_args[2] = (unsigned long long int)(_zzq_arg2);           \
+   _zzq_args[3] = (unsigned long long int)(_zzq_arg3);           \
+   _zzq_args[4] = (unsigned long long int)(_zzq_arg4);           \
+   _zzq_args[5] = (unsigned long long int)(_zzq_arg5);           \
+   __asm__ volatile(/* r2 = args */                              \
+                    "lgr 2,%1\n\t"                               \
+                    /* r3 = default */                           \
+                    "lgr 3,%2\n\t"                               \
+                    __SPECIAL_INSTRUCTION_PREAMBLE               \
+                    __CLIENT_REQUEST_CODE                        \
+                    /* results = r3 */                           \
+                    "lgr %0, 3\n\t"                              \
+                    : "=d" (_zzq_result)                         \
+                    : "a" (&_zzq_args[0]), "0" (_zzq_default)    \
+                    : "cc", "2", "3", "memory"                   \
+                   );                                            \
+   _zzq_result;                                                  \
+ })
 
-/* ------------------------ ppc64-aix5 ------------------------- */
+#define VALGRIND_GET_NR_CONTEXT(_zzq_rlval)                      \
+ { volatile OrigFn* _zzq_orig = &(_zzq_rlval);                   \
+   volatile unsigned long long int __addr;                       \
+   __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE               \
+                    __GET_NR_CONTEXT_CODE                        \
+                    "lgr %0, 3\n\t"                              \
+                    : "=a" (__addr)                              \
+                    :                                            \
+                    : "cc", "3", "memory"                        \
+                   );                                            \
+   _zzq_orig->nraddr = __addr;                                   \
+ }
 
-#if defined(PLAT_ppc64_aix5)
+#define VALGRIND_CALL_NOREDIR_R1                                 \
+                    __SPECIAL_INSTRUCTION_PREAMBLE               \
+                    __CALL_NO_REDIR_CODE
 
-typedef
-   struct { 
-      unsigned long long int nraddr; /* where's the code? */
-      unsigned long long int r2;  /* what tocptr do we need? */
-   }
-   OrigFn;
-
-#define __SPECIAL_INSTRUCTION_PREAMBLE                            \
-                     "rotldi 0,0,3  ; rotldi 0,0,13\n\t"          \
-                     "rotldi 0,0,61 ; rotldi 0,0,51\n\t"
-
-#define VALGRIND_DO_CLIENT_REQUEST(                               \
-        _zzq_rlval, _zzq_default, _zzq_request,                   \
-        _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5)    \
-                                                                  \
-  {          unsigned long long int  _zzq_args[7];                \
-    register unsigned long long int  _zzq_result;                 \
-    register unsigned long long int* _zzq_ptr;                    \
-    _zzq_args[0] = (unsigned int long long)(_zzq_request);        \
-    _zzq_args[1] = (unsigned int long long)(_zzq_arg1);           \
-    _zzq_args[2] = (unsigned int long long)(_zzq_arg2);           \
-    _zzq_args[3] = (unsigned int long long)(_zzq_arg3);           \
-    _zzq_args[4] = (unsigned int long long)(_zzq_arg4);           \
-    _zzq_args[5] = (unsigned int long long)(_zzq_arg5);           \
-    _zzq_args[6] = (unsigned int long long)(_zzq_default);        \
-    _zzq_ptr = _zzq_args;                                         \
-    __asm__ volatile("mr 4,%1\n\t"                                \
-                     "ld 3, 48(4)\n\t"                            \
-                     __SPECIAL_INSTRUCTION_PREAMBLE               \
-                     /* %R3 = client_request ( %R4 ) */           \
-                     "or 1,1,1\n\t"                               \
-                     "mr %0,3"                                    \
-                     : "=b" (_zzq_result)                         \
-                     : "b" (_zzq_ptr)                             \
-                     : "r3", "r4", "cc", "memory");               \
-    _zzq_rlval = _zzq_result;                                     \
-  }
-
-#define VALGRIND_GET_NR_CONTEXT(_zzq_rlval)                       \
-  { volatile OrigFn* _zzq_orig = &(_zzq_rlval);                   \
-    register unsigned long long int __addr;                       \
-    __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE               \
-                     /* %R3 = guest_NRADDR */                     \
-                     "or 2,2,2\n\t"                               \
-                     "mr %0,3"                                    \
-                     : "=b" (__addr)                              \
-                     :                                            \
-                     : "r3", "cc", "memory"                       \
-                    );                                            \
-    _zzq_orig->nraddr = __addr;                                   \
-    __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE               \
-                     /* %R3 = guest_NRADDR_GPR2 */                \
-                     "or 4,4,4\n\t"                               \
-                     "mr %0,3"                                    \
-                     : "=b" (__addr)                              \
-                     :                                            \
-                     : "r3", "cc", "memory"                       \
-                    );                                            \
-    _zzq_orig->r2 = __addr;                                       \
-  }
-
-#define VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                   \
-                     __SPECIAL_INSTRUCTION_PREAMBLE               \
-                     /* branch-and-link-to-noredir *%R11 */       \
-                     "or 3,3,3\n\t"
-
-#endif /* PLAT_ppc64_aix5 */
+#endif /* PLAT_s390x_linux */
 
 /* Insert assembly code for other platforms here... */
 
@@ -724,17 +694,20 @@
 */
 
 /* Use these to write the name of your wrapper.  NOTE: duplicates
-   VG_WRAP_FUNCTION_Z{U,Z} in pub_tool_redir.h. */
+   VG_WRAP_FUNCTION_Z{U,Z} in pub_tool_redir.h.  NOTE also: inserts
+   the default behaviour equivalance class tag "0000" into the name.
+   See pub_tool_redir.h for details -- normally you don't need to
+   think about this, though. */
 
 /* Use an extra level of macroisation so as to ensure the soname/fnname
    args are fully macro-expanded before pasting them together. */
 #define VG_CONCAT4(_aa,_bb,_cc,_dd) _aa##_bb##_cc##_dd
 
 #define I_WRAP_SONAME_FNNAME_ZU(soname,fnname)                    \
-   VG_CONCAT4(_vgwZU_,soname,_,fnname)
+   VG_CONCAT4(_vgw00000ZU_,soname,_,fnname)
 
 #define I_WRAP_SONAME_FNNAME_ZZ(soname,fnname)                    \
-   VG_CONCAT4(_vgwZZ_,soname,_,fnname)
+   VG_CONCAT4(_vgw00000ZZ_,soname,_,fnname)
 
 /* Use this macro from within a wrapper function to collect the
    context (address and possibly other info) of the original function.
@@ -1284,7 +1257,7 @@
    redzone, for the duration of the hidden call, to make it safe.
 
    Probably the same problem afflicts the other redzone-style ABIs too
-   (ppc64-linux, ppc32-aix5, ppc64-aix5); but for those, the stack is
+   (ppc64-linux); but for those, the stack is
    self describing (none of this CFI nonsense) so at least messing
    with the stack pointer doesn't give a danger of non-unwindable
    stack. */
@@ -3126,1127 +3099,483 @@
 
 #endif /* PLAT_arm_linux */
 
-/* ------------------------ ppc32-aix5 ------------------------- */
+/* ------------------------- s390x-linux ------------------------- */
 
-#if defined(PLAT_ppc32_aix5)
+#if defined(PLAT_s390x_linux)
 
-/* ARGREGS: r3 r4 r5 r6 r7 r8 r9 r10 (the rest on stack somewhere) */
+/* Similar workaround as amd64 (see above), but we use r11 as frame
+   pointer and save the old r11 in r7. r11 might be used for
+   argvec, therefore we copy argvec in r1 since r1 is clobbered
+   after the call anyway.  */
+#if defined(__GNUC__) && defined(__GCC_HAVE_DWARF2_CFI_ASM)
+#  define __FRAME_POINTER                                         \
+      ,"d"(__builtin_dwarf_cfa())
+#  define VALGRIND_CFI_PROLOGUE                                   \
+      ".cfi_remember_state\n\t"                                   \
+      "lgr 1,%1\n\t" /* copy the argvec pointer in r1 */          \
+      "lgr 7,11\n\t"                                              \
+      "lgr 11,%2\n\t"                                             \
+      ".cfi_def_cfa r11, 0\n\t"
+#  define VALGRIND_CFI_EPILOGUE                                   \
+      "lgr 11, 7\n\t"                                             \
+      ".cfi_restore_state\n\t"
+#else
+#  define __FRAME_POINTER
+#  define VALGRIND_CFI_PROLOGUE                                   \
+      "lgr 1,%1\n\t"
+#  define VALGRIND_CFI_EPILOGUE
+#endif
 
-/* These regs are trashed by the hidden call. */
-#define __CALLER_SAVED_REGS                                       \
-   "lr", "ctr", "xer",                                            \
-   "cr0", "cr1", "cr2", "cr3", "cr4", "cr5", "cr6", "cr7",        \
-   "r0", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10",   \
-   "r11", "r12", "r13"
 
-/* Expand the stack frame, copying enough info that unwinding
-   still works.  Trashes r3. */
 
-#define VG_EXPAND_FRAME_BY_trashes_r3(_n_fr)                      \
-         "addi 1,1,-" #_n_fr "\n\t"                               \
-         "lwz  3," #_n_fr "(1)\n\t"                               \
-         "stw  3,0(1)\n\t"
 
-#define VG_CONTRACT_FRAME_BY(_n_fr)                               \
-         "addi 1,1," #_n_fr "\n\t"
+/* These regs are trashed by the hidden call. Note that we overwrite
+   r14 in s390_irgen_noredir (VEX/priv/guest_s390_irgen.c) to give the
+   function a proper return address. All others are ABI defined call
+   clobbers. */
+#define __CALLER_SAVED_REGS "0","1","2","3","4","5","14", \
+                           "f0","f1","f2","f3","f4","f5","f6","f7"
 
-/* These CALL_FN_ macros assume that on ppc32-aix5, sizeof(unsigned
-   long) == 4. */
 
-#define CALL_FN_W_v(lval, orig)                                   \
-   do {                                                           \
-      volatile OrigFn        _orig = (orig);                      \
-      volatile unsigned long _argvec[3+0];                        \
-      volatile unsigned long _res;                                \
-      /* _argvec[0] holds current r2 across the call */           \
-      _argvec[1] = (unsigned long)_orig.r2;                       \
-      _argvec[2] = (unsigned long)_orig.nraddr;                   \
-      __asm__ volatile(                                           \
-         "mr 11,%1\n\t"                                           \
-         VG_EXPAND_FRAME_BY_trashes_r3(512)                       \
-         "stw  2,-8(11)\n\t"  /* save tocptr */                   \
-         "lwz  2,-4(11)\n\t"  /* use nraddr's tocptr */           \
-         "lwz 11, 0(11)\n\t"  /* target->r11 */                   \
-         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
-         "mr 11,%1\n\t"                                           \
-         "mr %0,3\n\t"                                            \
-         "lwz 2,-8(11)\n\t" /* restore tocptr */                  \
-         VG_CONTRACT_FRAME_BY(512)                                \
-         : /*out*/   "=r" (_res)                                  \
-         : /*in*/    "r" (&_argvec[2])                            \
-         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
-      );                                                          \
-      lval = (__typeof__(lval)) _res;                             \
+#define CALL_FN_W_v(lval, orig)                                  \
+   do {                                                          \
+      volatile OrigFn        _orig = (orig);                     \
+      volatile unsigned long  _argvec[1];                        \
+      volatile unsigned long _res;                               \
+      _argvec[0] = (unsigned long)_orig.nraddr;                  \
+      __asm__ volatile(                                          \
+         VALGRIND_CFI_PROLOGUE                                   \
+         "aghi 15,-160\n\t"                                      \
+         "lg 1, 0(1)\n\t"  /* target->r1 */                      \
+         VALGRIND_CALL_NOREDIR_R1                                \
+         "lgr %0, 2\n\t"                                         \
+         "aghi 15,160\n\t"                                       \
+         VALGRIND_CFI_EPILOGUE                                   \
+         : /*out*/   "=d" (_res)                                 \
+         : /*in*/    "d" (&_argvec[0]) __FRAME_POINTER           \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS,"7"     \
+      );                                                         \
+      lval = (__typeof__(lval)) _res;                            \
    } while (0)
 
-#define CALL_FN_W_W(lval, orig, arg1)                             \
-   do {                                                           \
-      volatile OrigFn        _orig = (orig);                      \
-      volatile unsigned long _argvec[3+1];                        \
-      volatile unsigned long _res;                                \
-      /* _argvec[0] holds current r2 across the call */           \
-      _argvec[1]   = (unsigned long)_orig.r2;                     \
-      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
-      _argvec[2+1] = (unsigned long)arg1;                         \
-      __asm__ volatile(                                           \
-         "mr 11,%1\n\t"                                           \
-         VG_EXPAND_FRAME_BY_trashes_r3(512)                       \
-         "stw  2,-8(11)\n\t"  /* save tocptr */                   \
-         "lwz  2,-4(11)\n\t"  /* use nraddr's tocptr */           \
-         "lwz  3, 4(11)\n\t"  /* arg1->r3 */                      \
-         "lwz 11, 0(11)\n\t"  /* target->r11 */                   \
-         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
-         "mr 11,%1\n\t"                                           \
-         "mr %0,3\n\t"                                            \
-         "lwz 2,-8(11)\n\t" /* restore tocptr */                  \
-         VG_CONTRACT_FRAME_BY(512)                                \
-         : /*out*/   "=r" (_res)                                  \
-         : /*in*/    "r" (&_argvec[2])                            \
-         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
-      );                                                          \
-      lval = (__typeof__(lval)) _res;                             \
+/* The call abi has the arguments in r2-r6 and stack */
+#define CALL_FN_W_W(lval, orig, arg1)                            \
+   do {                                                          \
+      volatile OrigFn        _orig = (orig);                     \
+      volatile unsigned long _argvec[2];                         \
+      volatile unsigned long _res;                               \
+      _argvec[0] = (unsigned long)_orig.nraddr;                  \
+      _argvec[1] = (unsigned long)arg1;                          \
+      __asm__ volatile(                                          \
+         VALGRIND_CFI_PROLOGUE                                   \
+         "aghi 15,-160\n\t"                                      \
+         "lg 2, 8(1)\n\t"                                        \
+         "lg 1, 0(1)\n\t"                                        \
+         VALGRIND_CALL_NOREDIR_R1                                \
+         "lgr %0, 2\n\t"                                         \
+         "aghi 15,160\n\t"                                       \
+         VALGRIND_CFI_EPILOGUE                                   \
+         : /*out*/   "=d" (_res)                                 \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER           \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS,"7"     \
+      );                                                         \
+      lval = (__typeof__(lval)) _res;                            \
    } while (0)
 
-#define CALL_FN_W_WW(lval, orig, arg1,arg2)                       \
-   do {                                                           \
-      volatile OrigFn        _orig = (orig);                      \
-      volatile unsigned long _argvec[3+2];                        \
-      volatile unsigned long _res;                                \
-      /* _argvec[0] holds current r2 across the call */           \
-      _argvec[1]   = (unsigned long)_orig.r2;                     \
-      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
-      _argvec[2+1] = (unsigned long)arg1;                         \
-      _argvec[2+2] = (unsigned long)arg2;                         \
-      __asm__ volatile(                                           \
-         "mr 11,%1\n\t"                                           \
-         VG_EXPAND_FRAME_BY_trashes_r3(512)                       \
-         "stw  2,-8(11)\n\t"  /* save tocptr */                   \
-         "lwz  2,-4(11)\n\t"  /* use nraddr's tocptr */           \
-         "lwz  3, 4(11)\n\t"  /* arg1->r3 */                      \
-         "lwz  4, 8(11)\n\t"  /* arg2->r4 */                      \
-         "lwz 11, 0(11)\n\t"  /* target->r11 */                   \
-         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
-         "mr 11,%1\n\t"                                           \
-         "mr %0,3\n\t"                                            \
-         "lwz 2,-8(11)\n\t" /* restore tocptr */                  \
-         VG_CONTRACT_FRAME_BY(512)                                \
-         : /*out*/   "=r" (_res)                                  \
-         : /*in*/    "r" (&_argvec[2])                            \
-         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
-      );                                                          \
-      lval = (__typeof__(lval)) _res;                             \
+#define CALL_FN_W_WW(lval, orig, arg1, arg2)                     \
+   do {                                                          \
+      volatile OrigFn        _orig = (orig);                     \
+      volatile unsigned long _argvec[3];                         \
+      volatile unsigned long _res;                               \
+      _argvec[0] = (unsigned long)_orig.nraddr;                  \
+      _argvec[1] = (unsigned long)arg1;                          \
+      _argvec[2] = (unsigned long)arg2;                          \
+      __asm__ volatile(                                          \
+         VALGRIND_CFI_PROLOGUE                                   \
+         "aghi 15,-160\n\t"                                      \
+         "lg 2, 8(1)\n\t"                                        \
+         "lg 3,16(1)\n\t"                                        \
+         "lg 1, 0(1)\n\t"                                        \
+         VALGRIND_CALL_NOREDIR_R1                                \
+         "lgr %0, 2\n\t"                                         \
+         "aghi 15,160\n\t"                                       \
+         VALGRIND_CFI_EPILOGUE                                   \
+         : /*out*/   "=d" (_res)                                 \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER           \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS,"7"     \
+      );                                                         \
+      lval = (__typeof__(lval)) _res;                            \
    } while (0)
 
-#define CALL_FN_W_WWW(lval, orig, arg1,arg2,arg3)                 \
-   do {                                                           \
-      volatile OrigFn        _orig = (orig);                      \
-      volatile unsigned long _argvec[3+3];                        \
-      volatile unsigned long _res;                                \
-      /* _argvec[0] holds current r2 across the call */           \
-      _argvec[1]   = (unsigned long)_orig.r2;                     \
-      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
-      _argvec[2+1] = (unsigned long)arg1;                         \
-      _argvec[2+2] = (unsigned long)arg2;                         \
-      _argvec[2+3] = (unsigned long)arg3;                         \
-      __asm__ volatile(                                           \
-         "mr 11,%1\n\t"                                           \
-         VG_EXPAND_FRAME_BY_trashes_r3(512)                       \
-         "stw  2,-8(11)\n\t"  /* save tocptr */                   \
-         "lwz  2,-4(11)\n\t"  /* use nraddr's tocptr */           \
-         "lwz  3, 4(11)\n\t"  /* arg1->r3 */                      \
-         "lwz  4, 8(11)\n\t"  /* arg2->r4 */                      \
-         "lwz  5, 12(11)\n\t" /* arg3->r5 */                      \
-         "lwz 11, 0(11)\n\t"  /* target->r11 */                   \
-         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
-         "mr 11,%1\n\t"                                           \
-         "mr %0,3\n\t"                                            \
-         "lwz 2,-8(11)\n\t" /* restore tocptr */                  \
-         VG_CONTRACT_FRAME_BY(512)                                \
-         : /*out*/   "=r" (_res)                                  \
-         : /*in*/    "r" (&_argvec[2])                            \
-         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
-      );                                                          \
-      lval = (__typeof__(lval)) _res;                             \
+#define CALL_FN_W_WWW(lval, orig, arg1, arg2, arg3)              \
+   do {                                                          \
+      volatile OrigFn        _orig = (orig);                     \
+      volatile unsigned long _argvec[4];                         \
+      volatile unsigned long _res;                               \
+      _argvec[0] = (unsigned long)_orig.nraddr;                  \
+      _argvec[1] = (unsigned long)arg1;                          \
+      _argvec[2] = (unsigned long)arg2;                          \
+      _argvec[3] = (unsigned long)arg3;                          \
+      __asm__ volatile(                                          \
+         VALGRIND_CFI_PROLOGUE                                   \
+         "aghi 15,-160\n\t"                                      \
+         "lg 2, 8(1)\n\t"                                        \
+         "lg 3,16(1)\n\t"                                        \
+         "lg 4,24(1)\n\t"                                        \
+         "lg 1, 0(1)\n\t"                                        \
+         VALGRIND_CALL_NOREDIR_R1                                \
+         "lgr %0, 2\n\t"                                         \
+         "aghi 15,160\n\t"                                       \
+         VALGRIND_CFI_EPILOGUE                                   \
+         : /*out*/   "=d" (_res)                                 \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER           \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS,"7"     \
+      );                                                         \
+      lval = (__typeof__(lval)) _res;                            \
    } while (0)
 
-#define CALL_FN_W_WWWW(lval, orig, arg1,arg2,arg3,arg4)           \
-   do {                                                           \
-      volatile OrigFn        _orig = (orig);                      \
-      volatile unsigned long _argvec[3+4];                        \
-      volatile unsigned long _res;                                \
-      /* _argvec[0] holds current r2 across the call */           \
-      _argvec[1]   = (unsigned long)_orig.r2;                     \
-      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
-      _argvec[2+1] = (unsigned long)arg1;                         \
-      _argvec[2+2] = (unsigned long)arg2;                         \
-      _argvec[2+3] = (unsigned long)arg3;                         \
-      _argvec[2+4] = (unsigned long)arg4;                         \
-      __asm__ volatile(                                           \
-         "mr 11,%1\n\t"                                           \
-         VG_EXPAND_FRAME_BY_trashes_r3(512)                       \
-         "stw  2,-8(11)\n\t"  /* save tocptr */                   \
-         "lwz  2,-4(11)\n\t"  /* use nraddr's tocptr */           \
-         "lwz  3, 4(11)\n\t"  /* arg1->r3 */                      \
-         "lwz  4, 8(11)\n\t"  /* arg2->r4 */                      \
-         "lwz  5, 12(11)\n\t" /* arg3->r5 */                      \
-         "lwz  6, 16(11)\n\t" /* arg4->r6 */                      \
-         "lwz 11, 0(11)\n\t"  /* target->r11 */                   \
-         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
-         "mr 11,%1\n\t"                                           \
-         "mr %0,3\n\t"                                            \
-         "lwz 2,-8(11)\n\t" /* restore tocptr */                  \
-         VG_CONTRACT_FRAME_BY(512)                                \
-         : /*out*/   "=r" (_res)                                  \
-         : /*in*/    "r" (&_argvec[2])                            \
-         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
-      );                                                          \
-      lval = (__typeof__(lval)) _res;                             \
+#define CALL_FN_W_WWWW(lval, orig, arg1, arg2, arg3, arg4)       \
+   do {                                                          \
+      volatile OrigFn        _orig = (orig);                     \
+      volatile unsigned long _argvec[5];                         \
+      volatile unsigned long _res;                               \
+      _argvec[0] = (unsigned long)_orig.nraddr;                  \
+      _argvec[1] = (unsigned long)arg1;                          \
+      _argvec[2] = (unsigned long)arg2;                          \
+      _argvec[3] = (unsigned long)arg3;                          \
+      _argvec[4] = (unsigned long)arg4;                          \
+      __asm__ volatile(                                          \
+         VALGRIND_CFI_PROLOGUE                                   \
+         "aghi 15,-160\n\t"                                      \
+         "lg 2, 8(1)\n\t"                                        \
+         "lg 3,16(1)\n\t"                                        \
+         "lg 4,24(1)\n\t"                                        \
+         "lg 5,32(1)\n\t"                                        \
+         "lg 1, 0(1)\n\t"                                        \
+         VALGRIND_CALL_NOREDIR_R1                                \
+         "lgr %0, 2\n\t"                                         \
+         "aghi 15,160\n\t"                                       \
+         VALGRIND_CFI_EPILOGUE                                   \
+         : /*out*/   "=d" (_res)                                 \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER           \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS,"7"     \
+      );                                                         \
+      lval = (__typeof__(lval)) _res;                            \
    } while (0)
 
-#define CALL_FN_W_5W(lval, orig, arg1,arg2,arg3,arg4,arg5)        \
-   do {                                                           \
-      volatile OrigFn        _orig = (orig);                      \
-      volatile unsigned long _argvec[3+5];                        \
-      volatile unsigned long _res;                                \
-      /* _argvec[0] holds current r2 across the call */           \
-      _argvec[1]   = (unsigned long)_orig.r2;                     \
-      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
-      _argvec[2+1] = (unsigned long)arg1;                         \
-      _argvec[2+2] = (unsigned long)arg2;                         \
-      _argvec[2+3] = (unsigned long)arg3;                         \
-      _argvec[2+4] = (unsigned long)arg4;                         \
-      _argvec[2+5] = (unsigned long)arg5;                         \
-      __asm__ volatile(                                           \
-         "mr 11,%1\n\t"                                           \
-         VG_EXPAND_FRAME_BY_trashes_r3(512)                       \
-         "stw  2,-8(11)\n\t"  /* save tocptr */                   \
-         "lwz  2,-4(11)\n\t"  /* use nraddr's tocptr */           \
-         "lwz  3, 4(11)\n\t"  /* arg1->r3 */                      \
-         "lwz  4, 8(11)\n\t" /* arg2->r4 */                       \
-         "lwz  5, 12(11)\n\t" /* arg3->r5 */                      \
-         "lwz  6, 16(11)\n\t" /* arg4->r6 */                      \
-         "lwz  7, 20(11)\n\t" /* arg5->r7 */                      \
-         "lwz 11, 0(11)\n\t"  /* target->r11 */                   \
-         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
-         "mr 11,%1\n\t"                                           \
-         "mr %0,3\n\t"                                            \
-         "lwz 2,-8(11)\n\t" /* restore tocptr */                  \
-         VG_CONTRACT_FRAME_BY(512)                                \
-         : /*out*/   "=r" (_res)                                  \
-         : /*in*/    "r" (&_argvec[2])                            \
-         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
-      );                                                          \
-      lval = (__typeof__(lval)) _res;                             \
+#define CALL_FN_W_5W(lval, orig, arg1, arg2, arg3, arg4, arg5)   \
+   do {                                                          \
+      volatile OrigFn        _orig = (orig);                     \
+      volatile unsigned long _argvec[6];                         \
+      volatile unsigned long _res;                               \
+      _argvec[0] = (unsigned long)_orig.nraddr;                  \
+      _argvec[1] = (unsigned long)arg1;                          \
+      _argvec[2] = (unsigned long)arg2;                          \
+      _argvec[3] = (unsigned long)arg3;                          \
+      _argvec[4] = (unsigned long)arg4;                          \
+      _argvec[5] = (unsigned long)arg5;                          \
+      __asm__ volatile(                                          \
+         VALGRIND_CFI_PROLOGUE                                   \
+         "aghi 15,-160\n\t"                                      \
+         "lg 2, 8(1)\n\t"                                        \
+         "lg 3,16(1)\n\t"                                        \
+         "lg 4,24(1)\n\t"                                        \
+         "lg 5,32(1)\n\t"                                        \
+         "lg 6,40(1)\n\t"                                        \
+         "lg 1, 0(1)\n\t"                                        \
+         VALGRIND_CALL_NOREDIR_R1                                \
+         "lgr %0, 2\n\t"                                         \
+         "aghi 15,160\n\t"                                       \
+         VALGRIND_CFI_EPILOGUE                                   \
+         : /*out*/   "=d" (_res)                                 \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER           \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS,"6","7" \
+      );                                                         \
+      lval = (__typeof__(lval)) _res;                            \
    } while (0)
 
-#define CALL_FN_W_6W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6)   \
-   do {                                                           \
-      volatile OrigFn        _orig = (orig);                      \
-      volatile unsigned long _argvec[3+6];                        \
-      volatile unsigned long _res;                                \
-      /* _argvec[0] holds current r2 across the call */           \
-      _argvec[1]   = (unsigned long)_orig.r2;                     \
-      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
-      _argvec[2+1] = (unsigned long)arg1;                         \
-      _argvec[2+2] = (unsigned long)arg2;                         \
-      _argvec[2+3] = (unsigned long)arg3;                         \
-      _argvec[2+4] = (unsigned long)arg4;                         \
-      _argvec[2+5] = (unsigned long)arg5;                         \
-      _argvec[2+6] = (unsigned long)arg6;                         \
-      __asm__ volatile(                                           \
-         "mr 11,%1\n\t"                                           \
-         VG_EXPAND_FRAME_BY_trashes_r3(512)                       \
-         "stw  2,-8(11)\n\t"  /* save tocptr */                   \
-         "lwz  2,-4(11)\n\t"  /* use nraddr's tocptr */           \
-         "lwz  3, 4(11)\n\t"  /* arg1->r3 */                      \
-         "lwz  4, 8(11)\n\t"  /* arg2->r4 */                      \
-         "lwz  5, 12(11)\n\t" /* arg3->r5 */                      \
-         "lwz  6, 16(11)\n\t" /* arg4->r6 */                      \
-         "lwz  7, 20(11)\n\t" /* arg5->r7 */                      \
-         "lwz  8, 24(11)\n\t" /* arg6->r8 */                      \
-         "lwz 11, 0(11)\n\t"  /* target->r11 */                   \
-         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
-         "mr 11,%1\n\t"                                           \
-         "mr %0,3\n\t"                                            \
-         "lwz 2,-8(11)\n\t" /* restore tocptr */                  \
-         VG_CONTRACT_FRAME_BY(512)                                \
-         : /*out*/   "=r" (_res)                                  \
-         : /*in*/    "r" (&_argvec[2])                            \
-         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
-      );                                                          \
-      lval = (__typeof__(lval)) _res;                             \
+#define CALL_FN_W_6W(lval, orig, arg1, arg2, arg3, arg4, arg5,   \
+                     arg6)                                       \
+   do {                                                          \
+      volatile OrigFn        _orig = (orig);                     \
+      volatile unsigned long _argvec[7];                         \
+      volatile unsigned long _res;                               \
+      _argvec[0] = (unsigned long)_orig.nraddr;                  \
+      _argvec[1] = (unsigned long)arg1;                          \
+      _argvec[2] = (unsigned long)arg2;                          \
+      _argvec[3] = (unsigned long)arg3;                          \
+      _argvec[4] = (unsigned long)arg4;                          \
+      _argvec[5] = (unsigned long)arg5;                          \
+      _argvec[6] = (unsigned long)arg6;                          \
+      __asm__ volatile(                                          \
+         VALGRIND_CFI_PROLOGUE                                   \
+         "aghi 15,-168\n\t"                                      \
+         "lg 2, 8(1)\n\t"                                        \
+         "lg 3,16(1)\n\t"                                        \
+         "lg 4,24(1)\n\t"                                        \
+         "lg 5,32(1)\n\t"                                        \
+         "lg 6,40(1)\n\t"                                        \
+         "mvc 160(8,15), 48(1)\n\t"                              \
+         "lg 1, 0(1)\n\t"                                        \
+         VALGRIND_CALL_NOREDIR_R1                                \
+         "lgr %0, 2\n\t"                                         \
+         "aghi 15,168\n\t"                                       \
+         VALGRIND_CFI_EPILOGUE                                   \
+         : /*out*/   "=d" (_res)                                 \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER           \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS,"6","7" \
+      );                                                         \
+      lval = (__typeof__(lval)) _res;                            \
    } while (0)
 
-#define CALL_FN_W_7W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,   \
-                                 arg7)                            \
-   do {                                                           \
-      volatile OrigFn        _orig = (orig);                      \
-      volatile unsigned long _argvec[3+7];                        \
-      volatile unsigned long _res;                                \
-      /* _argvec[0] holds current r2 across the call */           \
-      _argvec[1]   = (unsigned long)_orig.r2;                     \
-      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
-      _argvec[2+1] = (unsigned long)arg1;                         \
-      _argvec[2+2] = (unsigned long)arg2;                         \
-      _argvec[2+3] = (unsigned long)arg3;                         \
-      _argvec[2+4] = (unsigned long)arg4;                         \
-      _argvec[2+5] = (unsigned long)arg5;                         \
-      _argvec[2+6] = (unsigned long)arg6;                         \
-      _argvec[2+7] = (unsigned long)arg7;                         \
-      __asm__ volatile(                                           \
-         "mr 11,%1\n\t"                                           \
-         VG_EXPAND_FRAME_BY_trashes_r3(512)                       \
-         "stw  2,-8(11)\n\t"  /* save tocptr */                   \
-         "lwz  2,-4(11)\n\t"  /* use nraddr's tocptr */           \
-         "lwz  3, 4(11)\n\t"  /* arg1->r3 */                      \
-         "lwz  4, 8(11)\n\t"  /* arg2->r4 */                      \
-         "lwz  5, 12(11)\n\t" /* arg3->r5 */                      \
-         "lwz  6, 16(11)\n\t" /* arg4->r6 */                      \
-         "lwz  7, 20(11)\n\t" /* arg5->r7 */                      \
-         "lwz  8, 24(11)\n\t" /* arg6->r8 */                      \
-         "lwz  9, 28(11)\n\t" /* arg7->r9 */                      \
-         "lwz 11, 0(11)\n\t"  /* target->r11 */                   \
-         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
-         "mr 11,%1\n\t"                                           \
-         "mr %0,3\n\t"                                            \
-         "lwz 2,-8(11)\n\t" /* restore tocptr */                  \
-         VG_CONTRACT_FRAME_BY(512)                                \
-         : /*out*/   "=r" (_res)                                  \
-         : /*in*/    "r" (&_argvec[2])                            \
-         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
-      );                                                          \
-      lval = (__typeof__(lval)) _res;                             \
+#define CALL_FN_W_7W(lval, orig, arg1, arg2, arg3, arg4, arg5,   \
+                     arg6, arg7)                                 \
+   do {                                                          \
+      volatile OrigFn        _orig = (orig);                     \
+      volatile unsigned long _argvec[8];                         \
+      volatile unsigned long _res;                               \
+      _argvec[0] = (unsigned long)_orig.nraddr;                  \
+      _argvec[1] = (unsigned long)arg1;                          \
+      _argvec[2] = (unsigned long)arg2;                          \
+      _argvec[3] = (unsigned long)arg3;                          \
+      _argvec[4] = (unsigned long)arg4;                          \
+      _argvec[5] = (unsigned long)arg5;                          \
+      _argvec[6] = (unsigned long)arg6;                          \
+      _argvec[7] = (unsigned long)arg7;                          \
+      __asm__ volatile(                                          \
+         VALGRIND_CFI_PROLOGUE                                   \
+         "aghi 15,-176\n\t"                                      \
+         "lg 2, 8(1)\n\t"                                        \
+         "lg 3,16(1)\n\t"                                        \
+         "lg 4,24(1)\n\t"                                        \
+         "lg 5,32(1)\n\t"                                        \
+         "lg 6,40(1)\n\t"                                        \
+         "mvc 160(8,15), 48(1)\n\t"                              \
+         "mvc 168(8,15), 56(1)\n\t"                              \
+         "lg 1, 0(1)\n\t"                                        \
+         VALGRIND_CALL_NOREDIR_R1                                \
+         "lgr %0, 2\n\t"                                         \
+         "aghi 15,176\n\t"                                       \
+         VALGRIND_CFI_EPILOGUE                                   \
+         : /*out*/   "=d" (_res)                                 \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER           \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS,"6","7" \
+      );                                                         \
+      lval = (__typeof__(lval)) _res;                            \
    } while (0)
 
-#define CALL_FN_W_8W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,   \
-                                 arg7,arg8)                       \
-   do {                                                           \
-      volatile OrigFn        _orig = (orig);                      \
-      volatile unsigned long _argvec[3+8];                        \
-      volatile unsigned long _res;                                \
-      /* _argvec[0] holds current r2 across the call */           \
-      _argvec[1]   = (unsigned long)_orig.r2;                     \
-      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
-      _argvec[2+1] = (unsigned long)arg1;                         \
-      _argvec[2+2] = (unsigned long)arg2;                         \
-      _argvec[2+3] = (unsigned long)arg3;                         \
-      _argvec[2+4] = (unsigned long)arg4;                         \
-      _argvec[2+5] = (unsigned long)arg5;                         \
-      _argvec[2+6] = (unsigned long)arg6;                         \
-      _argvec[2+7] = (unsigned long)arg7;                         \
-      _argvec[2+8] = (unsigned long)arg8;                         \
-      __asm__ volatile(                                           \
-         "mr 11,%1\n\t"                                           \
-         VG_EXPAND_FRAME_BY_trashes_r3(512)                       \
-         "stw  2,-8(11)\n\t"  /* save tocptr */                   \
-         "lwz  2,-4(11)\n\t"  /* use nraddr's tocptr */           \
-         "lwz  3, 4(11)\n\t"  /* arg1->r3 */                      \
-         "lwz  4, 8(11)\n\t"  /* arg2->r4 */                      \
-         "lwz  5, 12(11)\n\t" /* arg3->r5 */                      \
-         "lwz  6, 16(11)\n\t" /* arg4->r6 */                      \
-         "lwz  7, 20(11)\n\t" /* arg5->r7 */                      \
-         "lwz  8, 24(11)\n\t" /* arg6->r8 */                      \
-         "lwz  9, 28(11)\n\t" /* arg7->r9 */                      \
-         "lwz 10, 32(11)\n\t" /* arg8->r10 */                     \
-         "lwz 11, 0(11)\n\t"  /* target->r11 */                   \
-         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
-         "mr 11,%1\n\t"                                           \
-         "mr %0,3\n\t"                                            \
-         "lwz 2,-8(11)\n\t" /* restore tocptr */                  \
-         VG_CONTRACT_FRAME_BY(512)                                \
-         : /*out*/   "=r" (_res)                                  \
-         : /*in*/    "r" (&_argvec[2])                            \
-         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
-      );                                                          \
-      lval = (__typeof__(lval)) _res;                             \
+#define CALL_FN_W_8W(lval, orig, arg1, arg2, arg3, arg4, arg5,   \
+                     arg6, arg7 ,arg8)                           \
+   do {                                                          \
+      volatile OrigFn        _orig = (orig);                     \
+      volatile unsigned long _argvec[9];                         \
+      volatile unsigned long _res;                               \
+      _argvec[0] = (unsigned long)_orig.nraddr;                  \
+      _argvec[1] = (unsigned long)arg1;                          \
+      _argvec[2] = (unsigned long)arg2;                          \
+      _argvec[3] = (unsigned long)arg3;                          \
+      _argvec[4] = (unsigned long)arg4;                          \
+      _argvec[5] = (unsigned long)arg5;                          \
+      _argvec[6] = (unsigned long)arg6;                          \
+      _argvec[7] = (unsigned long)arg7;                          \
+      _argvec[8] = (unsigned long)arg8;                          \
+      __asm__ volatile(                                          \
+         VALGRIND_CFI_PROLOGUE                                   \
+         "aghi 15,-184\n\t"                                      \
+         "lg 2, 8(1)\n\t"                                        \
+         "lg 3,16(1)\n\t"                                        \
+         "lg 4,24(1)\n\t"                                        \
+         "lg 5,32(1)\n\t"                                        \
+         "lg 6,40(1)\n\t"                                        \
+         "mvc 160(8,15), 48(1)\n\t"                              \
+         "mvc 168(8,15), 56(1)\n\t"                              \
+         "mvc 176(8,15), 64(1)\n\t"                              \
+         "lg 1, 0(1)\n\t"                                        \
+         VALGRIND_CALL_NOREDIR_R1                                \
+         "lgr %0, 2\n\t"                                         \
+         "aghi 15,184\n\t"                                       \
+         VALGRIND_CFI_EPILOGUE                                   \
+         : /*out*/   "=d" (_res)                                 \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER           \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS,"6","7" \
+      );                                                         \
+      lval = (__typeof__(lval)) _res;                            \
    } while (0)
 
-#define CALL_FN_W_9W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,   \
-                                 arg7,arg8,arg9)                  \
-   do {                                                           \
-      volatile OrigFn        _orig = (orig);                      \
-      volatile unsigned long _argvec[3+9];                        \
-      volatile unsigned long _res;                                \
-      /* _argvec[0] holds current r2 across the call */           \
-      _argvec[1]   = (unsigned long)_orig.r2;                     \
-      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
-      _argvec[2+1] = (unsigned long)arg1;                         \
-      _argvec[2+2] = (unsigned long)arg2;                         \
-      _argvec[2+3] = (unsigned long)arg3;                         \
-      _argvec[2+4] = (unsigned long)arg4;                         \
-      _argvec[2+5] = (unsigned long)arg5;                         \
-      _argvec[2+6] = (unsigned long)arg6;                         \
-      _argvec[2+7] = (unsigned long)arg7;                         \
-      _argvec[2+8] = (unsigned long)arg8;                         \
-      _argvec[2+9] = (unsigned long)arg9;                         \
-      __asm__ volatile(                                           \
-         "mr 11,%1\n\t"                                           \
-         VG_EXPAND_FRAME_BY_trashes_r3(512)                       \
-         "stw  2,-8(11)\n\t"  /* save tocptr */                   \
-         "lwz  2,-4(11)\n\t"  /* use nraddr's tocptr */           \
-         VG_EXPAND_FRAME_BY_trashes_r3(64)                        \
-         /* arg9 */                                               \
-         "lwz 3,36(11)\n\t"                                       \
-         "stw 3,56(1)\n\t"                                        \
-         /* args1-8 */                                            \
-         "lwz  3, 4(11)\n\t"  /* arg1->r3 */                      \
-         "lwz  4, 8(11)\n\t"  /* arg2->r4 */                      \
-         "lwz  5, 12(11)\n\t" /* arg3->r5 */                      \
-         "lwz  6, 16(11)\n\t" /* arg4->r6 */                      \
-         "lwz  7, 20(11)\n\t" /* arg5->r7 */                      \
-         "lwz  8, 24(11)\n\t" /* arg6->r8 */                      \
-         "lwz  9, 28(11)\n\t" /* arg7->r9 */                      \
-         "lwz 10, 32(11)\n\t" /* arg8->r10 */                     \
-         "lwz 11, 0(11)\n\t"  /* target->r11 */                   \
-         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
-         "mr 11,%1\n\t"                                           \
-         "mr %0,3\n\t"                                            \
-         "lwz 2,-8(11)\n\t" /* restore tocptr */                  \
-         VG_CONTRACT_FRAME_BY(64)                                 \
-         VG_CONTRACT_FRAME_BY(512)                                \
-         : /*out*/   "=r" (_res)                                  \
-         : /*in*/    "r" (&_argvec[2])                            \
-         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
-      );                                                          \
-      lval = (__typeof__(lval)) _res;                             \
+#define CALL_FN_W_9W(lval, orig, arg1, arg2, arg3, arg4, arg5,   \
+                     arg6, arg7 ,arg8, arg9)                     \
+   do {                                                          \
+      volatile OrigFn        _orig = (orig);                     \
+      volatile unsigned long _argvec[10];                        \
+      volatile unsigned long _res;                               \
+      _argvec[0] = (unsigned long)_orig.nraddr;                  \
+      _argvec[1] = (unsigned long)arg1;                          \
+      _argvec[2] = (unsigned long)arg2;                          \
+      _argvec[3] = (unsigned long)arg3;                          \
+      _argvec[4] = (unsigned long)arg4;                          \
+      _argvec[5] = (unsigned long)arg5;                          \
+      _argvec[6] = (unsigned long)arg6;                          \
+      _argvec[7] = (unsigned long)arg7;                          \
+      _argvec[8] = (unsigned long)arg8;                          \
+      _argvec[9] = (unsigned long)arg9;                          \
+      __asm__ volatile(                                          \
+         VALGRIND_CFI_PROLOGUE                                   \
+         "aghi 15,-192\n\t"                                      \
+         "lg 2, 8(1)\n\t"                                        \
+         "lg 3,16(1)\n\t"                                        \
+         "lg 4,24(1)\n\t"                                        \
+         "lg 5,32(1)\n\t"                                        \
+         "lg 6,40(1)\n\t"                                        \
+         "mvc 160(8,15), 48(1)\n\t"                              \
+         "mvc 168(8,15), 56(1)\n\t"                              \
+         "mvc 176(8,15), 64(1)\n\t"                              \
+         "mvc 184(8,15), 72(1)\n\t"                              \
+         "lg 1, 0(1)\n\t"                                        \
+         VALGRIND_CALL_NOREDIR_R1                                \
+         "lgr %0, 2\n\t"                                         \
+         "aghi 15,192\n\t"                                       \
+         VALGRIND_CFI_EPILOGUE                                   \
+         : /*out*/   "=d" (_res)                                 \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER           \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS,"6","7" \
+      );                                                         \
+      lval = (__typeof__(lval)) _res;                            \
    } while (0)
 
-#define CALL_FN_W_10W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,  \
-                                  arg7,arg8,arg9,arg10)           \
-   do {                                                           \
-      volatile OrigFn        _orig = (orig);                      \
-      volatile unsigned long _argvec[3+10];                       \
-      volatile unsigned long _res;                                \
-      /* _argvec[0] holds current r2 across the call */           \
-      _argvec[1]   = (unsigned long)_orig.r2;                     \
-      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
-      _argvec[2+1] = (unsigned long)arg1;                         \
-      _argvec[2+2] = (unsigned long)arg2;                         \
-      _argvec[2+3] = (unsigned long)arg3;                         \
-      _argvec[2+4] = (unsigned long)arg4;                         \
-      _argvec[2+5] = (unsigned long)arg5;                         \
-      _argvec[2+6] = (unsigned long)arg6;                         \
-      _argvec[2+7] = (unsigned long)arg7;                         \
-      _argvec[2+8] = (unsigned long)arg8;                         \
-      _argvec[2+9] = (unsigned long)arg9;                         \
-      _argvec[2+10] = (unsigned long)arg10;                       \
-      __asm__ volatile(                                           \
-         "mr 11,%1\n\t"                                           \
-         VG_EXPAND_FRAME_BY_trashes_r3(512)                       \
-         "stw  2,-8(11)\n\t"  /* save tocptr */                   \
-         "lwz  2,-4(11)\n\t"  /* use nraddr's tocptr */           \
-         VG_EXPAND_FRAME_BY_trashes_r3(64)                        \
-         /* arg10 */                                              \
-         "lwz 3,40(11)\n\t"                                       \
-         "stw 3,60(1)\n\t"                                        \
-         /* arg9 */                                               \
-         "lwz 3,36(11)\n\t"                                       \
-         "stw 3,56(1)\n\t"                                        \
-         /* args1-8 */                                            \
-         "lwz  3, 4(11)\n\t"  /* arg1->r3 */                      \
-         "lwz  4, 8(11)\n\t"  /* arg2->r4 */                      \
-         "lwz  5, 12(11)\n\t" /* arg3->r5 */                      \
-         "lwz  6, 16(11)\n\t" /* arg4->r6 */                      \
-         "lwz  7, 20(11)\n\t" /* arg5->r7 */                      \
-         "lwz  8, 24(11)\n\t" /* arg6->r8 */                      \
-         "lwz  9, 28(11)\n\t" /* arg7->r9 */                      \
-         "lwz 10, 32(11)\n\t" /* arg8->r10 */                     \
-         "lwz 11, 0(11)\n\t"  /* target->r11 */                   \
-         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
-         "mr 11,%1\n\t"                                           \
-         "mr %0,3\n\t"                                            \
-         "lwz 2,-8(11)\n\t" /* restore tocptr */                  \
-         VG_CONTRACT_FRAME_BY(64)                                 \
-         VG_CONTRACT_FRAME_BY(512)                                \
-         : /*out*/   "=r" (_res)                                  \
-         : /*in*/    "r" (&_argvec[2])                            \
-         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
-      );                                                          \
-      lval = (__typeof__(lval)) _res;                             \
+#define CALL_FN_W_10W(lval, orig, arg1, arg2, arg3, arg4, arg5,  \
+                     arg6, arg7 ,arg8, arg9, arg10)              \
+   do {                                                          \
+      volatile OrigFn        _orig = (orig);                     \
+      volatile unsigned long _argvec[11];                        \
+      volatile unsigned long _res;                               \
+      _argvec[0] = (unsigned long)_orig.nraddr;                  \
+      _argvec[1] = (unsigned long)arg1;                          \
+      _argvec[2] = (unsigned long)arg2;                          \
+      _argvec[3] = (unsigned long)arg3;                          \
+      _argvec[4] = (unsigned long)arg4;                          \
+      _argvec[5] = (unsigned long)arg5;                          \
+      _argvec[6] = (unsigned long)arg6;                          \
+      _argvec[7] = (unsigned long)arg7;                          \
+      _argvec[8] = (unsigned long)arg8;                          \
+      _argvec[9] = (unsigned long)arg9;                          \
+      _argvec[10] = (unsigned long)arg10;                        \
+      __asm__ volatile(                                          \
+         VALGRIND_CFI_PROLOGUE                                   \
+         "aghi 15,-200\n\t"                                      \
+         "lg 2, 8(1)\n\t"                                        \
+         "lg 3,16(1)\n\t"                                        \
+         "lg 4,24(1)\n\t"                                        \
+         "lg 5,32(1)\n\t"                                        \
+         "lg 6,40(1)\n\t"                                        \
+         "mvc 160(8,15), 48(1)\n\t"                              \
+         "mvc 168(8,15), 56(1)\n\t"                              \
+         "mvc 176(8,15), 64(1)\n\t"                              \
+         "mvc 184(8,15), 72(1)\n\t"                              \
+         "mvc 192(8,15), 80(1)\n\t"                              \
+         "lg 1, 0(1)\n\t"                                        \
+         VALGRIND_CALL_NOREDIR_R1                                \
+         "lgr %0, 2\n\t"                                         \
+         "aghi 15,200\n\t"                                       \
+         VALGRIND_CFI_EPILOGUE                                   \
+         : /*out*/   "=d" (_res)                                 \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER           \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS,"6","7" \
+      );                                                         \
+      lval = (__typeof__(lval)) _res;                            \
    } while (0)
 
-#define CALL_FN_W_11W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,  \
-                                  arg7,arg8,arg9,arg10,arg11)     \
-   do {                                                           \
-      volatile OrigFn        _orig = (orig);                      \
-      volatile unsigned long _argvec[3+11];                       \
-      volatile unsigned long _res;                                \
-      /* _argvec[0] holds current r2 across the call */           \
-      _argvec[1]   = (unsigned long)_orig.r2;                     \
-      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
-      _argvec[2+1] = (unsigned long)arg1;                         \
-      _argvec[2+2] = (unsigned long)arg2;                         \
-      _argvec[2+3] = (unsigned long)arg3;                         \
-      _argvec[2+4] = (unsigned long)arg4;                         \
-      _argvec[2+5] = (unsigned long)arg5;                         \
-      _argvec[2+6] = (unsigned long)arg6;                         \
-      _argvec[2+7] = (unsigned long)arg7;                         \
-      _argvec[2+8] = (unsigned long)arg8;                         \
-      _argvec[2+9] = (unsigned long)arg9;                         \
-      _argvec[2+10] = (unsigned long)arg10;                       \
-      _argvec[2+11] = (unsigned long)arg11;                       \
-      __asm__ volatile(                                           \
-         "mr 11,%1\n\t"                                           \
-         VG_EXPAND_FRAME_BY_trashes_r3(512)                       \
-         "stw  2,-8(11)\n\t"  /* save tocptr */                   \
-         "lwz  2,-4(11)\n\t"  /* use nraddr's tocptr */           \
-         VG_EXPAND_FRAME_BY_trashes_r3(72)                        \
-         /* arg11 */                                              \
-         "lwz 3,44(11)\n\t"                                       \
-         "stw 3,64(1)\n\t"                                        \
-         /* arg10 */                                              \
-         "lwz 3,40(11)\n\t"                                       \
-         "stw 3,60(1)\n\t"                                        \
-         /* arg9 */                                               \
-         "lwz 3,36(11)\n\t"                                       \
-         "stw 3,56(1)\n\t"                                        \
-         /* args1-8 */                                            \
-         "lwz  3, 4(11)\n\t"  /* arg1->r3 */                      \
-         "lwz  4, 8(11)\n\t"  /* arg2->r4 */                      \
-         "lwz  5, 12(11)\n\t" /* arg3->r5 */                      \
-         "lwz  6, 16(11)\n\t" /* arg4->r6 */                      \
-         "lwz  7, 20(11)\n\t" /* arg5->r7 */                      \
-         "lwz  8, 24(11)\n\t" /* arg6->r8 */                      \
-         "lwz  9, 28(11)\n\t" /* arg7->r9 */                      \
-         "lwz 10, 32(11)\n\t" /* arg8->r10 */                     \
-         "lwz 11, 0(11)\n\t"  /* target->r11 */                   \
-         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
-         "mr 11,%1\n\t"                                           \
-         "mr %0,3\n\t"                                            \
-         "lwz 2,-8(11)\n\t" /* restore tocptr */                  \
-         VG_CONTRACT_FRAME_BY(72)                                 \
-         VG_CONTRACT_FRAME_BY(512)                                \
-         : /*out*/   "=r" (_res)                                  \
-         : /*in*/    "r" (&_argvec[2])                            \
-         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
-      );                                                          \
-      lval = (__typeof__(lval)) _res;                             \
+#define CALL_FN_W_11W(lval, orig, arg1, arg2, arg3, arg4, arg5,  \
+                     arg6, arg7 ,arg8, arg9, arg10, arg11)       \
+   do {                                                          \
+      volatile OrigFn        _orig = (orig);                     \
+      volatile unsigned long _argvec[12];                        \
+      volatile unsigned long _res;                               \
+      _argvec[0] = (unsigned long)_orig.nraddr;                  \
+      _argvec[1] = (unsigned long)arg1;                          \
+      _argvec[2] = (unsigned long)arg2;                          \
+      _argvec[3] = (unsigned long)arg3;                          \
+      _argvec[4] = (unsigned long)arg4;                          \
+      _argvec[5] = (unsigned long)arg5;                          \
+      _argvec[6] = (unsigned long)arg6;                          \
+      _argvec[7] = (unsigned long)arg7;                          \
+      _argvec[8] = (unsigned long)arg8;                          \
+      _argvec[9] = (unsigned long)arg9;                          \
+      _argvec[10] = (unsigned long)arg10;                        \
+      _argvec[11] = (unsigned long)arg11;                        \
+      __asm__ volatile(                                          \
+         VALGRIND_CFI_PROLOGUE                                   \
+         "aghi 15,-208\n\t"                                      \
+         "lg 2, 8(1)\n\t"                                        \
+         "lg 3,16(1)\n\t"                                        \
+         "lg 4,24(1)\n\t"                                        \
+         "lg 5,32(1)\n\t"                                        \
+         "lg 6,40(1)\n\t"                                        \
+         "mvc 160(8,15), 48(1)\n\t"                              \
+         "mvc 168(8,15), 56(1)\n\t"                              \
+         "mvc 176(8,15), 64(1)\n\t"                              \
+         "mvc 184(8,15), 72(1)\n\t"                              \
+         "mvc 192(8,15), 80(1)\n\t"                              \
+         "mvc 200(8,15), 88(1)\n\t"                              \
+         "lg 1, 0(1)\n\t"                                        \
+         VALGRIND_CALL_NOREDIR_R1                                \
+         "lgr %0, 2\n\t"                                         \
+         "aghi 15,208\n\t"                                       \
+         VALGRIND_CFI_EPILOGUE                                   \
+         : /*out*/   "=d" (_res)                                 \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER           \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS,"6","7" \
+      );                                                         \
+      lval = (__typeof__(lval)) _res;                            \
    } while (0)
 
-#define CALL_FN_W_12W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,  \
-                                arg7,arg8,arg9,arg10,arg11,arg12) \
-   do {                                                           \
-      volatile OrigFn        _orig = (orig);                      \
-      volatile unsigned long _argvec[3+12];                       \
-      volatile unsigned long _res;                                \
-      /* _argvec[0] holds current r2 across the call */           \
-      _argvec[1]   = (unsigned long)_orig.r2;                     \
-      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
-      _argvec[2+1] = (unsigned long)arg1;                         \
-      _argvec[2+2] = (unsigned long)arg2;                         \
-      _argvec[2+3] = (unsigned long)arg3;                         \
-      _argvec[2+4] = (unsigned long)arg4;                         \
-      _argvec[2+5] = (unsigned long)arg5;                         \
-      _argvec[2+6] = (unsigned long)arg6;                         \
-      _argvec[2+7] = (unsigned long)arg7;                         \
-      _argvec[2+8] = (unsigned long)arg8;                         \
-      _argvec[2+9] = (unsigned long)arg9;                         \
-      _argvec[2+10] = (unsigned long)arg10;                       \
-      _argvec[2+11] = (unsigned long)arg11;                       \
-      _argvec[2+12] = (unsigned long)arg12;                       \
-      __asm__ volatile(                                           \
-         "mr 11,%1\n\t"                                           \
-         VG_EXPAND_FRAME_BY_trashes_r3(512)                       \
-         "stw  2,-8(11)\n\t"  /* save tocptr */                   \
-         "lwz  2,-4(11)\n\t"  /* use nraddr's tocptr */           \
-         VG_EXPAND_FRAME_BY_trashes_r3(72)                        \
-         /* arg12 */                                              \
-         "lwz 3,48(11)\n\t"                                       \
-         "stw 3,68(1)\n\t"                                        \
-         /* arg11 */                                              \
-         "lwz 3,44(11)\n\t"                                       \
-         "stw 3,64(1)\n\t"                                        \
-         /* arg10 */                                              \
-         "lwz 3,40(11)\n\t"                                       \
-         "stw 3,60(1)\n\t"                                        \
-         /* arg9 */                                               \
-         "lwz 3,36(11)\n\t"                                       \
-         "stw 3,56(1)\n\t"                                        \
-         /* args1-8 */                                            \
-         "lwz  3, 4(11)\n\t"  /* arg1->r3 */                      \
-         "lwz  4, 8(11)\n\t"  /* arg2->r4 */                      \
-         "lwz  5, 12(11)\n\t" /* arg3->r5 */                      \
-         "lwz  6, 16(11)\n\t" /* arg4->r6 */                      \
-         "lwz  7, 20(11)\n\t" /* arg5->r7 */                      \
-         "lwz  8, 24(11)\n\t" /* arg6->r8 */                      \
-         "lwz  9, 28(11)\n\t" /* arg7->r9 */                      \
-         "lwz 10, 32(11)\n\t" /* arg8->r10 */                     \
-         "lwz 11, 0(11)\n\t"  /* target->r11 */                   \
-         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
-         "mr 11,%1\n\t"                                           \
-         "mr %0,3\n\t"                                            \
-         "lwz 2,-8(11)\n\t" /* restore tocptr */                  \
-         VG_CONTRACT_FRAME_BY(72)                                 \
-         VG_CONTRACT_FRAME_BY(512)                                \
-         : /*out*/   "=r" (_res)                                  \
-         : /*in*/    "r" (&_argvec[2])                            \
-         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
-      );                                                          \
-      lval = (__typeof__(lval)) _res;                             \
+#define CALL_FN_W_12W(lval, orig, arg1, arg2, arg3, arg4, arg5,  \
+                     arg6, arg7 ,arg8, arg9, arg10, arg11, arg12)\
+   do {                                                          \
+      volatile OrigFn        _orig = (orig);                     \
+      volatile unsigned long _argvec[13];                        \
+      volatile unsigned long _res;                               \
+      _argvec[0] = (unsigned long)_orig.nraddr;                  \
+      _argvec[1] = (unsigned long)arg1;                          \
+      _argvec[2] = (unsigned long)arg2;                          \
+      _argvec[3] = (unsigned long)arg3;                          \
+      _argvec[4] = (unsigned long)arg4;                          \
+      _argvec[5] = (unsigned long)arg5;                          \
+      _argvec[6] = (unsigned long)arg6;                          \
+      _argvec[7] = (unsigned long)arg7;                          \
+      _argvec[8] = (unsigned long)arg8;                          \
+      _argvec[9] = (unsigned long)arg9;                          \
+      _argvec[10] = (unsigned long)arg10;                        \
+      _argvec[11] = (unsigned long)arg11;                        \
+      _argvec[12] = (unsigned long)arg12;                        \
+      __asm__ volatile(                                          \
+         VALGRIND_CFI_PROLOGUE                                   \
+         "aghi 15,-216\n\t"                                      \
+         "lg 2, 8(1)\n\t"                                        \
+         "lg 3,16(1)\n\t"                                        \
+         "lg 4,24(1)\n\t"                                        \
+         "lg 5,32(1)\n\t"                                        \
+         "lg 6,40(1)\n\t"                                        \
+         "mvc 160(8,15), 48(1)\n\t"                              \
+         "mvc 168(8,15), 56(1)\n\t"                              \
+         "mvc 176(8,15), 64(1)\n\t"                              \
+         "mvc 184(8,15), 72(1)\n\t"                              \
+         "mvc 192(8,15), 80(1)\n\t"                              \
+         "mvc 200(8,15), 88(1)\n\t"                              \
+         "mvc 208(8,15), 96(1)\n\t"                              \
+         "lg 1, 0(1)\n\t"                                        \
+         VALGRIND_CALL_NOREDIR_R1                                \
+         "lgr %0, 2\n\t"                                         \
+         "aghi 15,216\n\t"                                       \
+         VALGRIND_CFI_EPILOGUE                                   \
+         : /*out*/   "=d" (_res)                                 \
+         : /*in*/    "a" (&_argvec[0]) __FRAME_POINTER           \
+         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS,"6","7" \
+      );                                                         \
+      lval = (__typeof__(lval)) _res;                            \
    } while (0)
 
-#endif /* PLAT_ppc32_aix5 */
 
-/* ------------------------ ppc64-aix5 ------------------------- */
-
-#if defined(PLAT_ppc64_aix5)
-
-/* ARGREGS: r3 r4 r5 r6 r7 r8 r9 r10 (the rest on stack somewhere) */
-
-/* These regs are trashed by the hidden call. */
-#define __CALLER_SAVED_REGS                                       \
-   "lr", "ctr", "xer",                                            \
-   "cr0", "cr1", "cr2", "cr3", "cr4", "cr5", "cr6", "cr7",        \
-   "r0", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10",   \
-   "r11", "r12", "r13"
-
-/* Expand the stack frame, copying enough info that unwinding
-   still works.  Trashes r3. */
-
-#define VG_EXPAND_FRAME_BY_trashes_r3(_n_fr)                      \
-         "addi 1,1,-" #_n_fr "\n\t"                               \
-         "ld   3," #_n_fr "(1)\n\t"                               \
-         "std  3,0(1)\n\t"
-
-#define VG_CONTRACT_FRAME_BY(_n_fr)                               \
-         "addi 1,1," #_n_fr "\n\t"
-
-/* These CALL_FN_ macros assume that on ppc64-aix5, sizeof(unsigned
-   long) == 8. */
-
-#define CALL_FN_W_v(lval, orig)                                   \
-   do {                                                           \
-      volatile OrigFn        _orig = (orig);                      \
-      volatile unsigned long _argvec[3+0];                        \
-      volatile unsigned long _res;                                \
-      /* _argvec[0] holds current r2 across the call */           \
-      _argvec[1] = (unsigned long)_orig.r2;                       \
-      _argvec[2] = (unsigned long)_orig.nraddr;                   \
-      __asm__ volatile(                                           \
-         "mr 11,%1\n\t"                                           \
-         VG_EXPAND_FRAME_BY_trashes_r3(512)                       \
-         "std  2,-16(11)\n\t" /* save tocptr */                   \
-         "ld   2,-8(11)\n\t"  /* use nraddr's tocptr */           \
-         "ld  11, 0(11)\n\t"  /* target->r11 */                   \
-         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
-         "mr 11,%1\n\t"                                           \
-         "mr %0,3\n\t"                                            \
-         "ld 2,-16(11)\n\t" /* restore tocptr */                  \
-         VG_CONTRACT_FRAME_BY(512)                                \
-         : /*out*/   "=r" (_res)                                  \
-         : /*in*/    "r" (&_argvec[2])                            \
-         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
-      );                                                          \
-      lval = (__typeof__(lval)) _res;                             \
-   } while (0)
-
-#define CALL_FN_W_W(lval, orig, arg1)                             \
-   do {                                                           \
-      volatile OrigFn        _orig = (orig);                      \
-      volatile unsigned long _argvec[3+1];                        \
-      volatile unsigned long _res;                                \
-      /* _argvec[0] holds current r2 across the call */           \
-      _argvec[1]   = (unsigned long)_orig.r2;                     \
-      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
-      _argvec[2+1] = (unsigned long)arg1;                         \
-      __asm__ volatile(                                           \
-         "mr 11,%1\n\t"                                           \
-         VG_EXPAND_FRAME_BY_trashes_r3(512)                       \
-         "std  2,-16(11)\n\t" /* save tocptr */                   \
-         "ld   2,-8(11)\n\t"  /* use nraddr's tocptr */           \
-         "ld   3, 8(11)\n\t"  /* arg1->r3 */                      \
-         "ld  11, 0(11)\n\t"  /* target->r11 */                   \
-         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
-         "mr 11,%1\n\t"                                           \
-         "mr %0,3\n\t"                                            \
-         "ld 2,-16(11)\n\t" /* restore tocptr */                  \
-         VG_CONTRACT_FRAME_BY(512)                                \
-         : /*out*/   "=r" (_res)                                  \
-         : /*in*/    "r" (&_argvec[2])                            \
-         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
-      );                                                          \
-      lval = (__typeof__(lval)) _res;                             \
-   } while (0)
-
-#define CALL_FN_W_WW(lval, orig, arg1,arg2)                       \
-   do {                                                           \
-      volatile OrigFn        _orig = (orig);                      \
-      volatile unsigned long _argvec[3+2];                        \
-      volatile unsigned long _res;                                \
-      /* _argvec[0] holds current r2 across the call */           \
-      _argvec[1]   = (unsigned long)_orig.r2;                     \
-      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
-      _argvec[2+1] = (unsigned long)arg1;                         \
-      _argvec[2+2] = (unsigned long)arg2;                         \
-      __asm__ volatile(                                           \
-         "mr 11,%1\n\t"                                           \
-         VG_EXPAND_FRAME_BY_trashes_r3(512)                       \
-         "std  2,-16(11)\n\t" /* save tocptr */                   \
-         "ld   2,-8(11)\n\t"  /* use nraddr's tocptr */           \
-         "ld   3, 8(11)\n\t"  /* arg1->r3 */                      \
-         "ld   4, 16(11)\n\t" /* arg2->r4 */                      \
-         "ld  11, 0(11)\n\t"  /* target->r11 */                   \
-         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
-         "mr 11,%1\n\t"                                           \
-         "mr %0,3\n\t"                                            \
-         "ld  2,-16(11)\n\t" /* restore tocptr */                 \
-         VG_CONTRACT_FRAME_BY(512)                                \
-         : /*out*/   "=r" (_res)                                  \
-         : /*in*/    "r" (&_argvec[2])                            \
-         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
-      );                                                          \
-      lval = (__typeof__(lval)) _res;                             \
-   } while (0)
-
-#define CALL_FN_W_WWW(lval, orig, arg1,arg2,arg3)                 \
-   do {                                                           \
-      volatile OrigFn        _orig = (orig);                      \
-      volatile unsigned long _argvec[3+3];                        \
-      volatile unsigned long _res;                                \
-      /* _argvec[0] holds current r2 across the call */           \
-      _argvec[1]   = (unsigned long)_orig.r2;                     \
-      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
-      _argvec[2+1] = (unsigned long)arg1;                         \
-      _argvec[2+2] = (unsigned long)arg2;                         \
-      _argvec[2+3] = (unsigned long)arg3;                         \
-      __asm__ volatile(                                           \
-         "mr 11,%1\n\t"                                           \
-         VG_EXPAND_FRAME_BY_trashes_r3(512)                       \
-         "std  2,-16(11)\n\t" /* save tocptr */                   \
-         "ld   2,-8(11)\n\t"  /* use nraddr's tocptr */           \
-         "ld   3, 8(11)\n\t"  /* arg1->r3 */                      \
-         "ld   4, 16(11)\n\t" /* arg2->r4 */                      \
-         "ld   5, 24(11)\n\t" /* arg3->r5 */                      \
-         "ld  11, 0(11)\n\t"  /* target->r11 */                   \
-         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
-         "mr 11,%1\n\t"                                           \
-         "mr %0,3\n\t"                                            \
-         "ld  2,-16(11)\n\t" /* restore tocptr */                 \
-         VG_CONTRACT_FRAME_BY(512)                                \
-         : /*out*/   "=r" (_res)                                  \
-         : /*in*/    "r" (&_argvec[2])                            \
-         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
-      );                                                          \
-      lval = (__typeof__(lval)) _res;                             \
-   } while (0)
-
-#define CALL_FN_W_WWWW(lval, orig, arg1,arg2,arg3,arg4)           \
-   do {                                                           \
-      volatile OrigFn        _orig = (orig);                      \
-      volatile unsigned long _argvec[3+4];                        \
-      volatile unsigned long _res;                                \
-      /* _argvec[0] holds current r2 across the call */           \
-      _argvec[1]   = (unsigned long)_orig.r2;                     \
-      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
-      _argvec[2+1] = (unsigned long)arg1;                         \
-      _argvec[2+2] = (unsigned long)arg2;                         \
-      _argvec[2+3] = (unsigned long)arg3;                         \
-      _argvec[2+4] = (unsigned long)arg4;                         \
-      __asm__ volatile(                                           \
-         "mr 11,%1\n\t"                                           \
-         VG_EXPAND_FRAME_BY_trashes_r3(512)                       \
-         "std  2,-16(11)\n\t" /* save tocptr */                   \
-         "ld   2,-8(11)\n\t"  /* use nraddr's tocptr */           \
-         "ld   3, 8(11)\n\t"  /* arg1->r3 */                      \
-         "ld   4, 16(11)\n\t" /* arg2->r4 */                      \
-         "ld   5, 24(11)\n\t" /* arg3->r5 */                      \
-         "ld   6, 32(11)\n\t" /* arg4->r6 */                      \
-         "ld  11, 0(11)\n\t"  /* target->r11 */                   \
-         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
-         "mr 11,%1\n\t"                                           \
-         "mr %0,3\n\t"                                            \
-         "ld  2,-16(11)\n\t" /* restore tocptr */                 \
-         VG_CONTRACT_FRAME_BY(512)                                \
-         : /*out*/   "=r" (_res)                                  \
-         : /*in*/    "r" (&_argvec[2])                            \
-         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
-      );                                                          \
-      lval = (__typeof__(lval)) _res;                             \
-   } while (0)
-
-#define CALL_FN_W_5W(lval, orig, arg1,arg2,arg3,arg4,arg5)        \
-   do {                                                           \
-      volatile OrigFn        _orig = (orig);                      \
-      volatile unsigned long _argvec[3+5];                        \
-      volatile unsigned long _res;                                \
-      /* _argvec[0] holds current r2 across the call */           \
-      _argvec[1]   = (unsigned long)_orig.r2;                     \
-      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
-      _argvec[2+1] = (unsigned long)arg1;                         \
-      _argvec[2+2] = (unsigned long)arg2;                         \
-      _argvec[2+3] = (unsigned long)arg3;                         \
-      _argvec[2+4] = (unsigned long)arg4;                         \
-      _argvec[2+5] = (unsigned long)arg5;                         \
-      __asm__ volatile(                                           \
-         "mr 11,%1\n\t"                                           \
-         VG_EXPAND_FRAME_BY_trashes_r3(512)                       \
-         "std  2,-16(11)\n\t" /* save tocptr */                   \
-         "ld   2,-8(11)\n\t"  /* use nraddr's tocptr */           \
-         "ld   3, 8(11)\n\t"  /* arg1->r3 */                      \
-         "ld   4, 16(11)\n\t" /* arg2->r4 */                      \
-         "ld   5, 24(11)\n\t" /* arg3->r5 */                      \
-         "ld   6, 32(11)\n\t" /* arg4->r6 */                      \
-         "ld   7, 40(11)\n\t" /* arg5->r7 */                      \
-         "ld  11, 0(11)\n\t"  /* target->r11 */                   \
-         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
-         "mr 11,%1\n\t"                                           \
-         "mr %0,3\n\t"                                            \
-         "ld  2,-16(11)\n\t" /* restore tocptr */                 \
-         VG_CONTRACT_FRAME_BY(512)                                \
-         : /*out*/   "=r" (_res)                                  \
-         : /*in*/    "r" (&_argvec[2])                            \
-         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
-      );                                                          \
-      lval = (__typeof__(lval)) _res;                             \
-   } while (0)
-
-#define CALL_FN_W_6W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6)   \
-   do {                                                           \
-      volatile OrigFn        _orig = (orig);                      \
-      volatile unsigned long _argvec[3+6];                        \
-      volatile unsigned long _res;                                \
-      /* _argvec[0] holds current r2 across the call */           \
-      _argvec[1]   = (unsigned long)_orig.r2;                     \
-      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
-      _argvec[2+1] = (unsigned long)arg1;                         \
-      _argvec[2+2] = (unsigned long)arg2;                         \
-      _argvec[2+3] = (unsigned long)arg3;                         \
-      _argvec[2+4] = (unsigned long)arg4;                         \
-      _argvec[2+5] = (unsigned long)arg5;                         \
-      _argvec[2+6] = (unsigned long)arg6;                         \
-      __asm__ volatile(                                           \
-         "mr 11,%1\n\t"                                           \
-         VG_EXPAND_FRAME_BY_trashes_r3(512)                       \
-         "std  2,-16(11)\n\t" /* save tocptr */                   \
-         "ld   2,-8(11)\n\t"  /* use nraddr's tocptr */           \
-         "ld   3, 8(11)\n\t"  /* arg1->r3 */                      \
-         "ld   4, 16(11)\n\t" /* arg2->r4 */                      \
-         "ld   5, 24(11)\n\t" /* arg3->r5 */                      \
-         "ld   6, 32(11)\n\t" /* arg4->r6 */                      \
-         "ld   7, 40(11)\n\t" /* arg5->r7 */                      \
-         "ld   8, 48(11)\n\t" /* arg6->r8 */                      \
-         "ld  11, 0(11)\n\t"  /* target->r11 */                   \
-         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
-         "mr 11,%1\n\t"                                           \
-         "mr %0,3\n\t"                                            \
-         "ld  2,-16(11)\n\t" /* restore tocptr */                 \
-         VG_CONTRACT_FRAME_BY(512)                                \
-         : /*out*/   "=r" (_res)                                  \
-         : /*in*/    "r" (&_argvec[2])                            \
-         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
-      );                                                          \
-      lval = (__typeof__(lval)) _res;                             \
-   } while (0)
-
-#define CALL_FN_W_7W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,   \
-                                 arg7)                            \
-   do {                                                           \
-      volatile OrigFn        _orig = (orig);                      \
-      volatile unsigned long _argvec[3+7];                        \
-      volatile unsigned long _res;                                \
-      /* _argvec[0] holds current r2 across the call */           \
-      _argvec[1]   = (unsigned long)_orig.r2;                     \
-      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
-      _argvec[2+1] = (unsigned long)arg1;                         \
-      _argvec[2+2] = (unsigned long)arg2;                         \
-      _argvec[2+3] = (unsigned long)arg3;                         \
-      _argvec[2+4] = (unsigned long)arg4;                         \
-      _argvec[2+5] = (unsigned long)arg5;                         \
-      _argvec[2+6] = (unsigned long)arg6;                         \
-      _argvec[2+7] = (unsigned long)arg7;                         \
-      __asm__ volatile(                                           \
-         "mr 11,%1\n\t"                                           \
-         VG_EXPAND_FRAME_BY_trashes_r3(512)                       \
-         "std  2,-16(11)\n\t" /* save tocptr */                   \
-         "ld   2,-8(11)\n\t"  /* use nraddr's tocptr */           \
-         "ld   3, 8(11)\n\t"  /* arg1->r3 */                      \
-         "ld   4, 16(11)\n\t" /* arg2->r4 */                      \
-         "ld   5, 24(11)\n\t" /* arg3->r5 */                      \
-         "ld   6, 32(11)\n\t" /* arg4->r6 */                      \
-         "ld   7, 40(11)\n\t" /* arg5->r7 */                      \
-         "ld   8, 48(11)\n\t" /* arg6->r8 */                      \
-         "ld   9, 56(11)\n\t" /* arg7->r9 */                      \
-         "ld  11, 0(11)\n\t"  /* target->r11 */                   \
-         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
-         "mr 11,%1\n\t"                                           \
-         "mr %0,3\n\t"                                            \
-         "ld  2,-16(11)\n\t" /* restore tocptr */                 \
-         VG_CONTRACT_FRAME_BY(512)                                \
-         : /*out*/   "=r" (_res)                                  \
-         : /*in*/    "r" (&_argvec[2])                            \
-         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
-      );                                                          \
-      lval = (__typeof__(lval)) _res;                             \
-   } while (0)
-
-#define CALL_FN_W_8W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,   \
-                                 arg7,arg8)                       \
-   do {                                                           \
-      volatile OrigFn        _orig = (orig);                      \
-      volatile unsigned long _argvec[3+8];                        \
-      volatile unsigned long _res;                                \
-      /* _argvec[0] holds current r2 across the call */           \
-      _argvec[1]   = (unsigned long)_orig.r2;                     \
-      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
-      _argvec[2+1] = (unsigned long)arg1;                         \
-      _argvec[2+2] = (unsigned long)arg2;                         \
-      _argvec[2+3] = (unsigned long)arg3;                         \
-      _argvec[2+4] = (unsigned long)arg4;                         \
-      _argvec[2+5] = (unsigned long)arg5;                         \
-      _argvec[2+6] = (unsigned long)arg6;                         \
-      _argvec[2+7] = (unsigned long)arg7;                         \
-      _argvec[2+8] = (unsigned long)arg8;                         \
-      __asm__ volatile(                                           \
-         "mr 11,%1\n\t"                                           \
-         VG_EXPAND_FRAME_BY_trashes_r3(512)                       \
-         "std  2,-16(11)\n\t" /* save tocptr */                   \
-         "ld   2,-8(11)\n\t"  /* use nraddr's tocptr */           \
-         "ld   3, 8(11)\n\t"  /* arg1->r3 */                      \
-         "ld   4, 16(11)\n\t" /* arg2->r4 */                      \
-         "ld   5, 24(11)\n\t" /* arg3->r5 */                      \
-         "ld   6, 32(11)\n\t" /* arg4->r6 */                      \
-         "ld   7, 40(11)\n\t" /* arg5->r7 */                      \
-         "ld   8, 48(11)\n\t" /* arg6->r8 */                      \
-         "ld   9, 56(11)\n\t" /* arg7->r9 */                      \
-         "ld  10, 64(11)\n\t" /* arg8->r10 */                     \
-         "ld  11, 0(11)\n\t"  /* target->r11 */                   \
-         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
-         "mr 11,%1\n\t"                                           \
-         "mr %0,3\n\t"                                            \
-         "ld  2,-16(11)\n\t" /* restore tocptr */                 \
-         VG_CONTRACT_FRAME_BY(512)                                \
-         : /*out*/   "=r" (_res)                                  \
-         : /*in*/    "r" (&_argvec[2])                            \
-         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
-      );                                                          \
-      lval = (__typeof__(lval)) _res;                             \
-   } while (0)
-
-#define CALL_FN_W_9W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,   \
-                                 arg7,arg8,arg9)                  \
-   do {                                                           \
-      volatile OrigFn        _orig = (orig);                      \
-      volatile unsigned long _argvec[3+9];                        \
-      volatile unsigned long _res;                                \
-      /* _argvec[0] holds current r2 across the call */           \
-      _argvec[1]   = (unsigned long)_orig.r2;                     \
-      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
-      _argvec[2+1] = (unsigned long)arg1;                         \
-      _argvec[2+2] = (unsigned long)arg2;                         \
-      _argvec[2+3] = (unsigned long)arg3;                         \
-      _argvec[2+4] = (unsigned long)arg4;                         \
-      _argvec[2+5] = (unsigned long)arg5;                         \
-      _argvec[2+6] = (unsigned long)arg6;                         \
-      _argvec[2+7] = (unsigned long)arg7;                         \
-      _argvec[2+8] = (unsigned long)arg8;                         \
-      _argvec[2+9] = (unsigned long)arg9;                         \
-      __asm__ volatile(                                           \
-         "mr 11,%1\n\t"                                           \
-         VG_EXPAND_FRAME_BY_trashes_r3(512)                       \
-         "std  2,-16(11)\n\t" /* save tocptr */                   \
-         "ld   2,-8(11)\n\t"  /* use nraddr's tocptr */           \
-         VG_EXPAND_FRAME_BY_trashes_r3(128)                       \
-         /* arg9 */                                               \
-         "ld  3,72(11)\n\t"                                       \
-         "std 3,112(1)\n\t"                                       \
-         /* args1-8 */                                            \
-         "ld   3, 8(11)\n\t"  /* arg1->r3 */                      \
-         "ld   4, 16(11)\n\t" /* arg2->r4 */                      \
-         "ld   5, 24(11)\n\t" /* arg3->r5 */                      \
-         "ld   6, 32(11)\n\t" /* arg4->r6 */                      \
-         "ld   7, 40(11)\n\t" /* arg5->r7 */                      \
-         "ld   8, 48(11)\n\t" /* arg6->r8 */                      \
-         "ld   9, 56(11)\n\t" /* arg7->r9 */                      \
-         "ld  10, 64(11)\n\t" /* arg8->r10 */                     \
-         "ld  11, 0(11)\n\t"  /* target->r11 */                   \
-         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
-         "mr 11,%1\n\t"                                           \
-         "mr %0,3\n\t"                                            \
-         "ld  2,-16(11)\n\t" /* restore tocptr */                 \
-         VG_CONTRACT_FRAME_BY(128)                                \
-         VG_CONTRACT_FRAME_BY(512)                                \
-         : /*out*/   "=r" (_res)                                  \
-         : /*in*/    "r" (&_argvec[2])                            \
-         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
-      );                                                          \
-      lval = (__typeof__(lval)) _res;                             \
-   } while (0)
-
-#define CALL_FN_W_10W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,  \
-                                  arg7,arg8,arg9,arg10)           \
-   do {                                                           \
-      volatile OrigFn        _orig = (orig);                      \
-      volatile unsigned long _argvec[3+10];                       \
-      volatile unsigned long _res;                                \
-      /* _argvec[0] holds current r2 across the call */           \
-      _argvec[1]   = (unsigned long)_orig.r2;                     \
-      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
-      _argvec[2+1] = (unsigned long)arg1;                         \
-      _argvec[2+2] = (unsigned long)arg2;                         \
-      _argvec[2+3] = (unsigned long)arg3;                         \
-      _argvec[2+4] = (unsigned long)arg4;                         \
-      _argvec[2+5] = (unsigned long)arg5;                         \
-      _argvec[2+6] = (unsigned long)arg6;                         \
-      _argvec[2+7] = (unsigned long)arg7;                         \
-      _argvec[2+8] = (unsigned long)arg8;                         \
-      _argvec[2+9] = (unsigned long)arg9;                         \
-      _argvec[2+10] = (unsigned long)arg10;                       \
-      __asm__ volatile(                                           \
-         "mr 11,%1\n\t"                                           \
-         VG_EXPAND_FRAME_BY_trashes_r3(512)                       \
-         "std  2,-16(11)\n\t" /* save tocptr */                   \
-         "ld   2,-8(11)\n\t"  /* use nraddr's tocptr */           \
-         VG_EXPAND_FRAME_BY_trashes_r3(128)                       \
-         /* arg10 */                                              \
-         "ld  3,80(11)\n\t"                                       \
-         "std 3,120(1)\n\t"                                       \
-         /* arg9 */                                               \
-         "ld  3,72(11)\n\t"                                       \
-         "std 3,112(1)\n\t"                                       \
-         /* args1-8 */                                            \
-         "ld   3, 8(11)\n\t"  /* arg1->r3 */                      \
-         "ld   4, 16(11)\n\t" /* arg2->r4 */                      \
-         "ld   5, 24(11)\n\t" /* arg3->r5 */                      \
-         "ld   6, 32(11)\n\t" /* arg4->r6 */                      \
-         "ld   7, 40(11)\n\t" /* arg5->r7 */                      \
-         "ld   8, 48(11)\n\t" /* arg6->r8 */                      \
-         "ld   9, 56(11)\n\t" /* arg7->r9 */                      \
-         "ld  10, 64(11)\n\t" /* arg8->r10 */                     \
-         "ld  11, 0(11)\n\t"  /* target->r11 */                   \
-         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
-         "mr 11,%1\n\t"                                           \
-         "mr %0,3\n\t"                                            \
-         "ld  2,-16(11)\n\t" /* restore tocptr */                 \
-         VG_CONTRACT_FRAME_BY(128)                                \
-         VG_CONTRACT_FRAME_BY(512)                                \
-         : /*out*/   "=r" (_res)                                  \
-         : /*in*/    "r" (&_argvec[2])                            \
-         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
-      );                                                          \
-      lval = (__typeof__(lval)) _res;                             \
-   } while (0)
-
-#define CALL_FN_W_11W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,  \
-                                  arg7,arg8,arg9,arg10,arg11)     \
-   do {                                                           \
-      volatile OrigFn        _orig = (orig);                      \
-      volatile unsigned long _argvec[3+11];                       \
-      volatile unsigned long _res;                                \
-      /* _argvec[0] holds current r2 across the call */           \
-      _argvec[1]   = (unsigned long)_orig.r2;                     \
-      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
-      _argvec[2+1] = (unsigned long)arg1;                         \
-      _argvec[2+2] = (unsigned long)arg2;                         \
-      _argvec[2+3] = (unsigned long)arg3;                         \
-      _argvec[2+4] = (unsigned long)arg4;                         \
-      _argvec[2+5] = (unsigned long)arg5;                         \
-      _argvec[2+6] = (unsigned long)arg6;                         \
-      _argvec[2+7] = (unsigned long)arg7;                         \
-      _argvec[2+8] = (unsigned long)arg8;                         \
-      _argvec[2+9] = (unsigned long)arg9;                         \
-      _argvec[2+10] = (unsigned long)arg10;                       \
-      _argvec[2+11] = (unsigned long)arg11;                       \
-      __asm__ volatile(                                           \
-         "mr 11,%1\n\t"                                           \
-         VG_EXPAND_FRAME_BY_trashes_r3(512)                       \
-         "std  2,-16(11)\n\t" /* save tocptr */                   \
-         "ld   2,-8(11)\n\t"  /* use nraddr's tocptr */           \
-         VG_EXPAND_FRAME_BY_trashes_r3(144)                       \
-         /* arg11 */                                              \
-         "ld  3,88(11)\n\t"                                       \
-         "std 3,128(1)\n\t"                                       \
-         /* arg10 */                                              \
-         "ld  3,80(11)\n\t"                                       \
-         "std 3,120(1)\n\t"                                       \
-         /* arg9 */                                               \
-         "ld  3,72(11)\n\t"                                       \
-         "std 3,112(1)\n\t"                                       \
-         /* args1-8 */                                            \
-         "ld   3, 8(11)\n\t"  /* arg1->r3 */                      \
-         "ld   4, 16(11)\n\t" /* arg2->r4 */                      \
-         "ld   5, 24(11)\n\t" /* arg3->r5 */                      \
-         "ld   6, 32(11)\n\t" /* arg4->r6 */                      \
-         "ld   7, 40(11)\n\t" /* arg5->r7 */                      \
-         "ld   8, 48(11)\n\t" /* arg6->r8 */                      \
-         "ld   9, 56(11)\n\t" /* arg7->r9 */                      \
-         "ld  10, 64(11)\n\t" /* arg8->r10 */                     \
-         "ld  11, 0(11)\n\t"  /* target->r11 */                   \
-         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
-         "mr 11,%1\n\t"                                           \
-         "mr %0,3\n\t"                                            \
-         "ld  2,-16(11)\n\t" /* restore tocptr */                 \
-         VG_CONTRACT_FRAME_BY(144)                                \
-         VG_CONTRACT_FRAME_BY(512)                                \
-         : /*out*/   "=r" (_res)                                  \
-         : /*in*/    "r" (&_argvec[2])                            \
-         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
-      );                                                          \
-      lval = (__typeof__(lval)) _res;                             \
-   } while (0)
-
-#define CALL_FN_W_12W(lval, orig, arg1,arg2,arg3,arg4,arg5,arg6,  \
-                                arg7,arg8,arg9,arg10,arg11,arg12) \
-   do {                                                           \
-      volatile OrigFn        _orig = (orig);                      \
-      volatile unsigned long _argvec[3+12];                       \
-      volatile unsigned long _res;                                \
-      /* _argvec[0] holds current r2 across the call */           \
-      _argvec[1]   = (unsigned long)_orig.r2;                     \
-      _argvec[2]   = (unsigned long)_orig.nraddr;                 \
-      _argvec[2+1] = (unsigned long)arg1;                         \
-      _argvec[2+2] = (unsigned long)arg2;                         \
-      _argvec[2+3] = (unsigned long)arg3;                         \
-      _argvec[2+4] = (unsigned long)arg4;                         \
-      _argvec[2+5] = (unsigned long)arg5;                         \
-      _argvec[2+6] = (unsigned long)arg6;                         \
-      _argvec[2+7] = (unsigned long)arg7;                         \
-      _argvec[2+8] = (unsigned long)arg8;                         \
-      _argvec[2+9] = (unsigned long)arg9;                         \
-      _argvec[2+10] = (unsigned long)arg10;                       \
-      _argvec[2+11] = (unsigned long)arg11;                       \
-      _argvec[2+12] = (unsigned long)arg12;                       \
-      __asm__ volatile(                                           \
-         "mr 11,%1\n\t"                                           \
-         VG_EXPAND_FRAME_BY_trashes_r3(512)                       \
-         "std  2,-16(11)\n\t" /* save tocptr */                   \
-         "ld   2,-8(11)\n\t"  /* use nraddr's tocptr */           \
-         VG_EXPAND_FRAME_BY_trashes_r3(144)                       \
-         /* arg12 */                                              \
-         "ld  3,96(11)\n\t"                                       \
-         "std 3,136(1)\n\t"                                       \
-         /* arg11 */                                              \
-         "ld  3,88(11)\n\t"                                       \
-         "std 3,128(1)\n\t"                                       \
-         /* arg10 */                                              \
-         "ld  3,80(11)\n\t"                                       \
-         "std 3,120(1)\n\t"                                       \
-         /* arg9 */                                               \
-         "ld  3,72(11)\n\t"                                       \
-         "std 3,112(1)\n\t"                                       \
-         /* args1-8 */                                            \
-         "ld   3, 8(11)\n\t"  /* arg1->r3 */                      \
-         "ld   4, 16(11)\n\t" /* arg2->r4 */                      \
-         "ld   5, 24(11)\n\t" /* arg3->r5 */                      \
-         "ld   6, 32(11)\n\t" /* arg4->r6 */                      \
-         "ld   7, 40(11)\n\t" /* arg5->r7 */                      \
-         "ld   8, 48(11)\n\t" /* arg6->r8 */                      \
-         "ld   9, 56(11)\n\t" /* arg7->r9 */                      \
-         "ld  10, 64(11)\n\t" /* arg8->r10 */                     \
-         "ld  11, 0(11)\n\t"  /* target->r11 */                   \
-         VALGRIND_BRANCH_AND_LINK_TO_NOREDIR_R11                  \
-         "mr 11,%1\n\t"                                           \
-         "mr %0,3\n\t"                                            \
-         "ld  2,-16(11)\n\t" /* restore tocptr */                 \
-         VG_CONTRACT_FRAME_BY(144)                                \
-         VG_CONTRACT_FRAME_BY(512)                                \
-         : /*out*/   "=r" (_res)                                  \
-         : /*in*/    "r" (&_argvec[2])                            \
-         : /*trash*/ "cc", "memory", __CALLER_SAVED_REGS          \
-      );                                                          \
-      lval = (__typeof__(lval)) _res;                             \
-   } while (0)
-
-#endif /* PLAT_ppc64_aix5 */
+#endif /* PLAT_s390x_linux */
 
 
 /* ------------------------------------------------------------------ */
@@ -4292,9 +3621,14 @@
              errors. */
           VG_USERREQ__COUNT_ERRORS = 0x1201,
 
+          /* Allows a string (gdb monitor command) to be passed to the tool
+             Used for interaction with vgdb/gdb */
+          VG_USERREQ__GDB_MONITOR_COMMAND = 0x1202,
+
           /* These are useful and can be interpreted by any tool that
              tracks malloc() et al, by using vg_replace_malloc.c. */
           VG_USERREQ__MALLOCLIKE_BLOCK = 0x1301,
+          VG_USERREQ__RESIZEINPLACE_BLOCK = 0x130b,
           VG_USERREQ__FREELIKE_BLOCK   = 0x1302,
           /* Memory pool support. */
           VG_USERREQ__CREATE_MEMPOOL   = 0x1303,
@@ -4328,7 +3662,14 @@
           VG_USERREQ__LOAD_PDB_DEBUGINFO = 0x1601,
 
           /* Querying of debug info. */
-          VG_USERREQ__MAP_IP_TO_SRCLOC = 0x1701
+          VG_USERREQ__MAP_IP_TO_SRCLOC = 0x1701,
+
+          /* Disable/enable error reporting level.  Takes a single
+             Word arg which is the delta to this thread's error
+             disablement indicator.  Hence 1 disables or further
+             disables errors, and -1 moves back towards enablement.
+             Other values are not allowed. */
+          VG_USERREQ__CHANGE_ERR_DISABLEMENT = 0x1801
    } Vg_ClientRequest;
 
 #if !defined(__GNUC__)
@@ -4336,64 +3677,12 @@
 #endif
 
 
-/*
- * VALGRIND_DO_CLIENT_REQUEST_EXPR(): a C expression that invokes a Valgrind
- * client request and whose value equals the client request result.
- */
-
-#if defined(NVALGRIND)
-
-#define VALGRIND_DO_CLIENT_REQUEST_EXPR(                               \
-        _zzq_default, _zzq_request,                                    \
-        _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5)         \
-   (_zzq_default)
-
-#else /*defined(NVALGRIND)*/
-
-#if defined(_MSC_VER)
-
-#define VALGRIND_DO_CLIENT_REQUEST_EXPR(                                \
-        _zzq_default, _zzq_request,                                     \
-        _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5)          \
-   (vg_VALGRIND_DO_CLIENT_REQUEST_EXPR((uintptr_t)(_zzq_default),       \
-        (_zzq_request), (uintptr_t)(_zzq_arg1), (uintptr_t)(_zzq_arg2), \
-        (uintptr_t)(_zzq_arg3), (uintptr_t)(_zzq_arg4),                 \
-        (uintptr_t)(_zzq_arg5)))
-
-static __inline unsigned
-vg_VALGRIND_DO_CLIENT_REQUEST_EXPR(uintptr_t _zzq_default,
-                                   unsigned _zzq_request, uintptr_t _zzq_arg1,
-                                   uintptr_t _zzq_arg2, uintptr_t _zzq_arg3,
-                                   uintptr_t _zzq_arg4, uintptr_t _zzq_arg5)
-{
-    unsigned _zzq_rlval;
-    VALGRIND_DO_CLIENT_REQUEST(_zzq_rlval, _zzq_default, _zzq_request,
-                      _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5);
-    return _zzq_rlval;
-}
-
-#else /*defined(_MSC_VER)*/
-
-#define VALGRIND_DO_CLIENT_REQUEST_EXPR(                               \
-        _zzq_default, _zzq_request,                                    \
-        _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5)         \
-   (__extension__({unsigned int _zzq_rlval;                            \
-    VALGRIND_DO_CLIENT_REQUEST(_zzq_rlval, _zzq_default, _zzq_request, \
-                _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5) \
-    _zzq_rlval;                                                        \
-   }))
-
-#endif /*defined(_MSC_VER)*/
-
-#endif /*defined(NVALGRIND)*/
-
-
 /* Returns the number of Valgrinds this code is running under.  That
    is, 0 if running natively, 1 if running under Valgrind, 2 if
    running under Valgrind which is running under another Valgrind,
    etc. */
 #define RUNNING_ON_VALGRIND                                           \
-    VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* if not */,                   \
+    (unsigned)VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* if not */,         \
                                     VG_USERREQ__RUNNING_ON_VALGRIND,  \
                                     0, 0, 0, 0, 0)                    \
 
@@ -4402,12 +3691,9 @@
    _qzz_len - 1].  Useful if you are debugging a JITter or some such,
    since it provides a way to make sure valgrind will retranslate the
    invalidated area.  Returns no value. */
-#define VALGRIND_DISCARD_TRANSLATIONS(_qzz_addr,_qzz_len)         \
-   {unsigned int _qzz_res;                                        \
-    VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0,                       \
-                               VG_USERREQ__DISCARD_TRANSLATIONS,  \
-                               _qzz_addr, _qzz_len, 0, 0, 0);     \
-   }
+#define VALGRIND_DISCARD_TRANSLATIONS(_qzz_addr,_qzz_len)              \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DISCARD_TRANSLATIONS,  \
+                                    _qzz_addr, _qzz_len, 0, 0, 0)
 
 
 /* These requests are for getting Valgrind itself to print something.
@@ -4415,14 +3701,7 @@
    is the number of characters printed, excluding the "**<pid>** " part at the
    start and the backtrace (if present). */
 
-#if defined(NVALGRIND)
-
-#  define VALGRIND_PRINTF(...)
-#  define VALGRIND_PRINTF_BACKTRACE(...)
-
-#else /* NVALGRIND */
-
-#if !defined(_MSC_VER)
+#if defined(__GNUC__) || defined(__INTEL_COMPILER)
 /* Modern GCC will optimize the static routine out if unused,
    and unused attribute will shut down warnings about it.  */
 static int VALGRIND_PRINTF(const char *format, ...)
@@ -4434,17 +3713,24 @@
 #endif
 VALGRIND_PRINTF(const char *format, ...)
 {
+#if defined(NVALGRIND)
+   return 0;
+#else /* NVALGRIND */
+#if defined(_MSC_VER)
+   uintptr_t _qzz_res;
+#else
    unsigned long _qzz_res;
+#endif
    va_list vargs;
    va_start(vargs, format);
 #if defined(_MSC_VER)
-   VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0,
+   _qzz_res = VALGRIND_DO_CLIENT_REQUEST_EXPR(0,
                               VG_USERREQ__PRINTF_VALIST_BY_REF,
                               (uintptr_t)format,
                               (uintptr_t)&vargs,
                               0, 0, 0);
 #else
-   VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0,
+   _qzz_res = VALGRIND_DO_CLIENT_REQUEST_EXPR(0,
                               VG_USERREQ__PRINTF_VALIST_BY_REF,
                               (unsigned long)format,
                               (unsigned long)&vargs, 
@@ -4452,9 +3738,10 @@
 #endif
    va_end(vargs);
    return (int)_qzz_res;
+#endif /* NVALGRIND */
 }
 
-#if !defined(_MSC_VER)
+#if defined(__GNUC__) || defined(__INTEL_COMPILER)
 static int VALGRIND_PRINTF_BACKTRACE(const char *format, ...)
    __attribute__((format(__printf__, 1, 2), __unused__));
 #endif
@@ -4464,17 +3751,24 @@
 #endif
 VALGRIND_PRINTF_BACKTRACE(const char *format, ...)
 {
+#if defined(NVALGRIND)
+   return 0;
+#else /* NVALGRIND */
+#if defined(_MSC_VER)
+   uintptr_t _qzz_res;
+#else
    unsigned long _qzz_res;
+#endif
    va_list vargs;
    va_start(vargs, format);
 #if defined(_MSC_VER)
-   VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0,
+   _qzz_res = VALGRIND_DO_CLIENT_REQUEST_EXPR(0,
                               VG_USERREQ__PRINTF_BACKTRACE_VALIST_BY_REF,
                               (uintptr_t)format,
                               (uintptr_t)&vargs,
                               0, 0, 0);
 #else
-   VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0,
+   _qzz_res = VALGRIND_DO_CLIENT_REQUEST_EXPR(0,
                               VG_USERREQ__PRINTF_BACKTRACE_VALIST_BY_REF,
                               (unsigned long)format,
                               (unsigned long)&vargs, 
@@ -4482,9 +3776,8 @@
 #endif
    va_end(vargs);
    return (int)_qzz_res;
-}
-
 #endif /* NVALGRIND */
+}
 
 
 /* These requests allow control to move from the simulated CPU to the
@@ -4511,58 +3804,39 @@
    with a lot in the past.
 */
 #define VALGRIND_NON_SIMD_CALL0(_qyy_fn)                          \
-   __extension__                                                  \
-   ({unsigned long _qyy_res;                                      \
-    VALGRIND_DO_CLIENT_REQUEST(_qyy_res, 0 /* default return */,  \
-                               VG_USERREQ__CLIENT_CALL0,          \
-                               _qyy_fn,                           \
-                               0, 0, 0, 0);                       \
-    _qyy_res;                                                     \
-   })
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */,       \
+                                    VG_USERREQ__CLIENT_CALL0,     \
+                                    _qyy_fn,                      \
+                                    0, 0, 0, 0)
 
-#define VALGRIND_NON_SIMD_CALL1(_qyy_fn, _qyy_arg1)               \
-   __extension__                                                  \
-   ({unsigned long _qyy_res;                                      \
-    VALGRIND_DO_CLIENT_REQUEST(_qyy_res, 0 /* default return */,  \
-                               VG_USERREQ__CLIENT_CALL1,          \
-                               _qyy_fn,                           \
-                               _qyy_arg1, 0, 0, 0);               \
-    _qyy_res;                                                     \
-   })
+#define VALGRIND_NON_SIMD_CALL1(_qyy_fn, _qyy_arg1)                    \
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */,            \
+                                    VG_USERREQ__CLIENT_CALL1,          \
+                                    _qyy_fn,                           \
+                                    _qyy_arg1, 0, 0, 0)
 
-#define VALGRIND_NON_SIMD_CALL2(_qyy_fn, _qyy_arg1, _qyy_arg2)    \
-   __extension__                                                  \
-   ({unsigned long _qyy_res;                                      \
-    VALGRIND_DO_CLIENT_REQUEST(_qyy_res, 0 /* default return */,  \
-                               VG_USERREQ__CLIENT_CALL2,          \
-                               _qyy_fn,                           \
-                               _qyy_arg1, _qyy_arg2, 0, 0);       \
-    _qyy_res;                                                     \
-   })
+#define VALGRIND_NON_SIMD_CALL2(_qyy_fn, _qyy_arg1, _qyy_arg2)         \
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */,            \
+                                    VG_USERREQ__CLIENT_CALL2,          \
+                                    _qyy_fn,                           \
+                                    _qyy_arg1, _qyy_arg2, 0, 0)
 
 #define VALGRIND_NON_SIMD_CALL3(_qyy_fn, _qyy_arg1, _qyy_arg2, _qyy_arg3) \
-   __extension__                                                  \
-   ({unsigned long _qyy_res;                                      \
-    VALGRIND_DO_CLIENT_REQUEST(_qyy_res, 0 /* default return */,  \
-                               VG_USERREQ__CLIENT_CALL3,          \
-                               _qyy_fn,                           \
-                               _qyy_arg1, _qyy_arg2,              \
-                               _qyy_arg3, 0);                     \
-    _qyy_res;                                                     \
-   })
+    VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */,             \
+                                    VG_USERREQ__CLIENT_CALL3,           \
+                                    _qyy_fn,                            \
+                                    _qyy_arg1, _qyy_arg2,               \
+                                    _qyy_arg3, 0)
 
 
 /* Counts the number of errors that have been recorded by a tool.  Nb:
    the tool must record the errors with VG_(maybe_record_error)() or
    VG_(unique_error)() for them to be counted. */
 #define VALGRIND_COUNT_ERRORS                                     \
-   __extension__                                                  \
-   ({unsigned int _qyy_res;                                       \
-    VALGRIND_DO_CLIENT_REQUEST(_qyy_res, 0 /* default return */,  \
+    (unsigned)VALGRIND_DO_CLIENT_REQUEST_EXPR(                    \
+                               0 /* default return */,            \
                                VG_USERREQ__COUNT_ERRORS,          \
-                               0, 0, 0, 0, 0);                    \
-    _qyy_res;                                                     \
-   })
+                               0, 0, 0, 0, 0)
 
 /* Several Valgrind tools (Memcheck, Massif, Helgrind, DRD) rely on knowing
    when heap blocks are allocated in order to give accurate results.  This
@@ -4628,7 +3902,24 @@
    VALGRIND_FREELIKE_BLOCK should be put immediately after the point where a
    heap block is deallocated.
 
-   In many cases, these two client requests will not be enough to get your
+   VALGRIND_RESIZEINPLACE_BLOCK informs a tool about reallocation. For
+   Memcheck, it does four things:
+
+   - It records that the size of a block has been changed.  This assumes that
+     the block was annotated as having been allocated via
+     VALGRIND_MALLOCLIKE_BLOCK.  Otherwise, an error will be issued.
+
+   - If the block shrunk, it marks the freed memory as being unaddressable.
+
+   - If the block grew, it marks the new area as undefined and defines a red
+     zone past the end of the new block.
+
+   - The V-bits of the overlap between the old and the new block are preserved.
+
+   VALGRIND_RESIZEINPLACE_BLOCK should be put after allocation of the new block
+   and before deallocation of the old block.
+
+   In many cases, these three client requests will not be enough to get your
    allocator working well with Memcheck.  More specifically, if your allocator
    writes to freed blocks in any way then a VALGRIND_MAKE_MEM_UNDEFINED call
    will be necessary to mark the memory as addressable just before the zeroing
@@ -4646,147 +3937,124 @@
    understand the distinction between the allocator and the rest of the
    program.
 
-   Note: there is currently no VALGRIND_REALLOCLIKE_BLOCK client request;  it
-   has to be emulated with MALLOCLIKE/FREELIKE and memory copying.
-   
    Ignored if addr == 0.
 */
-#define VALGRIND_MALLOCLIKE_BLOCK(addr, sizeB, rzB, is_zeroed)    \
-   {unsigned int _qzz_res;                                        \
-    VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0,                       \
-                               VG_USERREQ__MALLOCLIKE_BLOCK,      \
-                               addr, sizeB, rzB, is_zeroed, 0);   \
-   }
+#define VALGRIND_MALLOCLIKE_BLOCK(addr, sizeB, rzB, is_zeroed)          \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__MALLOCLIKE_BLOCK,       \
+                                    addr, sizeB, rzB, is_zeroed, 0)
 
 /* See the comment for VALGRIND_MALLOCLIKE_BLOCK for details.
    Ignored if addr == 0.
 */
-#define VALGRIND_FREELIKE_BLOCK(addr, rzB)                        \
-   {unsigned int _qzz_res;                                        \
-    VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0,                       \
-                               VG_USERREQ__FREELIKE_BLOCK,        \
-                               addr, rzB, 0, 0, 0);               \
-   }
+#define VALGRIND_RESIZEINPLACE_BLOCK(addr, oldSizeB, newSizeB, rzB)     \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__RESIZEINPLACE_BLOCK,    \
+                                    addr, oldSizeB, newSizeB, rzB, 0)
+
+/* See the comment for VALGRIND_MALLOCLIKE_BLOCK for details.
+   Ignored if addr == 0.
+*/
+#define VALGRIND_FREELIKE_BLOCK(addr, rzB)                              \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__FREELIKE_BLOCK,         \
+                                    addr, rzB, 0, 0, 0)
 
 /* Create a memory pool. */
 #define VALGRIND_CREATE_MEMPOOL(pool, rzB, is_zeroed)             \
-   {unsigned int _qzz_res;                                        \
-    VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0,                       \
-                               VG_USERREQ__CREATE_MEMPOOL,        \
-                               pool, rzB, is_zeroed, 0, 0);       \
-   }
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__CREATE_MEMPOOL,   \
+                                    pool, rzB, is_zeroed, 0, 0)
 
 /* Destroy a memory pool. */
 #define VALGRIND_DESTROY_MEMPOOL(pool)                            \
-   {unsigned int _qzz_res;                                        \
-    VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0,                       \
-                               VG_USERREQ__DESTROY_MEMPOOL,       \
-                               pool, 0, 0, 0, 0);                 \
-   }
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DESTROY_MEMPOOL,  \
+                                    pool, 0, 0, 0, 0)
 
 /* Associate a piece of memory with a memory pool. */
 #define VALGRIND_MEMPOOL_ALLOC(pool, addr, size)                  \
-   {unsigned int _qzz_res;                                        \
-    VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0,                       \
-                               VG_USERREQ__MEMPOOL_ALLOC,         \
-                               pool, addr, size, 0, 0);           \
-   }
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__MEMPOOL_ALLOC,    \
+                                    pool, addr, size, 0, 0)
 
 /* Disassociate a piece of memory from a memory pool. */
 #define VALGRIND_MEMPOOL_FREE(pool, addr)                         \
-   {unsigned int _qzz_res;                                        \
-    VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0,                       \
-                               VG_USERREQ__MEMPOOL_FREE,          \
-                               pool, addr, 0, 0, 0);              \
-   }
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__MEMPOOL_FREE,     \
+                                    pool, addr, 0, 0, 0)
 
 /* Disassociate any pieces outside a particular range. */
 #define VALGRIND_MEMPOOL_TRIM(pool, addr, size)                   \
-   {unsigned int _qzz_res;                                        \
-    VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0,                       \
-                               VG_USERREQ__MEMPOOL_TRIM,          \
-                               pool, addr, size, 0, 0);           \
-   }
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__MEMPOOL_TRIM,     \
+                                    pool, addr, size, 0, 0)
 
 /* Resize and/or move a piece associated with a memory pool. */
 #define VALGRIND_MOVE_MEMPOOL(poolA, poolB)                       \
-   {unsigned int _qzz_res;                                        \
-    VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0,                       \
-                               VG_USERREQ__MOVE_MEMPOOL,          \
-                               poolA, poolB, 0, 0, 0);            \
-   }
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__MOVE_MEMPOOL,     \
+                                    poolA, poolB, 0, 0, 0)
 
 /* Resize and/or move a piece associated with a memory pool. */
 #define VALGRIND_MEMPOOL_CHANGE(pool, addrA, addrB, size)         \
-   {unsigned int _qzz_res;                                        \
-    VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0,                       \
-                               VG_USERREQ__MEMPOOL_CHANGE,        \
-                               pool, addrA, addrB, size, 0);      \
-   }
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__MEMPOOL_CHANGE,   \
+                                    pool, addrA, addrB, size, 0)
 
 /* Return 1 if a mempool exists, else 0. */
 #define VALGRIND_MEMPOOL_EXISTS(pool)                             \
-   __extension__                                                  \
-   ({unsigned int _qzz_res;                                       \
-    VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0,                       \
+    (unsigned)VALGRIND_DO_CLIENT_REQUEST_EXPR(0,                  \
                                VG_USERREQ__MEMPOOL_EXISTS,        \
-                               pool, 0, 0, 0, 0);                 \
-    _qzz_res;                                                     \
-   })
+                               pool, 0, 0, 0, 0)
 
 /* Mark a piece of memory as being a stack. Returns a stack id. */
 #define VALGRIND_STACK_REGISTER(start, end)                       \
-   __extension__                                                  \
-   ({unsigned int _qzz_res;                                       \
-    VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0,                       \
+    (unsigned)VALGRIND_DO_CLIENT_REQUEST_EXPR(0,                  \
                                VG_USERREQ__STACK_REGISTER,        \
-                               start, end, 0, 0, 0);              \
-    _qzz_res;                                                     \
-   })
+                               start, end, 0, 0, 0)
 
 /* Unmark the piece of memory associated with a stack id as being a
    stack. */
 #define VALGRIND_STACK_DEREGISTER(id)                             \
-   {unsigned int _qzz_res;                                        \
-    VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0,                       \
-                               VG_USERREQ__STACK_DEREGISTER,      \
-                               id, 0, 0, 0, 0);                   \
-   }
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__STACK_DEREGISTER, \
+                                    id, 0, 0, 0, 0)
 
 /* Change the start and end address of the stack id. */
 #define VALGRIND_STACK_CHANGE(id, start, end)                     \
-   {unsigned int _qzz_res;                                        \
-    VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0,                       \
-                               VG_USERREQ__STACK_CHANGE,          \
-                               id, start, end, 0, 0);             \
-   }
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__STACK_CHANGE,     \
+                                    id, start, end, 0, 0)
 
 /* Load PDB debug info for Wine PE image_map. */
-#define VALGRIND_LOAD_PDB_DEBUGINFO(fd, ptr, total_size, delta)   \
-   {unsigned int _qzz_res;                                        \
-    VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0,                       \
-                               VG_USERREQ__LOAD_PDB_DEBUGINFO,    \
-                               fd, ptr, total_size, delta, 0);    \
-   }
+#define VALGRIND_LOAD_PDB_DEBUGINFO(fd, ptr, total_size, delta)     \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__LOAD_PDB_DEBUGINFO, \
+                                    fd, ptr, total_size, delta, 0)
 
 /* Map a code address to a source file name and line number.  buf64
    must point to a 64-byte buffer in the caller's address space.  The
    result will be dumped in there and is guaranteed to be zero
    terminated.  If no info is found, the first byte is set to zero. */
 #define VALGRIND_MAP_IP_TO_SRCLOC(addr, buf64)                    \
-   {unsigned int _qzz_res;                                        \
-    VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0,                       \
+    (unsigned)VALGRIND_DO_CLIENT_REQUEST_EXPR(0,                  \
                                VG_USERREQ__MAP_IP_TO_SRCLOC,      \
-                               addr, buf64, 0, 0, 0);             \
-   }
+                               addr, buf64, 0, 0, 0)
 
+/* Disable error reporting for this thread.  Behaves in a stack like
+   way, so you can safely call this multiple times provided that
+   VALGRIND_ENABLE_ERROR_REPORTING is called the same number of times
+   to re-enable reporting.  The first call of this macro disables
+   reporting.  Subsequent calls have no effect except to increase the
+   number of VALGRIND_ENABLE_ERROR_REPORTING calls needed to re-enable
+   reporting.  Child threads do not inherit this setting from their
+   parents -- they are always created with reporting enabled. */
+#define VALGRIND_DISABLE_ERROR_REPORTING                                \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__CHANGE_ERR_DISABLEMENT, \
+                                    1, 0, 0, 0, 0)
 
+/* Re-enable error reporting, as per comments on
+   VALGRIND_DISABLE_ERROR_REPORTING. */
+#define VALGRIND_ENABLE_ERROR_REPORTING                                 \
+    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__CHANGE_ERR_DISABLEMENT, \
+                                    -1, 0, 0, 0, 0)
+
+#undef PLAT_x86_darwin
+#undef PLAT_amd64_darwin
+#undef PLAT_x86_win32
 #undef PLAT_x86_linux
 #undef PLAT_amd64_linux
 #undef PLAT_ppc32_linux
 #undef PLAT_ppc64_linux
 #undef PLAT_arm_linux
-#undef PLAT_ppc32_aix5
-#undef PLAT_ppc64_aix5
+#undef PLAT_s390x_linux
 
 #endif   /* __VALGRIND_H */
diff --git a/main/include/vki/vki-amd64-linux.h b/main/include/vki/vki-amd64-linux.h
index de3fd41..8c0bcba 100644
--- a/main/include/vki/vki-amd64-linux.h
+++ b/main/include/vki/vki-amd64-linux.h
@@ -7,7 +7,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2000-2010 Julian Seward 
+   Copyright (C) 2000-2011 Julian Seward 
       jseward@acm.org
 
    This program is free software; you can redistribute it and/or
diff --git a/main/include/vki/vki-arm-linux.h b/main/include/vki/vki-arm-linux.h
index 12de6fd..a77e2eb 100644
--- a/main/include/vki/vki-arm-linux.h
+++ b/main/include/vki/vki-arm-linux.h
@@ -7,7 +7,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2000-2008 Julian Seward 
+   Copyright (C) 2000-2011 Julian Seward 
       jseward@acm.org
 
    This program is free software; you can redistribute it and/or
@@ -34,6 +34,10 @@
 // arm is little-endian.
 #define VKI_LITTLE_ENDIAN  1
 
+// The various comments below indicating i386-ness should be regarded
+// with great skepticism -- they are quite possibly wrong.  But see
+// also bug 269079 comment 0.
+
 //----------------------------------------------------------------------
 // From linux-2.6.8.1/include/asm-i386/types.h
 //----------------------------------------------------------------------
@@ -190,43 +194,6 @@
 // From linux-2.6.8.1/include/asm-i386/sigcontext.h
 //----------------------------------------------------------------------
 
-struct _vki_fpreg {
-	unsigned short significand[4];
-	unsigned short exponent;
-};
-
-struct _vki_fpxreg {
-	unsigned short significand[4];
-	unsigned short exponent;
-	unsigned short padding[3];
-};
-
-struct _vki_xmmreg {
-	unsigned long element[4];
-};
-
-struct _vki_fpstate {
-	/* Regular FPU environment */
-	unsigned long 	cw;
-	unsigned long	sw;
-	unsigned long	tag;
-	unsigned long	ipoff;
-	unsigned long	cssel;
-	unsigned long	dataoff;
-	unsigned long	datasel;
-	struct _vki_fpreg	_st[8];
-	unsigned short	status;
-	unsigned short	magic;		/* 0xffff = regular FPU data only */
-
-	/* FXSR FPU environment */
-	unsigned long	_fxsr_env[6];	/* FXSR FPU env is ignored */
-	unsigned long	mxcsr;
-	unsigned long	reserved;
-	struct _vki_fpxreg	_fxsr_st[8];	/* FXSR FPU reg data is ignored */
-	struct _vki_xmmreg	_xmm[8];
-	unsigned long	padding[56];
-};
-
 struct vki_sigcontext {
 		unsigned long trap_no;
 		unsigned long error_code;
@@ -530,6 +497,12 @@
 #define VKI_TIOCGICOUNT	0x545D	/* read serial port inline interrupt counts */
 
 //----------------------------------------------------------------------
+// From linux-2.6.39-rc2/arch/arm/include/asm/ioctls.h
+//----------------------------------------------------------------------
+
+#define VKI_FIOQSIZE 0x545E
+
+//----------------------------------------------------------------------
 // From asm-generic/poll.h
 //----------------------------------------------------------------------
 
@@ -546,33 +519,41 @@
 // From linux-2.6.8.1/include/asm-i386/user.h
 //----------------------------------------------------------------------
 
-struct vki_user_i387_struct {
-	long	cwd;
-	long	swd;
-	long	twd;
-	long	fip;
-	long	fcs;
-	long	foo;
-	long	fos;
-	long	st_space[20];	/* 8*10 bytes for each FP-reg = 80 bytes */
+struct vki_user_fp {
+	struct vki_fp_reg {
+		unsigned int sign1:1;
+		unsigned int unused:15;
+		unsigned int sign2:1;
+		unsigned int exponent:14;
+		unsigned int j:1;
+		unsigned int mantissa1:31;
+		unsigned int mantissa0:32;
+	} fpregs[8];
+	unsigned int fpsr:32;
+	unsigned int fpcr:32;
+	unsigned char ftype[8];
+	unsigned int init_flag;
 };
 
-struct vki_user_fxsr_struct {
-	unsigned short	cwd;
-	unsigned short	swd;
-	unsigned short	twd;
-	unsigned short	fop;
-	long	fip;
-	long	fcs;
-	long	foo;
-	long	fos;
-	long	mxcsr;
-	long	reserved;
-	long	st_space[32];	/* 8*16 bytes for each FP-reg = 128 bytes */
-	long	xmm_space[32];	/* 8*16 bytes for each XMM-reg = 128 bytes */
-	long	padding[56];
+struct vki_user_vfp {
+	unsigned long long fpregs[32];
+	unsigned long fpscr;
 };
 
+#define VKI_IWMMXT_SIZE 0x98
+
+struct vki_iwmmxt_struct {
+	unsigned int save[VKI_IWMMXT_SIZE / sizeof(unsigned int)];
+};
+
+struct vki_crunch_state {
+	unsigned int    mvdx[16][2];
+	unsigned int    mvax[4][3];
+	unsigned int    dspsc[2];
+};
+
+#define VKI_CRUNCH_SIZE sizeof(struct vki_crunch_state)
+
 struct vki_user_regs_struct {
     long uregs[18];
 };
@@ -603,8 +584,7 @@
 #define VKI_ELF_NGREG (sizeof (struct vki_user_regs_struct) / sizeof(vki_elf_greg_t))
 typedef vki_elf_greg_t vki_elf_gregset_t[VKI_ELF_NGREG];
 
-typedef struct vki_user_i387_struct vki_elf_fpregset_t;
-typedef struct vki_user_fxsr_struct vki_elf_fpxregset_t;
+typedef struct vki_user_fp vki_elf_fpregset_t;
 
 #define VKI_AT_SYSINFO		32
 
@@ -799,8 +779,16 @@
 #define VKI_PTRACE_SETREGS            13
 #define VKI_PTRACE_GETFPREGS          14
 #define VKI_PTRACE_SETFPREGS          15
-#define VKI_PTRACE_GETFPXREGS         18
-#define VKI_PTRACE_SETFPXREGS         19
+#define VKI_PTRACE_GETWMMXREGS        18
+#define VKI_PTRACE_SETWMMXREGS        19
+#define VKI_PTRACE_GET_THREAD_AREA    22
+#define VKI_PTRACE_SET_SYSCALL        23
+#define VKI_PTRACE_GETCRUNCHREGS      25
+#define VKI_PTRACE_SETCRUNCHREGS      26
+#define VKI_PTRACE_GETVFPREGS         27
+#define VKI_PTRACE_SETVFPREGS         28
+#define VKI_PTRACE_GETHBPREGS         29
+#define VKI_PTRACE_SETHBPREGS         30
 
 //----------------------------------------------------------------------
 // From linux-2.6.15.4/include/asm-i386/vm86.h
diff --git a/main/include/vki/vki-darwin.h b/main/include/vki/vki-darwin.h
index e4d28d7..dfc883d 100644
--- a/main/include/vki/vki-darwin.h
+++ b/main/include/vki/vki-darwin.h
@@ -7,7 +7,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2007-2010 Apple Inc.
+   Copyright (C) 2007-2011 Apple Inc.
       Greg Parker  gparker@apple.com
 
    This program is free software; you can redistribute it and/or
diff --git a/main/include/vki/vki-linux.h b/main/include/vki/vki-linux.h
index 6930b92..cab1986 100644
--- a/main/include/vki/vki-linux.h
+++ b/main/include/vki/vki-linux.h
@@ -7,7 +7,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2000-2010 Julian Seward 
+   Copyright (C) 2000-2011 Julian Seward 
       jseward@acm.org
 
    This program is free software; you can redistribute it and/or
@@ -89,6 +89,8 @@
 #  include "vki-posixtypes-ppc64-linux.h"
 #elif defined(VGA_arm)
 #  include "vki-posixtypes-arm-linux.h"
+#elif defined(VGA_s390x)
+#  include "vki-posixtypes-s390x-linux.h"
 #else
 #  error Unknown platform
 #endif
@@ -120,8 +122,6 @@
 
 # define __user
 
-# define __attribute_const__    /* unimplemented */
-
 //----------------------------------------------------------------------
 // From linux-2.6.8.1/include/linux/posix_types.h
 //----------------------------------------------------------------------
@@ -194,6 +194,8 @@
 #  include "vki-ppc64-linux.h"
 #elif defined(VGA_arm)
 #  include "vki-arm-linux.h"
+#elif defined(VGA_s390x)
+#  include "vki-s390x-linux.h"
 #else
 #  error Unknown platform
 #endif
@@ -921,6 +923,11 @@
 	unsigned long	rlim_max;
 };
 
+struct vki_rlimit64 {
+	__vki_u64 rlim_cur;
+	__vki_u64 rlim_max;
+};
+
 //----------------------------------------------------------------------
 // From linux-2.6.8.1/include/linux/elfcore.h
 //----------------------------------------------------------------------
@@ -1957,7 +1964,9 @@
 //----------------------------------------------------------------------
 
 #define VKI_FBIOGET_VSCREENINFO	0x4600
+#define VKI_FBIOPUT_VSCREENINFO	0x4601
 #define VKI_FBIOGET_FSCREENINFO	0x4602
+#define VKI_FBIOPAN_DISPLAY	0x4606
 
 struct vki_fb_fix_screeninfo {
 	char id[16];			/* identification string eg "TT Builtin" */
@@ -2384,6 +2393,7 @@
 #define VKI_USBDEVFS_REAPURBNDELAY     _VKI_IOW('U', 13, void *)
 #define VKI_USBDEVFS_CONNECTINFO       _VKI_IOW('U', 17, struct vki_usbdevfs_connectinfo)
 #define VKI_USBDEVFS_IOCTL             _VKI_IOWR('U', 18, struct vki_usbdevfs_ioctl)
+#define VKI_USBDEVFS_RESET             _VKI_IO('U', 20)
 
 #define VKI_USBDEVFS_URB_TYPE_ISO              0
 #define VKI_USBDEVFS_URB_TYPE_INTERRUPT        1
@@ -2614,10 +2624,10 @@
 };
 
 /*--------------------------------------------------------------------*/
-// From linux-2.6.31.5/include/linux/perf_counter.h
+// From linux-2.6.31.5/include/linux/perf_event.h
 /*--------------------------------------------------------------------*/
 
-struct vki_perf_counter_attr {
+struct vki_perf_event_attr {
 
 	/*
 	 * Major type: hardware/software/tracepoint/etc.
@@ -2656,13 +2666,37 @@
 					inherit_stat   :  1, /* per task counts       */
 					enable_on_exec :  1, /* next exec enables     */
 					task           :  1, /* trace fork/exit       */
+					watermark      :  1, /* wakeup_watermark      */
+					/*
+					 * precise_ip:
+					 *
+					 *  0 - SAMPLE_IP can have arbitrary skid
+					 *  1 - SAMPLE_IP must have constant skid
+					 *  2 - SAMPLE_IP requested to have 0 skid
+					 *  3 - SAMPLE_IP must have 0 skid
+					 *
+					 *  See also PERF_RECORD_MISC_EXACT_IP
+					 */
+					precise_ip     :  2, /* skid constraint       */
+					mmap_data      :  1, /* non-exec mmap data    */
+					sample_id_all  :  1, /* sample_type all events */
 
-					__reserved_1   : 50;
+					__reserved_1   : 45;
 
-	__vki_u32			wakeup_events;	/* wakeup every n events */
-	__vki_u32			__reserved_2;
+	union {
+		__vki_u32		wakeup_events;	  /* wakeup every n events */
+		__vki_u32		wakeup_watermark; /* bytes before wakeup   */
+	};
 
-	__vki_u64			__reserved_3;
+	__vki_u32			bp_type;
+	union {
+		__vki_u64		bp_addr;
+		__vki_u64		config1; /* extension of config */
+	};
+	union {
+		__vki_u64		bp_len;
+		__vki_u64		config2; /* extension of config1 */
+	};
 };
 
 /*--------------------------------------------------------------------*/
@@ -2711,11 +2745,20 @@
 #define VKI_EV_MAX		0x1f
 #define VKI_EV_CNT		(VKI_EV_MAX+1)
 
-#ifdef ANDROID
+//----------------------------------------------------------------------
+// From linux-2.6.39-rc2/include/asm_generic/ioctls.h
+//----------------------------------------------------------------------
+
+#ifndef VKI_FIOQSIZE
+#define VKI_FIOQSIZE 0x5460     /* Value differs on some platforms */
+#endif
+
 //----------------------------------------------------------------------
 // From kernel/common/include/linux/ashmem.h
 //----------------------------------------------------------------------
 
+#if defined(VGPV_arm_linux_android)
+
 #define VKI_ASHMEM_NAME_LEN 256
 
 #define VKI_ASHMEM_NAME_DEF "dev/ashmem"
@@ -2769,7 +2812,7 @@
 #define VKI_BINDER_THREAD_EXIT _VKI_IOW('b', 8, int)
 #define VKI_BINDER_VERSION _VKI_IOWR('b', 9, struct vki_binder_version)
 
-#endif // ANDROID
+#endif /* defined(VGPV_arm_linux_android) */
 
 #endif // __VKI_LINUX_H
 
diff --git a/main/include/vki/vki-posixtypes-amd64-linux.h b/main/include/vki/vki-posixtypes-amd64-linux.h
index 1862410..32a2fc9 100644
--- a/main/include/vki/vki-posixtypes-amd64-linux.h
+++ b/main/include/vki/vki-posixtypes-amd64-linux.h
@@ -8,7 +8,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2000-2010 Julian Seward 
+   Copyright (C) 2000-2011 Julian Seward 
       jseward@acm.org
 
    This program is free software; you can redistribute it and/or
diff --git a/main/include/vki/vki-posixtypes-arm-linux.h b/main/include/vki/vki-posixtypes-arm-linux.h
index 043dbad..e9f910b 100644
--- a/main/include/vki/vki-posixtypes-arm-linux.h
+++ b/main/include/vki/vki-posixtypes-arm-linux.h
@@ -8,7 +8,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2000-2010 Julian Seward 
+   Copyright (C) 2000-2011 Julian Seward 
       jseward@acm.org
 
    This program is free software; you can redistribute it and/or
diff --git a/main/include/vki/vki-posixtypes-ppc32-linux.h b/main/include/vki/vki-posixtypes-ppc32-linux.h
index 6ab8e6e..a5c4524 100644
--- a/main/include/vki/vki-posixtypes-ppc32-linux.h
+++ b/main/include/vki/vki-posixtypes-ppc32-linux.h
@@ -8,7 +8,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2005-2010 Julian Seward
+   Copyright (C) 2005-2011 Julian Seward
       jseward@acm.org
 
    This program is free software; you can redistribute it and/or
diff --git a/main/include/vki/vki-posixtypes-ppc64-linux.h b/main/include/vki/vki-posixtypes-ppc64-linux.h
index 3b0a91d..2b002e5 100644
--- a/main/include/vki/vki-posixtypes-ppc64-linux.h
+++ b/main/include/vki/vki-posixtypes-ppc64-linux.h
@@ -8,7 +8,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2005-2010 Julian Seward
+   Copyright (C) 2005-2011 Julian Seward
       jseward@acm.org
 
    This program is free software; you can redistribute it and/or
diff --git a/main/include/vki/vki-posixtypes-s390x-linux.h b/main/include/vki/vki-posixtypes-s390x-linux.h
new file mode 100644
index 0000000..1dc753e
--- /dev/null
+++ b/main/include/vki/vki-posixtypes-s390x-linux.h
@@ -0,0 +1,77 @@
+
+/*--------------------------------------------------------------------*/
+/*--- s390x/Linux-specific kernel interface: posix types.          ---*/
+/*---                                 vki-posixtypes-s390x-linux.h ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+   This file is part of Valgrind, a dynamic binary instrumentation
+   framework.
+
+   Copyright IBM Corp. 2010-2011
+
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307, USA.
+
+   The GNU General Public License is contained in the file COPYING.
+*/
+
+/* Contributed by Florian Krohm and Volker Sameske */
+
+#ifndef __VKI_POSIXTYPES_S390X_LINUX_H
+#define __VKI_POSIXTYPES_S390X_LINUX_H
+
+//----------------------------------------------------------------------
+// From linux-2.6.16.60/include/asm-s390/posix_types.h
+//----------------------------------------------------------------------
+
+typedef long            __vki_kernel_off_t;
+typedef int             __vki_kernel_pid_t;
+typedef unsigned long   __vki_kernel_size_t;
+typedef long            __vki_kernel_time_t;
+typedef long            __vki_kernel_suseconds_t;
+typedef long            __vki_kernel_clock_t;
+typedef int		__vki_kernel_timer_t;
+typedef int		__vki_kernel_clockid_t;
+typedef int             __vki_kernel_daddr_t;
+typedef char *          __vki_kernel_caddr_t;
+typedef unsigned short	__vki_kernel_uid16_t;
+typedef unsigned short	__vki_kernel_gid16_t;
+typedef long long       __vki_kernel_loff_t;
+
+typedef unsigned int    __vki_kernel_ino_t;
+typedef unsigned int    __vki_kernel_mode_t;
+typedef unsigned int    __vki_kernel_nlink_t;
+typedef int             __vki_kernel_ipc_pid_t;
+typedef unsigned int    __vki_kernel_uid_t;
+typedef unsigned int    __vki_kernel_gid_t;
+typedef long            __vki_kernel_ssize_t;
+typedef long            __vki_kernel_ptrdiff_t;
+typedef unsigned long   __vki_kernel_sigset_t;      /* at least 32 bits */
+typedef __vki_kernel_uid_t __vki_kernel_old_uid_t;
+typedef __vki_kernel_gid_t __vki_kernel_old_gid_t;
+typedef __vki_kernel_uid_t __vki_kernel_uid32_t;
+typedef __vki_kernel_gid_t __vki_kernel_gid32_t;
+typedef unsigned short __vki_kernel_old_dev_t;
+
+typedef struct {
+   int val[2];
+} __vki_kernel_fsid_t;
+
+#endif // __VKI_POSIXTYPES_S390X_LINUX_H
+
+/*--------------------------------------------------------------------*/
+/*--- end                                                          ---*/
+/*--------------------------------------------------------------------*/
diff --git a/main/include/vki/vki-posixtypes-x86-linux.h b/main/include/vki/vki-posixtypes-x86-linux.h
index 42b2bf0..2bb3025 100644
--- a/main/include/vki/vki-posixtypes-x86-linux.h
+++ b/main/include/vki/vki-posixtypes-x86-linux.h
@@ -8,7 +8,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2000-2010 Julian Seward 
+   Copyright (C) 2000-2011 Julian Seward 
       jseward@acm.org
 
    This program is free software; you can redistribute it and/or
diff --git a/main/include/vki/vki-ppc32-aix5.h b/main/include/vki/vki-ppc32-aix5.h
deleted file mode 100644
index 71ca550..0000000
--- a/main/include/vki/vki-ppc32-aix5.h
+++ /dev/null
@@ -1,463 +0,0 @@
-
-/*--------------------------------------------------------------------*/
-/*--- 32-bit AIX5-specific kernel interface.      vki-ppc32-aix5.h ---*/
-/*--------------------------------------------------------------------*/
-
-/*
-   This file is part of Valgrind, a dynamic binary instrumentation
-   framework.
-
-   Copyright (C) 2006-2010 OpenWorks LLP
-      info@open-works.co.uk
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful, but
-   WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307, USA.
-
-   The GNU General Public License is contained in the file COPYING.
-*/
-
-/* This file defines types and constants for the kernel interface, and to
-   make that clear everything is prefixed VKI_/vki_.
-*/
-
-/* This file was generated by running auxprogs/aix5_VKI_info.c. */
-
-#ifndef __VKI_PPC32_AIX5_H
-#define __VKI_PPC32_AIX5_H
-
-#if !defined(VGP_ppc32_aix5)
-#  error This file should be included in 32-bit AIX5 builds only.
-#endif
-
-//--------------------------------------------------------------
-// VERIFIED
-//--------------------------------------------------------------
-
-/* ---------------- Errors ---------------- */
-
-#define VKI_EINVAL 22
-#define VKI_EINTR  4
-#define VKI_ENOSYS 109
-#define VKI_EAGAIN 11
-#define VKI_ENOMEM 12
-#define VKI_EACCES 13
-#define VKI_EEXIST 17
-#define VKI_EPERM  1
-#define VKI_ENOENT 2
-#define VKI_ESRCH  3
-#define VKI_EBADF  9
-#define VKI_EFAULT 14
-#define VKI_EMFILE 24
-#define VKI_ECHILD 10
-#define VKI_EOVERFLOW 127
-#define VKI_ERESTARTSYS 0 /* AIX doesn't have this */
-
-/* ---------------- File I/O ---------------- */
-
-#define VKI_O_WRONLY 0x00000001
-#define VKI_O_RDONLY 0x00000000
-#define VKI_O_APPEND 0x00000008
-#define VKI_O_CREAT  0x00000100
-#define VKI_O_RDWR   0x00000002
-#define VKI_O_EXCL   0x00000400
-#define VKI_O_TRUNC  0x00000200
-
-#define VKI_S_IRUSR  0x00000100
-#define VKI_S_IXUSR  0x00000040
-#define VKI_S_IXGRP  0x00000008
-#define VKI_S_IXOTH  0x00000001
-#define VKI_S_IWUSR  0x00000080
-#define VKI_S_IWOTH  0x00000002
-#define VKI_S_ISUID  0x00000800
-#define VKI_S_ISGID  0x00000400
-#define VKI_S_IFMT   0x0000f000
-#define VKI_S_IFDIR  0x00004000
-#define VKI_S_IFCHR  0x00002000
-#define VKI_S_IFBLK  0x00006000
-
-/* Next 3 are from include/vki/vki-linux.h */
-#define VKI_S_ISDIR(m)  (((m) & VKI_S_IFMT) == VKI_S_IFDIR)
-#define VKI_S_ISCHR(m)  (((m) & VKI_S_IFMT) == VKI_S_IFCHR)
-#define VKI_S_ISBLK(m)  (((m) & VKI_S_IFMT) == VKI_S_IFBLK)
-
-#define VKI_F_DUPFD  0x00000000
-#define VKI_F_SETFD  0x00000002
-#define VKI_FD_CLOEXEC  0x00000001
-
-#define VKI_R_OK 0x00000004
-#define VKI_W_OK 0x00000002
-#define VKI_X_OK 0x00000001
-
-/* Known:
-   sizeof(struct stat) = 116
-     st_dev:  off  0 sz 4
-     st_ino:  off  4 sz 4
-     st_mode: off  8 sz 4
-     st_uid:  off 16 sz 4
-     st_gid:  off 20 sz 4
-     st_size: off 28 sz 4
-*/
-struct vki_stat {
-   /*  0 */ UInt st_dev;
-   /*  4 */ UInt st_ino;
-   /*  8 */ UInt st_mode;
-   /* 12 */ UInt __off12;
-   /* 16 */ UInt st_uid;
-   /* 20 */ UInt st_gid;
-   /* 24 */ UInt __off24;
-   /* 28 */ UInt st_size;
-   /* 32 */ UChar __off32[116-32];
-};
-
-#define VKI_STX_NORMAL  0
-
-typedef UInt vki_size_t;
-
-#define VKI_SEEK_SET 0
-#define VKI_PATH_MAX 1023
-
-/* Known:
-   sizeof(struct iovec) = 8
-     iov_base: off  0 sz 4
-      iov_len: off  4 sz 4
-*/
-struct vki_iovec {
-   /* 0 */ Addr iov_base;
-   /* 4 */ UInt iov_len;
-};
-
-#define _VKI_IOC_NONE 0
-#define _VKI_IOC_READ 1    /* kernel reads, userspace writes */
-#define _VKI_IOC_WRITE 2   /* kernel writes, userspace reads */
-#define _VKI_IOC_DIR(_x)   (((_x) >> 30) & 3)
-#define _VKI_IOC_SIZE(_x)  (((_x) >> 16) & 0x7F)
-
-/* ---------------- MMappery ---------------- */
-
-/* This assumes the page size is 4096.  That assumption is checked
-   by the launcher. */
-#define VKI_PAGE_SHIFT  12
-#define VKI_PAGE_SIZE   (1UL << VKI_PAGE_SHIFT)
-#define VKI_MAX_PAGE_SHIFT      VKI_PAGE_SHIFT
-#define VKI_MAX_PAGE_SIZE       VKI_PAGE_SIZE
-
-#define VKI_PROT_NONE  0x00000000
-#define VKI_PROT_READ  0x00000001
-#define VKI_PROT_WRITE 0x00000002
-#define VKI_PROT_EXEC  0x00000004
-
-#define VKI_MAP_FIXED     0x00000100
-#define VKI_MAP_PRIVATE   0x00000002
-#define VKI_MAP_ANONYMOUS 0x00000010
-
-/* ---------------- RLimitery ---------------- */
-
-/* rlimit: these pertain to syscall "appgetrlimit" */
-#define VKI_RLIMIT_DATA   0x00000002
-#define VKI_RLIMIT_NOFILE 0x00000007
-#define VKI_RLIMIT_STACK  0x00000003
-#define VKI_RLIMIT_CORE   0x00000004
-
-/* Known:
-   sizeof(struct rlimit) = 8
-     rlim_cur: off  0 sz 4
-     rlim_max: off  4 sz 4
-*/
-struct vki_rlimit {
-   UInt rlim_cur;
-   UInt rlim_max;
-};
-
-/* ---------------- Time ---------------- */
-
-/* Known:
-   sizeof(struct timeval) = 8
-      tv_sec: off  0 sz 4
-     tv_usec: off  4 sz 4
-*/
-struct vki_timeval {
-   UInt tv_sec;         /* seconds */
-   UInt tv_usec;        /* microseconds */
-};
-
-/* Known:
-   sizeof(struct timespec) = 8
-      tv_sec: off  0 sz 4
-     tv_nsec: off  4 sz 4
-*/
-struct vki_timespec {
-   UInt tv_sec;         /* seconds */
-   UInt tv_nsec;        /* nanoseconds */
-};
-
-/* ---------------- Signals ---------------- */
-
-/* This layout verified 27 July 06. */
-#define _VKI_NSIG_BPW   32
-#define _VKI_NSIG       64
-#define _VKI_NSIG_WORDS (_VKI_NSIG / _VKI_NSIG_BPW)
-
-typedef struct {
-   UInt sig[_VKI_NSIG_WORDS];
-} vki_sigset_t;
-
-#define VKI_SIGSEGV   11
-#define VKI_SIGBUS    10
-#define VKI_SIGFPE     8
-#define VKI_SIGHUP     1
-#define VKI_SIGINT     2
-#define VKI_SIGQUIT    3
-#define VKI_SIGABRT    6
-#define VKI_SIGUSR1   30
-#define VKI_SIGUSR2   31
-#define VKI_SIGPIPE   13
-#define VKI_SIGALRM   14
-#define VKI_SIGTERM   15
-/* VKI_SIGSTKFLT does not exist on AIX 5.2 */
-#define VKI_SIGTTIN   21
-#define VKI_SIGTTOU   22
-#define VKI_SIGXCPU   24
-#define VKI_SIGXFSZ   25
-#define VKI_SIGVTALRM 34
-#define VKI_SIGPROF   32
-#define VKI_SIGIO     23
-#define VKI_SIGPWR    29
-/* VKI_SIGUNUSED does not exist on AIX 5.2 */
-#define VKI_SIGRTMIN  50
-#define VKI_SIGRTMAX  57
-#define VKI_SIGTRAP    5
-#define VKI_SIGCONT   19
-#define VKI_SIGCHLD   20
-#define VKI_SIGWINCH  28
-#define VKI_SIGURG    16
-#define VKI_SIGILL     4
-#define VKI_SIGSTOP   17
-#define VKI_SIGKILL    9
-#define VKI_SIGTSTP   18
-#define VKI_SIGSYS    12
-
-/* Known:
-    sizeof(struct sigaction) = 16
-      sa_handler: off  0 sz 4
-         sa_mask: off  4 sz 8
-        sa_flags: off 12 sz 4
-    sa_sigaction: off  0 sz 4
-*/
-struct vki_sigaction {
-   void*        ksa_handler;
-   vki_sigset_t sa_mask;
-   UInt         sa_flags;
-};
-
-#define VKI_SA_ONSTACK      1
-#define VKI_SA_RESTART      8
-#define VKI_SA_RESETHAND    2
-#define VKI_SA_SIGINFO    256
-#define VKI_SA_NODEFER    512
-#define VKI_SA_NOCLDSTOP    4
-#define VKI_SA_NOCLDWAIT 1024
-
-#define VKI_SA_RESTORER  0 /* AIX doesn't have this */
-#define VKI_SA_NOMASK    0 /* AIX doesn't have this */
-#define VKI_SA_ONESHOT   0 /* AIX doesn't have this */
-
-#define VKI_SS_ONSTACK 1
-#define VKI_SS_DISABLE 2
-
-#define VKI_MINSIGSTKSZ 1168
-
-#define VKI_SI_USER  0
-
-#define VKI_SIG_BLOCK      0
-#define VKI_SIG_SETMASK    2
-#define VKI_SIG_UNBLOCK    1
-#define VKI_SIG_IGN        (void*)1
-#define VKI_SIG_DFL        (void*)0
-
-#define VKI_SEGV_ACCERR 51
-#define VKI_SEGV_MAPERR 50
-
-#define VKI_TRAP_TRACE 61
-#define VKI_TRAP_BRKPT 60
-#define VKI_BUS_OBJERR 3
-#define VKI_BUS_ADRERR 2
-#define VKI_BUS_ADRALN 1
-#define VKI_FPE_FLTSUB 27
-#define VKI_FPE_FLTINV 26
-#define VKI_FPE_FLTRES 25
-#define VKI_FPE_FLTUND 24
-#define VKI_FPE_FLTOVF 23
-#define VKI_FPE_FLTDIV 22
-#define VKI_FPE_INTOVF 21
-#define VKI_FPE_INTDIV 20
-#define VKI_ILL_BADSTK 37
-#define VKI_ILL_COPROC 36
-#define VKI_ILL_PRVREG 35
-#define VKI_ILL_PRVOPC 34
-#define VKI_ILL_ILLTRP 33
-#define VKI_ILL_ILLADR 32
-#define VKI_ILL_ILLOPN 31
-#define VKI_ILL_ILLOPC 30
-
-/* Known: 
-    sizeof(siginfo_t) = 64
-     si_signo: off  0 sz 4
-      si_code: off  8 sz 4
-       si_pid: off 12 sz 4
-      si_addr: off 20 sz 4
-*/
-typedef struct {
-    UInt  si_signo;
-    UInt  __off4;
-    UInt  si_code;
-    UInt  si_pid;
-    UInt  __off16;
-    void* si_addr;
-    UInt  __off24;
-    UInt  __off28;
-    UInt  __off32;
-    UInt  __off36;
-    UInt  __off40;
-    UInt  __off44;
-    UInt  __off48;
-    UInt  __off52;
-    UInt  __off56;
-    UInt  __off60;
-} vki_siginfo_t;
-
-/* Known:
-   sizeof(stack_t) = 28
-       ss_sp: off  0 sz 4
-     ss_size: off  4 sz 4
-    ss_flags: off  8 sz 4
-*/
-typedef struct vki_sigaltstack {
-   /*  0 */ void* ss_sp;
-   /*  4 */ UInt  ss_size;
-   /*  8 */ UInt  ss_flags;
-   /* 12 */ UInt  __off12;
-   /* 16 */ UInt  __off16;
-   /* 20 */ UInt  __off20;
-   /* 24 */ UInt  __off24;
-} vki_stack_t;
-
-/* ---------------- Misc ---------------- */
-
-#define VKI_PTRACE_TRACEME 0  /* nb: is really PT_TRACE_ME */
-#define VKI_PTRACE_DETACH 31  /* nb: is really PT_DETACH */
-
-
-//--------------------------------------------------------------
-// BOGUS
-//--------------------------------------------------------------
-
-struct vki_dirent {
-  int bogus;
-};
-
-struct vki_sockaddr {
-  int bogus;
-};
-
-struct vki_pollfd {
-  int bogus;
-};
-
-/* Structure describing an Internet (IP) socket address. */
-//struct vki_sockaddr_in {
-//  int bogus;
-//};
-
-struct vki_ucontext {
-  int bogus;
-};
-
-
-//--------------------------------------------------------------
-// FROM glibc-ports-2.4/sysdeps/unix/sysv/aix/dlldr.h
-//--------------------------------------------------------------
-
-/* Copyright (C) 2001 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-
-/*
-
- int __loadx(flag, module, arg1, arg2, arg3)
-
- The __loadx() is a call to ld_loadutil() kernel function, which
- does the real work. Note ld_loadutil() is not exported an cannot be
- called directly from user space.
-
- void *ld_loadutil() call is a utility function used for loader extensions
- supporting run-time linking and dl*() functions.
-
- void *   - will return the modules entry point if it succeds of NULL
-                on failure.
-
- int flag - the flag field performas a dual role: the top 8 bits specify
-            the work for __loadx() to perform, the bottom 8 bits are
-            used to pass flags to the work routines, all other bits are
-            reserved.
-
-*/
-
-#define VKI_DL_LOAD       0x1000000 /* __loadx(flag,buf, buf_len, filename, libr_path) */
-#define VKI_DL_POSTLOADQ  0x2000000 /* __loadx(flag,buf, buf_len, module_handle) */
-#define VKI_DL_EXECQ      0x3000000 /* __loadx(flag,buf, buf_len) */
-#define VKI_DL_EXITQ      0x4000000 /* __loadx(flag,buf, buf_len) */
-#define VKI_DL_PREUNLOADQ 0x5000000 /* __loadx(flag,buf, buf_len, module_handle) */
-#define VKI_DL_INIT       0x6000000 /* __loadx(flag,NULL) */
-#define VKI_DL_GETSYM     0x7000000 /* __loadx(flag,symbol, index, modules_data_origin) */
-#define VKI_DL_SETDEPEND  0x8000000 /* __loadx(flag,import_data_org, import_index, */
-                                    /*              export_data_org, export_index) */
-#define VKI_DL_DELDEPEND  0x9000000 /* __loadx(flag,import_data_org, import_index, */
-                                    /*              export_data_org, export_index) */
-#define VKI_DL_GLOBALSYM  0xA000000 /* __loadx(flag,symbol_name, ptr_to_rec_index, */
-                                    /*                        ptr_to_rec_data_org) */
-#define VKI_DL_UNIX_SYSCALL 0xB000000 /* __loadx(flag,syscall_symbol_name) */
-
-#define VKI_DL_FUNCTION_MASK 0xFF000000
-#define VKI_DL_SRCHDEPENDS   0x00100000
-#define VKI_DL_SRCHMODULE    0x00080000
-#define VKI_DL_SRCHLOADLIST  0x00040000
-#define VKI_DL_LOAD_LDX1     0x00040000
-#define VKI_DL_LOAD_RTL      0x00020000
-#define VKI_DL_HASHSTRING    0x00020000
-#define VKI_DL_INFO_OK       0x00010000
-#define VKI_DL_LOAD_DLINFO   0x00010000
-#define VKI_DL_UNLOADED      0x00020000
-
-
-#endif // __VKI_PPC32_AIX5_H
-
-/*--------------------------------------------------------------------*/
-/*--- end                                                          ---*/
-/*--------------------------------------------------------------------*/
diff --git a/main/include/vki/vki-ppc32-linux.h b/main/include/vki/vki-ppc32-linux.h
index 6b44386..d0c5ba6 100644
--- a/main/include/vki/vki-ppc32-linux.h
+++ b/main/include/vki/vki-ppc32-linux.h
@@ -7,7 +7,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2005-2010 Julian Seward
+   Copyright (C) 2005-2011 Julian Seward
       jseward@acm.org
 
    This program is free software; you can redistribute it and/or
@@ -543,7 +543,7 @@
 #define VKI_FIONBIO		_VKI_IOW('f', 126, int)
 #define VKI_FIONREAD		_VKI_IOR('f', 127, int)
 //#define VKI_TIOCINQ		VKI_FIONREAD
-//#define VKI_FIOQSIZE		_VKI_IOR('f', 128, vki_loff_t)
+#define VKI_FIOQSIZE		_VKI_IOR('f', 128, vki_loff_t)
 
 //#define VKI_TIOCGETP		_VKI_IOR('t', 8, struct vki_sgttyb)
 //#define VKI_TIOCSETP		_VKI_IOW('t', 9, struct vki_sgttyb)
diff --git a/main/include/vki/vki-ppc64-aix5.h b/main/include/vki/vki-ppc64-aix5.h
deleted file mode 100644
index 092d92c..0000000
--- a/main/include/vki/vki-ppc64-aix5.h
+++ /dev/null
@@ -1,464 +0,0 @@
-
-/*--------------------------------------------------------------------*/
-/*--- 64-bit AIX5-specific kernel interface.      vki-ppc64-aix5.h ---*/
-/*--------------------------------------------------------------------*/
-
-/*
-   This file is part of Valgrind, a dynamic binary instrumentation
-   framework.
-
-   Copyright (C) 2006-2010 OpenWorks LLP
-      info@open-works.co.uk
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful, but
-   WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307, USA.
-
-   The GNU General Public License is contained in the file COPYING.
-*/
-
-/* This file defines types and constants for the kernel interface, and to
-   make that clear everything is prefixed VKI_/vki_.
-*/
-
-/* This file was generated by running auxprogs/aix5_VKI_info.c. */
-
-#ifndef __VKI_PPC64_AIX5_H
-#define __VKI_PPC64_AIX5_H
-
-#if !defined(VGP_ppc64_aix5)
-#  error This file should be included in 64-bit AIX5 builds only.
-#endif
-
-//--------------------------------------------------------------
-// VERIFIED
-//--------------------------------------------------------------
-
-/* ---------------- Errors ---------------- */
-
-#define VKI_EINVAL 22
-#define VKI_EINTR  4
-#define VKI_ENOSYS 109
-#define VKI_EAGAIN 11
-#define VKI_ENOMEM 12
-#define VKI_EACCES 13
-#define VKI_EEXIST 17
-#define VKI_EPERM  1
-#define VKI_ENOENT 2
-#define VKI_ESRCH  3
-#define VKI_EBADF  9
-#define VKI_EFAULT 14
-#define VKI_EMFILE 24
-#define VKI_ECHILD 10
-#define VKI_EOVERFLOW 127
-#define VKI_ERESTARTSYS 0 /* AIX doesn't have this */
-
-/* ---------------- File I/O ---------------- */
-
-#define VKI_O_WRONLY 0x00000001
-#define VKI_O_RDONLY 0x00000000
-#define VKI_O_APPEND 0x00000008
-#define VKI_O_CREAT  0x00000100
-#define VKI_O_RDWR   0x00000002
-#define VKI_O_EXCL   0x00000400
-#define VKI_O_TRUNC  0x00000200
-
-#define VKI_S_IRUSR  0x00000100
-#define VKI_S_IXUSR  0x00000040
-#define VKI_S_IXGRP  0x00000008
-#define VKI_S_IXOTH  0x00000001
-#define VKI_S_IWUSR  0x00000080
-#define VKI_S_IWOTH  0x00000002
-#define VKI_S_ISUID  0x00000800
-#define VKI_S_ISGID  0x00000400
-#define VKI_S_IFMT   0x0000f000
-#define VKI_S_IFDIR  0x00004000
-#define VKI_S_IFCHR  0x00002000
-#define VKI_S_IFBLK  0x00006000
-
-/* Next 3 are from include/vki/vki-linux.h */
-#define VKI_S_ISDIR(m)  (((m) & VKI_S_IFMT) == VKI_S_IFDIR)
-#define VKI_S_ISCHR(m)  (((m) & VKI_S_IFMT) == VKI_S_IFCHR)
-#define VKI_S_ISBLK(m)  (((m) & VKI_S_IFMT) == VKI_S_IFBLK)
-
-#define VKI_F_DUPFD  0x00000000
-#define VKI_F_SETFD  0x00000002
-#define VKI_FD_CLOEXEC  0x00000001
-
-#define VKI_R_OK 0x00000004
-#define VKI_W_OK 0x00000002
-#define VKI_X_OK 0x00000001
-
-/* Known:
-   sizeof(struct stat) = 176
-      st_dev:  off   0 sz 8
-      st_ino:  off   8 sz 8
-      st_mode: off  16 sz 4
-      st_uid:  off  24 sz 4
-      st_gid:  off  28 sz 4
-      st_size: off 168 sz 8
-*/
-struct vki_stat {
-   /*   0 */ ULong st_dev;
-   /*   8 */ ULong st_ino;
-   /*  16 */ UInt  st_mode;
-   /*  20 */ UInt  __off20;
-   /*  24 */ UInt  st_uid;
-   /*  28 */ UInt  st_gid;
-   /*  32 */ UChar __off28[168-32];
-   /* 168 */ ULong st_size;
-};
-
-#define VKI_STX_NORMAL  0
-
-typedef ULong vki_size_t;
-
-#define VKI_SEEK_SET 0
-#define VKI_PATH_MAX 1023
-
-/* Known:
-   sizeof(struct iovec) = 16
-      iov_base: off  0 sz 8
-      iov_len:  off  8 sz 8
-
-*/
-struct vki_iovec {
-   /* 0 */ Addr  iov_base;
-   /* 8 */ ULong iov_len;
-};
-
-#define _VKI_IOC_NONE 0
-#define _VKI_IOC_READ 1    /* kernel reads, userspace writes */
-#define _VKI_IOC_WRITE 2   /* kernel writes, userspace reads */
-#define _VKI_IOC_DIR(_x)   (((_x) >> 30) & 3)
-#define _VKI_IOC_SIZE(_x)  (((_x) >> 16) & 0x7F)
-
-/* ---------------- MMappery ---------------- */
-
-/* This assumes the page size is 4096.  That assumption is checked
-   by the launcher. */
-#define VKI_PAGE_SHIFT  12
-#define VKI_PAGE_SIZE   (1UL << VKI_PAGE_SHIFT)
-#define VKI_MAX_PAGE_SHIFT      VKI_PAGE_SHIFT
-#define VKI_MAX_PAGE_SIZE       VKI_PAGE_SIZE
-
-#define VKI_PROT_NONE  0x00000000
-#define VKI_PROT_READ  0x00000001
-#define VKI_PROT_WRITE 0x00000002
-#define VKI_PROT_EXEC  0x00000004
-
-#define VKI_MAP_FIXED     0x00000100
-#define VKI_MAP_PRIVATE   0x00000002
-#define VKI_MAP_ANONYMOUS 0x00000010
-
-/* ---------------- RLimitery ---------------- */
-
-/* rlimit: these pertain to syscall "appgetrlimit" */
-#define VKI_RLIMIT_DATA   0x00000002
-#define VKI_RLIMIT_NOFILE 0x00000007
-#define VKI_RLIMIT_STACK  0x00000003
-#define VKI_RLIMIT_CORE   0x00000004
-
-/* Known:
-   sizeof(struct rlimit) = 16
-      rlim_cur: off  0 sz 8
-      rlim_max: off  8 sz 8
-*/
-struct vki_rlimit {
-   /* 0 */ ULong rlim_cur;
-   /* 8 */ ULong rlim_max;
-};
-
-/* ---------------- Time ---------------- */
-
-/* Known:
-   sizeof(struct timeval) = 16
-      tv_sec: off  0 sz 8
-     tv_usec: off  8 sz 4
-*/
-struct vki_timeval {
-   /*  0 */ ULong tv_sec;         /* seconds */
-   /*  8 */ UInt  tv_usec;        /* microseconds */
-   /* 12 */ UInt  __off12;
-};
-
-/* Known:
-   sizeof(struct timespec) = 16
-      tv_sec: off  0 sz 8
-     tv_nsec: off  8 sz 8
-*/
-struct vki_timespec {
-   /* 0 */ ULong tv_sec;         /* seconds */
-   /* 8 */ ULong tv_nsec;        /* nanoseconds */
-};
-
-/* ---------------- Signals ---------------- */
-
-/* This layout verified 27 July 06. */
-#define _VKI_NSIG_BPW   64
-#define _VKI_NSIG       256
-#define _VKI_NSIG_WORDS (_VKI_NSIG / _VKI_NSIG_BPW)
-
-typedef struct {
-   ULong sig[_VKI_NSIG_WORDS];
-} vki_sigset_t;
-
-#define VKI_SIGSEGV   11
-#define VKI_SIGBUS    10
-#define VKI_SIGFPE     8
-#define VKI_SIGHUP     1
-#define VKI_SIGINT     2
-#define VKI_SIGQUIT    3
-#define VKI_SIGABRT    6
-#define VKI_SIGUSR1   30
-#define VKI_SIGUSR2   31
-#define VKI_SIGPIPE   13
-#define VKI_SIGALRM   14
-#define VKI_SIGTERM   15
-/* VKI_SIGSTKFLT does not exist on AIX 5.2 */
-#define VKI_SIGTTIN   21
-#define VKI_SIGTTOU   22
-#define VKI_SIGXCPU   24
-#define VKI_SIGXFSZ   25
-#define VKI_SIGVTALRM 34
-#define VKI_SIGPROF   32
-#define VKI_SIGIO     23
-#define VKI_SIGPWR    29
-/* VKI_SIGUNUSED does not exist on AIX 5.2 */
-#define VKI_SIGRTMIN  50
-#define VKI_SIGRTMAX  57
-#define VKI_SIGTRAP    5
-#define VKI_SIGCONT   19
-#define VKI_SIGCHLD   20
-#define VKI_SIGWINCH  28
-#define VKI_SIGURG    16
-#define VKI_SIGILL     4
-#define VKI_SIGSTOP   17
-#define VKI_SIGKILL    9
-#define VKI_SIGTSTP   18
-#define VKI_SIGSYS    12
-
-/* Known:
-   sizeof(struct sigaction) = 48
-   sa_sigaction: off  0 sz 8
-     sa_handler: off  0 sz 8
-        sa_mask: off  8 sz 32
-       sa_flags: off 40 sz 4
-*/
-struct vki_sigaction {
-   /*  0 */ void*        ksa_handler;
-   /*  8 */ vki_sigset_t sa_mask;
-   /* 40 */ UInt         sa_flags;
-   /* 44 */ UInt         __off44;
-};
-
-#define VKI_SA_ONSTACK      1
-#define VKI_SA_RESTART      8
-#define VKI_SA_RESETHAND    2
-#define VKI_SA_SIGINFO    256
-#define VKI_SA_NODEFER    512
-#define VKI_SA_NOCLDSTOP    4
-#define VKI_SA_NOCLDWAIT 1024
-
-#define VKI_SA_RESTORER  0 /* AIX doesn't have this */
-#define VKI_SA_NOMASK    0 /* AIX doesn't have this */
-#define VKI_SA_ONESHOT   0 /* AIX doesn't have this */
-
-#define VKI_SS_ONSTACK 1
-#define VKI_SS_DISABLE 2
-
-#define VKI_MINSIGSTKSZ 1200
-
-#define VKI_SI_USER  0
-
-#define VKI_SIG_BLOCK      0
-#define VKI_SIG_SETMASK    2
-#define VKI_SIG_UNBLOCK    1
-#define VKI_SIG_IGN        (void*)1
-#define VKI_SIG_DFL        (void*)0
-
-#define VKI_SEGV_ACCERR 51
-#define VKI_SEGV_MAPERR 50
-
-#define VKI_TRAP_TRACE 61
-#define VKI_TRAP_BRKPT 60
-#define VKI_BUS_OBJERR 3
-#define VKI_BUS_ADRERR 2
-#define VKI_BUS_ADRALN 1
-#define VKI_FPE_FLTSUB 27
-#define VKI_FPE_FLTINV 26
-#define VKI_FPE_FLTRES 25
-#define VKI_FPE_FLTUND 24
-#define VKI_FPE_FLTOVF 23
-#define VKI_FPE_FLTDIV 22
-#define VKI_FPE_INTOVF 21
-#define VKI_FPE_INTDIV 20
-
-#define VKI_ILL_BADSTK 37
-#define VKI_ILL_COPROC 36
-#define VKI_ILL_PRVREG 35
-#define VKI_ILL_PRVOPC 34
-#define VKI_ILL_ILLTRP 33
-#define VKI_ILL_ILLADR 32
-#define VKI_ILL_ILLOPN 31
-#define VKI_ILL_ILLOPC 30
-
-/* Known: 
-   sizeof(siginfo_t) = 64
-      si_signo: off  0 sz 4
-       si_code: off  8 sz 4
-        si_pid: off 12 sz 4
-       si_addr: off 24 sz 8
-*/
-typedef struct {
-   /*  0 */ UInt  si_signo;
-   /*  4 */ UInt  __off4;
-   /*  8 */ UInt  si_code;
-   /* 12 */ UInt  si_pid;
-   /* 16 */ UInt  __off16;
-   /* 20 */ UInt  __off20;
-   /* 24 */ void* si_addr;
-   /* 32 */ UInt  __off32;
-   /* 36 */ UInt  __off36;
-   /* 40 */ UInt  __off40;
-   /* 44 */ UInt  __off44;
-   /* 48 */ UInt  __off48;
-   /* 52 */ UInt  __off52;
-   /* 56 */ UInt  __off56;
-   /* 60 */ UInt  __off60;
-} vki_siginfo_t;
-
-/* Known:
-   sizeof(stack_t) = 40
-       ss_sp: off  0 sz 8
-     ss_size: off  8 sz 8
-    ss_flags: off 16 sz 4
-*/
-typedef struct vki_sigaltstack {
-   /*  0 */ void* ss_sp;
-   /*  8 */ ULong ss_size;
-   /* 16 */ UInt  ss_flags;
-   /* 20 */ UInt  __off20;
-   /* 24 */ ULong __off24;
-   /* 32 */ ULong __off32;
-} vki_stack_t;
-
-/* ---------------- Misc ---------------- */
-
-#define VKI_PTRACE_TRACEME 0  /* nb: is really PT_TRACE_ME */
-#define VKI_PTRACE_DETACH 31  /* nb: is really PT_DETACH */
-
-
-//--------------------------------------------------------------
-// BOGUS
-//--------------------------------------------------------------
-
-struct vki_dirent {
-  int bogus;
-};
-
-struct vki_sockaddr {
-  int bogus;
-};
-
-struct vki_pollfd {
-  int bogus;
-};
-
-/* Structure describing an Internet (IP) socket address. */
-//struct vki_sockaddr_in {
-//  int bogus;
-//};
-
-struct vki_ucontext {
-  int bogus;
-};
-
-
-//--------------------------------------------------------------
-// FROM glibc-ports-2.4/sysdeps/unix/sysv/aix/dlldr.h
-//--------------------------------------------------------------
-
-/* Copyright (C) 2001 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-
-/*
-
- int __loadx(flag, module, arg1, arg2, arg3)
-
- The __loadx() is a call to ld_loadutil() kernel function, which
- does the real work. Note ld_loadutil() is not exported an cannot be
- called directly from user space.
-
- void *ld_loadutil() call is a utility function used for loader extensions
- supporting run-time linking and dl*() functions.
-
- void *   - will return the modules entry point if it succeds of NULL
-                on failure.
-
- int flag - the flag field performas a dual role: the top 8 bits specify
-            the work for __loadx() to perform, the bottom 8 bits are
-            used to pass flags to the work routines, all other bits are
-            reserved.
-
-*/
-
-#define VKI_DL_LOAD       0x1000000 /* __loadx(flag,buf, buf_len, filename, libr_path) */
-#define VKI_DL_POSTLOADQ  0x2000000 /* __loadx(flag,buf, buf_len, module_handle) */
-#define VKI_DL_EXECQ      0x3000000 /* __loadx(flag,buf, buf_len) */
-#define VKI_DL_EXITQ      0x4000000 /* __loadx(flag,buf, buf_len) */
-#define VKI_DL_PREUNLOADQ 0x5000000 /* __loadx(flag,buf, buf_len, module_handle) */
-#define VKI_DL_INIT       0x6000000 /* __loadx(flag,NULL) */
-#define VKI_DL_GETSYM     0x7000000 /* __loadx(flag,symbol, index, modules_data_origin) */
-#define VKI_DL_SETDEPEND  0x8000000 /* __loadx(flag,import_data_org, import_index, */
-                                    /*              export_data_org, export_index) */
-#define VKI_DL_DELDEPEND  0x9000000 /* __loadx(flag,import_data_org, import_index, */
-                                    /*              export_data_org, export_index) */
-#define VKI_DL_GLOBALSYM  0xA000000 /* __loadx(flag,symbol_name, ptr_to_rec_index, */
-                                    /*                        ptr_to_rec_data_org) */
-#define VKI_DL_UNIX_SYSCALL 0xB000000 /* __loadx(flag,syscall_symbol_name) */
-
-#define VKI_DL_FUNCTION_MASK 0xFF000000
-#define VKI_DL_SRCHDEPENDS   0x00100000
-#define VKI_DL_SRCHMODULE    0x00080000
-#define VKI_DL_SRCHLOADLIST  0x00040000
-#define VKI_DL_LOAD_LDX1     0x00040000
-#define VKI_DL_LOAD_RTL      0x00020000
-#define VKI_DL_HASHSTRING    0x00020000
-#define VKI_DL_INFO_OK       0x00010000
-#define VKI_DL_LOAD_DLINFO   0x00010000
-#define VKI_DL_UNLOADED      0x00020000
-
-
-#endif // __VKI_PPC64_AIX5_H
-
-/*--------------------------------------------------------------------*/
-/*--- end                                                          ---*/
-/*--------------------------------------------------------------------*/
diff --git a/main/include/vki/vki-ppc64-linux.h b/main/include/vki/vki-ppc64-linux.h
index 5af8470..6e50b5b 100644
--- a/main/include/vki/vki-ppc64-linux.h
+++ b/main/include/vki/vki-ppc64-linux.h
@@ -7,7 +7,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2005-2010 Julian Seward
+   Copyright (C) 2005-2011 Julian Seward
       jseward@acm.org
 
    This program is free software; you can redistribute it and/or
@@ -620,6 +620,7 @@
 #define VKI_FIOASYNC        _VKI_IOW('f', 125, int)
 #define VKI_TIOCSERGETLSR   0x5459 /* Get line status register */
 #define VKI_TIOCGICOUNT	    0x545D /* read serial port inline interrupt counts */
+#define VKI_FIOQSIZE        _VKI_IOR('f', 128, vki_loff_t)
 
 //----------------------------------------------------------------------
 // From linux-2.6.13/include/asm-ppc64/poll.h
diff --git a/main/include/vki/vki-s390x-linux.h b/main/include/vki/vki-s390x-linux.h
new file mode 100644
index 0000000..2b5b861
--- /dev/null
+++ b/main/include/vki/vki-s390x-linux.h
@@ -0,0 +1,949 @@
+
+/*--------------------------------------------------------------------*/
+/*--- s390x/Linux-specific kernel interface.     vki-s390x-linux.h ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+   This file is part of Valgrind, a dynamic binary instrumentation
+   framework.
+
+   Copyright IBM Corp. 2010-2011
+
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307, USA.
+
+   The GNU General Public License is contained in the file COPYING.
+*/
+
+/* Contributed by Florian Krohm and Volker Sameske */
+
+#ifndef __VKI_S390X_LINUX_H
+#define __VKI_S390X_LINUX_H
+
+#define __force
+
+//----------------------------------------------------------------------
+// From linux-2.6.16.60/include/asm-s390/types.h
+//----------------------------------------------------------------------
+
+typedef __signed__ char __vki_s8;
+typedef unsigned char __vki_u8;
+
+typedef __signed__ short __vki_s16;
+typedef unsigned short __vki_u16;
+
+typedef __signed__ int __vki_s32;
+typedef unsigned int __vki_u32;
+
+typedef __signed__ long __vki_s64;
+typedef unsigned long __vki_u64;
+
+typedef unsigned short vki_u16;
+
+typedef unsigned int vki_u32;
+
+//----------------------------------------------------------------------
+// From linux-2.6.16.60/include/asm-s390/page.h
+//----------------------------------------------------------------------
+
+/* PAGE_SHIFT determines the page size */
+#define VKI_PAGE_SHIFT  12
+#define VKI_PAGE_SIZE   (1UL << VKI_PAGE_SHIFT)
+
+//----------------------------------------------------------------------
+// From linux-2.6.16.60/include/asm-s390/siginfo.h
+//----------------------------------------------------------------------
+
+/* We need that to ensure that sizeof(siginfo) == 128. */
+#ifdef __s390x__
+#define __VKI_ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
+#endif
+
+//----------------------------------------------------------------------
+// From linux-2.6.16.60/include/asm-s390/sigcontext.h
+//----------------------------------------------------------------------
+
+#define __VKI_NUM_GPRS 16
+#define __VKI_NUM_FPRS 16
+#define __VKI_NUM_ACRS 16
+
+#ifndef VGA_s390x
+
+/* Has to be at least _NSIG_WORDS from asm/signal.h */
+#define _VKI_SIGCONTEXT_NSIG	64
+#define _VKI_SIGCONTEXT_NSIG_BPW	32
+/* Size of stack frame allocated when calling signal handler. */
+#define __VKI_SIGNAL_FRAMESIZE	96
+
+#else /* VGA_s390x */
+
+/* Has to be at least _NSIG_WORDS from asm/signal.h */
+#define _VKI_SIGCONTEXT_NSIG	64
+#define _VKI_SIGCONTEXT_NSIG_BPW	64
+/* Size of stack frame allocated when calling signal handler. */
+#define __VKI_SIGNAL_FRAMESIZE	160
+
+#endif /* VGA_s390x */
+
+
+#define _VKI_SIGCONTEXT_NSIG_WORDS	(_VKI_SIGCONTEXT_NSIG / _VKI_SIGCONTEXT_NSIG_BPW)
+#define _VKI_SIGMASK_COPY_SIZE	(sizeof(unsigned long)*_VKI_SIGCONTEXT_NSIG_WORDS)
+
+typedef struct
+{
+	unsigned long mask;
+	unsigned long addr;
+} __attribute__ ((aligned(8))) _vki_psw_t;
+
+typedef struct
+{
+	_vki_psw_t psw;
+	unsigned long gprs[__VKI_NUM_GPRS];
+	unsigned int  acrs[__VKI_NUM_ACRS];
+} _vki_s390_regs_common;
+
+typedef struct
+{
+	unsigned int fpc;
+	double   fprs[__VKI_NUM_FPRS];
+} _vki_s390_fp_regs;
+
+typedef struct
+{
+	_vki_s390_regs_common regs;
+	_vki_s390_fp_regs     fpregs;
+} _vki_sigregs;
+
+
+struct vki_sigcontext
+{
+	unsigned long   oldmask[_VKI_SIGCONTEXT_NSIG_WORDS];
+	_vki_sigregs    __user *sregs;
+};
+
+
+//----------------------------------------------------------------------
+// From linux-2.6.16.60/include/asm-s390/signal.h
+//----------------------------------------------------------------------
+
+#define _VKI_NSIG           _VKI_SIGCONTEXT_NSIG
+#define _VKI_NSIG_BPW       _VKI_SIGCONTEXT_NSIG_BPW
+#define _VKI_NSIG_WORDS     _VKI_SIGCONTEXT_NSIG_WORDS
+
+typedef unsigned long vki_old_sigset_t;
+
+typedef struct {
+	unsigned long sig[_VKI_NSIG_WORDS];
+} vki_sigset_t;
+
+#define VKI_SIGHUP           1
+#define VKI_SIGINT           2
+#define VKI_SIGQUIT          3
+#define VKI_SIGILL           4
+#define VKI_SIGTRAP          5
+#define VKI_SIGABRT          6
+#define VKI_SIGIOT           6
+#define VKI_SIGBUS           7
+#define VKI_SIGFPE           8
+#define VKI_SIGKILL          9
+#define VKI_SIGUSR1         10
+#define VKI_SIGSEGV         11
+#define VKI_SIGUSR2         12
+#define VKI_SIGPIPE         13
+#define VKI_SIGALRM         14
+#define VKI_SIGTERM         15
+#define VKI_SIGSTKFLT       16
+#define VKI_SIGCHLD         17
+#define VKI_SIGCONT         18
+#define VKI_SIGSTOP         19
+#define VKI_SIGTSTP         20
+#define VKI_SIGTTIN         21
+#define VKI_SIGTTOU         22
+#define VKI_SIGURG          23
+#define VKI_SIGXCPU         24
+#define VKI_SIGXFSZ         25
+#define VKI_SIGVTALRM       26
+#define VKI_SIGPROF         27
+#define VKI_SIGWINCH        28
+#define VKI_SIGIO           29
+#define VKI_SIGPOLL         VKI_SIGIO
+/*
+#define VKI_SIGLOST         29
+*/
+#define VKI_SIGPWR          30
+#define VKI_SIGSYS	    31
+#define VKI_SIGUNUSED       31
+
+/* These should not be considered constants from userland.  */
+#define VKI_SIGRTMIN        32
+#define VKI_SIGRTMAX        _VKI_NSIG
+
+/*
+ * SA_FLAGS values:
+ *
+ * SA_ONSTACK indicates that a registered stack_t will be used.
+ * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the
+ * SA_RESTART flag to get restarting signals (which were the default long ago)
+ * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
+ * SA_RESETHAND clears the handler when the signal is delivered.
+ * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
+ * SA_NODEFER prevents the current signal from being masked in the handler.
+ *
+ * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
+ * Unix names RESETHAND and NODEFER respectively.
+ */
+#define VKI_SA_NOCLDSTOP    0x00000001
+#define VKI_SA_NOCLDWAIT    0x00000002
+#define VKI_SA_SIGINFO      0x00000004
+#define VKI_SA_ONSTACK      0x08000000
+#define VKI_SA_RESTART      0x10000000
+#define VKI_SA_NODEFER      0x40000000
+#define VKI_SA_RESETHAND    0x80000000
+
+#define VKI_SA_NOMASK       VKI_SA_NODEFER
+#define VKI_SA_ONESHOT      VKI_SA_RESETHAND
+#define VKI_SA_INTERRUPT    0x20000000 /* dummy -- ignored */
+
+#define VKI_SA_RESTORER     0x04000000
+
+/*
+ * sigaltstack controls
+ */
+#define VKI_SS_ONSTACK      1
+#define VKI_SS_DISABLE      2
+
+#define VKI_MINSIGSTKSZ     2048
+#define VKI_SIGSTKSZ        8192
+
+
+/* Next lines asm-generic/signal.h */
+#define VKI_SIG_BLOCK          0 /* for blocking signals */
+#define VKI_SIG_UNBLOCK        1 /* for unblocking signals */
+#define VKI_SIG_SETMASK        2 /* for setting the signal mask */
+
+typedef void __vki_signalfn_t(int);
+typedef __vki_signalfn_t __user *__vki_sighandler_t;
+
+/* default signal handling */
+#define VKI_SIG_DFL ((__force __vki_sighandler_t)0)
+/* ignore signal */
+#define VKI_SIG_IGN ((__force __vki_sighandler_t)1)
+/* error return from signal */
+#define VKI_SIG_ERR ((__force __vki_sighandler_t)-1)
+/* Back to asm-s390/signal.h */
+
+struct vki_old_sigaction {
+        // [[Nb: a 'k' prefix is added to "sa_handler" because
+        // bits/sigaction.h (which gets dragged in somehow via signal.h)
+        // #defines it as something else.  Since that is done for glibc's
+        // purposes, which we don't care about here, we use our own name.]]
+        __vki_sighandler_t ksa_handler;
+        vki_old_sigset_t sa_mask;
+        unsigned long sa_flags;
+        void (*sa_restorer)(void);
+};
+
+struct vki_sigaction {
+        // [[See comment about extra 'k' above]]
+        __vki_sighandler_t ksa_handler;
+        unsigned long sa_flags;
+        void (*sa_restorer)(void);
+        vki_sigset_t sa_mask;               /* mask last for extensibility */
+};
+
+struct vki_k_sigaction {
+        struct vki_sigaction sa;
+};
+
+
+/* On Linux we use the same type for passing sigactions to
+   and from the kernel.  Hence: */
+typedef  struct vki_sigaction  vki_sigaction_toK_t;
+typedef  struct vki_sigaction  vki_sigaction_fromK_t;
+
+
+typedef struct vki_sigaltstack {
+	void __user *ss_sp;
+	int ss_flags;
+	vki_size_t ss_size;
+} vki_stack_t;
+
+
+//----------------------------------------------------------------------
+// From linux-2.6.16.60/include/asm-s390/mman.h
+//----------------------------------------------------------------------
+
+#define VKI_PROT_NONE   0x0             /* No page permissions */
+#define VKI_PROT_READ   0x1             /* page can be read */
+#define VKI_PROT_WRITE  0x2             /* page can be written */
+#define VKI_PROT_EXEC   0x4             /* page can be executed */
+#define VKI_PROT_GROWSDOWN 0x01000000   /* mprotect flag: extend
+					   change to start of
+					   growsdown vma */
+#define VKI_PROT_GROWSUP   0x02000000   /* mprotect flag:
+					   extend change to end
+					   of growsup vma */
+
+#define VKI_MAP_SHARED		0x0001  /* Share changes */
+#define VKI_MAP_PRIVATE 	0x0002	/*  */
+#define VKI_MAP_FIXED   	0x0010	/*  */
+#define VKI_MAP_ANONYMOUS	0x0020	/*  */
+
+
+//----------------------------------------------------------------------
+// From linux-2.6.16.60/include/asm-s390/fcntl.h
+//----------------------------------------------------------------------
+
+#define VKI_O_RDONLY        00000000
+#define VKI_O_WRONLY        00000001
+#define VKI_O_RDWR          00000002
+#define VKI_O_ACCMODE       00000003
+#define VKI_O_CREAT         00000100        /* not fcntl */
+#define VKI_O_EXCL          00000200        /* not fcntl */
+#define VKI_O_NOCTTY        00000400        /* not fcntl */
+#define VKI_O_TRUNC         00001000        /* not fcntl */
+#define VKI_O_APPEND        00002000
+#define VKI_O_NONBLOCK      00004000
+
+#define VKI_AT_FDCWD            -100
+
+#define VKI_F_DUPFD	0	/* dup */
+#define VKI_F_GETFD	1	/* get close_on_exec */
+#define VKI_F_SETFD	2	/* set/clear close_on_exec */
+#define VKI_F_GETFL	3	/* get file->f_flags */
+#define VKI_F_SETFL	4	/* set file->f_flags */
+#define VKI_F_GETLK	5
+#define VKI_F_SETLK	6
+#define VKI_F_SETLKW	7
+#define VKI_F_SETOWN	8	/* for sockets. */
+#define VKI_F_GETOWN	9	/* for sockets. */
+#define VKI_F_SETSIG	10	/* for sockets. */
+#define VKI_F_GETSIG	11	/* for sockets. */
+
+#define VKI_FD_CLOEXEC  1  /* actually anything with low bit set goes */
+
+#define VKI_F_LINUX_SPECIFIC_BASE   1024
+
+
+//----------------------------------------------------------------------
+// From linux-2.6.16.60/include/asm-s390x/resource.h
+//----------------------------------------------------------------------
+
+// which just does #include <asm-generic/resource.h>
+
+#define VKI_RLIMIT_DATA             2       /* max data size */
+#define VKI_RLIMIT_STACK            3       /* max stack size */
+#define VKI_RLIMIT_CORE             4       /* max core file size */
+#define VKI_RLIMIT_NOFILE           7       /* max number of open files */
+
+
+//----------------------------------------------------------------------
+// From linux-2.6.16.60/include/asm-s390/socket.h
+//----------------------------------------------------------------------
+
+#define VKI_SOL_SOCKET      1
+
+#define VKI_SO_TYPE         3
+
+
+//----------------------------------------------------------------------
+// From linux-2.6.16.60/include/asm-s390/sockios.h
+//----------------------------------------------------------------------
+
+#define VKI_SIOCSPGRP       0x8902
+#define VKI_SIOCGPGRP       0x8904
+#define VKI_SIOCGSTAMP      0x8906          /* Get stamp (timeval) */
+/* since 2.6.22 */
+#define VKI_SIOCGSTAMPNS    0x8907          /* Get stamp (timespec) */
+
+
+//----------------------------------------------------------------------
+// From linux-2.6.16.60/include/asm-s390/stat.h
+//----------------------------------------------------------------------
+
+#ifndef VGA_s390x
+struct vki_stat {
+        unsigned short st_dev;
+        unsigned short __pad1;
+        unsigned long  st_ino;
+        unsigned short st_mode;
+        unsigned short st_nlink;
+        unsigned short st_uid;
+        unsigned short st_gid;
+        unsigned short st_rdev;
+        unsigned short __pad2;
+        unsigned long  st_size;
+        unsigned long  st_blksize;
+        unsigned long  st_blocks;
+        unsigned long  st_atime;
+        unsigned long  st_atime_nsec;
+        unsigned long  st_mtime;
+        unsigned long  st_mtime_nsec;
+        unsigned long  st_ctime;
+        unsigned long  st_ctime_nsec;
+        unsigned long  __unused4;
+        unsigned long  __unused5;
+};
+
+/* This matches struct stat64 in glibc2.1, hence the absolutely
+ * insane amounts of padding around dev_t's.
+ */
+struct vki_stat64 {
+        unsigned long long	st_dev;
+        unsigned int    __pad1;
+        unsigned long   __st_ino;
+        unsigned int    st_mode;
+        unsigned int    st_nlink;
+        unsigned long   st_uid;
+        unsigned long   st_gid;
+        unsigned long long	st_rdev;
+        unsigned int    __pad3;
+        long long	st_size;
+        unsigned long   st_blksize;
+        unsigned char   __pad4[4];
+        unsigned long   __pad5;     /* future possible st_blocks high bits */
+        unsigned long   st_blocks;  /* Number 512-byte blocks allocated. */
+        unsigned long   st_atime;
+        unsigned long   st_atime_nsec;
+        unsigned long   st_mtime;
+        unsigned long   st_mtime_nsec;
+        unsigned long   st_ctime;
+        unsigned long   st_ctime_nsec;  /* will be high 32 bits of ctime someday */
+        unsigned long long	st_ino;
+};
+
+#else
+
+struct vki_stat {
+        unsigned long  st_dev;
+        unsigned long  st_ino;
+        unsigned long  st_nlink;
+        unsigned int   st_mode;
+        unsigned int   st_uid;
+        unsigned int   st_gid;
+        unsigned int   __pad1;
+        unsigned long  st_rdev;
+        unsigned long  st_size;
+        unsigned long  st_atime;
+	unsigned long  st_atime_nsec;
+        unsigned long  st_mtime;
+	unsigned long  st_mtime_nsec;
+        unsigned long  st_ctime;
+	unsigned long  st_ctime_nsec;
+        unsigned long  st_blksize;
+        long           st_blocks;
+        unsigned long  __unused[3];
+};
+
+#endif /* VGA_s390x */
+
+
+//----------------------------------------------------------------------
+// From linux-2.6.16.60/include/asm-s390/statfs.h
+//----------------------------------------------------------------------
+
+struct vki_statfs {
+        int  f_type;
+        int  f_bsize;
+        long f_blocks;
+        long f_bfree;
+        long f_bavail;
+        long f_files;
+        long f_ffree;
+        __vki_kernel_fsid_t f_fsid;
+        int  f_namelen;
+        int  f_frsize;
+        int  f_spare[5];
+};
+
+
+//----------------------------------------------------------------------
+// From linux-2.6.16.60/include/asm-s390/termios.h
+//----------------------------------------------------------------------
+
+struct vki_winsize {
+	unsigned short ws_row;
+	unsigned short ws_col;
+	unsigned short ws_xpixel;
+	unsigned short ws_ypixel;
+};
+
+#define VKI_NCC 8
+struct vki_termio {
+	unsigned short c_iflag;		/* input mode flags */
+	unsigned short c_oflag;		/* output mode flags */
+	unsigned short c_cflag;		/* control mode flags */
+	unsigned short c_lflag;		/* local mode flags */
+	unsigned char c_line;		/* line discipline */
+	unsigned char c_cc[VKI_NCC];	/* control characters */
+};
+
+
+//----------------------------------------------------------------------
+// From linux-2.6.16.60/include/asm-s390/termbits.h
+//----------------------------------------------------------------------
+
+typedef unsigned char   vki_cc_t;
+typedef unsigned int    vki_tcflag_t;
+
+#define VKI_NCCS 19
+struct vki_termios {
+	vki_tcflag_t c_iflag;		/* input mode flags */
+	vki_tcflag_t c_oflag;		/* output mode flags */
+	vki_tcflag_t c_cflag;		/* control mode flags */
+	vki_tcflag_t c_lflag;		/* local mode flags */
+	vki_cc_t c_line;		/* line discipline */
+	vki_cc_t c_cc[VKI_NCCS];	/* control characters */
+};
+
+
+//----------------------------------------------------------------------
+// From linux-2.6.16.60/include/asm-s390/ioctl.h
+//----------------------------------------------------------------------
+
+#define _VKI_IOC_NRBITS		8
+#define _VKI_IOC_TYPEBITS	8
+#define _VKI_IOC_SIZEBITS	14
+#define _VKI_IOC_DIRBITS	2
+
+#define _VKI_IOC_NRMASK		((1 << _VKI_IOC_NRBITS)-1)
+#define _VKI_IOC_TYPEMASK	((1 << _VKI_IOC_TYPEBITS)-1)
+#define _VKI_IOC_SIZEMASK	((1 << _VKI_IOC_SIZEBITS)-1)
+#define _VKI_IOC_DIRMASK	((1 << _VKI_IOC_DIRBITS)-1)
+
+#define _VKI_IOC_NRSHIFT	0
+#define _VKI_IOC_TYPESHIFT	(_VKI_IOC_NRSHIFT+_VKI_IOC_NRBITS)
+#define _VKI_IOC_SIZESHIFT	(_VKI_IOC_TYPESHIFT+_VKI_IOC_TYPEBITS)
+#define _VKI_IOC_DIRSHIFT	(_VKI_IOC_SIZESHIFT+_VKI_IOC_SIZEBITS)
+
+#define _VKI_IOC_NONE	0U
+#define _VKI_IOC_WRITE	1U
+#define _VKI_IOC_READ	2U
+
+#define _VKI_IOC(dir,type,nr,size) \
+	(((dir)  << _VKI_IOC_DIRSHIFT) | \
+	 ((type) << _VKI_IOC_TYPESHIFT) | \
+	 ((nr)   << _VKI_IOC_NRSHIFT) | \
+	 ((size) << _VKI_IOC_SIZESHIFT))
+
+/* used to create numbers */
+#define _VKI_IO(type,nr)	_VKI_IOC(_VKI_IOC_NONE,(type),(nr),0)
+#define _VKI_IOR(type,nr,size)	_VKI_IOC(_VKI_IOC_READ,(type),(nr),(_VKI_IOC_TYPECHECK(size)))
+#define _VKI_IOW(type,nr,size)	_VKI_IOC(_VKI_IOC_WRITE,(type),(nr),(_VKI_IOC_TYPECHECK(size)))
+#define _VKI_IOWR(type,nr,size)	_VKI_IOC(_VKI_IOC_READ|_VKI_IOC_WRITE,(type),(nr),(_VKI_IOC_TYPECHECK(size)))
+
+/* used to decode ioctl numbers.. */
+#define _VKI_IOC_DIR(nr)	(((nr) >> _VKI_IOC_DIRSHIFT) & _VKI_IOC_DIRMASK)
+#define _VKI_IOC_TYPE(nr)	(((nr) >> _VKI_IOC_TYPESHIFT) & _VKI_IOC_TYPEMASK)
+#define _VKI_IOC_NR(nr)		(((nr) >> _VKI_IOC_NRSHIFT) & _VKI_IOC_NRMASK)
+#define _VKI_IOC_SIZE(nr)	(((nr) >> _VKI_IOC_SIZESHIFT) & _VKI_IOC_SIZEMASK)
+
+//----------------------------------------------------------------------
+// From linux-2.6.16.60/include/asm-s390/ioctls.h
+//----------------------------------------------------------------------
+
+/* 0x54 is just a magic number to make these relatively unique ('T') */
+
+#define VKI_TCGETS	0x5401
+#define VKI_TCSETS	0x5402
+#define VKI_TCSETSW	0x5403
+#define VKI_TCSETSF	0x5404
+#define VKI_TCGETA	0x5405
+#define VKI_TCSETA	0x5406
+#define VKI_TCSETAW	0x5407
+#define VKI_TCSETAF	0x5408
+#define VKI_TCSBRK	0x5409
+#define VKI_TCXONC	0x540A
+#define VKI_TCFLSH	0x540B
+
+#define VKI_TIOCSCTTY	0x540E
+#define VKI_TIOCGPGRP	0x540F
+#define VKI_TIOCSPGRP	0x5410
+#define VKI_TIOCOUTQ	0x5411
+
+#define VKI_TIOCGWINSZ	0x5413
+#define VKI_TIOCSWINSZ	0x5414
+#define VKI_TIOCMGET	0x5415
+#define VKI_TIOCMBIS	0x5416
+#define VKI_TIOCMBIC	0x5417
+#define VKI_TIOCMSET	0x5418
+
+#define VKI_FIONREAD	0x541B
+#define VKI_TIOCLINUX	0x541C
+
+#define VKI_FIONBIO	0x5421
+
+#define VKI_TCSBRKP	0x5425	/* Needed for POSIX tcsendbreak() */
+
+#define VKI_TIOCGPTN	_VKI_IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
+#define VKI_TIOCSPTLCK	_VKI_IOW('T',0x31, int)  /* Lock/unlock Pty */
+
+#define VKI_FIOASYNC	        0x5452
+
+#define VKI_TIOCSERGETLSR       0x5459 /* Get line status register */
+
+#define VKI_TIOCGICOUNT	0x545D	/* read serial port inline interrupt counts */
+
+//----------------------------------------------------------------------
+// From linux-2.6.39-rc2/arch/s390/include/asm/ioctls.h
+//----------------------------------------------------------------------
+
+#define VKI_FIOQSIZE 0x545E
+
+//----------------------------------------------------------------------
+// From linux-2.6.16.60/include/asm-s390/poll.h
+//----------------------------------------------------------------------
+
+struct vki_pollfd {
+	int fd;
+	short events;
+	short revents;
+};
+
+#define VKI_POLLIN          0x0001
+
+//----------------------------------------------------------------------
+// From linux-2.6.16.60/include/asm-s390/ptrace.h
+//----------------------------------------------------------------------
+#define VKI_NUM_GPRS	16
+#define VKI_NUM_FPRS	16
+#define VKI_NUM_CRS	16
+#define VKI_NUM_ACRS	16
+
+typedef union
+{
+	float   f;
+	double  d;
+        __vki_u64   ui;
+	struct
+	{
+		__vki_u32 hi;
+		__vki_u32 lo;
+	} fp;
+} vki_freg_t;
+
+typedef struct
+{
+	__vki_u32   fpc;
+	vki_freg_t  fprs[VKI_NUM_FPRS];
+} vki_s390_fp_regs;
+
+typedef struct
+{
+        unsigned long mask;
+        unsigned long addr;
+} __attribute__ ((aligned(8))) vki_psw_t;
+
+typedef struct
+{
+	vki_psw_t psw;
+	unsigned long gprs[VKI_NUM_GPRS];
+	unsigned int  acrs[VKI_NUM_ACRS];
+	unsigned long orig_gpr2;
+} vki_s390_regs;
+
+/*
+ * Now for the program event recording (trace) definitions.
+ */
+typedef struct
+{
+	unsigned long cr[3];
+} vki_per_cr_words;
+
+typedef	struct
+{
+#ifdef VGA_s390x
+	unsigned                       : 32;
+#endif /* VGA_s390x */
+	unsigned em_branching          : 1;
+	unsigned em_instruction_fetch  : 1;
+	/*
+	 * Switching on storage alteration automatically fixes
+	 * the storage alteration event bit in the users std.
+	 */
+	unsigned em_storage_alteration : 1;
+	unsigned em_gpr_alt_unused     : 1;
+	unsigned em_store_real_address : 1;
+	unsigned                       : 3;
+	unsigned branch_addr_ctl       : 1;
+	unsigned                       : 1;
+	unsigned storage_alt_space_ctl : 1;
+	unsigned                       : 21;
+	unsigned long starting_addr;
+	unsigned long ending_addr;
+} vki_per_cr_bits;
+
+typedef struct
+{
+	unsigned short perc_atmid;
+	unsigned long address;
+	unsigned char access_id;
+} vki_per_lowcore_words;
+
+typedef struct
+{
+	unsigned perc_branching          : 1;
+	unsigned perc_instruction_fetch  : 1;
+	unsigned perc_storage_alteration : 1;
+	unsigned perc_gpr_alt_unused     : 1;
+	unsigned perc_store_real_address : 1;
+	unsigned                         : 3;
+	unsigned atmid_psw_bit_31        : 1;
+	unsigned atmid_validity_bit      : 1;
+	unsigned atmid_psw_bit_32        : 1;
+	unsigned atmid_psw_bit_5         : 1;
+	unsigned atmid_psw_bit_16        : 1;
+	unsigned atmid_psw_bit_17        : 1;
+	unsigned si                      : 2;
+	unsigned long address;
+	unsigned                         : 4;
+	unsigned access_id               : 4;
+} vki_per_lowcore_bits;
+
+typedef struct
+{
+	union {
+		vki_per_cr_words   words;
+		vki_per_cr_bits    bits;
+	} control_regs;
+	/*
+	 * Use these flags instead of setting em_instruction_fetch
+	 * directly they are used so that single stepping can be
+	 * switched on & off while not affecting other tracing
+	 */
+	unsigned  single_step       : 1;
+	unsigned  instruction_fetch : 1;
+	unsigned                    : 30;
+	/*
+	 * These addresses are copied into cr10 & cr11 if single
+	 * stepping is switched off
+	 */
+	unsigned long starting_addr;
+	unsigned long ending_addr;
+	union {
+		vki_per_lowcore_words words;
+		vki_per_lowcore_bits  bits;
+	} lowcore;
+} vki_per_struct;
+
+/*
+ * The user_regs_struct defines the way the user registers are
+ * store on the stack for signal handling.
+ */
+struct vki_user_regs_struct
+{
+	vki_psw_t psw;
+	unsigned long gprs[VKI_NUM_GPRS];
+	unsigned int  acrs[VKI_NUM_ACRS];
+	unsigned long orig_gpr2;
+	vki_s390_fp_regs fp_regs;
+	/*
+	 * These per registers are in here so that gdb can modify them
+	 * itself as there is no "official" ptrace interface for hardware
+	 * watchpoints. This is the way intel does it.
+	 */
+	vki_per_struct per_info;
+	unsigned long ieee_instruction_pointer;
+	/* Used to give failing instruction back to user for ieee exceptions */
+};
+
+typedef struct
+{
+	unsigned int  vki_len;
+	unsigned long vki_kernel_addr;
+	unsigned long vki_process_addr;
+} vki_ptrace_area;
+
+/*
+ * S/390 specific non posix ptrace requests
+ */
+#define VKI_PTRACE_PEEKUSR_AREA       0x5000
+#define VKI_PTRACE_POKEUSR_AREA       0x5001
+
+//----------------------------------------------------------------------
+// From linux-2.6.16.60/include/asm-s390/elf.h
+//----------------------------------------------------------------------
+
+typedef vki_s390_fp_regs vki_elf_fpregset_t;
+typedef vki_s390_regs vki_elf_gregset_t;
+
+
+//----------------------------------------------------------------------
+// From linux-2.6.16.60/include/asm-s390/ucontext.h
+//----------------------------------------------------------------------
+
+struct vki_ucontext {
+	unsigned long	      uc_flags;
+	struct vki_ucontext  *uc_link;
+	vki_stack_t	      uc_stack;
+	_vki_sigregs          uc_mcontext;
+	vki_sigset_t	      uc_sigmask; /* mask last for extensibility */
+};
+
+//----------------------------------------------------------------------
+// From linux-2.6.16.60/include/asm-s390/ipcbuf.h
+//----------------------------------------------------------------------
+
+struct vki_ipc64_perm
+{
+	__vki_kernel_key_t	key;
+	__vki_kernel_uid32_t	uid;
+	__vki_kernel_gid32_t	gid;
+	__vki_kernel_uid32_t	cuid;
+	__vki_kernel_gid32_t	cgid;
+	__vki_kernel_mode_t	mode;
+	unsigned short		__pad1;
+	unsigned short		seq;
+#ifndef VGA_s390x
+	unsigned short		__pad2;
+#endif /* ! VGA_s390x */
+	unsigned long		__unused1;
+	unsigned long		__unused2;
+};
+
+
+//----------------------------------------------------------------------
+// From linux-2.6.16.60/include/asm-s390/sembuf.h
+//----------------------------------------------------------------------
+
+struct vki_semid64_ds {
+	struct vki_ipc64_perm sem_perm;		/* permissions .. see ipc.h */
+	__vki_kernel_time_t   sem_otime;	/* last semop time */
+#ifndef VGA_s390x
+	unsigned long	__unused1;
+#endif /* ! VGA_s390x */
+	__vki_kernel_time_t   sem_ctime;	/* last change time */
+#ifndef VGA_s390x
+	unsigned long	__unused2;
+#endif /* ! VGA_s390x */
+	unsigned long	sem_nsems;		/* no. of semaphores in array */
+	unsigned long	__unused3;
+	unsigned long	__unused4;
+};
+
+
+//----------------------------------------------------------------------
+// From linux-2.6.16.60/include/asm-s390/msgbuf.h
+//----------------------------------------------------------------------
+
+struct vki_msqid64_ds {
+	struct vki_ipc64_perm msg_perm;
+	__vki_kernel_time_t msg_stime;	/* last msgsnd time */
+#ifndef VGA_s390x
+	unsigned long	__unused1;
+#endif /* ! VGA_s390x */
+	__vki_kernel_time_t msg_rtime;	/* last msgrcv time */
+#ifndef VGA_s390x
+	unsigned long	__unused2;
+#endif /* ! VGA_s390x */
+	__vki_kernel_time_t msg_ctime;	/* last change time */
+#ifndef VGA_s390x
+	unsigned long	__unused3;
+#endif /* ! VGA_s390x */
+	unsigned long  msg_cbytes;	/* current number of bytes on queue */
+	unsigned long  msg_qnum;	/* number of messages in queue */
+	unsigned long  msg_qbytes;	/* max number of bytes on queue */
+	__vki_kernel_pid_t msg_lspid;	/* pid of last msgsnd */
+	__vki_kernel_pid_t msg_lrpid;	/* last receive pid */
+	unsigned long  __unused4;
+	unsigned long  __unused5;
+};
+
+
+//----------------------------------------------------------------------
+// From linux-2.6.16.60/include/asm-s390/ipc.h
+//----------------------------------------------------------------------
+
+struct vki_ipc_kludge {
+	struct vki_msgbuf __user *msgp;
+	long msgtyp;
+};
+
+#define VKI_SEMOP	 1
+#define VKI_SEMGET	 2
+#define VKI_SEMCTL	 3
+#define VKI_SEMTIMEDOP	 4
+#define VKI_MSGSND	11
+#define VKI_MSGRCV	12
+#define VKI_MSGGET	13
+#define VKI_MSGCTL	14
+#define VKI_SHMAT	21
+#define VKI_SHMDT	22
+#define VKI_SHMGET	23
+#define VKI_SHMCTL	24
+
+
+//----------------------------------------------------------------------
+// From linux-2.6.16.60/include/asm-s390/shmbuf.h
+//----------------------------------------------------------------------
+
+struct vki_shmid64_ds {
+	struct vki_ipc64_perm	shm_perm;	/* operation perms */
+	vki_size_t		shm_segsz;	/* size of segment (bytes) */
+	__vki_kernel_time_t	shm_atime;	/* last attach time */
+#ifndef VGA_s390x
+	unsigned long		__unused1;
+#endif /* ! VGA_s390x */
+	__vki_kernel_time_t	shm_dtime;	/* last detach time */
+#ifndef VGA_s390x
+	unsigned long		__unused2;
+#endif /* ! VGA_s390x */
+	__vki_kernel_time_t	shm_ctime;	/* last change time */
+#ifndef VGA_s390x
+	unsigned long		__unused3;
+#endif /* ! VGA_s390x */
+	__vki_kernel_pid_t	shm_cpid;	/* pid of creator */
+	__vki_kernel_pid_t	shm_lpid;	/* pid of last operator */
+	unsigned long		shm_nattch;	/* no. of current attaches */
+	unsigned long		__unused4;
+	unsigned long		__unused5;
+};
+
+struct vki_shminfo64 {
+	unsigned long	shmmax;
+	unsigned long	shmmin;
+	unsigned long	shmmni;
+	unsigned long	shmseg;
+	unsigned long	shmall;
+	unsigned long	__unused1;
+	unsigned long	__unused2;
+	unsigned long	__unused3;
+	unsigned long	__unused4;
+};
+
+
+//----------------------------------------------------------------------
+// The following are defined in the VKI namespace but are nowhere found
+// in the linux headers.
+//----------------------------------------------------------------------
+#define VKI_BIG_ENDIAN      1
+#define VKI_MAX_PAGE_SHIFT  VKI_PAGE_SHIFT
+#define VKI_MAX_PAGE_SIZE   VKI_PAGE_SIZE
+
+//----------------------------------------------------------------------
+// From linux-2.6.35.4/arch/s390x/include/asm/shmparam.h
+//----------------------------------------------------------------------
+
+#define VKI_SHMLBA  VKI_PAGE_SIZE
+
+/* If a system call returns a value >= VKI_MAX_ERRNO then that is considered
+   an error condition. I.e. the system call failed. */
+#define VKI_MAX_ERRNO       -125
+
+#endif // __VKI_S390X_LINUX_H
+
+/*--------------------------------------------------------------------*/
+/*--- end                                                          ---*/
+/*--------------------------------------------------------------------*/
diff --git a/main/include/vki/vki-scnums-aix5.h b/main/include/vki/vki-scnums-aix5.h
deleted file mode 100644
index 3ca8ebf..0000000
--- a/main/include/vki/vki-scnums-aix5.h
+++ /dev/null
@@ -1,1616 +0,0 @@
-
-/*--------------------------------------------------------------------*/
-/*--- System call numbers for ppc32-aix5 and ppc64-aix5.           ---*/
-/*---                                            vki-scnums-aix5.h ---*/
-/*--------------------------------------------------------------------*/
-
-/*
-   This file is part of Valgrind, a dynamic binary instrumentation
-   framework.
-
-   Copyright (C) 2006-2010 OpenWorks LLP
-      info@open-works.co.uk
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful, but
-   WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307, USA.
-
-   The GNU General Public License is contained in the file COPYING.
-
-   Neither the names of the U.S. Department of Energy nor the
-   University of California nor the names of its contributors may be
-   used to endorse or promote products derived from this software
-   without prior written permission.
-*/
-
-#ifndef __VKI_SCNUMS_AIX5_H
-#define __VKI_SCNUMS_AIX5_H
-
-#if !defined(VGP_ppc32_aix5) && !defined(VGP_ppc64_aix5)
-#  error This file should be included in AIX5 builds only.
-#endif
-
-// WARNING: note that this file, unlike other vki-scnums-PLATFORM.h files,
-// isn't suitable for inclusion in asm files.
-
-//--------------------------------------------------------------
-// Syscalls for AIX 5.2 running on ppc32
-//--------------------------------------------------------------
-
-/* This is the initial value for a syscall number, when we don't
-   know what it is. */
-#define __NR_AIX5_UNKNOWN (-1)
-
-/* Vanilla AIX 5.2 ones */
-
-extern Int VG_(aix5_NR_utrchook_sc);
-#define __NR_AIX5_utrchook_sc VG_(aix5_NR_utrchook_sc)
-
-extern Int VG_(aix5_NR_thread_create);
-#define __NR_AIX5_thread_create VG_(aix5_NR_thread_create)
-
-extern Int VG_(aix5_NR_kfork);
-#define __NR_AIX5_kfork VG_(aix5_NR_kfork)
-
-extern Int VG_(aix5_NR_kra_fork);
-#define __NR_AIX5_kra_fork VG_(aix5_NR_kra_fork)
-
-extern Int VG_(aix5_NR_execve);
-#define __NR_AIX5_execve VG_(aix5_NR_execve)
-
-extern Int VG_(aix5_NR_ra_execve);
-#define __NR_AIX5_ra_execve VG_(aix5_NR_ra_execve)
-
-extern Int VG_(aix5_NR__load);
-#define __NR_AIX5__load VG_(aix5_NR__load)
-
-extern Int VG_(aix5_NR___unload);
-#define __NR_AIX5___unload VG_(aix5_NR___unload)
-
-extern Int VG_(aix5_NR_loadbind);
-#define __NR_AIX5_loadbind VG_(aix5_NR_loadbind)
-
-extern Int VG_(aix5_NR___loadx);
-#define __NR_AIX5___loadx VG_(aix5_NR___loadx)
-
-extern Int VG_(aix5_NR_bindprocessor);
-#define __NR_AIX5_bindprocessor VG_(aix5_NR_bindprocessor)
-
-extern Int VG_(aix5_NR_trcgent);
-#define __NR_AIX5_trcgent VG_(aix5_NR_trcgent)
-
-extern Int VG_(aix5_NR_trcgen);
-#define __NR_AIX5_trcgen VG_(aix5_NR_trcgen)
-
-extern Int VG_(aix5_NR_trchk);
-#define __NR_AIX5_trchk VG_(aix5_NR_trchk)
-
-extern Int VG_(aix5_NR_trchkt);
-#define __NR_AIX5_trchkt VG_(aix5_NR_trchkt)
-
-extern Int VG_(aix5_NR_trchkl);
-#define __NR_AIX5_trchkl VG_(aix5_NR_trchkl)
-
-extern Int VG_(aix5_NR_trchklt);
-#define __NR_AIX5_trchklt VG_(aix5_NR_trchklt)
-
-extern Int VG_(aix5_NR_trchkg);
-#define __NR_AIX5_trchkg VG_(aix5_NR_trchkg)
-
-extern Int VG_(aix5_NR_trchkgt);
-#define __NR_AIX5_trchkgt VG_(aix5_NR_trchkgt)
-
-extern Int VG_(aix5_NR_kill);
-#define __NR_AIX5_kill VG_(aix5_NR_kill)
-
-extern Int VG_(aix5_NR__addcpucosts);
-#define __NR_AIX5__addcpucosts VG_(aix5_NR__addcpucosts)
-
-extern Int VG_(aix5_NR_mycpu);
-#define __NR_AIX5_mycpu VG_(aix5_NR_mycpu)
-
-extern Int VG_(aix5_NR_adjtime);
-#define __NR_AIX5_adjtime VG_(aix5_NR_adjtime)
-
-extern Int VG_(aix5_NR_checkpnt_block);
-#define __NR_AIX5_checkpnt_block VG_(aix5_NR_checkpnt_block)
-
-extern Int VG_(aix5_NR__checkpnt_kill);
-#define __NR_AIX5__checkpnt_kill VG_(aix5_NR__checkpnt_kill)
-
-extern Int VG_(aix5_NR__checkpnt_fail);
-#define __NR_AIX5__checkpnt_fail VG_(aix5_NR__checkpnt_fail)
-
-extern Int VG_(aix5_NR__checkpnt_commit);
-#define __NR_AIX5__checkpnt_commit VG_(aix5_NR__checkpnt_commit)
-
-extern Int VG_(aix5_NR__checkpnt_register);
-#define __NR_AIX5__checkpnt_register VG_(aix5_NR__checkpnt_register)
-
-extern Int VG_(aix5_NR__checkpnt);
-#define __NR_AIX5__checkpnt VG_(aix5_NR__checkpnt)
-
-extern Int VG_(aix5_NR_setcrid);
-#define __NR_AIX5_setcrid VG_(aix5_NR_setcrid)
-
-extern Int VG_(aix5_NR_getcrid);
-#define __NR_AIX5_getcrid VG_(aix5_NR_getcrid)
-
-extern Int VG_(aix5_NR_mkcrid);
-#define __NR_AIX5_mkcrid VG_(aix5_NR_mkcrid)
-
-extern Int VG_(aix5_NR_checkpnt_wait);
-#define __NR_AIX5_checkpnt_wait VG_(aix5_NR_checkpnt_wait)
-
-extern Int VG_(aix5_NR_checkpnt_deliver);
-#define __NR_AIX5_checkpnt_deliver VG_(aix5_NR_checkpnt_deliver)
-
-extern Int VG_(aix5_NR_gencore);
-#define __NR_AIX5_gencore VG_(aix5_NR_gencore)
-
-extern Int VG_(aix5_NR_thread_terminate);
-#define __NR_AIX5_thread_terminate VG_(aix5_NR_thread_terminate)
-
-extern Int VG_(aix5_NR__exit);
-#define __NR_AIX5__exit VG_(aix5_NR__exit)
-
-extern Int VG_(aix5_NR_kwaitpid64);
-#define __NR_AIX5_kwaitpid64 VG_(aix5_NR_kwaitpid64)
-
-extern Int VG_(aix5_NR_kwaitpid);
-#define __NR_AIX5_kwaitpid VG_(aix5_NR_kwaitpid)
-
-extern Int VG_(aix5_NR_yield);
-#define __NR_AIX5_yield VG_(aix5_NR_yield)
-
-extern Int VG_(aix5_NR_getprocs64);
-#define __NR_AIX5_getprocs64 VG_(aix5_NR_getprocs64)
-
-extern Int VG_(aix5_NR_getevars);
-#define __NR_AIX5_getevars VG_(aix5_NR_getevars)
-
-extern Int VG_(aix5_NR_getargs);
-#define __NR_AIX5_getargs VG_(aix5_NR_getargs)
-
-extern Int VG_(aix5_NR_getthrds64);
-#define __NR_AIX5_getthrds64 VG_(aix5_NR_getthrds64)
-
-extern Int VG_(aix5_NR_getthrds);
-#define __NR_AIX5_getthrds VG_(aix5_NR_getthrds)
-
-extern Int VG_(aix5_NR_getprocs);
-#define __NR_AIX5_getprocs VG_(aix5_NR_getprocs)
-
-extern Int VG_(aix5_NR_sigcleanup);
-#define __NR_AIX5_sigcleanup VG_(aix5_NR_sigcleanup)
-
-extern Int VG_(aix5_NR__setpri);
-#define __NR_AIX5__setpri VG_(aix5_NR__setpri)
-
-extern Int VG_(aix5_NR__getpri);
-#define __NR_AIX5__getpri VG_(aix5_NR__getpri)
-
-extern Int VG_(aix5_NR_profil);
-#define __NR_AIX5_profil VG_(aix5_NR_profil)
-
-extern Int VG_(aix5_NR_reboot);
-#define __NR_AIX5_reboot VG_(aix5_NR_reboot)
-
-extern Int VG_(aix5_NR_appgetrlimit);
-#define __NR_AIX5_appgetrlimit VG_(aix5_NR_appgetrlimit)
-
-extern Int VG_(aix5_NR_appsetrlimit);
-#define __NR_AIX5_appsetrlimit VG_(aix5_NR_appsetrlimit)
-
-extern Int VG_(aix5_NR__setpriority);
-#define __NR_AIX5__setpriority VG_(aix5_NR__setpriority)
-
-extern Int VG_(aix5_NR__getpriority);
-#define __NR_AIX5__getpriority VG_(aix5_NR__getpriority)
-
-extern Int VG_(aix5_NR_setrlimit64);
-#define __NR_AIX5_setrlimit64 VG_(aix5_NR_setrlimit64)
-
-extern Int VG_(aix5_NR_getrlimit64);
-#define __NR_AIX5_getrlimit64 VG_(aix5_NR_getrlimit64)
-
-extern Int VG_(aix5_NR_appgetrusage);
-#define __NR_AIX5_appgetrusage VG_(aix5_NR_appgetrusage)
-
-extern Int VG_(aix5_NR_getrusage64);
-#define __NR_AIX5_getrusage64 VG_(aix5_NR_getrusage64)
-
-extern Int VG_(aix5_NR_getvtid);
-#define __NR_AIX5_getvtid VG_(aix5_NR_getvtid)
-
-extern Int VG_(aix5_NR_getrtid);
-#define __NR_AIX5_getrtid VG_(aix5_NR_getrtid)
-
-extern Int VG_(aix5_NR_getrpid);
-#define __NR_AIX5_getrpid VG_(aix5_NR_getrpid)
-
-extern Int VG_(aix5_NR_restart_wait);
-#define __NR_AIX5_restart_wait VG_(aix5_NR_restart_wait)
-
-extern Int VG_(aix5_NR_restart);
-#define __NR_AIX5_restart VG_(aix5_NR_restart)
-
-extern Int VG_(aix5_NR__rmcpucosts);
-#define __NR_AIX5__rmcpucosts VG_(aix5_NR__rmcpucosts)
-
-extern Int VG_(aix5_NR__clock_getcpuclockid);
-#define __NR_AIX5__clock_getcpuclockid VG_(aix5_NR__clock_getcpuclockid)
-
-extern Int VG_(aix5_NR__clock_settime);
-#define __NR_AIX5__clock_settime VG_(aix5_NR__clock_settime)
-
-extern Int VG_(aix5_NR__clock_gettime);
-#define __NR_AIX5__clock_gettime VG_(aix5_NR__clock_gettime)
-
-extern Int VG_(aix5_NR__clock_getres);
-#define __NR_AIX5__clock_getres VG_(aix5_NR__clock_getres)
-
-extern Int VG_(aix5_NR__timer_settime);
-#define __NR_AIX5__timer_settime VG_(aix5_NR__timer_settime)
-
-extern Int VG_(aix5_NR__timer_gettime);
-#define __NR_AIX5__timer_gettime VG_(aix5_NR__timer_gettime)
-
-extern Int VG_(aix5_NR__timer_getoverrun);
-#define __NR_AIX5__timer_getoverrun VG_(aix5_NR__timer_getoverrun)
-
-extern Int VG_(aix5_NR__timer_delete);
-#define __NR_AIX5__timer_delete VG_(aix5_NR__timer_delete)
-
-extern Int VG_(aix5_NR__timer_create);
-#define __NR_AIX5__timer_create VG_(aix5_NR__timer_create)
-
-extern Int VG_(aix5_NR__sigqueue);
-#define __NR_AIX5__sigqueue VG_(aix5_NR__sigqueue)
-
-extern Int VG_(aix5_NR__sigsuspend);
-#define __NR_AIX5__sigsuspend VG_(aix5_NR__sigsuspend)
-
-extern Int VG_(aix5_NR__sigaction);
-#define __NR_AIX5__sigaction VG_(aix5_NR__sigaction)
-
-extern Int VG_(aix5_NR_sigprocmask);
-#define __NR_AIX5_sigprocmask VG_(aix5_NR_sigprocmask)
-
-extern Int VG_(aix5_NR_siglocalmask);
-#define __NR_AIX5_siglocalmask VG_(aix5_NR_siglocalmask)
-
-extern Int VG_(aix5_NR_count_event_waiters);
-#define __NR_AIX5_count_event_waiters VG_(aix5_NR_count_event_waiters)
-
-extern Int VG_(aix5_NR_thread_waitact);
-#define __NR_AIX5_thread_waitact VG_(aix5_NR_thread_waitact)
-
-extern Int VG_(aix5_NR_thread_waitlock_local);
-#define __NR_AIX5_thread_waitlock_local VG_(aix5_NR_thread_waitlock_local)
-
-extern Int VG_(aix5_NR_thread_waitlock);
-#define __NR_AIX5_thread_waitlock VG_(aix5_NR_thread_waitlock)
-
-extern Int VG_(aix5_NR_thread_wait);
-#define __NR_AIX5_thread_wait VG_(aix5_NR_thread_wait)
-
-extern Int VG_(aix5_NR_thread_unlock);
-#define __NR_AIX5_thread_unlock VG_(aix5_NR_thread_unlock)
-
-extern Int VG_(aix5_NR_thread_twakeup_unlock);
-#define __NR_AIX5_thread_twakeup_unlock VG_(aix5_NR_thread_twakeup_unlock)
-
-extern Int VG_(aix5_NR_thread_twakeup_event);
-#define __NR_AIX5_thread_twakeup_event VG_(aix5_NR_thread_twakeup_event)
-
-extern Int VG_(aix5_NR_thread_twakeup);
-#define __NR_AIX5_thread_twakeup VG_(aix5_NR_thread_twakeup)
-
-extern Int VG_(aix5_NR_thread_tsleep_event);
-#define __NR_AIX5_thread_tsleep_event VG_(aix5_NR_thread_tsleep_event)
-
-extern Int VG_(aix5_NR_thread_tsleep_chkpnt);
-#define __NR_AIX5_thread_tsleep_chkpnt VG_(aix5_NR_thread_tsleep_chkpnt)
-
-extern Int VG_(aix5_NR_thread_tsleep);
-#define __NR_AIX5_thread_tsleep VG_(aix5_NR_thread_tsleep)
-
-extern Int VG_(aix5_NR_thread_post_many);
-#define __NR_AIX5_thread_post_many VG_(aix5_NR_thread_post_many)
-
-extern Int VG_(aix5_NR_thread_post);
-#define __NR_AIX5_thread_post VG_(aix5_NR_thread_post)
-
-extern Int VG_(aix5_NR_ue_proc_unregister);
-#define __NR_AIX5_ue_proc_unregister VG_(aix5_NR_ue_proc_unregister)
-
-extern Int VG_(aix5_NR_ue_proc_register);
-#define __NR_AIX5_ue_proc_register VG_(aix5_NR_ue_proc_register)
-
-extern Int VG_(aix5_NR_kthread_ctl);
-#define __NR_AIX5_kthread_ctl VG_(aix5_NR_kthread_ctl)
-
-extern Int VG_(aix5_NR__thread_setsched);
-#define __NR_AIX5__thread_setsched VG_(aix5_NR__thread_setsched)
-
-extern Int VG_(aix5_NR_threads_runnable);
-#define __NR_AIX5_threads_runnable VG_(aix5_NR_threads_runnable)
-
-extern Int VG_(aix5_NR_thread_getregs);
-#define __NR_AIX5_thread_getregs VG_(aix5_NR_thread_getregs)
-
-extern Int VG_(aix5_NR_thread_terminate_unlock);
-#define __NR_AIX5_thread_terminate_unlock VG_(aix5_NR_thread_terminate_unlock)
-
-extern Int VG_(aix5_NR_thread_terminate_ack);
-#define __NR_AIX5_thread_terminate_ack VG_(aix5_NR_thread_terminate_ack)
-
-extern Int VG_(aix5_NR_thread_setstate_fast);
-#define __NR_AIX5_thread_setstate_fast VG_(aix5_NR_thread_setstate_fast)
-
-extern Int VG_(aix5_NR_thread_setstate);
-#define __NR_AIX5_thread_setstate VG_(aix5_NR_thread_setstate)
-
-extern Int VG_(aix5_NR_thread_setmymask_fast);
-#define __NR_AIX5_thread_setmymask_fast VG_(aix5_NR_thread_setmymask_fast)
-
-extern Int VG_(aix5_NR_thread_setmystate_fast);
-#define __NR_AIX5_thread_setmystate_fast VG_(aix5_NR_thread_setmystate_fast)
-
-extern Int VG_(aix5_NR_thread_setmystate);
-#define __NR_AIX5_thread_setmystate VG_(aix5_NR_thread_setmystate)
-
-extern Int VG_(aix5_NR_thread_init);
-#define __NR_AIX5_thread_init VG_(aix5_NR_thread_init)
-
-extern Int VG_(aix5_NR_times);
-#define __NR_AIX5_times VG_(aix5_NR_times)
-
-extern Int VG_(aix5_NR__nsleep);
-#define __NR_AIX5__nsleep VG_(aix5_NR__nsleep)
-
-extern Int VG_(aix5_NR_reltimerid);
-#define __NR_AIX5_reltimerid VG_(aix5_NR_reltimerid)
-
-extern Int VG_(aix5_NR_appresinc);
-#define __NR_AIX5_appresinc VG_(aix5_NR_appresinc)
-
-extern Int VG_(aix5_NR_apprestimer);
-#define __NR_AIX5_apprestimer VG_(aix5_NR_apprestimer)
-
-extern Int VG_(aix5_NR_appresabs);
-#define __NR_AIX5_appresabs VG_(aix5_NR_appresabs)
-
-extern Int VG_(aix5_NR_appsettimer);
-#define __NR_AIX5_appsettimer VG_(aix5_NR_appsettimer)
-
-extern Int VG_(aix5_NR_appgettimer);
-#define __NR_AIX5_appgettimer VG_(aix5_NR_appgettimer)
-
-extern Int VG_(aix5_NR_gettimerid);
-#define __NR_AIX5_gettimerid VG_(aix5_NR_gettimerid)
-
-extern Int VG_(aix5_NR_incinterval);
-#define __NR_AIX5_incinterval VG_(aix5_NR_incinterval)
-
-extern Int VG_(aix5_NR_absinterval);
-#define __NR_AIX5_absinterval VG_(aix5_NR_absinterval)
-
-extern Int VG_(aix5_NR_getinterval);
-#define __NR_AIX5_getinterval VG_(aix5_NR_getinterval)
-
-extern Int VG_(aix5_NR_upfget);
-#define __NR_AIX5_upfget VG_(aix5_NR_upfget)
-
-extern Int VG_(aix5_NR__wlm_wait);
-#define __NR_AIX5__wlm_wait VG_(aix5_NR__wlm_wait)
-
-extern Int VG_(aix5_NR__wlm_post);
-#define __NR_AIX5__wlm_post VG_(aix5_NR__wlm_post)
-
-extern Int VG_(aix5_NR__wlm_event_init);
-#define __NR_AIX5__wlm_event_init VG_(aix5_NR__wlm_event_init)
-
-extern Int VG_(aix5_NR__wlm_set_tag);
-#define __NR_AIX5__wlm_set_tag VG_(aix5_NR__wlm_set_tag)
-
-extern Int VG_(aix5_NR__wlm_set);
-#define __NR_AIX5__wlm_set VG_(aix5_NR__wlm_set)
-
-extern Int VG_(aix5_NR_ptrace64);
-#define __NR_AIX5_ptrace64 VG_(aix5_NR_ptrace64)
-
-extern Int VG_(aix5_NR_ptracex);
-#define __NR_AIX5_ptracex VG_(aix5_NR_ptracex)
-
-extern Int VG_(aix5_NR_ptrace);
-#define __NR_AIX5_ptrace VG_(aix5_NR_ptrace)
-
-extern Int VG_(aix5_NR_ksetcontext_sigreturn);
-#define __NR_AIX5_ksetcontext_sigreturn VG_(aix5_NR_ksetcontext_sigreturn)
-
-extern Int VG_(aix5_NR_ksetcontext);
-#define __NR_AIX5_ksetcontext VG_(aix5_NR_ksetcontext)
-
-extern Int VG_(aix5_NR_kgetcontext);
-#define __NR_AIX5_kgetcontext VG_(aix5_NR_kgetcontext)
-
-extern Int VG_(aix5_NR_sigreturn);
-#define __NR_AIX5_sigreturn VG_(aix5_NR_sigreturn)
-
-extern Int VG_(aix5_NR__wlm_get_bio_stats);
-#define __NR_AIX5__wlm_get_bio_stats VG_(aix5_NR__wlm_get_bio_stats)
-
-extern Int VG_(aix5_NR_splice);
-#define __NR_AIX5_splice VG_(aix5_NR_splice)
-
-extern Int VG_(aix5_NR_rmsock);
-#define __NR_AIX5_rmsock VG_(aix5_NR_rmsock)
-
-extern Int VG_(aix5_NR_nrecvmsg);
-#define __NR_AIX5_nrecvmsg VG_(aix5_NR_nrecvmsg)
-
-extern Int VG_(aix5_NR_socket_aio_dequeue);
-#define __NR_AIX5_socket_aio_dequeue VG_(aix5_NR_socket_aio_dequeue)
-
-extern Int VG_(aix5_NR_getkerninfo);
-#define __NR_AIX5_getkerninfo VG_(aix5_NR_getkerninfo)
-
-extern Int VG_(aix5_NR_getpeereid);
-#define __NR_AIX5_getpeereid VG_(aix5_NR_getpeereid)
-
-extern Int VG_(aix5_NR_getpeername);
-#define __NR_AIX5_getpeername VG_(aix5_NR_getpeername)
-
-extern Int VG_(aix5_NR_ngetpeername);
-#define __NR_AIX5_ngetpeername VG_(aix5_NR_ngetpeername)
-
-extern Int VG_(aix5_NR_getsockname);
-#define __NR_AIX5_getsockname VG_(aix5_NR_getsockname)
-
-extern Int VG_(aix5_NR_ngetsockname);
-#define __NR_AIX5_ngetsockname VG_(aix5_NR_ngetsockname)
-
-extern Int VG_(aix5_NR_getsockopt);
-#define __NR_AIX5_getsockopt VG_(aix5_NR_getsockopt)
-
-extern Int VG_(aix5_NR_setsockopt);
-#define __NR_AIX5_setsockopt VG_(aix5_NR_setsockopt)
-
-extern Int VG_(aix5_NR_shutdown);
-#define __NR_AIX5_shutdown VG_(aix5_NR_shutdown)
-
-extern Int VG_(aix5_NR_recvmsg);
-#define __NR_AIX5_recvmsg VG_(aix5_NR_recvmsg)
-
-extern Int VG_(aix5_NR_recv);
-#define __NR_AIX5_recv VG_(aix5_NR_recv)
-
-extern Int VG_(aix5_NR_nrecvfrom);
-#define __NR_AIX5_nrecvfrom VG_(aix5_NR_nrecvfrom)
-
-extern Int VG_(aix5_NR_recvfrom);
-#define __NR_AIX5_recvfrom VG_(aix5_NR_recvfrom)
-
-extern Int VG_(aix5_NR_nsendmsg);
-#define __NR_AIX5_nsendmsg VG_(aix5_NR_nsendmsg)
-
-extern Int VG_(aix5_NR_sendmsg);
-#define __NR_AIX5_sendmsg VG_(aix5_NR_sendmsg)
-
-extern Int VG_(aix5_NR_send);
-#define __NR_AIX5_send VG_(aix5_NR_send)
-
-extern Int VG_(aix5_NR_sendto);
-#define __NR_AIX5_sendto VG_(aix5_NR_sendto)
-
-extern Int VG_(aix5_NR_socketpair);
-#define __NR_AIX5_socketpair VG_(aix5_NR_socketpair)
-
-extern Int VG_(aix5_NR_accept);
-#define __NR_AIX5_accept VG_(aix5_NR_accept)
-
-extern Int VG_(aix5_NR_naccept);
-#define __NR_AIX5_naccept VG_(aix5_NR_naccept)
-
-extern Int VG_(aix5_NR_listen);
-#define __NR_AIX5_listen VG_(aix5_NR_listen)
-
-extern Int VG_(aix5_NR_bind);
-#define __NR_AIX5_bind VG_(aix5_NR_bind)
-
-extern Int VG_(aix5_NR_socket);
-#define __NR_AIX5_socket VG_(aix5_NR_socket)
-
-extern Int VG_(aix5_NR_connext);
-#define __NR_AIX5_connext VG_(aix5_NR_connext)
-
-extern Int VG_(aix5_NR_setdomainname);
-#define __NR_AIX5_setdomainname VG_(aix5_NR_setdomainname)
-
-extern Int VG_(aix5_NR_getdomainname);
-#define __NR_AIX5_getdomainname VG_(aix5_NR_getdomainname)
-
-extern Int VG_(aix5_NR_sethostname);
-#define __NR_AIX5_sethostname VG_(aix5_NR_sethostname)
-
-extern Int VG_(aix5_NR_sethostid);
-#define __NR_AIX5_sethostid VG_(aix5_NR_sethostid)
-
-extern Int VG_(aix5_NR_gethostid);
-#define __NR_AIX5_gethostid VG_(aix5_NR_gethostid)
-
-extern Int VG_(aix5_NR_gethostname);
-#define __NR_AIX5_gethostname VG_(aix5_NR_gethostname)
-
-extern Int VG_(aix5_NR_send_file);
-#define __NR_AIX5_send_file VG_(aix5_NR_send_file)
-
-extern Int VG_(aix5_NR__rmlmbcost);
-#define __NR_AIX5__rmlmbcost VG_(aix5_NR__rmlmbcost)
-
-extern Int VG_(aix5_NR___rs_pickmcm);
-#define __NR_AIX5___rs_pickmcm VG_(aix5_NR___rs_pickmcm)
-
-extern Int VG_(aix5_NR_rs_getsystem);
-#define __NR_AIX5_rs_getsystem VG_(aix5_NR_rs_getsystem)
-
-extern Int VG_(aix5_NR_rs_getassociativity);
-#define __NR_AIX5_rs_getassociativity VG_(aix5_NR_rs_getassociativity)
-
-extern Int VG_(aix5_NR_rs_setpartition);
-#define __NR_AIX5_rs_setpartition VG_(aix5_NR_rs_setpartition)
-
-extern Int VG_(aix5_NR_rs_getpartition);
-#define __NR_AIX5_rs_getpartition VG_(aix5_NR_rs_getpartition)
-
-extern Int VG_(aix5_NR_ra_getrset);
-#define __NR_AIX5_ra_getrset VG_(aix5_NR_ra_getrset)
-
-extern Int VG_(aix5_NR_rs_getinfo);
-#define __NR_AIX5_rs_getinfo VG_(aix5_NR_rs_getinfo)
-
-extern Int VG_(aix5_NR_rs_getrad);
-#define __NR_AIX5_rs_getrad VG_(aix5_NR_rs_getrad)
-
-extern Int VG_(aix5_NR_rs_numrads);
-#define __NR_AIX5_rs_numrads VG_(aix5_NR_rs_numrads)
-
-extern Int VG_(aix5_NR___kdb_format_print_rele);
-#define __NR_AIX5___kdb_format_print_rele VG_(aix5_NR___kdb_format_print_rele)
-
-extern Int VG_(aix5_NR___kdb_format_print_init);
-#define __NR_AIX5___kdb_format_print_init VG_(aix5_NR___kdb_format_print_init)
-
-extern Int VG_(aix5_NR_close);
-#define __NR_AIX5_close VG_(aix5_NR_close)
-
-extern Int VG_(aix5_NR_kfsync_range);
-#define __NR_AIX5_kfsync_range VG_(aix5_NR_kfsync_range)
-
-extern Int VG_(aix5_NR_fsync);
-#define __NR_AIX5_fsync VG_(aix5_NR_fsync)
-
-extern Int VG_(aix5_NR_kpwrite);
-#define __NR_AIX5_kpwrite VG_(aix5_NR_kpwrite)
-
-extern Int VG_(aix5_NR_kwritev);
-#define __NR_AIX5_kwritev VG_(aix5_NR_kwritev)
-
-extern Int VG_(aix5_NR_kwrite);
-#define __NR_AIX5_kwrite VG_(aix5_NR_kwrite)
-
-extern Int VG_(aix5_NR_kpread);
-#define __NR_AIX5_kpread VG_(aix5_NR_kpread)
-
-extern Int VG_(aix5_NR_kreadv);
-#define __NR_AIX5_kreadv VG_(aix5_NR_kreadv)
-
-extern Int VG_(aix5_NR_kread);
-#define __NR_AIX5_kread VG_(aix5_NR_kread)
-
-extern Int VG_(aix5_NR_klseek);
-#define __NR_AIX5_klseek VG_(aix5_NR_klseek)
-
-extern Int VG_(aix5_NR__lseek);
-#define __NR_AIX5__lseek VG_(aix5_NR__lseek)
-
-extern Int VG_(aix5_NR_lseek);
-#define __NR_AIX5_lseek VG_(aix5_NR_lseek)
-
-extern Int VG_(aix5_NR__setsid);
-#define __NR_AIX5__setsid VG_(aix5_NR__setsid)
-
-extern Int VG_(aix5_NR__setpgid);
-#define __NR_AIX5__setpgid VG_(aix5_NR__setpgid)
-
-extern Int VG_(aix5_NR__setpgrp);
-#define __NR_AIX5__setpgrp VG_(aix5_NR__setpgrp)
-
-extern Int VG_(aix5_NR__getpgrpx);
-#define __NR_AIX5__getpgrpx VG_(aix5_NR__getpgrpx)
-
-extern Int VG_(aix5_NR__getpgrp);
-#define __NR_AIX5__getpgrp VG_(aix5_NR__getpgrp)
-
-extern Int VG_(aix5_NR__getppid);
-#define __NR_AIX5__getppid VG_(aix5_NR__getppid)
-
-extern Int VG_(aix5_NR__thread_self);
-#define __NR_AIX5__thread_self VG_(aix5_NR__thread_self)
-
-extern Int VG_(aix5_NR__getpid);
-#define __NR_AIX5__getpid VG_(aix5_NR__getpid)
-
-extern Int VG_(aix5_NR_kgetpgidx);
-#define __NR_AIX5_kgetpgidx VG_(aix5_NR_kgetpgidx)
-
-extern Int VG_(aix5_NR_setuid);
-#define __NR_AIX5_setuid VG_(aix5_NR_setuid)
-
-extern Int VG_(aix5_NR_setuidx);
-#define __NR_AIX5_setuidx VG_(aix5_NR_setuidx)
-
-extern Int VG_(aix5_NR_getuidx);
-#define __NR_AIX5_getuidx VG_(aix5_NR_getuidx)
-
-extern Int VG_(aix5_NR_seteuid);
-#define __NR_AIX5_seteuid VG_(aix5_NR_seteuid)
-
-extern Int VG_(aix5_NR_setreuid);
-#define __NR_AIX5_setreuid VG_(aix5_NR_setreuid)
-
-extern Int VG_(aix5_NR_chdir);
-#define __NR_AIX5_chdir VG_(aix5_NR_chdir)
-
-extern Int VG_(aix5_NR_fchdir);
-#define __NR_AIX5_fchdir VG_(aix5_NR_fchdir)
-
-extern Int VG_(aix5_NR_chroot);
-#define __NR_AIX5_chroot VG_(aix5_NR_chroot)
-
-extern Int VG_(aix5_NR_fchmod);
-#define __NR_AIX5_fchmod VG_(aix5_NR_fchmod)
-
-extern Int VG_(aix5_NR_chmod);
-#define __NR_AIX5_chmod VG_(aix5_NR_chmod)
-
-extern Int VG_(aix5_NR_chown);
-#define __NR_AIX5_chown VG_(aix5_NR_chown)
-
-extern Int VG_(aix5_NR_lchown);
-#define __NR_AIX5_lchown VG_(aix5_NR_lchown)
-
-extern Int VG_(aix5_NR_fchown);
-#define __NR_AIX5_fchown VG_(aix5_NR_fchown)
-
-extern Int VG_(aix5_NR_fchownx);
-#define __NR_AIX5_fchownx VG_(aix5_NR_fchownx)
-
-extern Int VG_(aix5_NR_chownx);
-#define __NR_AIX5_chownx VG_(aix5_NR_chownx)
-
-extern Int VG_(aix5_NR_kfclear);
-#define __NR_AIX5_kfclear VG_(aix5_NR_kfclear)
-
-extern Int VG_(aix5_NR_fclear);
-#define __NR_AIX5_fclear VG_(aix5_NR_fclear)
-
-extern Int VG_(aix5_NR_ffinfo);
-#define __NR_AIX5_ffinfo VG_(aix5_NR_ffinfo)
-
-extern Int VG_(aix5_NR_finfo);
-#define __NR_AIX5_finfo VG_(aix5_NR_finfo)
-
-extern Int VG_(aix5_NR_fscntl);
-#define __NR_AIX5_fscntl VG_(aix5_NR_fscntl)
-
-extern Int VG_(aix5_NR_ktruncate);
-#define __NR_AIX5_ktruncate VG_(aix5_NR_ktruncate)
-
-extern Int VG_(aix5_NR_kftruncate);
-#define __NR_AIX5_kftruncate VG_(aix5_NR_kftruncate)
-
-extern Int VG_(aix5_NR_truncate);
-#define __NR_AIX5_truncate VG_(aix5_NR_truncate)
-
-extern Int VG_(aix5_NR_ftruncate);
-#define __NR_AIX5_ftruncate VG_(aix5_NR_ftruncate)
-
-extern Int VG_(aix5_NR_getdirent64);
-#define __NR_AIX5_getdirent64 VG_(aix5_NR_getdirent64)
-
-extern Int VG_(aix5_NR_getdirent);
-#define __NR_AIX5_getdirent VG_(aix5_NR_getdirent)
-
-extern Int VG_(aix5_NR_kioctl32);
-#define __NR_AIX5_kioctl32 VG_(aix5_NR_kioctl32)
-
-extern Int VG_(aix5_NR_kioctl);
-#define __NR_AIX5_kioctl VG_(aix5_NR_kioctl)
-
-extern Int VG_(aix5_NR_link);
-#define __NR_AIX5_link VG_(aix5_NR_link)
-
-extern Int VG_(aix5_NR_klockf);
-#define __NR_AIX5_klockf VG_(aix5_NR_klockf)
-
-extern Int VG_(aix5_NR_lockf);
-#define __NR_AIX5_lockf VG_(aix5_NR_lockf)
-
-extern Int VG_(aix5_NR_mkdir);
-#define __NR_AIX5_mkdir VG_(aix5_NR_mkdir)
-
-extern Int VG_(aix5_NR_mknod);
-#define __NR_AIX5_mknod VG_(aix5_NR_mknod)
-
-extern Int VG_(aix5_NR_mntctl);
-#define __NR_AIX5_mntctl VG_(aix5_NR_mntctl)
-
-extern Int VG_(aix5_NR_vmount);
-#define __NR_AIX5_vmount VG_(aix5_NR_vmount)
-
-extern Int VG_(aix5_NR_creat);
-#define __NR_AIX5_creat VG_(aix5_NR_creat)
-
-extern Int VG_(aix5_NR_openx);
-#define __NR_AIX5_openx VG_(aix5_NR_openx)
-
-extern Int VG_(aix5_NR_open);
-#define __NR_AIX5_open VG_(aix5_NR_open)
-
-extern Int VG_(aix5_NR_quotactl);
-#define __NR_AIX5_quotactl VG_(aix5_NR_quotactl)
-
-extern Int VG_(aix5_NR_rename);
-#define __NR_AIX5_rename VG_(aix5_NR_rename)
-
-extern Int VG_(aix5_NR_rmdir);
-#define __NR_AIX5_rmdir VG_(aix5_NR_rmdir)
-
-extern Int VG_(aix5_NR_fstatx);
-#define __NR_AIX5_fstatx VG_(aix5_NR_fstatx)
-
-extern Int VG_(aix5_NR_statx);
-#define __NR_AIX5_statx VG_(aix5_NR_statx)
-
-extern Int VG_(aix5_NR_symlink);
-#define __NR_AIX5_symlink VG_(aix5_NR_symlink)
-
-extern Int VG_(aix5_NR_readlink);
-#define __NR_AIX5_readlink VG_(aix5_NR_readlink)
-
-extern Int VG_(aix5_NR_syncvfs);
-#define __NR_AIX5_syncvfs VG_(aix5_NR_syncvfs)
-
-extern Int VG_(aix5_NR_sync);
-#define __NR_AIX5_sync VG_(aix5_NR_sync)
-
-extern Int VG_(aix5_NR_umask);
-#define __NR_AIX5_umask VG_(aix5_NR_umask)
-
-extern Int VG_(aix5_NR_uvmount);
-#define __NR_AIX5_uvmount VG_(aix5_NR_uvmount)
-
-extern Int VG_(aix5_NR_umount);
-#define __NR_AIX5_umount VG_(aix5_NR_umount)
-
-extern Int VG_(aix5_NR_unameu);
-#define __NR_AIX5_unameu VG_(aix5_NR_unameu)
-
-extern Int VG_(aix5_NR_unamex);
-#define __NR_AIX5_unamex VG_(aix5_NR_unamex)
-
-extern Int VG_(aix5_NR_uname);
-#define __NR_AIX5_uname VG_(aix5_NR_uname)
-
-extern Int VG_(aix5_NR_unlink);
-#define __NR_AIX5_unlink VG_(aix5_NR_unlink)
-
-extern Int VG_(aix5_NR_ustat);
-#define __NR_AIX5_ustat VG_(aix5_NR_ustat)
-
-extern Int VG_(aix5_NR_utimes);
-#define __NR_AIX5_utimes VG_(aix5_NR_utimes)
-
-extern Int VG_(aix5_NR___msgxrcv);
-#define __NR_AIX5___msgxrcv VG_(aix5_NR___msgxrcv)
-
-extern Int VG_(aix5_NR___msgrcv);
-#define __NR_AIX5___msgrcv VG_(aix5_NR___msgrcv)
-
-extern Int VG_(aix5_NR___msgsnd);
-#define __NR_AIX5___msgsnd VG_(aix5_NR___msgsnd)
-
-extern Int VG_(aix5_NR_msgctl);
-#define __NR_AIX5_msgctl VG_(aix5_NR_msgctl)
-
-extern Int VG_(aix5_NR_msgget);
-#define __NR_AIX5_msgget VG_(aix5_NR_msgget)
-
-extern Int VG_(aix5_NR_getgidx);
-#define __NR_AIX5_getgidx VG_(aix5_NR_getgidx)
-
-extern Int VG_(aix5_NR___semop);
-#define __NR_AIX5___semop VG_(aix5_NR___semop)
-
-extern Int VG_(aix5_NR_semget);
-#define __NR_AIX5_semget VG_(aix5_NR_semget)
-
-extern Int VG_(aix5_NR_semctl);
-#define __NR_AIX5_semctl VG_(aix5_NR_semctl)
-
-extern Int VG_(aix5_NR_shmctl);
-#define __NR_AIX5_shmctl VG_(aix5_NR_shmctl)
-
-extern Int VG_(aix5_NR_shmdt);
-#define __NR_AIX5_shmdt VG_(aix5_NR_shmdt)
-
-extern Int VG_(aix5_NR_shmat);
-#define __NR_AIX5_shmat VG_(aix5_NR_shmat)
-
-extern Int VG_(aix5_NR_shmget);
-#define __NR_AIX5_shmget VG_(aix5_NR_shmget)
-
-extern Int VG_(aix5_NR_ra_shmgetv);
-#define __NR_AIX5_ra_shmgetv VG_(aix5_NR_ra_shmgetv)
-
-extern Int VG_(aix5_NR_ra_shmget);
-#define __NR_AIX5_ra_shmget VG_(aix5_NR_ra_shmget)
-
-extern Int VG_(aix5_NR_privcheck);
-#define __NR_AIX5_privcheck VG_(aix5_NR_privcheck)
-
-extern Int VG_(aix5_NR_disclaim);
-#define __NR_AIX5_disclaim VG_(aix5_NR_disclaim)
-
-extern Int VG_(aix5_NR__sem_destroy_unnamed);
-#define __NR_AIX5__sem_destroy_unnamed VG_(aix5_NR__sem_destroy_unnamed)
-
-extern Int VG_(aix5_NR__sem_wait);
-#define __NR_AIX5__sem_wait VG_(aix5_NR__sem_wait)
-
-extern Int VG_(aix5_NR__sem_close);
-#define __NR_AIX5__sem_close VG_(aix5_NR__sem_close)
-
-extern Int VG_(aix5_NR__sem_open);
-#define __NR_AIX5__sem_open VG_(aix5_NR__sem_open)
-
-extern Int VG_(aix5_NR_sem_unlink);
-#define __NR_AIX5_sem_unlink VG_(aix5_NR_sem_unlink)
-
-extern Int VG_(aix5_NR_sem_post);
-#define __NR_AIX5_sem_post VG_(aix5_NR_sem_post)
-
-extern Int VG_(aix5_NR_sem_init);
-#define __NR_AIX5_sem_init VG_(aix5_NR_sem_init)
-
-extern Int VG_(aix5_NR_sem_getvalue);
-#define __NR_AIX5_sem_getvalue VG_(aix5_NR_sem_getvalue)
-
-extern Int VG_(aix5_NR_sem_destroy);
-#define __NR_AIX5_sem_destroy VG_(aix5_NR_sem_destroy)
-
-extern Int VG_(aix5_NR__mq_notify);
-#define __NR_AIX5__mq_notify VG_(aix5_NR__mq_notify)
-
-extern Int VG_(aix5_NR__mq_open);
-#define __NR_AIX5__mq_open VG_(aix5_NR__mq_open)
-
-extern Int VG_(aix5_NR_mq_unlink);
-#define __NR_AIX5_mq_unlink VG_(aix5_NR_mq_unlink)
-
-extern Int VG_(aix5_NR_mq_setattr);
-#define __NR_AIX5_mq_setattr VG_(aix5_NR_mq_setattr)
-
-extern Int VG_(aix5_NR_mq_send);
-#define __NR_AIX5_mq_send VG_(aix5_NR_mq_send)
-
-extern Int VG_(aix5_NR_mq_receive);
-#define __NR_AIX5_mq_receive VG_(aix5_NR_mq_receive)
-
-extern Int VG_(aix5_NR_mq_getattr);
-#define __NR_AIX5_mq_getattr VG_(aix5_NR_mq_getattr)
-
-extern Int VG_(aix5_NR_mq_close);
-#define __NR_AIX5_mq_close VG_(aix5_NR_mq_close)
-
-extern Int VG_(aix5_NR_shm_unlink);
-#define __NR_AIX5_shm_unlink VG_(aix5_NR_shm_unlink)
-
-extern Int VG_(aix5_NR_shm_open);
-#define __NR_AIX5_shm_open VG_(aix5_NR_shm_open)
-
-extern Int VG_(aix5_NR__poll);
-#define __NR_AIX5__poll VG_(aix5_NR__poll)
-
-extern Int VG_(aix5_NR__select);
-#define __NR_AIX5__select VG_(aix5_NR__select)
-
-extern Int VG_(aix5_NR_sysconfig);
-#define __NR_AIX5_sysconfig VG_(aix5_NR_sysconfig)
-
-extern Int VG_(aix5_NR_sys_parm);
-#define __NR_AIX5_sys_parm VG_(aix5_NR_sys_parm)
-
-extern Int VG_(aix5_NR_loadquery);
-#define __NR_AIX5_loadquery VG_(aix5_NR_loadquery)
-
-extern Int VG_(aix5_NR_knlist);
-#define __NR_AIX5_knlist VG_(aix5_NR_knlist)
-
-extern Int VG_(aix5_NR_brk);
-#define __NR_AIX5_brk VG_(aix5_NR_brk)
-
-extern Int VG_(aix5_NR_fjfs_sys_call);
-#define __NR_AIX5_fjfs_sys_call VG_(aix5_NR_fjfs_sys_call)
-
-extern Int VG_(aix5_NR_jfs_sys_call);
-#define __NR_AIX5_jfs_sys_call VG_(aix5_NR_jfs_sys_call)
-
-extern Int VG_(aix5_NR_acct);
-#define __NR_AIX5_acct VG_(aix5_NR_acct)
-
-extern Int VG_(aix5_NR__dr_unregister);
-#define __NR_AIX5__dr_unregister VG_(aix5_NR__dr_unregister)
-
-extern Int VG_(aix5_NR__dr_notify);
-#define __NR_AIX5__dr_notify VG_(aix5_NR__dr_notify)
-
-extern Int VG_(aix5_NR__dr_register);
-#define __NR_AIX5__dr_register VG_(aix5_NR__dr_register)
-
-extern Int VG_(aix5_NR_getlparload);
-#define __NR_AIX5_getlparload VG_(aix5_NR_getlparload)
-
-extern Int VG_(aix5_NR_dr_reconfig);
-#define __NR_AIX5_dr_reconfig VG_(aix5_NR_dr_reconfig)
-
-extern Int VG_(aix5_NR_projctl);
-#define __NR_AIX5_projctl VG_(aix5_NR_projctl)
-
-extern Int VG_(aix5_NR_sbrk);
-#define __NR_AIX5_sbrk VG_(aix5_NR_sbrk)
-
-extern Int VG_(aix5_NR__sigpending);
-#define __NR_AIX5__sigpending VG_(aix5_NR__sigpending)
-
-extern Int VG_(aix5_NR__pause);
-#define __NR_AIX5__pause VG_(aix5_NR__pause)
-
-extern Int VG_(aix5_NR_thread_kill);
-#define __NR_AIX5_thread_kill VG_(aix5_NR_thread_kill)
-
-extern Int VG_(aix5_NR_sigstack);
-#define __NR_AIX5_sigstack VG_(aix5_NR_sigstack)
-
-extern Int VG_(aix5_NR_sigaltstack);
-#define __NR_AIX5_sigaltstack VG_(aix5_NR_sigaltstack)
-
-extern Int VG_(aix5_NR_appulimit);
-#define __NR_AIX5_appulimit VG_(aix5_NR_appulimit)
-
-extern Int VG_(aix5_NR_ras_service);
-#define __NR_AIX5_ras_service VG_(aix5_NR_ras_service)
-
-extern Int VG_(aix5_NR__wlm_class_descr2key);
-#define __NR_AIX5__wlm_class_descr2key VG_(aix5_NR__wlm_class_descr2key)
-
-extern Int VG_(aix5_NR__wlm_get_procinfo);
-#define __NR_AIX5__wlm_get_procinfo VG_(aix5_NR__wlm_get_procinfo)
-
-extern Int VG_(aix5_NR__wlm_get_info);
-#define __NR_AIX5__wlm_get_info VG_(aix5_NR__wlm_get_info)
-
-extern Int VG_(aix5_NR__wlm_getclassname);
-#define __NR_AIX5__wlm_getclassname VG_(aix5_NR__wlm_getclassname)
-
-extern Int VG_(aix5_NR__wlm_unload_classes);
-#define __NR_AIX5__wlm_unload_classes VG_(aix5_NR__wlm_unload_classes)
-
-extern Int VG_(aix5_NR__wlm_load);
-#define __NR_AIX5__wlm_load VG_(aix5_NR__wlm_load)
-
-extern Int VG_(aix5_NR__wlm_tune);
-#define __NR_AIX5__wlm_tune VG_(aix5_NR__wlm_tune)
-
-extern Int VG_(aix5_NR__wlm_assign);
-#define __NR_AIX5__wlm_assign VG_(aix5_NR__wlm_assign)
-
-extern Int VG_(aix5_NR__wlm_classify);
-#define __NR_AIX5__wlm_classify VG_(aix5_NR__wlm_classify)
-
-extern Int VG_(aix5_NR_fp_cpusync);
-#define __NR_AIX5_fp_cpusync VG_(aix5_NR_fp_cpusync)
-
-extern Int VG_(aix5_NR__fp_trapstate_ker);
-#define __NR_AIX5__fp_trapstate_ker VG_(aix5_NR__fp_trapstate_ker)
-
-extern Int VG_(aix5_NR__ewlm_classify_correlator);
-#define __NR_AIX5__ewlm_classify_correlator VG_(aix5_NR__ewlm_classify_correlator)
-
-extern Int VG_(aix5_NR__arm_stop_transaction);
-#define __NR_AIX5__arm_stop_transaction VG_(aix5_NR__arm_stop_transaction)
-
-extern Int VG_(aix5_NR__arm_destroy_application);
-#define __NR_AIX5__arm_destroy_application VG_(aix5_NR__arm_destroy_application)
-
-extern Int VG_(aix5_NR__arm_stop_application);
-#define __NR_AIX5__arm_stop_application VG_(aix5_NR__arm_stop_application)
-
-extern Int VG_(aix5_NR__arm_generate_correlator);
-#define __NR_AIX5__arm_generate_correlator VG_(aix5_NR__arm_generate_correlator)
-
-extern Int VG_(aix5_NR__arm_discard_transaction);
-#define __NR_AIX5__arm_discard_transaction VG_(aix5_NR__arm_discard_transaction)
-
-extern Int VG_(aix5_NR__arm_unbind_thread);
-#define __NR_AIX5__arm_unbind_thread VG_(aix5_NR__arm_unbind_thread)
-
-extern Int VG_(aix5_NR__arm_bind_thread);
-#define __NR_AIX5__arm_bind_thread VG_(aix5_NR__arm_bind_thread)
-
-extern Int VG_(aix5_NR__arm_unblock_transaction);
-#define __NR_AIX5__arm_unblock_transaction VG_(aix5_NR__arm_unblock_transaction)
-
-extern Int VG_(aix5_NR__arm_block_transaction);
-#define __NR_AIX5__arm_block_transaction VG_(aix5_NR__arm_block_transaction)
-
-extern Int VG_(aix5_NR__arm_update_transaction);
-#define __NR_AIX5__arm_update_transaction VG_(aix5_NR__arm_update_transaction)
-
-extern Int VG_(aix5_NR__arm_register_metric);
-#define __NR_AIX5__arm_register_metric VG_(aix5_NR__arm_register_metric)
-
-extern Int VG_(aix5_NR__arm_report_transaction);
-#define __NR_AIX5__arm_report_transaction VG_(aix5_NR__arm_report_transaction)
-
-extern Int VG_(aix5_NR__arm_start_transaction);
-#define __NR_AIX5__arm_start_transaction VG_(aix5_NR__arm_start_transaction)
-
-extern Int VG_(aix5_NR__arm_register_transaction);
-#define __NR_AIX5__arm_register_transaction VG_(aix5_NR__arm_register_transaction)
-
-extern Int VG_(aix5_NR__arm_start_application);
-#define __NR_AIX5__arm_start_application VG_(aix5_NR__arm_start_application)
-
-extern Int VG_(aix5_NR__arm_register_application);
-#define __NR_AIX5__arm_register_application VG_(aix5_NR__arm_register_application)
-
-extern Int VG_(aix5_NR__lsarm_getinfo);
-#define __NR_AIX5__lsarm_getinfo VG_(aix5_NR__lsarm_getinfo)
-
-extern Int VG_(aix5_NR__ewlm_init);
-#define __NR_AIX5__ewlm_init VG_(aix5_NR__ewlm_init)
-
-extern Int VG_(aix5_NR__ewlm_query);
-#define __NR_AIX5__ewlm_query VG_(aix5_NR__ewlm_query)
-
-extern Int VG_(aix5_NR_ewlm_verify_policy);
-#define __NR_AIX5_ewlm_verify_policy VG_(aix5_NR_ewlm_verify_policy)
-
-extern Int VG_(aix5_NR_ewlm_abort_policy);
-#define __NR_AIX5_ewlm_abort_policy VG_(aix5_NR_ewlm_abort_policy)
-
-extern Int VG_(aix5_NR_ewlm_commit_policy);
-#define __NR_AIX5_ewlm_commit_policy VG_(aix5_NR_ewlm_commit_policy)
-
-extern Int VG_(aix5_NR_ewlm_prepare_policy);
-#define __NR_AIX5_ewlm_prepare_policy VG_(aix5_NR_ewlm_prepare_policy)
-
-extern Int VG_(aix5_NR_ewlm_get_completions);
-#define __NR_AIX5_ewlm_get_completions VG_(aix5_NR_ewlm_get_completions)
-
-extern Int VG_(aix5_NR_ewlm_get_activedata);
-#define __NR_AIX5_ewlm_get_activedata VG_(aix5_NR_ewlm_get_activedata)
-
-extern Int VG_(aix5_NR_ewlm_get_appldata);
-#define __NR_AIX5_ewlm_get_appldata VG_(aix5_NR_ewlm_get_appldata)
-
-extern Int VG_(aix5_NR_ewlm_collect_samples);
-#define __NR_AIX5_ewlm_collect_samples VG_(aix5_NR_ewlm_collect_samples)
-
-extern Int VG_(aix5_NR_ewlm_disconnect);
-#define __NR_AIX5_ewlm_disconnect VG_(aix5_NR_ewlm_disconnect)
-
-extern Int VG_(aix5_NR_ewlm_connect);
-#define __NR_AIX5_ewlm_connect VG_(aix5_NR_ewlm_connect)
-
-extern Int VG_(aix5_NR_auditlog);
-#define __NR_AIX5_auditlog VG_(aix5_NR_auditlog)
-
-extern Int VG_(aix5_NR_auditproc);
-#define __NR_AIX5_auditproc VG_(aix5_NR_auditproc)
-
-extern Int VG_(aix5_NR_getgroups);
-#define __NR_AIX5_getgroups VG_(aix5_NR_getgroups)
-
-extern Int VG_(aix5_NR_setgid);
-#define __NR_AIX5_setgid VG_(aix5_NR_setgid)
-
-extern Int VG_(aix5_NR_setgidx);
-#define __NR_AIX5_setgidx VG_(aix5_NR_setgidx)
-
-extern Int VG_(aix5_NR_setgroups);
-#define __NR_AIX5_setgroups VG_(aix5_NR_setgroups)
-
-extern Int VG_(aix5_NR_frevoke);
-#define __NR_AIX5_frevoke VG_(aix5_NR_frevoke)
-
-extern Int VG_(aix5_NR_revoke);
-#define __NR_AIX5_revoke VG_(aix5_NR_revoke)
-
-extern Int VG_(aix5_NR___pag_setvalue);
-#define __NR_AIX5___pag_setvalue VG_(aix5_NR___pag_setvalue)
-
-extern Int VG_(aix5_NR___pag_getvalue);
-#define __NR_AIX5___pag_getvalue VG_(aix5_NR___pag_getvalue)
-
-extern Int VG_(aix5_NR___pag_getid);
-#define __NR_AIX5___pag_getid VG_(aix5_NR___pag_getid)
-
-extern Int VG_(aix5_NR___pag_getname);
-#define __NR_AIX5___pag_getname VG_(aix5_NR___pag_getname)
-
-extern Int VG_(aix5_NR___pag_setname);
-#define __NR_AIX5___pag_setname VG_(aix5_NR___pag_setname)
-
-extern Int VG_(aix5_NR_kcap_set_proc);
-#define __NR_AIX5_kcap_set_proc VG_(aix5_NR_kcap_set_proc)
-
-extern Int VG_(aix5_NR_kcap_get_proc);
-#define __NR_AIX5_kcap_get_proc VG_(aix5_NR_kcap_get_proc)
-
-extern Int VG_(aix5_NR_pipe);
-#define __NR_AIX5_pipe VG_(aix5_NR_pipe)
-
-extern Int VG_(aix5_NR_mwakeup);
-#define __NR_AIX5_mwakeup VG_(aix5_NR_mwakeup)
-
-extern Int VG_(aix5_NR___msleep);
-#define __NR_AIX5___msleep VG_(aix5_NR___msleep)
-
-extern Int VG_(aix5_NR_kmmap);
-#define __NR_AIX5_kmmap VG_(aix5_NR_kmmap)
-
-extern Int VG_(aix5_NR_msem_remove);
-#define __NR_AIX5_msem_remove VG_(aix5_NR_msem_remove)
-
-extern Int VG_(aix5_NR_mincore);
-#define __NR_AIX5_mincore VG_(aix5_NR_mincore)
-
-extern Int VG_(aix5_NR_madvise);
-#define __NR_AIX5_madvise VG_(aix5_NR_madvise)
-
-extern Int VG_(aix5_NR_munmap);
-#define __NR_AIX5_munmap VG_(aix5_NR_munmap)
-
-extern Int VG_(aix5_NR_msync);
-#define __NR_AIX5_msync VG_(aix5_NR_msync)
-
-extern Int VG_(aix5_NR_mprotect);
-#define __NR_AIX5_mprotect VG_(aix5_NR_mprotect)
-
-extern Int VG_(aix5_NR_mmap);
-#define __NR_AIX5_mmap VG_(aix5_NR_mmap)
-
-extern Int VG_(aix5_NR_swapqry);
-#define __NR_AIX5_swapqry VG_(aix5_NR_swapqry)
-
-extern Int VG_(aix5_NR_swapon);
-#define __NR_AIX5_swapon VG_(aix5_NR_swapon)
-
-extern Int VG_(aix5_NR_swapoff);
-#define __NR_AIX5_swapoff VG_(aix5_NR_swapoff)
-
-extern Int VG_(aix5_NR_psdanger);
-#define __NR_AIX5_psdanger VG_(aix5_NR_psdanger)
-
-extern Int VG_(aix5_NR_vmgetinfo);
-#define __NR_AIX5_vmgetinfo VG_(aix5_NR_vmgetinfo)
-
-extern Int VG_(aix5_NR_rs_admregistername);
-#define __NR_AIX5_rs_admregistername VG_(aix5_NR_rs_admregistername)
-
-extern Int VG_(aix5_NR_rs_discardname);
-#define __NR_AIX5_rs_discardname VG_(aix5_NR_rs_discardname)
-
-extern Int VG_(aix5_NR_rs_setnameattr);
-#define __NR_AIX5_rs_setnameattr VG_(aix5_NR_rs_setnameattr)
-
-extern Int VG_(aix5_NR_rs_registername);
-#define __NR_AIX5_rs_registername VG_(aix5_NR_rs_registername)
-
-extern Int VG_(aix5_NR_rs_getnamedrset);
-#define __NR_AIX5_rs_getnamedrset VG_(aix5_NR_rs_getnamedrset)
-
-extern Int VG_(aix5_NR_rs_getnameattr);
-#define __NR_AIX5_rs_getnameattr VG_(aix5_NR_rs_getnameattr)
-
-extern Int VG_(aix5_NR_rs_getrsetnames);
-#define __NR_AIX5_rs_getrsetnames VG_(aix5_NR_rs_getrsetnames)
-
-extern Int VG_(aix5_NR_ra_attachrset);
-#define __NR_AIX5_ra_attachrset VG_(aix5_NR_ra_attachrset)
-
-extern Int VG_(aix5_NR_ra_detachrset);
-#define __NR_AIX5_ra_detachrset VG_(aix5_NR_ra_detachrset)
-
-extern Int VG_(aix5_NR_dmapi_init);
-#define __NR_AIX5_dmapi_init VG_(aix5_NR_dmapi_init)
-
-extern Int VG_(aix5_NR_kdm_ioctl);
-#define __NR_AIX5_kdm_ioctl VG_(aix5_NR_kdm_ioctl)
-
-extern Int VG_(aix5_NR_access);
-#define __NR_AIX5_access VG_(aix5_NR_access)
-
-extern Int VG_(aix5_NR_accessx);
-#define __NR_AIX5_accessx VG_(aix5_NR_accessx)
-
-extern Int VG_(aix5_NR_kfcntl);
-#define __NR_AIX5_kfcntl VG_(aix5_NR_kfcntl)
-
-extern Int VG_(aix5_NR___pfcntl);
-#define __NR_AIX5___pfcntl VG_(aix5_NR___pfcntl)
-
-extern Int VG_(aix5_NR_fstatfs64);
-#define __NR_AIX5_fstatfs64 VG_(aix5_NR_fstatfs64)
-
-extern Int VG_(aix5_NR_statfs64);
-#define __NR_AIX5_statfs64 VG_(aix5_NR_statfs64)
-
-extern Int VG_(aix5_NR_fstatfs);
-#define __NR_AIX5_fstatfs VG_(aix5_NR_fstatfs)
-
-extern Int VG_(aix5_NR_statfs);
-#define __NR_AIX5_statfs VG_(aix5_NR_statfs)
-
-extern Int VG_(aix5_NR_probe);
-#define __NR_AIX5_probe VG_(aix5_NR_probe)
-
-extern Int VG_(aix5_NR_cmp_swap);
-#define __NR_AIX5_cmp_swap VG_(aix5_NR_cmp_swap)
-
-extern Int VG_(aix5_NR__validate_pag);
-#define __NR_AIX5__validate_pag VG_(aix5_NR__validate_pag)
-
-extern Int VG_(aix5_NR_kgetsidx);
-#define __NR_AIX5_kgetsidx VG_(aix5_NR_kgetsidx)
-
-extern Int VG_(aix5_NR_kgetsid);
-#define __NR_AIX5_kgetsid VG_(aix5_NR_kgetsid)
-
-extern Int VG_(aix5_NR_plock);
-#define __NR_AIX5_plock VG_(aix5_NR_plock)
-
-extern Int VG_(aix5_NR_upfput);
-#define __NR_AIX5_upfput VG_(aix5_NR_upfput)
-
-extern Int VG_(aix5_NR_usrinfo);
-#define __NR_AIX5_usrinfo VG_(aix5_NR_usrinfo)
-
-extern Int VG_(aix5_NR_audit);
-#define __NR_AIX5_audit VG_(aix5_NR_audit)
-
-extern Int VG_(aix5_NR_auditobj);
-#define __NR_AIX5_auditobj VG_(aix5_NR_auditobj)
-
-extern Int VG_(aix5_NR_auditbin);
-#define __NR_AIX5_auditbin VG_(aix5_NR_auditbin)
-
-extern Int VG_(aix5_NR_auditevents);
-#define __NR_AIX5_auditevents VG_(aix5_NR_auditevents)
-
-extern Int VG_(aix5_NR_faccessx);
-#define __NR_AIX5_faccessx VG_(aix5_NR_faccessx)
-
-extern Int VG_(aix5_NR___fchaclx);
-#define __NR_AIX5___fchaclx VG_(aix5_NR___fchaclx)
-
-extern Int VG_(aix5_NR___chaclx);
-#define __NR_AIX5___chaclx VG_(aix5_NR___chaclx)
-
-extern Int VG_(aix5_NR_fchacl);
-#define __NR_AIX5_fchacl VG_(aix5_NR_fchacl)
-
-extern Int VG_(aix5_NR_chacl);
-#define __NR_AIX5_chacl VG_(aix5_NR_chacl)
-
-extern Int VG_(aix5_NR___fstataclx);
-#define __NR_AIX5___fstataclx VG_(aix5_NR___fstataclx)
-
-extern Int VG_(aix5_NR___stataclx);
-#define __NR_AIX5___stataclx VG_(aix5_NR___stataclx)
-
-extern Int VG_(aix5_NR_fstatacl);
-#define __NR_AIX5_fstatacl VG_(aix5_NR_fstatacl)
-
-extern Int VG_(aix5_NR_statacl);
-#define __NR_AIX5_statacl VG_(aix5_NR_statacl)
-
-extern Int VG_(aix5_NR_setpriv);
-#define __NR_AIX5_setpriv VG_(aix5_NR_setpriv)
-
-extern Int VG_(aix5_NR_getpriv);
-#define __NR_AIX5_getpriv VG_(aix5_NR_getpriv)
-
-extern Int VG_(aix5_NR_fstatpriv);
-#define __NR_AIX5_fstatpriv VG_(aix5_NR_fstatpriv)
-
-extern Int VG_(aix5_NR_statpriv);
-#define __NR_AIX5_statpriv VG_(aix5_NR_statpriv)
-
-extern Int VG_(aix5_NR_fchpriv);
-#define __NR_AIX5_fchpriv VG_(aix5_NR_fchpriv)
-
-extern Int VG_(aix5_NR_chpriv);
-#define __NR_AIX5_chpriv VG_(aix5_NR_chpriv)
-
-extern Int VG_(aix5_NR_i_int2cpu_pal);
-#define __NR_AIX5_i_int2cpu_pal VG_(aix5_NR_i_int2cpu_pal)
-
-extern Int VG_(aix5_NR_hd_cfg);
-#define __NR_AIX5_hd_cfg VG_(aix5_NR_hd_cfg)
-
-extern Int VG_(aix5_NR_putpmsg);
-#define __NR_AIX5_putpmsg VG_(aix5_NR_putpmsg)
-
-extern Int VG_(aix5_NR_putmsg);
-#define __NR_AIX5_putmsg VG_(aix5_NR_putmsg)
-
-extern Int VG_(aix5_NR_getpmsg);
-#define __NR_AIX5_getpmsg VG_(aix5_NR_getpmsg)
-
-extern Int VG_(aix5_NR_getmsg);
-#define __NR_AIX5_getmsg VG_(aix5_NR_getmsg)
-
-extern Int VG_(aix5_NR_strinfo);
-#define __NR_AIX5_strinfo VG_(aix5_NR_strinfo)
-
-extern Int VG_(aix5_NR_strreset);
-#define __NR_AIX5_strreset VG_(aix5_NR_strreset)
-
-extern Int VG_(aix5_NR_dupmsg);
-#define __NR_AIX5_dupmsg VG_(aix5_NR_dupmsg)
-
-extern Int VG_(aix5_NR__kgrantpt);
-#define __NR_AIX5__kgrantpt VG_(aix5_NR__kgrantpt)
-
-extern Int VG_(aix5_NR_aixgsc);
-#define __NR_AIX5_aixgsc VG_(aix5_NR_aixgsc)
-
-extern Int VG_(aix5_NR_smaccept);
-#define __NR_AIX5_smaccept VG_(aix5_NR_smaccept)
-
-extern Int VG_(aix5_NR_smconnect);
-#define __NR_AIX5_smconnect VG_(aix5_NR_smconnect)
-
-extern Int VG_(aix5_NR_smlisten);
-#define __NR_AIX5_smlisten VG_(aix5_NR_smlisten)
-
-extern Int VG_(aix5_NR_smbind);
-#define __NR_AIX5_smbind VG_(aix5_NR_smbind)
-
-extern Int VG_(aix5_NR_smsocket);
-#define __NR_AIX5_smsocket VG_(aix5_NR_smsocket)
-
-extern Int VG_(aix5_NR_smdetatt);
-#define __NR_AIX5_smdetatt VG_(aix5_NR_smdetatt)
-
-extern Int VG_(aix5_NR_smattach);
-#define __NR_AIX5_smattach VG_(aix5_NR_smattach)
-
-extern Int VG_(aix5_NR_smselect);
-#define __NR_AIX5_smselect VG_(aix5_NR_smselect)
-
-extern Int VG_(aix5_NR_smwait);
-#define __NR_AIX5_smwait VG_(aix5_NR_smwait)
-
-extern Int VG_(aix5_NR_smsetthresh);
-#define __NR_AIX5_smsetthresh VG_(aix5_NR_smsetthresh)
-
-extern Int VG_(aix5_NR_smsendbuff);
-#define __NR_AIX5_smsendbuff VG_(aix5_NR_smsendbuff)
-
-extern Int VG_(aix5_NR_smfreebuff);
-#define __NR_AIX5_smfreebuff VG_(aix5_NR_smfreebuff)
-
-extern Int VG_(aix5_NR_smrcvbuff);
-#define __NR_AIX5_smrcvbuff VG_(aix5_NR_smrcvbuff)
-
-extern Int VG_(aix5_NR_smgetbuff);
-#define __NR_AIX5_smgetbuff VG_(aix5_NR_smgetbuff)
-
-extern Int VG_(aix5_NR_smversion);
-#define __NR_AIX5_smversion VG_(aix5_NR_smversion)
-
-extern Int VG_(aix5_NR_smtcheckinit);
-#define __NR_AIX5_smtcheckinit VG_(aix5_NR_smtcheckinit)
-
-extern Int VG_(aix5_NR_aio_nwait_timeout);
-#define __NR_AIX5_aio_nwait_timeout VG_(aix5_NR_aio_nwait_timeout)
-
-extern Int VG_(aix5_NR_kaio_stats);
-#define __NR_AIX5_kaio_stats VG_(aix5_NR_kaio_stats)
-
-extern Int VG_(aix5_NR_aio_cntl);
-#define __NR_AIX5_aio_cntl VG_(aix5_NR_aio_cntl)
-
-extern Int VG_(aix5_NR_listio);
-#define __NR_AIX5_listio VG_(aix5_NR_listio)
-
-extern Int VG_(aix5_NR_acancel);
-#define __NR_AIX5_acancel VG_(aix5_NR_acancel)
-
-extern Int VG_(aix5_NR_iosuspend);
-#define __NR_AIX5_iosuspend VG_(aix5_NR_iosuspend)
-
-extern Int VG_(aix5_NR_kaio_rdwr);
-#define __NR_AIX5_kaio_rdwr VG_(aix5_NR_kaio_rdwr)
-
-extern Int VG_(aix5_NR_aio_nwait);
-#define __NR_AIX5_aio_nwait VG_(aix5_NR_aio_nwait)
-
-extern Int VG_(aix5_NR__posix_iofsync);
-#define __NR_AIX5__posix_iofsync VG_(aix5_NR__posix_iofsync)
-
-extern Int VG_(aix5_NR__posix_aio_nwait_timeout);
-#define __NR_AIX5__posix_aio_nwait_timeout VG_(aix5_NR__posix_aio_nwait_timeout)
-
-extern Int VG_(aix5_NR__posix_kaio_stats);
-#define __NR_AIX5__posix_kaio_stats VG_(aix5_NR__posix_kaio_stats)
-
-extern Int VG_(aix5_NR__posix_listio);
-#define __NR_AIX5__posix_listio VG_(aix5_NR__posix_listio)
-
-extern Int VG_(aix5_NR__posix_acancel);
-#define __NR_AIX5__posix_acancel VG_(aix5_NR__posix_acancel)
-
-extern Int VG_(aix5_NR__posix_iosuspend);
-#define __NR_AIX5__posix_iosuspend VG_(aix5_NR__posix_iosuspend)
-
-extern Int VG_(aix5_NR__posix_kaio_rdwr);
-#define __NR_AIX5__posix_kaio_rdwr VG_(aix5_NR__posix_kaio_rdwr)
-
-extern Int VG_(aix5_NR__posix_aio_cntl);
-#define __NR_AIX5__posix_aio_cntl VG_(aix5_NR__posix_aio_cntl)
-
-extern Int VG_(aix5_NR__posix_aio_nwait);
-#define __NR_AIX5__posix_aio_nwait VG_(aix5_NR__posix_aio_nwait)
-
-extern Int VG_(aix5_NR_nfs_cntl);
-#define __NR_AIX5_nfs_cntl VG_(aix5_NR_nfs_cntl)
-
-extern Int VG_(aix5_NR_nfssvc);
-#define __NR_AIX5_nfssvc VG_(aix5_NR_nfssvc)
-
-extern Int VG_(aix5_NR_nfs_getfh);
-#define __NR_AIX5_nfs_getfh VG_(aix5_NR_nfs_getfh)
-
-extern Int VG_(aix5_NR_exportfs);
-#define __NR_AIX5_exportfs VG_(aix5_NR_exportfs)
-
-extern Int VG_(aix5_NR_lm_svc);
-#define __NR_AIX5_lm_svc VG_(aix5_NR_lm_svc)
-
-extern Int VG_(aix5_NR_pw_config);
-#define __NR_AIX5_pw_config VG_(aix5_NR_pw_config)
-
-extern Int VG_(aix5_NR_pw_post);
-#define __NR_AIX5_pw_post VG_(aix5_NR_pw_post)
-
-extern Int VG_(aix5_NR_pw_wait);
-#define __NR_AIX5_pw_wait VG_(aix5_NR_pw_wait)
-
-extern Int VG_(aix5_NR_pw_loadavg);
-#define __NR_AIX5_pw_loadavg VG_(aix5_NR_pw_loadavg)
-
-extern Int VG_(aix5_NR_pw_debug);
-#define __NR_AIX5_pw_debug VG_(aix5_NR_pw_debug)
-
-/* Extras for AIX 5.3 */
-
-extern Int VG_(aix5_NR___libc_sbrk);
-#define __NR_AIX5___libc_sbrk VG_(aix5_NR___libc_sbrk)
-
-extern Int VG_(aix5_NR_thread_waitlock_);
-#define __NR_AIX5_thread_waitlock_ VG_(aix5_NR_thread_waitlock_)
-
-extern Int VG_(aix5_NR__fp_fpscrx_sc);
-#define __NR_AIX5__fp_fpscrx_sc VG_(aix5_NR__fp_fpscrx_sc)
-
-extern Int VG_(aix5_NR_sched_get_priority_max);
-#define __NR_AIX5_sched_get_priority_max \
-        VG_(aix5_NR_sched_get_priority_max)
-
-/* Extras for AIX 5.3 64-bit mode. */
-
-extern Int VG_(aix5_NR_kload);
-#define __NR_AIX5_kload VG_(aix5_NR_kload)
-
-extern Int VG_(aix5_NR__fp_fpscrx64_);
-#define __NR_AIX5__fp_fpscrx64_ VG_(aix5_NR__fp_fpscrx64_)
-
-extern Int VG_(aix5_NR_kunload64);
-#define __NR_AIX5_kunload64 VG_(aix5_NR_kunload64)
-
-/* We need an extra fake syscall to denote signal handler returns, as
-   used in sigframe-ppc32/64-aix5.h.  Since we don't know what number we
-   can assign to it, monitor the numbers passed to
-   VG_(aix5_register_syscall), and set it to 10000+the largest syscall
-   nummber seen. */
-
-extern Int VG_(aix5_NR_FAKE_SIGRETURN);
-#define __NR_AIX5_FAKE_SIGRETURN VG_(aix5_NR_FAKE_SIGRETURN)
-
-
-//--------------------------------------------------------------
-// "Bindings" to Linux-like names
-//--------------------------------------------------------------
-
-#define __NR_getppid         __NR_AIX5__getppid
-#define __NR_getpid          __NR_AIX5__getpid
-#define __NR_close           __NR_AIX5_close
-#define __NR_open            __NR_AIX5_open
-#define __NR_mmap            __NR_AIX5_mmap
-#define __NR_write           __NR_AIX5_kwrite
-#define __NR_exit            __NR_AIX5__exit
-#define __NR_read            __NR_AIX5_kread
-#define __NR_getrlimit       __NR_AIX5_appgetrlimit
-#define __NR_setrlimit       __NR_AIX5_appsetrlimit
-#define __NR_rt_sigaction    __NR_AIX5__sigaction
-#define __NR_rt_sigprocmask  __NR_AIX5_sigprocmask
-#define __NR__sigpending     __NR_AIX5__sigpending
-#define __NR__sigsuspend     __NR_AIX5__sigsuspend
-#define __NR_fcntl           __NR_AIX5_kfcntl
-#define __NR_unlink          __NR_AIX5_unlink
-#define __NR_pipe            __NR_AIX5_pipe
-#define __NR_mprotect        __NR_AIX5_mprotect
-#define __NR_munmap          __NR_AIX5_munmap
-#define __NR_fork            __NR_AIX5_kfork
-#define __NR_execve          __NR_AIX5_execve
-#define __NR_rename          __NR_AIX5_rename
-#define __NR_access          __NR_AIX5_access
-#define __NR_kill            __NR_AIX5_kill
-#define __NR_tkill           __NR_AIX5_thread_kill
-#define __NR_getgroups       __NR_AIX5_getgroups
-#define __NR_sched_yield     __NR_AIX5_yield
-
-//--------------------------------------------------------------
-// BOGUS
-//--------------------------------------------------------------
-
-/* XXXXXXXXX BOGUS */
-#define __NR_rt_sigreturn    9999
-#define __NR_getegid         9999
-#define __NR_ptrace          9999
-#define __NR_rt_sigtimedwait 9999
-#define __NR_lseek           9999
-#define __NR_fstat           9999
-#define __NR_dup             9999
-#define __NR_getcwd          9999
-#define __NR_readlink        9999
-#define __NR_getdents        9999
-#define __NR_gettid          9999
-#define __NR_getpgrp         9999
-#define __NR_geteuid         9999
-
-
-#endif /* __VKI_SCNUMS_AIX5_H */
-
-/*--------------------------------------------------------------------*/
-/*--- end                                                          ---*/
-/*--------------------------------------------------------------------*/
diff --git a/main/include/vki/vki-scnums-amd64-linux.h b/main/include/vki/vki-scnums-amd64-linux.h
index f891f94..81db239 100644
--- a/main/include/vki/vki-scnums-amd64-linux.h
+++ b/main/include/vki/vki-scnums-amd64-linux.h
@@ -8,7 +8,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2000-2010 Julian Seward 
+   Copyright (C) 2000-2011 Julian Seward 
       jseward@acm.org
 
    This program is free software; you can redistribute it and/or
@@ -379,7 +379,17 @@
 #define __NR_preadv             295
 #define __NR_pwritev            296
 #define __NR_rt_tgsigqueueinfo  297
-#define __NR_perf_counter_open  298
+#define __NR_perf_event_open    298
+#define __NR_recvmmsg           299
+#define __NR_fanotify_init      300
+#define __NR_fanotify_mark      301
+#define __NR_prlimit64          302
+#define __NR_name_to_handle_at  303
+#define __NR_open_by_handle_at  304
+#define __NR_clock_adjtime      305
+#define __NR_syncfs             306
+#define __NR_sendmmsg           307
+#define __NR_setns              308
 
 #endif /* __VKI_SCNUMS_AMD64_LINUX_H */
 
diff --git a/main/include/vki/vki-scnums-arm-linux.h b/main/include/vki/vki-scnums-arm-linux.h
index 6300897..0a184fa 100644
--- a/main/include/vki/vki-scnums-arm-linux.h
+++ b/main/include/vki/vki-scnums-arm-linux.h
@@ -8,7 +8,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2008-2010 Evan Geller
+   Copyright (C) 2008-2011 Evan Geller
       gaze@bea.ms
 
    This program is free software; you can redistribute it and/or
@@ -382,7 +382,7 @@
 #define __NR_vmsplice			343
 #define __NR_move_pages			344
 #define __NR_getcpu			345
-					/* 346 for epoll_pwait */
+#define __NR_epoll_pwait		346
 #define __NR_kexec_load			347
 #define __NR_utimensat			348
 #define __NR_signalfd			349
@@ -397,6 +397,21 @@
 #define __NR_dup3                       358
 #define __NR_pipe2                      359
 #define __NR_inotify_init1              360
+#define __NR_preadv			361
+#define __NR_pwritev			362
+#define __NR_rt_tgsigqueueinfo		363
+#define __NR_perf_event_open		364
+#define __NR_recvmmsg			365
+#define __NR_accept4			366
+#define __NR_fanotify_init		367
+#define __NR_fanotify_mark		368
+#define __NR_prlimit64			369
+#define __NR_name_to_handle_at		370
+#define __NR_open_by_handle_at		371
+#define __NR_clock_adjtime		372
+#define __NR_syncfs			373
+#define __NR_sendmmsg			374
+#define __NR_setns			375
 
 
 
diff --git a/main/include/vki/vki-scnums-darwin.h b/main/include/vki/vki-scnums-darwin.h
index f39f28e..516b97c 100644
--- a/main/include/vki/vki-scnums-darwin.h
+++ b/main/include/vki/vki-scnums-darwin.h
@@ -7,7 +7,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2007-2010 Apple Inc.
+   Copyright (C) 2007-2011 Apple Inc.
       Greg Parker  gparker@apple.com
 
    This program is free software; you can redistribute it and/or
@@ -515,18 +515,18 @@
 			/* 298  old new_system_shared_regions */
 			/* 299  old shared_region_map_file_np */
 			/* 300  old shared_region_make_private_np */
-			/* 301 */
-			/* 302 */
-			/* 303 */
-			/* 304 */
-			/* 305 */
-			/* 306 */
-			/* 307 */
-			/* 308 */
+#define __NR_psynch_mutexwait VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(301)
+#define __NR_psynch_mutexdrop VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(302)
+#define __NR_psynch_cvbroad   VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(303)
+#define __NR_psynch_cvsignal  VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(304)
+#define __NR_psynch_cvwait    VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(305)
+#define __NR_psynch_rw_rdlock VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(306)
+#define __NR_psynch_rw_wrlock VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(307)
+#define __NR_psynch_rw_unlock VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(308)
 			/* 309 */
 #define	__NR_getsid         VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(310)
 #define	__NR_settid_with_pid VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(311)
-			/* 312 */
+#define __NR_psynch_cvclrprepost VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(312)
 #define	__NR_aio_fsync      VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(313)
 #define	__NR_aio_return     VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(314)
 #define	__NR_aio_suspend    VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(315)
diff --git a/main/include/vki/vki-scnums-ppc32-linux.h b/main/include/vki/vki-scnums-ppc32-linux.h
index 2235653..3eb20ba 100644
--- a/main/include/vki/vki-scnums-ppc32-linux.h
+++ b/main/include/vki/vki-scnums-ppc32-linux.h
@@ -8,7 +8,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2005-2010 Julian Seward
+   Copyright (C) 2005-2011 Julian Seward
       jseward@acm.org
 
    This program is free software; you can redistribute it and/or
@@ -361,10 +361,38 @@
 #define __NR_dup3               316
 #define __NR_pipe2              317
 #define __NR_inotify_init1      318
-#define __NR_perf_counter_open  319
+#define __NR_perf_event_open    319
 #define __NR_preadv             320
 #define __NR_pwritev            321
 #define __NR_rt_tgsigqueueinfo  322
+#define __NR_fanotify_init	323
+#define __NR_fanotify_mark	324
+#define __NR_prlimit64		325
+#define __NR_socket		326
+#define __NR_bind		327
+#define __NR_connect		328
+#define __NR_listen		329
+#define __NR_accept		330
+#define __NR_getsockname	331
+#define __NR_getpeername	332
+#define __NR_socketpair		333
+#define __NR_send		334
+#define __NR_sendto		335
+#define __NR_recv		336
+#define __NR_recvfrom		337
+#define __NR_shutdown		338
+#define __NR_setsockopt		339
+#define __NR_getsockopt		340
+#define __NR_sendmsg		341
+#define __NR_recvmsg		342
+#define __NR_recvmmsg		343
+#define __NR_accept4		344
+#define __NR_name_to_handle_at	345
+#define __NR_open_by_handle_at	346
+#define __NR_clock_adjtime	347
+#define __NR_syncfs		348
+#define __NR_sendmmsg		349
+#define __NR_setns		350
 
 #endif /* __VKI_SCNUMS_PPC32_LINUX_H */
 
diff --git a/main/include/vki/vki-scnums-ppc64-linux.h b/main/include/vki/vki-scnums-ppc64-linux.h
index e019e6f..75c5b82 100644
--- a/main/include/vki/vki-scnums-ppc64-linux.h
+++ b/main/include/vki/vki-scnums-ppc64-linux.h
@@ -8,7 +8,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2005-2010 Julian Seward
+   Copyright (C) 2005-2011 Julian Seward
       jseward@acm.org
 
    This program is free software; you can redistribute it and/or
@@ -353,10 +353,38 @@
 #define __NR_dup3               316
 #define __NR_pipe2              317
 #define __NR_inotify_init1      318
-#define __NR_perf_counter_open  319
+#define __NR_perf_event_open    319
 #define __NR_preadv             320
 #define __NR_pwritev            321
 #define __NR_rt_tgsigqueueinfo  322
+#define __NR_fanotify_init	323
+#define __NR_fanotify_mark	324
+#define __NR_prlimit64		325
+#define __NR_socket		326
+#define __NR_bind		327
+#define __NR_connect		328
+#define __NR_listen		329
+#define __NR_accept		330
+#define __NR_getsockname	331
+#define __NR_getpeername	332
+#define __NR_socketpair		333
+#define __NR_send		334
+#define __NR_sendto		335
+#define __NR_recv		336
+#define __NR_recvfrom		337
+#define __NR_shutdown		338
+#define __NR_setsockopt		339
+#define __NR_getsockopt		340
+#define __NR_sendmsg		341
+#define __NR_recvmsg		342
+#define __NR_recvmmsg		343
+#define __NR_accept4		344
+#define __NR_name_to_handle_at	345
+#define __NR_open_by_handle_at	346
+#define __NR_clock_adjtime	347
+#define __NR_syncfs		348
+#define __NR_sendmmsg		349
+#define __NR_setns		350
 
 #endif /* __VKI_SCNUMS_PPC64_LINUX_H */
 
diff --git a/main/include/vki/vki-scnums-s390x-linux.h b/main/include/vki/vki-scnums-s390x-linux.h
new file mode 100644
index 0000000..348d36a
--- /dev/null
+++ b/main/include/vki/vki-scnums-s390x-linux.h
@@ -0,0 +1,345 @@
+
+/*--------------------------------------------------------------------*/
+/*--- System call numbers for s390x-linux.                         ---*/
+/*---                                     vki-scnums-s390x-linux.h ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+   This file is part of Valgrind, a dynamic binary instrumentation
+   framework.
+
+   Copyright IBM Corp. 2010-2011
+
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307, USA.
+
+   The GNU General Public License is contained in the file COPYING.
+*/
+
+/* Contributed by Florian Krohm and Christian Borntraeger. */
+
+#ifndef __VKI_SCNUMS_S390X_LINUX_H
+#define __VKI_SCNUMS_S390X_LINUX_H
+
+//----------------------------------------------------------------------
+// From linux-2.6.39.2/include/asm-s390/unistd.h
+//----------------------------------------------------------------------
+
+/*
+ * This file contains the system call numbers.
+ */
+
+#define __NR_exit                 1
+#define __NR_fork                 2
+#define __NR_read                 3
+#define __NR_write                4
+#define __NR_open                 5
+#define __NR_close                6
+#define __NR_restart_syscall	  7
+#define __NR_creat                8
+#define __NR_link                 9
+#define __NR_unlink              10
+#define __NR_execve              11
+#define __NR_chdir               12
+#define __NR_mknod               14
+#define __NR_chmod               15
+#define __NR_lseek               19
+#define __NR_getpid              20
+#define __NR_mount               21
+#define __NR_umount              22
+#define __NR_ptrace              26
+#define __NR_alarm               27
+#define __NR_pause               29
+#define __NR_utime               30
+#define __NR_access              33
+#define __NR_nice                34
+#define __NR_sync                36
+#define __NR_kill                37
+#define __NR_rename              38
+#define __NR_mkdir               39
+#define __NR_rmdir               40
+#define __NR_dup                 41
+#define __NR_pipe                42
+#define __NR_times               43
+#define __NR_brk                 45
+#define __NR_signal              48
+#define __NR_acct                51
+#define __NR_umount2             52
+#define __NR_ioctl               54
+#define __NR_fcntl               55
+#define __NR_setpgid             57
+#define __NR_umask               60
+#define __NR_chroot              61
+#define __NR_ustat               62
+#define __NR_dup2                63
+#define __NR_getppid             64
+#define __NR_getpgrp             65
+#define __NR_setsid              66
+#define __NR_sigaction           67
+#define __NR_sigsuspend          72
+#define __NR_sigpending          73
+#define __NR_sethostname         74
+#define __NR_setrlimit           75
+#define __NR_getrusage           77
+#define __NR_gettimeofday        78
+#define __NR_settimeofday        79
+#define __NR_symlink             83
+#define __NR_readlink            85
+#define __NR_uselib              86
+#define __NR_swapon              87
+#define __NR_reboot              88
+#define __NR_readdir             89
+#define __NR_mmap                90
+#define __NR_munmap              91
+#define __NR_truncate            92
+#define __NR_ftruncate           93
+#define __NR_fchmod              94
+#define __NR_getpriority         96
+#define __NR_setpriority         97
+#define __NR_statfs              99
+#define __NR_fstatfs            100
+#define __NR_socketcall         102
+#define __NR_syslog             103
+#define __NR_setitimer          104
+#define __NR_getitimer          105
+#define __NR_stat               106
+#define __NR_lstat              107
+#define __NR_fstat              108
+#define __NR_lookup_dcookie     110
+#define __NR_vhangup            111
+#define __NR_idle               112
+#define __NR_wait4              114
+#define __NR_swapoff            115
+#define __NR_sysinfo            116
+#define __NR_ipc                117
+#define __NR_fsync              118
+#define __NR_sigreturn          119
+#define __NR_clone              120
+#define __NR_setdomainname      121
+#define __NR_uname              122
+#define __NR_adjtimex           124
+#define __NR_mprotect           125
+#define __NR_sigprocmask        126
+#define __NR_create_module      127
+#define __NR_init_module        128
+#define __NR_delete_module      129
+#define __NR_get_kernel_syms    130
+#define __NR_quotactl           131
+#define __NR_getpgid            132
+#define __NR_fchdir             133
+#define __NR_bdflush            134
+#define __NR_sysfs              135
+#define __NR_personality        136
+#define __NR_afs_syscall        137 /* Syscall for Andrew File System */
+#define __NR_getdents           141
+#define __NR_flock              143
+#define __NR_msync              144
+#define __NR_readv              145
+#define __NR_writev             146
+#define __NR_getsid             147
+#define __NR_fdatasync          148
+#define __NR__sysctl            149
+#define __NR_mlock              150
+#define __NR_munlock            151
+#define __NR_mlockall           152
+#define __NR_munlockall         153
+#define __NR_sched_setparam             154
+#define __NR_sched_getparam             155
+#define __NR_sched_setscheduler         156
+#define __NR_sched_getscheduler         157
+#define __NR_sched_yield                158
+#define __NR_sched_get_priority_max     159
+#define __NR_sched_get_priority_min     160
+#define __NR_sched_rr_get_interval      161
+#define __NR_nanosleep          162
+#define __NR_mremap             163
+#define __NR_query_module       167
+#define __NR_poll               168
+#define __NR_nfsservctl         169
+#define __NR_prctl              172
+#define __NR_rt_sigreturn       173
+#define __NR_rt_sigaction       174
+#define __NR_rt_sigprocmask     175
+#define __NR_rt_sigpending      176
+#define __NR_rt_sigtimedwait    177
+#define __NR_rt_sigqueueinfo    178
+#define __NR_rt_sigsuspend      179
+#define __NR_pread64            180
+#define __NR_pwrite64           181
+#define __NR_getcwd             183
+#define __NR_capget             184
+#define __NR_capset             185
+#define __NR_sigaltstack        186
+#define __NR_sendfile           187
+#define __NR_getpmsg		188
+#define __NR_putpmsg		189
+#define __NR_vfork		190
+#define __NR_pivot_root         217
+#define __NR_mincore            218
+#define __NR_madvise            219
+#define __NR_getdents64		220
+#define __NR_readahead		222
+#define __NR_setxattr		224
+#define __NR_lsetxattr		225
+#define __NR_fsetxattr		226
+#define __NR_getxattr		227
+#define __NR_lgetxattr		228
+#define __NR_fgetxattr		229
+#define __NR_listxattr		230
+#define __NR_llistxattr		231
+#define __NR_flistxattr		232
+#define __NR_removexattr	233
+#define __NR_lremovexattr	234
+#define __NR_fremovexattr	235
+#define __NR_gettid		236
+#define __NR_tkill		237
+#define __NR_futex		238
+#define __NR_sched_setaffinity	239
+#define __NR_sched_getaffinity	240
+#define __NR_tgkill		241
+/* Number 242 is reserved for tux */
+#define __NR_io_setup		243
+#define __NR_io_destroy		244
+#define __NR_io_getevents	245
+#define __NR_io_submit		246
+#define __NR_io_cancel		247
+#define __NR_exit_group		248
+#define __NR_epoll_create	249
+#define __NR_epoll_ctl		250
+#define __NR_epoll_wait		251
+#define __NR_set_tid_address	252
+#define __NR_fadvise64		253
+#define __NR_timer_create	254
+#define __NR_timer_settime	(__NR_timer_create+1)
+#define __NR_timer_gettime	(__NR_timer_create+2)
+#define __NR_timer_getoverrun	(__NR_timer_create+3)
+#define __NR_timer_delete	(__NR_timer_create+4)
+#define __NR_clock_settime	(__NR_timer_create+5)
+#define __NR_clock_gettime	(__NR_timer_create+6)
+#define __NR_clock_getres	(__NR_timer_create+7)
+#define __NR_clock_nanosleep	(__NR_timer_create+8)
+/* Number 263 is reserved for vserver */
+#define __NR_statfs64		265
+#define __NR_fstatfs64		266
+#define __NR_remap_file_pages	267
+/* Number 268 is reserved for new sys_mbind */
+/* Number 269 is reserved for new sys_get_mempolicy */
+/* Number 270 is reserved for new sys_set_mempolicy */
+#define __NR_mq_open		271
+#define __NR_mq_unlink		272
+#define __NR_mq_timedsend	273
+#define __NR_mq_timedreceive	274
+#define __NR_mq_notify		275
+#define __NR_mq_getsetattr	276
+#define __NR_kexec_load		277
+#define __NR_add_key		278
+#define __NR_request_key	279
+#define __NR_keyctl		280
+#define __NR_waitid		281
+#define __NR_ioprio_set		282
+#define __NR_ioprio_get		283
+#define __NR_inotify_init	284
+#define __NR_inotify_add_watch	285
+#define __NR_inotify_rm_watch	286
+/* Number 287 is reserved for new sys_migrate_pages */
+#define __NR_openat		288
+#define __NR_mkdirat		289
+#define __NR_mknodat		290
+#define __NR_fchownat		291
+#define __NR_futimesat		292
+#define __NR_unlinkat		294
+#define __NR_renameat		295
+#define __NR_linkat		296
+#define __NR_symlinkat		297
+#define __NR_readlinkat		298
+#define __NR_fchmodat		299
+#define __NR_faccessat		300
+#define __NR_pselect6		301
+#define __NR_ppoll		302
+#define __NR_unshare		303
+#define __NR_set_robust_list	304
+#define __NR_get_robust_list	305
+#define __NR_splice		306
+#define __NR_sync_file_range	307
+#define __NR_tee		308
+#define __NR_vmsplice		309
+/* Number 310 is reserved for new sys_move_pages */
+#define __NR_getcpu		311
+#define __NR_epoll_pwait	312
+#define __NR_utimes		313
+#define __NR_fallocate		314
+#define __NR_utimensat		315
+#define __NR_signalfd		316
+#define __NR_timerfd		317
+#define __NR_eventfd		318
+#define __NR_timerfd_create	319
+#define __NR_timerfd_settime	320
+#define __NR_timerfd_gettime	321
+#define __NR_signalfd4		322
+#define __NR_eventfd2		323
+#define __NR_inotify_init1	324
+#define __NR_pipe2		325
+#define __NR_dup3		326
+#define __NR_epoll_create1	327
+#define	__NR_preadv		328
+#define	__NR_pwritev		329
+#define __NR_rt_tgsigqueueinfo	330
+#define __NR_perf_event_open	331
+#define __NR_fanotify_init	332
+#define __NR_fanotify_mark	333
+#define __NR_prlimit64		334
+#define __NR_name_to_handle_at	335
+#define __NR_open_by_handle_at	336
+#define __NR_clock_adjtime	337
+#define __NR_syncfs		338
+#define NR_syscalls 339
+
+/* 
+ * There are some system calls that are not present on 64 bit, some
+ * have a different name although they do the same (e.g. __NR_chown32
+ * is __NR_chown on 64 bit).
+ */
+#ifdef VGA_s390x
+
+#define __NR_select		142
+#define __NR_getrlimit		191	/* SuS compliant getrlimit */
+#define __NR_lchown  		198
+#define __NR_getuid  		199
+#define __NR_getgid  		200
+#define __NR_geteuid  		201
+#define __NR_getegid  		202
+#define __NR_setreuid  		203
+#define __NR_setregid  		204
+#define __NR_getgroups  	205
+#define __NR_setgroups  	206
+#define __NR_fchown  		207
+#define __NR_setresuid  	208
+#define __NR_getresuid  	209
+#define __NR_setresgid  	210
+#define __NR_getresgid  	211
+#define __NR_chown  		212
+#define __NR_setuid  		213
+#define __NR_setgid  		214
+#define __NR_setfsuid  		215
+#define __NR_setfsgid  		216
+#define __NR_newfstatat		293
+
+#endif
+
+#endif /* __VKI_SCNUMS_S390X_LINUX_H */
+
+/*--------------------------------------------------------------------*/
+/*--- end                                                          ---*/
+/*--------------------------------------------------------------------*/
diff --git a/main/include/vki/vki-scnums-x86-linux.h b/main/include/vki/vki-scnums-x86-linux.h
index f194277..9bdd86d 100644
--- a/main/include/vki/vki-scnums-x86-linux.h
+++ b/main/include/vki/vki-scnums-x86-linux.h
@@ -8,7 +8,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2000-2010 Julian Seward 
+   Copyright (C) 2000-2011 Julian Seward 
       jseward@acm.org
 
    This program is free software; you can redistribute it and/or
@@ -370,7 +370,17 @@
 #define __NR_preadv             333
 #define __NR_pwritev            334
 #define __NR_rt_tgsigqueueinfo  335
-#define __NR_perf_counter_open  336
+#define __NR_perf_event_open	336
+#define __NR_recvmmsg		337
+#define __NR_fanotify_init	338
+#define __NR_fanotify_mark	339
+#define __NR_prlimit64		340
+#define __NR_name_to_handle_at	341
+#define __NR_open_by_handle_at  342
+#define __NR_clock_adjtime	343
+#define __NR_syncfs             344
+#define __NR_sendmmsg		345
+#define __NR_setns		346
 
 #endif /* __VKI_SCNUMS_X86_LINUX_H */
 
diff --git a/main/include/vki/vki-x86-linux.h b/main/include/vki/vki-x86-linux.h
index 8f8aec8..2a14104 100644
--- a/main/include/vki/vki-x86-linux.h
+++ b/main/include/vki/vki-x86-linux.h
@@ -7,7 +7,7 @@
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2000-2010 Julian Seward 
+   Copyright (C) 2000-2011 Julian Seward 
       jseward@acm.org
 
    This program is free software; you can redistribute it and/or