All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe  Gerum <rpm@xenomai.org>
To: xenomai@xenomai.org
Subject: [PATCH Dovetail 07/13] cobalt/clock: pipeline: make HOSTRT depend on IPIPE
Date: Sat,  2 Jan 2021 10:33:47 +0100	[thread overview]
Message-ID: <20210102093353.3195090-8-rpm@xenomai.org> (raw)
In-Reply-To: <20210102093353.3195090-1-rpm@xenomai.org>

From: Philippe Gerum <rpm@xenomai.org>

This interface is pointless with Dovetail whose applications directly
refer to the wallclock time exported through the common vDSO.

No functional change is introduced.

Signed-off-by: Philippe Gerum <rpm@xenomai.org>
---
 include/cobalt/kernel/vdso.h  | 18 +++++++++++-------
 kernel/cobalt/Kconfig         |  4 ----
 kernel/cobalt/ipipe/kevents.c | 14 ++++++++------
 kernel/cobalt/posix/clock.c   |  4 ++--
 4 files changed, 21 insertions(+), 19 deletions(-)

diff --git a/include/cobalt/kernel/vdso.h b/include/cobalt/kernel/vdso.h
index f7140adc7..7da88a730 100644
--- a/include/cobalt/kernel/vdso.h
+++ b/include/cobalt/kernel/vdso.h
@@ -25,21 +25,25 @@
 #include <asm/processor.h>
 #include <cobalt/uapi/kernel/vdso.h>
 
+extern struct xnvdso *nkvdso;
+
 /*
  * Define the available feature set here. We have a single feature
- * defined for now.
+ * defined for now, only in the I-pipe case.
  */
-#ifdef CONFIG_XENO_OPT_HOSTRT
-#define XNVDSO_FEATURES XNVDSO_FEAT_HOST_REALTIME
-#else
-#define XNVDSO_FEATURES 0
-#endif /* CONFIG_XENO_OPT_HOSTRT */
+#ifdef CONFIG_IPIPE_HAVE_HOSTRT
 
-extern struct xnvdso *nkvdso;
+#define XNVDSO_FEATURES XNVDSO_FEAT_HOST_REALTIME
 
 static inline struct xnvdso_hostrt_data *get_hostrt_data(void)
 {
 	return &nkvdso->hostrt_data;
 }
 
+#else
+
+#define XNVDSO_FEATURES 0
+
+#endif
+
 #endif /* _COBALT_KERNEL_VDSO_H */
diff --git a/kernel/cobalt/Kconfig b/kernel/cobalt/Kconfig
index 0d96913bd..ead4740c1 100644
--- a/kernel/cobalt/Kconfig
+++ b/kernel/cobalt/Kconfig
@@ -210,10 +210,6 @@ config XENO_OPT_TIMER_RBTREE
 
 endchoice
 
-config XENO_OPT_HOSTRT
-       depends on IPIPE_HAVE_HOSTRT
-       def_bool y
-
 config XENO_OPT_PIPE
 	bool
 
diff --git a/kernel/cobalt/ipipe/kevents.c b/kernel/cobalt/ipipe/kevents.c
index e0d4a1288..595faffd3 100644
--- a/kernel/cobalt/ipipe/kevents.c
+++ b/kernel/cobalt/ipipe/kevents.c
@@ -377,7 +377,7 @@ void ipipe_migration_hook(struct task_struct *p) /* hw IRQs off */
 	xnsched_run();
 }
 
-#ifdef CONFIG_XENO_OPT_HOSTRT
+#ifdef CONFIG_IPIPE_HAVE_HOSTRT
 
 static IPIPE_DEFINE_SPINLOCK(__hostrtlock);
 
@@ -417,7 +417,7 @@ static inline void init_hostrt(void)
 	nkvdso->hostrt_data.live = 0;
 }
 
-#else /* !CONFIG_XENO_OPT_HOSTRT */
+#else /* !CONFIG_IPIPE_HAVE_HOSTRT */
 
 struct ipipe_hostrt_data;
 
@@ -428,7 +428,7 @@ static inline int handle_hostrt_event(struct ipipe_hostrt_data *hostrt)
 
 static inline void init_hostrt(void) { }
 
-#endif /* !CONFIG_XENO_OPT_HOSTRT */
+#endif /* !CONFIG_IPIPE_HAVE_HOSTRT */
 
 static void __handle_taskexit_event(struct task_struct *p)
 {
@@ -756,12 +756,14 @@ int ipipe_kevent_hook(int kevent, void *data)
 	case IPIPE_KEVT_CLEANUP:
 		ret = handle_cleanup_event(data);
 		break;
-	case IPIPE_KEVT_HOSTRT:
-		ret = handle_hostrt_event(data);
-		break;
 	case IPIPE_KEVT_SETAFFINITY:
 		ret = handle_setaffinity_event(data);
 		break;
+#ifdef IPIPE_KEVT_HOSTRT
+	case IPIPE_KEVT_HOSTRT:
+		ret = handle_hostrt_event(data);
+		break;
+#endif
 #ifdef IPIPE_KEVT_CLOCKFREQ
 	case IPIPE_KEVT_CLOCKFREQ:
 		ret = handle_clockfreq_event(data);
diff --git a/kernel/cobalt/posix/clock.c b/kernel/cobalt/posix/clock.c
index 561358e74..40271f3ed 100644
--- a/kernel/cobalt/posix/clock.c
+++ b/kernel/cobalt/posix/clock.c
@@ -31,7 +31,7 @@ DECLARE_BITMAP(cobalt_clock_extids, COBALT_MAX_EXTCLOCKS);
 
 static int do_clock_host_realtime(struct timespec *tp)
 {
-#ifdef CONFIG_XENO_OPT_HOSTRT
+#ifdef CONFIG_IPIPE_HAVE_HOSTRT
 	struct xnvdso_hostrt_data *hostrt_data;
 	u64 now, base, mask, cycle_delta;
 	__u32 mult, shift;
@@ -78,7 +78,7 @@ static int do_clock_host_realtime(struct timespec *tp)
 	tp->tv_nsec = rem;
 
 	return 0;
-#else /* CONFIG_XENO_OPT_HOSTRT */
+#else
 	return -EINVAL;
 #endif
 }
-- 
2.26.2



  parent reply	other threads:[~2021-01-02  9:33 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-02  9:33 [PATCH Dovetail 00/13] Keep on abstracting the pipeline interface Philippe Gerum
2021-01-02  9:33 ` [PATCH Dovetail 01/13] cobalt/thread: pipeline: abstract threadinfo accessor Philippe Gerum
2021-01-08  9:02   ` Jan Kiszka
2021-01-02  9:33 ` [PATCH Dovetail 02/13] cobalt/apc: pipeline: abstract interface for deferred routine calls Philippe Gerum
2021-01-02  9:33 ` [PATCH Dovetail 03/13] cobalt/trace: pipeline: abstract trace calls Philippe Gerum
2021-01-02  9:33 ` [PATCH Dovetail 04/13] cobalt/lock: pipeline: abstract hard lock API Philippe Gerum
2021-01-02  9:33 ` [PATCH Dovetail 05/13] cobalt/kernel: pipeline: abstract execution stage predicates Philippe Gerum
2021-01-02  9:33 ` [PATCH Dovetail 06/13] cobalt/sched, clock: pipeline: abstract IPI management Philippe Gerum
2021-01-08  9:40   ` Jan Kiszka
2021-01-02  9:33 ` Philippe Gerum [this message]
2021-01-07 13:52   ` [PATCH Dovetail 07/13] cobalt/clock: pipeline: make HOSTRT depend on IPIPE Jan Kiszka
2021-01-09 10:45     ` Philippe Gerum
2021-01-02  9:33 ` [PATCH Dovetail 08/13] cobalt/build: pipeline: select IPIPE layer only if present Philippe Gerum
2021-01-02  9:33 ` [PATCH Dovetail 09/13] cobalt/clock: pipeline: abstract clock, timer access services Philippe Gerum
2021-01-02  9:33 ` [PATCH Dovetail 10/13] cobalt/wrappers: pipeline: abstract pipeline-related bits Philippe Gerum
2021-01-07 13:56   ` Jan Kiszka
2021-01-11 12:59   ` Jan Kiszka
2021-01-02  9:33 ` [PATCH Dovetail 11/13] cobalt/timer: pipeline: abstract tick management Philippe Gerum
2021-01-02  9:33 ` [PATCH Dovetail 12/13] cobalt/debug: pipeline: abstract panic prep call Philippe Gerum
2021-01-02  9:33 ` [PATCH Dovetail 13/13] cobalt/syscall: pipeline: abstract syscall entry points Philippe Gerum
2021-01-07 14:08   ` Jan Kiszka
2021-01-09 10:58     ` Philippe Gerum
2021-01-11 12:11       ` 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=20210102093353.3195090-8-rpm@xenomai.org \
    --to=rpm@xenomai.org \
    --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.