All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe  Gerum <rpm@xenomai.org>
To: xenomai@xenomai.org
Subject: [PATCH Dovetail 10/13] cobalt/wrappers: pipeline: abstract pipeline-related bits
Date: Sat,  2 Jan 2021 10:33:50 +0100	[thread overview]
Message-ID: <20210102093353.3195090-11-rpm@xenomai.org> (raw)
In-Reply-To: <20210102093353.3195090-1-rpm@xenomai.org>

From: Philippe Gerum <rpm@xenomai.org>

No functional change is introduced.

Signed-off-by: Philippe Gerum <rpm@xenomai.org>
---
 .../cobalt/kernel/ipipe/pipeline/wrappers.h   | 25 +++++++++++++++++++
 .../cobalt/include/linux/xenomai/wrappers.h   | 23 ++++-------------
 kernel/cobalt/posix/process.c                 |  2 +-
 3 files changed, 31 insertions(+), 19 deletions(-)
 create mode 100644 include/cobalt/kernel/ipipe/pipeline/wrappers.h

diff --git a/include/cobalt/kernel/ipipe/pipeline/wrappers.h b/include/cobalt/kernel/ipipe/pipeline/wrappers.h
new file mode 100644
index 000000000..ac940fb32
--- /dev/null
+++ b/include/cobalt/kernel/ipipe/pipeline/wrappers.h
@@ -0,0 +1,25 @@
+/*
+ * SPDX-License-Identifier: GPL-2.0
+ */
+#ifndef _COBALT_KERNEL_IPIPE_WRAPPERS_H
+#define _COBALT_KERNEL_IPIPE_WRAPPERS_H
+
+#include <linux/ipipe.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0)
+#define cobalt_set_task_state(tsk, state_value)	\
+	set_task_state(tsk, state_value)
+#else
+/*
+ * The co-kernel can still set the current task state safely if it
+ * runs on the head stage.
+ */
+#define cobalt_set_task_state(tsk, state_value)	\
+		smp_store_mb((tsk)->state, (state_value))
+#endif
+
+#ifndef ipipe_root_nr_syscalls
+#define ipipe_root_nr_syscalls(ti)	NR_syscalls
+#endif
+
+#endif /* !_COBALT_KERNEL_IPIPE_WRAPPERS_H */
diff --git a/kernel/cobalt/include/linux/xenomai/wrappers.h b/kernel/cobalt/include/linux/xenomai/wrappers.h
index 847d68088..3e825e366 100644
--- a/kernel/cobalt/include/linux/xenomai/wrappers.h
+++ b/kernel/cobalt/include/linux/xenomai/wrappers.h
@@ -21,12 +21,13 @@
 
 #include <linux/version.h>
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0)
+typedef siginfo_t kernel_siginfo_t;
+#endif
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0)
 #include <linux/sched.h>
 #include <linux/sched/rt.h>
-
-#define cobalt_set_task_state(tsk, state_value)	\
-	set_task_state(tsk, state_value)
 #else
 #include <linux/sched.h>
 #include <linux/sched/signal.h>
@@ -35,22 +36,8 @@
 #include <linux/sched/debug.h>
 #include <linux/sched/task_stack.h>
 #include <uapi/linux/sched/types.h>
-/*
- * The co-kernel can still do this sanely for a thread which is
- * currently active on the head stage.
- */
-#define cobalt_set_task_state(tsk, state_value)	\
-		smp_store_mb((tsk)->state, (state_value))
 #endif
 
-#include <linux/ipipe.h>
-
-#ifndef ipipe_root_nr_syscalls
-#define ipipe_root_nr_syscalls(ti)	NR_syscalls
-#endif
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0)
-typedef siginfo_t kernel_siginfo_t;
-#endif
+#include <pipeline/wrappers.h>
 
 #endif /* !_COBALT_LINUX_WRAPPERS_H */
diff --git a/kernel/cobalt/posix/process.c b/kernel/cobalt/posix/process.c
index accd989ca..fcae7df06 100644
--- a/kernel/cobalt/posix/process.c
+++ b/kernel/cobalt/posix/process.c
@@ -640,7 +640,7 @@ int cobalt_map_user(struct xnthread *thread, __u32 __user *u_winoff)
 	 * it.
 	 */
 	xnthread_run_handler(thread, map_thread);
-	pipeline_enable_kevents(current);
+	pipeline_enable_kevents();
 
 	attr.mode = 0;
 	attr.entry = NULL;
-- 
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 ` [PATCH Dovetail 07/13] cobalt/clock: pipeline: make HOSTRT depend on IPIPE Philippe Gerum
2021-01-07 13:52   ` 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 ` Philippe Gerum [this message]
2021-01-07 13:56   ` [PATCH Dovetail 10/13] cobalt/wrappers: pipeline: abstract pipeline-related bits 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-11-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.