linux-user: Use correct target SHMLBA in shmat()
commitee8e76141b4dd00f8e97fda274876a17f9a46bbe
authorPeter Maydell <peter.maydell@linaro.org>
Mon, 11 Jul 2016 15:48:11 +0000 (11 16:48 +0100)
committerRiku Voipio <riku.voipio@linaro.org>
Wed, 21 Sep 2016 11:28:52 +0000 (21 14:28 +0300)
tree97fad83fed31bae2f164c1a525e13b468e12cfbc
parent0ef9ea290ed9319cb788ea40be06dd18b32ba05a
linux-user: Use correct target SHMLBA in shmat()

The shmat() handling needs to do target-specific handling
of the attach address for shmat():
 * if the SHM_RND flag is passed, the address is rounded
   down to a SHMLBA boundary
 * if SHM_RND is not passed, then the call is failed EINVAL
   if the address is not a multiple of SHMLBA

Since SHMLBA is target-specific, we need to do this
checking and rounding in QEMU and can't leave it up to the
host syscall.

Allow targets to define TARGET_FORCE_SHMLBA and provide
a target_shmlba() function if appropriate, and update
do_shmat() to honour them.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
linux-user/arm/target_syscall.h
linux-user/mips/target_syscall.h
linux-user/mips64/target_syscall.h
linux-user/sh4/target_syscall.h
linux-user/sparc/target_syscall.h
linux-user/syscall.c