aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel/sys_sparc32.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc64/kernel/sys_sparc32.c')
-rw-r--r--arch/sparc64/kernel/sys_sparc32.c64
1 files changed, 0 insertions, 64 deletions
diff --git a/arch/sparc64/kernel/sys_sparc32.c b/arch/sparc64/kernel/sys_sparc32.c
index e27cb71bd8e2..7876a0226285 100644
--- a/arch/sparc64/kernel/sys_sparc32.c
+++ b/arch/sparc64/kernel/sys_sparc32.c
@@ -459,70 +459,6 @@ asmlinkage long compat_sys_sysfs(int option, u32 arg1, u32 arg2)
459 return sys_sysfs(option, arg1, arg2); 459 return sys_sysfs(option, arg1, arg2);
460} 460}
461 461
462struct sysinfo32 {
463 s32 uptime;
464 u32 loads[3];
465 u32 totalram;
466 u32 freeram;
467 u32 sharedram;
468 u32 bufferram;
469 u32 totalswap;
470 u32 freeswap;
471 unsigned short procs;
472 unsigned short pad;
473 u32 totalhigh;
474 u32 freehigh;
475 u32 mem_unit;
476 char _f[20-2*sizeof(int)-sizeof(int)];
477};
478
479asmlinkage long sys32_sysinfo(struct sysinfo32 __user *info)
480{
481 struct sysinfo s;
482 int ret, err;
483 int bitcount = 0;
484 mm_segment_t old_fs = get_fs ();
485
486 set_fs(KERNEL_DS);
487 ret = sys_sysinfo((struct sysinfo __user *) &s);
488 set_fs(old_fs);
489 /* Check to see if any memory value is too large for 32-bit and
490 * scale down if needed.
491 */
492 if ((s.totalram >> 32) || (s.totalswap >> 32)) {
493 while (s.mem_unit < PAGE_SIZE) {
494 s.mem_unit <<= 1;
495 bitcount++;
496 }
497 s.totalram >>= bitcount;
498 s.freeram >>= bitcount;
499 s.sharedram >>= bitcount;
500 s.bufferram >>= bitcount;
501 s.totalswap >>= bitcount;
502 s.freeswap >>= bitcount;
503 s.totalhigh >>= bitcount;
504 s.freehigh >>= bitcount;
505 }
506
507 err = put_user (s.uptime, &info->uptime);
508 err |= __put_user (s.loads[0], &info->loads[0]);
509 err |= __put_user (s.loads[1], &info->loads[1]);
510 err |= __put_user (s.loads[2], &info->loads[2]);
511 err |= __put_user (s.totalram, &info->totalram);
512 err |= __put_user (s.freeram, &info->freeram);
513 err |= __put_user (s.sharedram, &info->sharedram);
514 err |= __put_user (s.bufferram, &info->bufferram);
515 err |= __put_user (s.totalswap, &info->totalswap);
516 err |= __put_user (s.freeswap, &info->freeswap);
517 err |= __put_user (s.procs, &info->procs);
518 err |= __put_user (s.totalhigh, &info->totalhigh);
519 err |= __put_user (s.freehigh, &info->freehigh);
520 err |= __put_user (s.mem_unit, &info->mem_unit);
521 if (err)
522 return -EFAULT;
523 return ret;
524}
525
526asmlinkage long compat_sys_sched_rr_get_interval(compat_pid_t pid, struct compat_timespec __user *interval) 462asmlinkage long compat_sys_sched_rr_get_interval(compat_pid_t pid, struct compat_timespec __user *interval)
527{ 463{
528 struct timespec t; 464 struct timespec t;