[PATCH 1/4] cobalt/kernel: add abstract inband work submission API

Philippe Gerum rpm at xenomai.org
Sun Jan 17 16:11:30 CET 2021


From: Philippe Gerum <rpm at xenomai.org>

Provide an abstract interface for triggering work handlers on the
in-band execution stage (aka "secondary mode" in the old jargon),
which can be implemented using ipipe_post_root_work() from the I-pipe,
or as a Dovetail-aware irq_work.

No functional change is introduced in the pre-existing code.

Signed-off-by: Philippe Gerum <rpm at xenomai.org>
---
 .../kernel/ipipe/pipeline/inband_work.h       | 32 +++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 include/cobalt/kernel/ipipe/pipeline/inband_work.h

diff --git a/include/cobalt/kernel/ipipe/pipeline/inband_work.h b/include/cobalt/kernel/ipipe/pipeline/inband_work.h
new file mode 100644
index 000000000..12ef07b00
--- /dev/null
+++ b/include/cobalt/kernel/ipipe/pipeline/inband_work.h
@@ -0,0 +1,32 @@
+/*
+ * SPDX-License-Identifier: GPL-2.0
+ *
+ * Copyright (C) 2019 Philippe Gerum  <rpm at xenomai.org>
+ */
+
+#ifndef _COBALT_KERNEL_IPIPE_INBAND_WORK_H
+#define _COBALT_KERNEL_IPIPE_INBAND_WORK_H
+
+#include <linux/ipipe.h>
+
+/*
+ * This field must be named inband_work and appear first in the
+ * container work struct.
+ */
+struct pipeline_inband_work {
+	struct ipipe_work_header work;
+};
+
+#define PIPELINE_INBAND_WORK_INITIALIZER(__work, __handler)		\
+	{								\
+		.work = {						\
+			.size = sizeof(__work),				\
+			.handler = (void (*)(struct ipipe_work_header *)) \
+			__handler,					\
+		},							\
+	}
+
+#define pipeline_post_inband_work(__work)	\
+	ipipe_post_work_root(__work, inband_work.work)
+
+#endif /* !_COBALT_KERNEL_IPIPE_INBAND_WORK_H */
-- 
2.26.2




More information about the Xenomai mailing list