aboutsummaryrefslogtreecommitdiffstats
path: root/arch/tile/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-07-27 13:54:11 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-07-27 13:54:11 -0400
commitf9abf53af4c78b08da44d841d23308c4f4d74c83 (patch)
treed6da18a9904884196112835cdb76e8c2a84e4fde /arch/tile/kernel
parentba4f67899f9b3091744da4a4ce4057123ed02c4e (diff)
parentcdf8b4633075f2171d440d2e37c9c2609019a81a (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile
Pull tile architecture updates from Chris Metcalf: "A few stray changes" * git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile: tile: Define AT_VECTOR_SIZE_ARCH for ARCH_DLINFO tile: support gcc 7 optimization to use __multi3 tile 32-bit big-endian: fix bugs in syscall argument order tile: allow disabling CONFIG_EARLY_PRINTK
Diffstat (limited to 'arch/tile/kernel')
-rw-r--r--arch/tile/kernel/compat.c35
-rw-r--r--arch/tile/kernel/sys.c13
2 files changed, 32 insertions, 16 deletions
diff --git a/arch/tile/kernel/compat.c b/arch/tile/kernel/compat.c
index 49120843ff96..bdaf71d31a4a 100644
--- a/arch/tile/kernel/compat.c
+++ b/arch/tile/kernel/compat.c
@@ -23,42 +23,50 @@
23#include <linux/uaccess.h> 23#include <linux/uaccess.h>
24#include <linux/signal.h> 24#include <linux/signal.h>
25#include <asm/syscalls.h> 25#include <asm/syscalls.h>
26#include <asm/byteorder.h>
26 27
27/* 28/*
28 * Syscalls that take 64-bit numbers traditionally take them in 32-bit 29 * Syscalls that take 64-bit numbers traditionally take them in 32-bit
29 * "high" and "low" value parts on 32-bit architectures. 30 * "high" and "low" value parts on 32-bit architectures.
30 * In principle, one could imagine passing some register arguments as 31 * In principle, one could imagine passing some register arguments as
31 * fully 64-bit on TILE-Gx in 32-bit mode, but it seems easier to 32 * fully 64-bit on TILE-Gx in 32-bit mode, but it seems easier to
32 * adapt the usual convention. 33 * adopt the usual convention.
33 */ 34 */
34 35
36#ifdef __BIG_ENDIAN
37#define SYSCALL_PAIR(name) u32, name ## _hi, u32, name ## _lo
38#else
39#define SYSCALL_PAIR(name) u32, name ## _lo, u32, name ## _hi
40#endif
41
35COMPAT_SYSCALL_DEFINE4(truncate64, char __user *, filename, u32, dummy, 42COMPAT_SYSCALL_DEFINE4(truncate64, char __user *, filename, u32, dummy,
36 u32, low, u32, high) 43 SYSCALL_PAIR(length))
37{ 44{
38 return sys_truncate(filename, ((loff_t)high << 32) | low); 45 return sys_truncate(filename, ((loff_t)length_hi << 32) | length_lo);
39} 46}
40 47
41COMPAT_SYSCALL_DEFINE4(ftruncate64, unsigned int, fd, u32, dummy, 48COMPAT_SYSCALL_DEFINE4(ftruncate64, unsigned int, fd, u32, dummy,
42 u32, low, u32, high) 49 SYSCALL_PAIR(length))
43{ 50{
44 return sys_ftruncate(fd, ((loff_t)high << 32) | low); 51 return sys_ftruncate(fd, ((loff_t)length_hi << 32) | length_lo);
45} 52}
46 53
47COMPAT_SYSCALL_DEFINE6(pread64, unsigned int, fd, char __user *, ubuf, 54COMPAT_SYSCALL_DEFINE6(pread64, unsigned int, fd, char __user *, ubuf,
48 size_t, count, u32, dummy, u32, low, u32, high) 55 size_t, count, u32, dummy, SYSCALL_PAIR(offset))
49{ 56{
50 return sys_pread64(fd, ubuf, count, ((loff_t)high << 32) | low); 57 return sys_pread64(fd, ubuf, count,
58 ((loff_t)offset_hi << 32) | offset_lo);
51} 59}
52 60
53COMPAT_SYSCALL_DEFINE6(pwrite64, unsigned int, fd, char __user *, ubuf, 61COMPAT_SYSCALL_DEFINE6(pwrite64, unsigned int, fd, char __user *, ubuf,
54 size_t, count, u32, dummy, u32, low, u32, high) 62 size_t, count, u32, dummy, SYSCALL_PAIR(offset))
55{ 63{
56 return sys_pwrite64(fd, ubuf, count, ((loff_t)high << 32) | low); 64 return sys_pwrite64(fd, ubuf, count,
65 ((loff_t)offset_hi << 32) | offset_lo);
57} 66}
58 67
59COMPAT_SYSCALL_DEFINE6(sync_file_range2, int, fd, unsigned int, flags, 68COMPAT_SYSCALL_DEFINE6(sync_file_range2, int, fd, unsigned int, flags,
60 u32, offset_lo, u32, offset_hi, 69 SYSCALL_PAIR(offset), SYSCALL_PAIR(nbytes))
61 u32, nbytes_lo, u32, nbytes_hi)
62{ 70{
63 return sys_sync_file_range(fd, ((loff_t)offset_hi << 32) | offset_lo, 71 return sys_sync_file_range(fd, ((loff_t)offset_hi << 32) | offset_lo,
64 ((loff_t)nbytes_hi << 32) | nbytes_lo, 72 ((loff_t)nbytes_hi << 32) | nbytes_lo,
@@ -66,8 +74,7 @@ COMPAT_SYSCALL_DEFINE6(sync_file_range2, int, fd, unsigned int, flags,
66} 74}
67 75
68COMPAT_SYSCALL_DEFINE6(fallocate, int, fd, int, mode, 76COMPAT_SYSCALL_DEFINE6(fallocate, int, fd, int, mode,
69 u32, offset_lo, u32, offset_hi, 77 SYSCALL_PAIR(offset), SYSCALL_PAIR(len))
70 u32, len_lo, u32, len_hi)
71{ 78{
72 return sys_fallocate(fd, mode, ((loff_t)offset_hi << 32) | offset_lo, 79 return sys_fallocate(fd, mode, ((loff_t)offset_hi << 32) | offset_lo,
73 ((loff_t)len_hi << 32) | len_lo); 80 ((loff_t)len_hi << 32) | len_lo);
@@ -77,6 +84,8 @@ COMPAT_SYSCALL_DEFINE6(fallocate, int, fd, int, mode,
77 * Avoid bug in generic sys_llseek() that specifies offset_high and 84 * Avoid bug in generic sys_llseek() that specifies offset_high and
78 * offset_low as "unsigned long", thus making it possible to pass 85 * offset_low as "unsigned long", thus making it possible to pass
79 * a sign-extended high 32 bits in offset_low. 86 * a sign-extended high 32 bits in offset_low.
87 * Note that we do not use SYSCALL_PAIR here since glibc passes the
88 * high and low parts explicitly in that order.
80 */ 89 */
81COMPAT_SYSCALL_DEFINE5(llseek, unsigned int, fd, unsigned int, offset_high, 90COMPAT_SYSCALL_DEFINE5(llseek, unsigned int, fd, unsigned int, offset_high,
82 unsigned int, offset_low, loff_t __user *, result, 91 unsigned int, offset_low, loff_t __user *, result,
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 @@
33#include <asm/pgtable.h> 33#include <asm/pgtable.h>
34#include <asm/homecache.h> 34#include <asm/homecache.h>
35#include <asm/cachectl.h> 35#include <asm/cachectl.h>
36#include <asm/byteorder.h>
36#include <arch/chip.h> 37#include <arch/chip.h>
37 38
38SYSCALL_DEFINE3(cacheflush, unsigned long, addr, unsigned long, len, 39SYSCALL_DEFINE3(cacheflush, unsigned long, addr, unsigned long, len,
@@ -59,13 +60,19 @@ SYSCALL_DEFINE3(cacheflush, unsigned long, addr, unsigned long, len,
59 60
60#if !defined(__tilegx__) || defined(CONFIG_COMPAT) 61#if !defined(__tilegx__) || defined(CONFIG_COMPAT)
61 62
62ssize_t sys32_readahead(int fd, u32 offset_lo, u32 offset_hi, u32 count) 63#ifdef __BIG_ENDIAN
64#define SYSCALL_PAIR(name) u32 name ## _hi, u32 name ## _lo
65#else
66#define SYSCALL_PAIR(name) u32 name ## _lo, u32 name ## _hi
67#endif
68
69ssize_t sys32_readahead(int fd, SYSCALL_PAIR(offset), u32 count)
63{ 70{
64 return sys_readahead(fd, ((loff_t)offset_hi << 32) | offset_lo, count); 71 return sys_readahead(fd, ((loff_t)offset_hi << 32) | offset_lo, count);
65} 72}
66 73
67int sys32_fadvise64_64(int fd, u32 offset_lo, u32 offset_hi, 74int sys32_fadvise64_64(int fd, SYSCALL_PAIR(offset),
68 u32 len_lo, u32 len_hi, int advice) 75 SYSCALL_PAIR(len), int advice)
69{ 76{
70 return sys_fadvise64_64(fd, ((loff_t)offset_hi << 32) | offset_lo, 77 return sys_fadvise64_64(fd, ((loff_t)offset_hi << 32) | offset_lo,
71 ((loff_t)len_hi << 32) | len_lo, advice); 78 ((loff_t)len_hi << 32) | len_lo, advice);