diff options
author | Chris Metcalf <cmetcalf@mellanox.com> | 2016-06-15 21:19:04 +0200 |
---|---|---|
committer | Chris Metcalf <cmetcalf@mellanox.com> | 2016-06-15 21:31:01 +0200 |
commit | ca768667d87331d2e2fc84e1546fbf96f22ed5fe (patch) | |
tree | 54464ddab4d52317a759011adaaab5e56ec281ee /arch/tile/kernel/sys.c | |
parent | tile: allow disabling CONFIG_EARLY_PRINTK (diff) | |
download | linux-ca768667d87331d2e2fc84e1546fbf96f22ed5fe.tar.xz linux-ca768667d87331d2e2fc84e1546fbf96f22ed5fe.zip |
tile 32-bit big-endian: fix bugs in syscall argument order
The glibc __LONG_LONG_PAIR passes arguments in a different
order for BE platforms vs LE platforms. Adjust the expectations
in the kernel 32-bit syscall routines for BE to match.
Signed-off-by: Chris Metcalf <cmetcalf@mellanox.com>
Diffstat (limited to 'arch/tile/kernel/sys.c')
-rw-r--r-- | arch/tile/kernel/sys.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/arch/tile/kernel/sys.c b/arch/tile/kernel/sys.c index 38debe706061..c7418dcbbb08 100644 --- a/arch/tile/kernel/sys.c +++ b/arch/tile/kernel/sys.c @@ -33,6 +33,7 @@ #include <asm/pgtable.h> #include <asm/homecache.h> #include <asm/cachectl.h> +#include <asm/byteorder.h> #include <arch/chip.h> SYSCALL_DEFINE3(cacheflush, unsigned long, addr, unsigned long, len, @@ -59,13 +60,19 @@ SYSCALL_DEFINE3(cacheflush, unsigned long, addr, unsigned long, len, #if !defined(__tilegx__) || defined(CONFIG_COMPAT) -ssize_t sys32_readahead(int fd, u32 offset_lo, u32 offset_hi, u32 count) +#ifdef __BIG_ENDIAN +#define SYSCALL_PAIR(name) u32 name ## _hi, u32 name ## _lo +#else +#define SYSCALL_PAIR(name) u32 name ## _lo, u32 name ## _hi +#endif + +ssize_t sys32_readahead(int fd, SYSCALL_PAIR(offset), u32 count) { return sys_readahead(fd, ((loff_t)offset_hi << 32) | offset_lo, count); } -int sys32_fadvise64_64(int fd, u32 offset_lo, u32 offset_hi, - u32 len_lo, u32 len_hi, int advice) +int sys32_fadvise64_64(int fd, SYSCALL_PAIR(offset), + SYSCALL_PAIR(len), int advice) { return sys_fadvise64_64(fd, ((loff_t)offset_hi << 32) | offset_lo, ((loff_t)len_hi << 32) | len_lo, advice); |