Rationalise the mmap system call handling - after examining the kernel
source it turns out that there are five different versions of mmap for
the three platforms we currently support:

  - On x86-linux there is mmap (aka old_mmap) which takes the
    arguments in a memory block and the offset in bytes; and
    mmap2 (aka sys_mmap2) which takes the arguments in the normal
    way and the offset in pages.

  - On ppc32-linux there is mmap (aka sys_mmap) which takes the
    arguments in the normal way and the offset in bytes; and
    mmap2 (aka sys_mmap2) which takes the arguments in the normal
    way and the offset in pages.

  - On amd64-linux everything is simple and there is just the one
    call, mmap (aka sys_mmap)  which takes the arguments in the normal
    way and the offset in bytes.

To reconcile all this I have created a generic handler and then
written five platform specific wrappers which normalise all the
arguments and then call the generic handler.

I have also modified the address space manager to use mmap2 rather
than mmap on x86 and ppc32 so that large offsets can be correctly
handled.

There is still an issue of OffT truncating offsets as we go through
the address space manager that will need to be addressed.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4834 a5019735-40e9-0310-863c-91ae7b9d1cf9
8 files changed