aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/compat_linux.c
diff options
context:
space:
mode:
authorKyle McMartin <kyle@parisc-linux.org>2007-02-10 04:46:00 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-11 13:51:32 -0500
commitd4d23add3abcd18d8021b99f230df608ccb2f007 (patch)
tree756c5a7d21a9f5a25f10bfcec40c01aecc596c2f /arch/s390/kernel/compat_linux.c
parent72fd4a35a824331d7a0f4168d7576502d95d34b3 (diff)
[PATCH] Common compat_sys_sysinfo
I noticed that almost all architectures implemented exactly the same sys32_sysinfo... except parisc, where a bug was to be found in handling of the uptime. So let's remove a whole whack of code for fun and profit. Cribbed compat_sys_sysinfo from x86_64's implementation, since I figured it would be the best tested. This patch incorporates Arnd's suggestion of not using set_fs/get_fs, but instead extracting out the common code from sys_sysinfo. Cc: Christoph Hellwig <hch@infradead.org> Cc: <linux-arch@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/s390/kernel/compat_linux.c')
-rw-r--r--arch/s390/kernel/compat_linux.c45
1 files changed, 0 insertions, 45 deletions
diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c
index 666bb6daa148..664c669b1856 100644
--- a/arch/s390/kernel/compat_linux.c
+++ b/arch/s390/kernel/compat_linux.c
@@ -398,51 +398,6 @@ int cp_compat_stat(struct kstat *stat, struct compat_stat __user *statbuf)
398 return err; 398 return err;
399} 399}
400 400
401struct sysinfo32 {
402 s32 uptime;
403 u32 loads[3];
404 u32 totalram;
405 u32 freeram;
406 u32 sharedram;
407 u32 bufferram;
408 u32 totalswap;
409 u32 freeswap;
410 unsigned short procs;
411 unsigned short pads;
412 u32 totalhigh;
413 u32 freehigh;
414 unsigned int mem_unit;
415 char _f[8];
416};
417
418asmlinkage long sys32_sysinfo(struct sysinfo32 __user *info)
419{
420 struct sysinfo s;
421 int ret, err;
422 mm_segment_t old_fs = get_fs ();
423
424 set_fs (KERNEL_DS);
425 ret = sys_sysinfo((struct sysinfo __force __user *) &s);
426 set_fs (old_fs);
427 err = put_user (s.uptime, &info->uptime);
428 err |= __put_user (s.loads[0], &info->loads[0]);
429 err |= __put_user (s.loads[1], &info->loads[1]);
430 err |= __put_user (s.loads[2], &info->loads[2]);
431 err |= __put_user (s.totalram, &info->totalram);
432 err |= __put_user (s.freeram, &info->freeram);
433 err |= __put_user (s.sharedram, &info->sharedram);
434 err |= __put_user (s.bufferram, &info->bufferram);
435 err |= __put_user (s.totalswap, &info->totalswap);
436 err |= __put_user (s.freeswap, &info->freeswap);
437 err |= __put_user (s.procs, &info->procs);
438 err |= __put_user (s.totalhigh, &info->totalhigh);
439 err |= __put_user (s.freehigh, &info->freehigh);
440 err |= __put_user (s.mem_unit, &info->mem_unit);
441 if (err)
442 return -EFAULT;
443 return ret;
444}
445
446asmlinkage long sys32_sched_rr_get_interval(compat_pid_t pid, 401asmlinkage long sys32_sched_rr_get_interval(compat_pid_t pid,
447 struct compat_timespec __user *interval) 402 struct compat_timespec __user *interval)
448{ 403{