aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/restart_block.h7
-rw-r--r--include/linux/syscalls.h7
-rw-r--r--kernel/time/hrtimer.c8
-rw-r--r--kernel/time/posix-stubs.c4
-rw-r--r--kernel/time/posix-timers.c4
5 files changed, 16 insertions, 14 deletions
diff --git a/include/linux/restart_block.h b/include/linux/restart_block.h
index bcfdb918cd81..5d83d0c1d06c 100644
--- a/include/linux/restart_block.h
+++ b/include/linux/restart_block.h
@@ -7,6 +7,7 @@
7 7
8#include <linux/compiler.h> 8#include <linux/compiler.h>
9#include <linux/types.h> 9#include <linux/types.h>
10#include <linux/time64.h>
10 11
11struct timespec; 12struct timespec;
12struct compat_timespec; 13struct compat_timespec;
@@ -15,9 +16,7 @@ struct pollfd;
15enum timespec_type { 16enum timespec_type {
16 TT_NONE = 0, 17 TT_NONE = 0,
17 TT_NATIVE = 1, 18 TT_NATIVE = 1,
18#ifdef CONFIG_COMPAT
19 TT_COMPAT = 2, 19 TT_COMPAT = 2,
20#endif
21}; 20};
22 21
23/* 22/*
@@ -40,10 +39,8 @@ struct restart_block {
40 clockid_t clockid; 39 clockid_t clockid;
41 enum timespec_type type; 40 enum timespec_type type;
42 union { 41 union {
43 struct timespec __user *rmtp; 42 struct __kernel_timespec __user *rmtp;
44#ifdef CONFIG_COMPAT
45 struct compat_timespec __user *compat_rmtp; 43 struct compat_timespec __user *compat_rmtp;
46#endif
47 }; 44 };
48 u64 expires; 45 u64 expires;
49 } nanosleep; 46 } nanosleep;
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 40bb40d1741b..c9a2a2601852 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -536,7 +536,8 @@ asmlinkage long sys_set_robust_list(struct robust_list_head __user *head,
536 size_t len); 536 size_t len);
537 537
538/* kernel/hrtimer.c */ 538/* kernel/hrtimer.c */
539asmlinkage long sys_nanosleep(struct timespec __user *rqtp, struct timespec __user *rmtp); 539asmlinkage long sys_nanosleep(struct __kernel_timespec __user *rqtp,
540 struct __kernel_timespec __user *rmtp);
540 541
541/* kernel/itimer.c */ 542/* kernel/itimer.c */
542asmlinkage long sys_getitimer(int which, struct itimerval __user *value); 543asmlinkage long sys_getitimer(int which, struct itimerval __user *value);
@@ -573,8 +574,8 @@ asmlinkage long sys_clock_gettime(clockid_t which_clock,
573asmlinkage long sys_clock_getres(clockid_t which_clock, 574asmlinkage long sys_clock_getres(clockid_t which_clock,
574 struct __kernel_timespec __user *tp); 575 struct __kernel_timespec __user *tp);
575asmlinkage long sys_clock_nanosleep(clockid_t which_clock, int flags, 576asmlinkage long sys_clock_nanosleep(clockid_t which_clock, int flags,
576 const struct timespec __user *rqtp, 577 const struct __kernel_timespec __user *rqtp,
577 struct timespec __user *rmtp); 578 struct __kernel_timespec __user *rmtp);
578 579
579/* kernel/printk.c */ 580/* kernel/printk.c */
580asmlinkage long sys_syslog(int type, char __user *buf, int len); 581asmlinkage long sys_syslog(int type, char __user *buf, int len);
diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index f183257ff0c6..d7051b3993b5 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -1747,8 +1747,10 @@ out:
1747 return ret; 1747 return ret;
1748} 1748}
1749 1749
1750SYSCALL_DEFINE2(nanosleep, struct timespec __user *, rqtp, 1750#if !defined(CONFIG_64BIT_TIME) || defined(CONFIG_64BIT)
1751 struct timespec __user *, rmtp) 1751
1752SYSCALL_DEFINE2(nanosleep, struct __kernel_timespec __user *, rqtp,
1753 struct __kernel_timespec __user *, rmtp)
1752{ 1754{
1753 struct timespec64 tu; 1755 struct timespec64 tu;
1754 1756
@@ -1763,6 +1765,8 @@ SYSCALL_DEFINE2(nanosleep, struct timespec __user *, rqtp,
1763 return hrtimer_nanosleep(&tu, HRTIMER_MODE_REL, CLOCK_MONOTONIC); 1765 return hrtimer_nanosleep(&tu, HRTIMER_MODE_REL, CLOCK_MONOTONIC);
1764} 1766}
1765 1767
1768#endif
1769
1766#ifdef CONFIG_COMPAT_32BIT_TIME 1770#ifdef CONFIG_COMPAT_32BIT_TIME
1767 1771
1768COMPAT_SYSCALL_DEFINE2(nanosleep, struct compat_timespec __user *, rqtp, 1772COMPAT_SYSCALL_DEFINE2(nanosleep, struct compat_timespec __user *, rqtp,
diff --git a/kernel/time/posix-stubs.c b/kernel/time/posix-stubs.c
index 4e76021cea7f..474e4ca2e28f 100644
--- a/kernel/time/posix-stubs.c
+++ b/kernel/time/posix-stubs.c
@@ -126,8 +126,8 @@ SYSCALL_DEFINE2(clock_getres, const clockid_t, which_clock, struct __kernel_time
126} 126}
127 127
128SYSCALL_DEFINE4(clock_nanosleep, const clockid_t, which_clock, int, flags, 128SYSCALL_DEFINE4(clock_nanosleep, const clockid_t, which_clock, int, flags,
129 const struct timespec __user *, rqtp, 129 const struct __kernel_timespec __user *, rqtp,
130 struct timespec __user *, rmtp) 130 struct __kernel_timespec __user *, rmtp)
131{ 131{
132 struct timespec64 t; 132 struct timespec64 t;
133 133
diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c
index 93b2c38ad0f3..c21f4c4f8660 100644
--- a/kernel/time/posix-timers.c
+++ b/kernel/time/posix-timers.c
@@ -1212,8 +1212,8 @@ static int common_nsleep(const clockid_t which_clock, int flags,
1212} 1212}
1213 1213
1214SYSCALL_DEFINE4(clock_nanosleep, const clockid_t, which_clock, int, flags, 1214SYSCALL_DEFINE4(clock_nanosleep, const clockid_t, which_clock, int, flags,
1215 const struct timespec __user *, rqtp, 1215 const struct __kernel_timespec __user *, rqtp,
1216 struct timespec __user *, rmtp) 1216 struct __kernel_timespec __user *, rmtp)
1217{ 1217{
1218 const struct k_clock *kc = clockid_to_kclock(which_clock); 1218 const struct k_clock *kc = clockid_to_kclock(which_clock);
1219 struct timespec64 t; 1219 struct timespec64 t;