aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel
diff options
context:
space:
mode:
authorCatalin Marinas <catalin.marinas@arm.com>2012-12-17 19:01:45 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-17 20:15:18 -0500
commit0ad50c3896afbb3c103409a18260e601b87a744c (patch)
tree3a59c1e90b3ee62daf18bc9689cf454a31f164be /arch/powerpc/kernel
parent918854a65e856574523d94763ef2a2b48ad55a25 (diff)
compat: generic compat_sys_sched_rr_get_interval() implementation
This function is used by sparc, powerpc tile and arm64 for compat support. The patch adds a generic implementation with a wrapper for PowerPC to do the u32->int sign extension. The reason for a single patch covering powerpc, tile, sparc and arm64 is to keep it bisectable, otherwise kernel building may fail with mismatched function declarations. Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Acked-by: Chris Metcalf <cmetcalf@tilera.com> [for tile] Acked-by: David S. Miller <davem@davemloft.net> Acked-by: Arnd Bergmann <arnd@arndb.de> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Alexander Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r--arch/powerpc/kernel/sys_ppc32.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/arch/powerpc/kernel/sys_ppc32.c b/arch/powerpc/kernel/sys_ppc32.c
index 9c2ed90ece8f..8a93778ed9f5 100644
--- a/arch/powerpc/kernel/sys_ppc32.c
+++ b/arch/powerpc/kernel/sys_ppc32.c
@@ -175,19 +175,10 @@ asmlinkage long compat_sys_prctl(u32 option, u32 arg2, u32 arg3, u32 arg4, u32 a
175 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) 175 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
176 * and the register representation of a signed int (msr in 64-bit mode) is performed. 176 * and the register representation of a signed int (msr in 64-bit mode) is performed.
177 */ 177 */
178asmlinkage long compat_sys_sched_rr_get_interval(u32 pid, struct compat_timespec __user *interval) 178asmlinkage long compat_sys_sched_rr_get_interval_wrapper(u32 pid,
179{ 179 struct compat_timespec __user *interval)
180 struct timespec t; 180{
181 int ret; 181 return compat_sys_sched_rr_get_interval((int)pid, interval);
182 mm_segment_t old_fs = get_fs ();
183
184 /* The __user pointer cast is valid because of the set_fs() */
185 set_fs (KERNEL_DS);
186 ret = sys_sched_rr_get_interval((int)pid, (struct timespec __user *) &t);
187 set_fs (old_fs);
188 if (put_compat_timespec(&t, interval))
189 return -EFAULT;
190 return ret;
191} 182}
192 183
193/* Note: it is necessary to treat mode as an unsigned int, 184/* Note: it is necessary to treat mode as an unsigned int,