From 527c412519eb63ed354790f4291c3728815d11a6 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Thu, 17 Sep 2020 09:41:58 +0200 Subject: compat: add a compat_need_64bit_alignment_fixup() helper Add a helper to check if the calling syscall needs a fixup for non-natural 64-bit type alignment in the compat ABI. This will only return true for i386 syscalls on x86_64. Signed-off-by: Christoph Hellwig Signed-off-by: Al Viro --- include/linux/compat.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/linux/compat.h') diff --git a/include/linux/compat.h b/include/linux/compat.h index d38c4d7e83bd..f0026a344482 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h @@ -932,6 +932,15 @@ static inline bool in_compat_syscall(void) { return false; } #endif /* CONFIG_COMPAT */ +/* + * Some legacy ABIs like the i386 one use less than natural alignment for 64-bit + * types, and will need special compat treatment for that. Most architectures + * don't need that special handling even for compat syscalls. + */ +#ifndef compat_need_64bit_alignment_fixup +#define compat_need_64bit_alignment_fixup() false +#endif + /* * A pointer passed in from user mode. This should not * be used for syscall parameters, just declare them -- cgit