All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Bezdeka <florian.bezdeka@siemens.com>
To: xenomai@xenomai.org
Cc: jan.kiszka@siemens.com, chensong@tj.kylinos.cn,
	Florian Bezdeka <florian.bezdeka@siemens.com>
Subject: [PATCH 1/9] y2038: libcobalt: Centralize sc_cobalt_clock_gettime syscall
Date: Tue,  1 Jun 2021 11:43:26 +0200	[thread overview]
Message-ID: <20210601094334.774394-2-florian.bezdeka@siemens.com> (raw)
In-Reply-To: <20210601094334.774394-1-florian.bezdeka@siemens.com>

There were two places invoking the sc_cobalt_clock_gettime syscalls
and both places would be updated while introducing y2038 support. To
keep y2038 compatibility as simple as possible the code has been moved
into a simple helper function.

Signed-off-by: Florian Bezdeka <florian.bezdeka@siemens.com>
---
 lib/cobalt/clock.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/lib/cobalt/clock.c b/lib/cobalt/clock.c
index a0673d1fc..3f87278ce 100644
--- a/lib/cobalt/clock.c
+++ b/lib/cobalt/clock.c
@@ -149,6 +149,11 @@ static int __do_clock_host_realtime(struct timespec *ts)
 	return 0;
 }
 
+static int __do_clock_gettime(clockid_t clock_id, struct timespec *tp)
+{
+	return -XENOMAI_SYSCALL2(sc_cobalt_clock_gettime, clock_id, tp);
+}
+
 static int gettime_via_tsc(clockid_t clock_id, struct timespec *tp)
 {
 	unsigned long rem;
@@ -172,7 +177,7 @@ static int gettime_via_tsc(clockid_t clock_id, struct timespec *tp)
 		tp->tv_nsec = rem;
 		return 0;
 	default:
-		ret = -XENOMAI_SYSCALL2(sc_cobalt_clock_gettime, clock_id, tp);
+		ret = __do_clock_gettime(clock_id, tp);
 	}
 
 	if (ret) {
@@ -197,7 +202,7 @@ static int gettime_via_vdso(clockid_t clock_id, struct timespec *tp)
 		ret = __cobalt_vdso_gettime(clock_id, tp);
 		break;
 	default:
-		ret = -XENOMAI_SYSCALL2(sc_cobalt_clock_gettime, clock_id, tp);
+		ret = __do_clock_gettime(clock_id, tp);
 	}
 
 	if (ret) {
-- 
2.31.1



  reply	other threads:[~2021-06-01  9:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-01  9:43 [PATCH 0/9] y2038: clock_{g,s}ettime64, clock_nanosleep64 Florian Bezdeka
2021-06-01  9:43 ` Florian Bezdeka [this message]
2021-06-01  9:43 ` [PATCH 2/9] y2038: cobalt/posix/clock: Adding clock_gettime64 Florian Bezdeka
2021-06-01  9:43 ` [PATCH 3/9] y2038: cobalt/posix/clock: Adding clock_settime64 Florian Bezdeka
2021-06-01  9:43 ` [PATCH 4/9] y2038: lib/cobalt/clock: dispatch clock_gettime Florian Bezdeka
2021-06-01  9:43 ` [PATCH 5/9] y2038: lib/cobalt/clock: dispatch clock_settime Florian Bezdeka
2021-06-01  9:43 ` [PATCH 6/9] y2038: testsuite/smokey/y2038: testcase for settime64 and gettime64 Florian Bezdeka
2021-06-01  9:43 ` [PATCH 7/9] y2038: cobalt/posix/clock: Adding clock_nanosleep64 Florian Bezdeka
2021-06-01  9:43 ` [PATCH 8/9] y2038: lib/cobalt/clock: dispatch clock_nanosleep Florian Bezdeka
2021-06-01  9:43 ` [PATCH 9/9] y2038: testsuite/smokey/y2038: Adding testcase for nanosleep64 Florian Bezdeka
2021-06-04 11:41   ` Jan Kiszka
2021-06-04 11:43     ` Jan Kiszka
2021-06-04 12:05       ` Jan Kiszka
2021-06-04 12:21         ` Jan Kiszka
2021-06-04 12:45         ` Philippe Gerum
2021-06-04 12:07 ` [PATCH 0/9] y2038: clock_{g,s}ettime64, clock_nanosleep64 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=20210601094334.774394-2-florian.bezdeka@siemens.com \
    --to=florian.bezdeka@siemens.com \
    --cc=chensong@tj.kylinos.cn \
    --cc=jan.kiszka@siemens.com \
    --cc=xenomai@xenomai.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.