summaryrefslogtreecommitdiff
path: root/arch/arm64
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-12-14 22:49:35 +0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-12-20 03:07:40 +0400
commit9b064fc3f95a8e44e929fdf4d6037334ea03d15b (patch)
treedd1a2a6075667841f88b1ea8b62f4df2e18c3c68 /arch/arm64
parent5c49574ffd7ac07eae8c3b065d19e6ebc7e4760f (diff)
downloadlinux-9b064fc3f95a8e44e929fdf4d6037334ea03d15b.tar.xz
new helper: compat_user_stack_pointer()
Compat counterpart of current_user_stack_pointer(); for most of the biarch architectures those two are identical, but e.g. arm64 and arm use different registers for stack pointer... Note that amd64 variants of current_user_stack_pointer/compat_user_stack_pointer do *not* rely on pt_regs having been through FIXUP_TOP_OF_STACK. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/arm64')
-rw-r--r--arch/arm64/include/asm/compat.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/arm64/include/asm/compat.h b/arch/arm64/include/asm/compat.h
index 37e610dc084e..d9ec40217a27 100644
--- a/arch/arm64/include/asm/compat.h
+++ b/arch/arm64/include/asm/compat.h
@@ -209,10 +209,11 @@ static inline compat_uptr_t ptr_to_compat(void __user *uptr)
return (u32)(unsigned long)uptr;
}
+#define compat_user_stack_pointer() (current_pt_regs()->compat_sp)
+
static inline void __user *arch_compat_alloc_user_space(long len)
{
- struct pt_regs *regs = task_pt_regs(current);
- return (void __user *)regs->compat_sp - len;
+ return (void __user *)compat_user_stack_pointer() - len;
}
struct compat_ipc64_perm {