Lines Matching +full:scaled +full:- +full:output +full:- +full:hz
1 // SPDX-License-Identifier: GPL-2.0
10 * Some of the system calls expect a non-C calling standard, others have
63 retval = -ENOMEM; in SYSCALL_DEFINE1()
68 * This is pure guess-work..
76 mm = current->mm; in SYSCALL_DEFINE4()
77 mm->end_code = bss_start + bss_len; in SYSCALL_DEFINE4()
78 mm->start_brk = bss_start + bss_len; in SYSCALL_DEFINE4()
79 mm->brk = bss_start + bss_len; in SYSCALL_DEFINE4()
121 buf->error = -EINVAL; /* only used if we fail */ in osf_filldir()
122 if (reclen > buf->count) in osf_filldir()
126 buf->error = -EOVERFLOW; in osf_filldir()
129 if (buf->basep) { in osf_filldir()
130 if (put_user(offset, buf->basep)) in osf_filldir()
132 buf->basep = NULL; in osf_filldir()
134 dirent = buf->dirent; in osf_filldir()
135 if (put_user(d_ino, &dirent->d_ino) || in osf_filldir()
136 put_user(namlen, &dirent->d_namlen) || in osf_filldir()
137 put_user(reclen, &dirent->d_reclen) || in osf_filldir()
138 copy_to_user(dirent->d_name, name, namlen) || in osf_filldir()
139 put_user(0, dirent->d_name + namlen)) in osf_filldir()
142 buf->dirent = dirent; in osf_filldir()
143 buf->count -= reclen; in osf_filldir()
146 buf->error = -EFAULT; in osf_filldir()
164 return -EBADF; in SYSCALL_DEFINE4()
170 error = count - buf.count; in SYSCALL_DEFINE4()
182 unsigned long ret = -EINVAL; in SYSCALL_DEFINE6()
187 current->comm, flags); in SYSCALL_DEFINE6()
282 tmp.st_dev = lstat->dev; in linux_to_osf_stat()
283 tmp.st_mode = lstat->mode; in linux_to_osf_stat()
284 tmp.st_nlink = lstat->nlink; in linux_to_osf_stat()
285 tmp.st_uid = from_kuid_munged(current_user_ns(), lstat->uid); in linux_to_osf_stat()
286 tmp.st_gid = from_kgid_munged(current_user_ns(), lstat->gid); in linux_to_osf_stat()
287 tmp.st_rdev = lstat->rdev; in linux_to_osf_stat()
288 tmp.st_ldev = lstat->rdev; in linux_to_osf_stat()
289 tmp.st_size = lstat->size; in linux_to_osf_stat()
290 tmp.st_uatime = lstat->atime.tv_nsec / 1000; in linux_to_osf_stat()
291 tmp.st_umtime = lstat->mtime.tv_nsec / 1000; in linux_to_osf_stat()
292 tmp.st_uctime = lstat->ctime.tv_nsec / 1000; in linux_to_osf_stat()
293 tmp.st_ino = lstat->ino; in linux_to_osf_stat()
294 tmp.st_atime = lstat->atime.tv_sec; in linux_to_osf_stat()
295 tmp.st_mtime = lstat->mtime.tv_sec; in linux_to_osf_stat()
296 tmp.st_ctime = lstat->ctime.tv_sec; in linux_to_osf_stat()
297 tmp.st_blksize = lstat->blksize; in linux_to_osf_stat()
298 tmp.st_blocks = lstat->blocks; in linux_to_osf_stat()
300 return copy_to_user(osf_stat, &tmp, sizeof(tmp)) ? -EFAULT : 0; in linux_to_osf_stat()
309 tmp_stat.f_type = linux_stat->f_type; in linux_to_osf_statfs()
311 tmp_stat.f_fsize = linux_stat->f_frsize; in linux_to_osf_statfs()
312 tmp_stat.f_bsize = linux_stat->f_bsize; in linux_to_osf_statfs()
313 tmp_stat.f_blocks = linux_stat->f_blocks; in linux_to_osf_statfs()
314 tmp_stat.f_bfree = linux_stat->f_bfree; in linux_to_osf_statfs()
315 tmp_stat.f_bavail = linux_stat->f_bavail; in linux_to_osf_statfs()
316 tmp_stat.f_files = linux_stat->f_files; in linux_to_osf_statfs()
317 tmp_stat.f_ffree = linux_stat->f_ffree; in linux_to_osf_statfs()
318 tmp_stat.f_fsid = linux_stat->f_fsid; in linux_to_osf_statfs()
321 return copy_to_user(osf_stat, &tmp_stat, bufsiz) ? -EFAULT : 0; in linux_to_osf_statfs()
330 tmp_stat.f_type = linux_stat->f_type; in linux_to_osf_statfs64()
331 tmp_stat.f_fsize = linux_stat->f_frsize; in linux_to_osf_statfs64()
332 tmp_stat.f_bsize = linux_stat->f_bsize; in linux_to_osf_statfs64()
333 tmp_stat.f_blocks = linux_stat->f_blocks; in linux_to_osf_statfs64()
334 tmp_stat.f_bfree = linux_stat->f_bfree; in linux_to_osf_statfs64()
335 tmp_stat.f_bavail = linux_stat->f_bavail; in linux_to_osf_statfs64()
336 tmp_stat.f_files = linux_stat->f_files; in linux_to_osf_statfs64()
337 tmp_stat.f_ffree = linux_stat->f_ffree; in linux_to_osf_statfs64()
338 tmp_stat.f_fsid = linux_stat->f_fsid; in linux_to_osf_statfs64()
341 return copy_to_user(osf_stat, &tmp_stat, bufsiz) ? -EFAULT : 0; in linux_to_osf_statfs64()
462 retval = -EFAULT; in osf_ufs_mount()
469 retval = do_mount(devname->name, dirname, "ext2", flags, NULL); in osf_ufs_mount()
483 retval = -EFAULT; in osf_cdfs_mount()
490 retval = do_mount(devname->name, dirname, "iso9660", flags, NULL); in osf_cdfs_mount()
503 return -EFAULT; in osf_procfs_mount()
524 retval = -EINVAL; in SYSCALL_DEFINE4()
536 memcpy(tmp + 0 * 32, utsname()->sysname, 32); in SYSCALL_DEFINE1()
537 memcpy(tmp + 1 * 32, utsname()->nodename, 32); in SYSCALL_DEFINE1()
538 memcpy(tmp + 2 * 32, utsname()->release, 32); in SYSCALL_DEFINE1()
539 memcpy(tmp + 3 * 32, utsname()->version, 32); in SYSCALL_DEFINE1()
540 memcpy(tmp + 4 * 32, utsname()->machine, 32); in SYSCALL_DEFINE1()
544 return -EFAULT; in SYSCALL_DEFINE1()
571 kname = utsname()->domainname; in SYSCALL_DEFINE2()
578 return -EFAULT; in SYSCALL_DEFINE2()
595 #define PLE_FLAG_ALL -1 /* All flag value */
655 if (get_user(error, &args->set.nbytes)) in SYSCALL_DEFINE2()
656 error = -EFAULT; in SYSCALL_DEFINE2()
659 if (get_user(error, &args->fset.nbytes)) in SYSCALL_DEFINE2()
660 error = -EFAULT; in SYSCALL_DEFINE2()
663 error = get_user(min_buf_size_ptr, &args->get.min_buf_size); in SYSCALL_DEFINE2()
669 error = get_user(min_buf_size_ptr, &args->fget.min_buf_size); in SYSCALL_DEFINE2()
679 error = -EOPNOTSUPP; in SYSCALL_DEFINE2()
689 unsigned long oss_sp = current->sas_ss_sp + current->sas_ss_size; in SYSCALL_DEFINE2()
696 error = -EFAULT; in SYSCALL_DEFINE2()
697 if (get_user(ss_sp, &uss->ss_sp)) in SYSCALL_DEFINE2()
702 error = -EPERM; in SYSCALL_DEFINE2()
703 if (current->sas_ss_sp && on_sig_stack(usp)) in SYSCALL_DEFINE2()
707 track onstack-ness, but rather calculate it, we must in SYSCALL_DEFINE2()
709 current->sas_ss_sp = (unsigned long)ss_sp - SIGSTKSZ; in SYSCALL_DEFINE2()
710 current->sas_ss_size = SIGSTKSZ; in SYSCALL_DEFINE2()
714 error = -EFAULT; in SYSCALL_DEFINE2()
715 if (put_user(oss_sp, &uoss->ss_sp) || in SYSCALL_DEFINE2()
716 put_user(oss_os, &uoss->ss_onstack)) in SYSCALL_DEFINE2()
728 utsname()->sysname, in SYSCALL_DEFINE3()
729 utsname()->nodename, in SYSCALL_DEFINE3()
730 utsname()->release, in SYSCALL_DEFINE3()
731 utsname()->version, in SYSCALL_DEFINE3()
732 utsname()->machine, in SYSCALL_DEFINE3()
743 offset = command-1; in SYSCALL_DEFINE3()
747 return -EINVAL; in SYSCALL_DEFINE3()
758 return -EFAULT; in SYSCALL_DEFINE3()
773 w = current_thread_info()->ieee_state & IEEE_SW_MASK; in SYSCALL_DEFINE5()
776 return -EFAULT; in SYSCALL_DEFINE5()
789 return -EINVAL; in SYSCALL_DEFINE5()
790 w = current_thread_info()->status & UAC_BITMASK; in SYSCALL_DEFINE5()
792 return -EFAULT; in SYSCALL_DEFINE5()
797 return -EINVAL; in SYSCALL_DEFINE5()
799 ((char*)hwrpb + hwrpb->processor_offset); in SYSCALL_DEFINE5()
800 w = cpu->type; in SYSCALL_DEFINE5()
802 return -EFAULT; in SYSCALL_DEFINE5()
807 return -EINVAL; in SYSCALL_DEFINE5()
809 return -EFAULT; in SYSCALL_DEFINE5()
816 return -EOPNOTSUPP; in SYSCALL_DEFINE5()
831 * set in the trap shadow of a software-complete insn. in SYSCALL_DEFINE5()
835 return -EFAULT; in SYSCALL_DEFINE5()
836 state = ¤t_thread_info()->ieee_state; in SYSCALL_DEFINE5()
854 return -EFAULT; in SYSCALL_DEFINE5()
855 state = ¤t_thread_info()->ieee_state; in SYSCALL_DEFINE5()
904 return -EFAULT; in SYSCALL_DEFINE5()
908 status = current_thread_info()->status; in SYSCALL_DEFINE5()
910 current_thread_info()->status = status; in SYSCALL_DEFINE5()
914 return -EOPNOTSUPP; in SYSCALL_DEFINE5()
927 return -EOPNOTSUPP; in SYSCALL_DEFINE5()
951 return -EFAULT; in get_tv32()
952 o->tv_sec = tv.tv_sec; in get_tv32()
953 o->tv_nsec = tv.tv_usec * NSEC_PER_USEC; in get_tv32()
961 .tv_sec = i->tv_sec, in put_tv32()
962 .tv_usec = i->tv_nsec / NSEC_PER_USEC}, in put_tv32()
970 .tv_sec = i->tv_sec, in put_tv_to_tv32()
971 .tv_usec = i->tv_usec}, in put_tv_to_tv32()
978 value->tv_usec = (jiffies % HZ) * (1000000L / HZ); in jiffies_to_timeval32()
979 value->tv_sec = jiffies / HZ; in jiffies_to_timeval32()
990 return -EFAULT; in SYSCALL_DEFINE2()
994 return -EFAULT; in SYSCALL_DEFINE2()
1007 return -EFAULT; in SYSCALL_DEFINE2()
1011 return -EFAULT; in SYSCALL_DEFINE2()
1025 return -EFAULT; in SYSCALL_DEFINE2()
1029 return -EINVAL; in SYSCALL_DEFINE2()
1044 return -EFAULT; in SYSCALL_DEFINE5()
1047 return -EINVAL; in SYSCALL_DEFINE5()
1050 return -EINVAL; in SYSCALL_DEFINE5()
1069 long ru_oublock; /* block output operations */
1084 return -EINVAL; in SYSCALL_DEFINE2()
1094 r.ru_minflt = current->min_flt; in SYSCALL_DEFINE2()
1095 r.ru_majflt = current->maj_flt; in SYSCALL_DEFINE2()
1098 utime_jiffies = nsecs_to_jiffies(current->signal->cutime); in SYSCALL_DEFINE2()
1099 stime_jiffies = nsecs_to_jiffies(current->signal->cstime); in SYSCALL_DEFINE2()
1102 r.ru_minflt = current->signal->cmin_flt; in SYSCALL_DEFINE2()
1103 r.ru_majflt = current->signal->cmaj_flt; in SYSCALL_DEFINE2()
1107 return copy_to_user(ru, &r, sizeof(r)) ? -EFAULT : 0; in SYSCALL_DEFINE2()
1119 if (put_tv_to_tv32(&ur->ru_utime, &r.ru_utime)) in SYSCALL_DEFINE4()
1120 return -EFAULT; in SYSCALL_DEFINE4()
1121 if (put_tv_to_tv32(&ur->ru_stime, &r.ru_stime)) in SYSCALL_DEFINE4()
1122 return -EFAULT; in SYSCALL_DEFINE4()
1123 if (copy_to_user(&ur->ru_maxrss, &r.ru_maxrss, in SYSCALL_DEFINE4()
1124 sizeof(struct rusage32) - offsetof(struct rusage32, ru_maxrss))) in SYSCALL_DEFINE4()
1125 return -EFAULT; in SYSCALL_DEFINE4()
1155 return -EFAULT; in SYSCALL_DEFINE2()
1162 long freq; /* frequency offset (scaled ppm) */
1174 long ppsfreq; /* pps frequency (scaled ppm) (ro) */
1177 long stabil; /* pps stability (scaled ppm) (ro) */
1195 copy_from_user(&txc.tick, &txc_p->tick, sizeof(struct timex32) - in SYSCALL_DEFINE1()
1197 return -EFAULT; in SYSCALL_DEFINE1()
1205 (copy_to_user(&txc_p->tick, &txc.tick, sizeof(struct timex32) - in SYSCALL_DEFINE1()
1207 (put_user(txc.time.tv_sec, &txc_p->time.tv_sec)) || in SYSCALL_DEFINE1()
1208 (put_user(txc.time.tv_usec, &txc_p->time.tv_usec))) in SYSCALL_DEFINE1()
1209 return -EFAULT; in SYSCALL_DEFINE1()
1237 if (current->personality & ADDR_LIMIT_32BIT) in arch_get_unmapped_area()
1243 return -ENOMEM; in arch_get_unmapped_area()
1255 merely specific addresses, but regions of memory -- perhaps in arch_get_unmapped_area()
1260 if (addr != (unsigned long) -ENOMEM) in arch_get_unmapped_area()
1267 if (addr != (unsigned long) -ENOMEM) in arch_get_unmapped_area()
1280 /* Return value is the unbiased priority, i.e. 20 - prio. in SYSCALL_DEFINE2()
1284 prio = 20 - prio; in SYSCALL_DEFINE2()
1291 current_pt_regs()->r20 = sys_geteuid(); in SYSCALL_DEFINE0()
1297 current_pt_regs()->r20 = sys_getegid(); in SYSCALL_DEFINE0()
1303 current_pt_regs()->r20 = sys_getppid(); in SYSCALL_DEFINE0()
1313 current_pt_regs()->r20 = fd[1]; in SYSCALL_DEFINE0()
1321 current_pt_regs()->hae = val; in SYSCALL_DEFINE1()