From: Florian Bezdeka <florian.bezdeka@siemens.com>
To: xenomai@lists.linux.dev, jan.kiszka@siemens.com
Cc: Florian Bezdeka <florian.bezdeka@siemens.com>
Subject: [PATCH 05/13] y2038: cobalt/posix/timer: Adding timer_gettime64
Date: Mon, 08 May 2023 10:13:27 +0200 [thread overview]
Message-ID: <20230508-florian-y2038-part-two-v1-5-a417812fba85@siemens.com> (raw)
In-Reply-To: <20230508-florian-y2038-part-two-v1-0-a417812fba85@siemens.com>
Add a syscall specific for timer_gettime with 64bit time_t.
Signed-off-by: Florian Bezdeka <florian.bezdeka@siemens.com>
---
include/cobalt/uapi/syscall.h | 1 +
kernel/cobalt/posix/timer.c | 13 +++++++++++++
kernel/cobalt/posix/timer.h | 3 +++
kernel/cobalt/trace/cobalt-posix.h | 3 ++-
4 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/include/cobalt/uapi/syscall.h b/include/cobalt/uapi/syscall.h
index 77184bd22..24e759eef 100644
--- a/include/cobalt/uapi/syscall.h
+++ b/include/cobalt/uapi/syscall.h
@@ -137,6 +137,7 @@
#define sc_cobalt_recvmmsg64 114
#define sc_cobalt_cond_wait_prologue64 115
#define sc_cobalt_timer_settime64 116
+#define sc_cobalt_timer_gettime64 117
#define __NR_COBALT_SYSCALLS 128 /* Power of 2 */
diff --git a/kernel/cobalt/posix/timer.c b/kernel/cobalt/posix/timer.c
index 3c7579def..0f111a42c 100644
--- a/kernel/cobalt/posix/timer.c
+++ b/kernel/cobalt/posix/timer.c
@@ -534,6 +534,19 @@ COBALT_SYSCALL(timer_gettime, current,
return cobalt_put_u_itimerspec(u_val, &val);
}
+COBALT_SYSCALL(timer_gettime64, current,
+ (timer_t tm, struct __kernel_itimerspec __user *u_val))
+{
+ struct itimerspec64 val;
+ int ret;
+
+ ret = __cobalt_timer_gettime(tm, &val);
+ if (ret)
+ return ret;
+
+ return cobalt_put_itimerspec64(u_val, &val);
+}
+
COBALT_SYSCALL(timer_getoverrun, current, (timer_t timerid))
{
struct cobalt_timer *timer;
diff --git a/kernel/cobalt/posix/timer.h b/kernel/cobalt/posix/timer.h
index 16d3a572a..864c780e8 100644
--- a/kernel/cobalt/posix/timer.h
+++ b/kernel/cobalt/posix/timer.h
@@ -86,6 +86,9 @@ COBALT_SYSCALL_DECL(timer_settime64,
COBALT_SYSCALL_DECL(timer_gettime,
(timer_t tm, struct __user_old_itimerspec __user *u_val));
+COBALT_SYSCALL_DECL(timer_gettime64,
+ (timer_t tm, struct __kernel_itimerspec __user *u_val));
+
COBALT_SYSCALL_DECL(timer_getoverrun, (timer_t tm));
#endif /* !_COBALT_POSIX_TIMER_H */
diff --git a/kernel/cobalt/trace/cobalt-posix.h b/kernel/cobalt/trace/cobalt-posix.h
index 5f99b1162..dc4f53a5a 100644
--- a/kernel/cobalt/trace/cobalt-posix.h
+++ b/kernel/cobalt/trace/cobalt-posix.h
@@ -169,7 +169,8 @@
__cobalt_symbolic_syscall(event_wait64), \
__cobalt_symbolic_syscall(recvmmsg64), \
__cobalt_symbolic_syscall(cond_wait_prologue64), \
- __cobalt_symbolic_syscall(timer_settime64))
+ __cobalt_symbolic_syscall(timer_settime64), \
+ __cobalt_symbolic_syscall(timer_gettime64))
DECLARE_EVENT_CLASS(cobalt_syscall_entry,
TP_PROTO(unsigned int nr),
--
2.39.2
next prev parent reply other threads:[~2023-05-08 8:13 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-08 8:13 [PATCH 00/13] y2038: Part two - timer and timerfd support Florian Bezdeka
2023-05-08 8:13 ` [PATCH 01/13] y2038: cobalt: Introduce some itimerspec64 related helpers Florian Bezdeka
2023-05-12 15:59 ` Jan Kiszka
2023-05-15 9:31 ` Florian Bezdeka
2023-05-15 9:36 ` Jan Kiszka
2023-05-08 8:13 ` [PATCH 02/13] y2038: cobalt/posix/timer: Adding timer_settime64 Florian Bezdeka
2023-05-12 16:02 ` Jan Kiszka
2023-05-15 9:33 ` Florian Bezdeka
2023-05-08 8:13 ` [PATCH 03/13] y2038: lib/cobalt: Dispatch timer_settime Florian Bezdeka
2023-05-08 8:13 ` [PATCH 04/13] y2038: testsuite/smokey/y2038: Adding tests for timer_settime Florian Bezdeka
2023-05-08 8:13 ` Florian Bezdeka [this message]
2023-05-08 8:13 ` [PATCH 06/13] y2038: lib/cobalt: Dispatch timer_gettime Florian Bezdeka
2023-05-08 8:13 ` [PATCH 07/13] y2038: testsuite/smokey/y2038: Adding tests for timer_gettime Florian Bezdeka
2023-05-08 8:13 ` [PATCH 08/13] y2038: cobalt/posix/timerfd: Adding timerfd_settime64 Florian Bezdeka
2023-05-08 8:13 ` [PATCH 09/13] y2038: lib/cobalt: Dispatch timerfd_settime Florian Bezdeka
2023-05-08 8:13 ` [PATCH 10/13] y2038: testsuite/smokey/y2038: Adding tests for timerfd_settime Florian Bezdeka
2023-05-08 8:13 ` [PATCH 11/13] y2038: cobalt/posix/timerfd: Adding timerfd_gettime64 Florian Bezdeka
2023-05-08 8:13 ` [PATCH 12/13] y2038: lib/cobalt: Dispatch timerfd_gettime Florian Bezdeka
2023-05-08 8:13 ` [PATCH 13/13] y2038: testsuite/smokey/y2038: Adding tests for timerfd_gettime Florian Bezdeka
2023-05-08 10:50 ` Lukasz Majewski
2023-05-08 11:45 ` Florian Bezdeka
2023-05-12 16:09 ` [PATCH 00/13] y2038: Part two - timer and timerfd support Jan Kiszka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230508-florian-y2038-part-two-v1-5-a417812fba85@siemens.com \
--to=florian.bezdeka@siemens.com \
--cc=jan.kiszka@siemens.com \
--cc=xenomai@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).