Skip to contentSkip to conversation

xenomai: Add choice for enabling/disabling Cobalt/Mercury core

PATCH New Pawel Sikora 3 participants 5 messages Apr 10, 2017 – Apr 12, 2017

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/2 xenomai: Add choice for enabling/disabling Cobalt/Mercury core

Add an option choice for Cobalt or Mercury core
depending on option BR2_LINUX_KERNEL_EXT_XENOMAI.

---
Changes v3 -> v4:
- No changes, just merging in series with SMP patch.

 package/xenomai/Config.in  | 27 +++++++++++++++++++++++++++
 package/xenomai/xenomai.mk |  6 ++++++
 2 files changed, 33 insertions(+)
package/xenomai/Config.in +27 -0
index b548ee810..324f5025a 100644
@@ -51,6 +51,33 @@ config BR2_PACKAGE_XENOMAI_VERSION
 	  BR2_LINUX_KERNEL_EXT_XENOMAI_ADEOS_PATCH, in the Linux
 	  Kernel -> Linux Kernel Extensions menu.
 
+choice
+	prompt "Xenomai core"
+	default BR2_PACKAGE_XENOMAI_MERCURY
+	help
+	  Select the Xenomai core: dual kernel (Cobalt)
+	  or native Linux Kernel (Mercury).
+
+config BR2_PACKAGE_XENOMAI_MERCURY
+	bool "Mercury"
+	depends on !BR2_LINUX_KERNEL_EXT_XENOMAI
+	help
+	  Select Mercury core for the Xenomai userspace.
+	  You want to use it if you have the native Linux Kernel.
+
+config BR2_PACKAGE_XENOMAI_COBALT
+	bool "Cobalt"
+	help
+	  Select Cobalt core (dual kernel) for the Xenomai
+	  userspace. Use this if you use a Xenomai-patched
+	  Linux kernel.
+
+	  If you want to use Cobalt core, your kernel must have
+	  the Adeos and Xenomai patches applied to it. You can
+	  add these through the BR2_LINUX_KERNEL_EXT_XENOMAI option
+	  in the Linux Kernel Extensions menu.
+endchoice
+
 config BR2_PACKAGE_XENOMAI_TESTSUITE
 	bool "Install testsuite"
 	help
package/xenomai/xenomai.mk +6 -0
index c9e810e05..73d9617b1 100644
@@ -23,6 +23,12 @@ XENOMAI_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) install-user
 
 XENOMAI_CONF_OPTS += --includedir=/usr/include/xenomai/ --disable-doc-install
 
+ifeq ($(BR2_PACKAGE_XENOMAI_MERCURY),y)
+XENOMAI_CONF_OPTS += --with-core=mercury
+else
+XENOMAI_CONF_OPTS += --with-core=cobalt
+endif
+
 define XENOMAI_REMOVE_DEVFILES
 	for i in xeno-config xeno-info wrap-link.sh ; do \
 		rm -f $(TARGET_DIR)/usr/bin/$$i ; \
Signature · 1 line
2.12.1
#1 lore raw

PATCH v4 2/2 xenomai: Add config for enabling/disabling SMP

Add a config option for enabling/disabling SMP
in Xenomai userspace in version 3.x

Enabled by default.

---
Changes v3 -> v4:
- No changes, just merging in series with 'core Cobalt/Mercury' patch

 package/xenomai/Config.in  | 17 +++++++++++++++++
 package/xenomai/xenomai.mk |  6 ++++++
 2 files changed, 23 insertions(+)
package/xenomai/Config.in +17 -0
index 324f5025a..efb504b35 100644
@@ -78,6 +78,23 @@ config BR2_PACKAGE_XENOMAI_COBALT
 	  in the Linux Kernel Extensions menu.
 endchoice
 
+config BR2_PACKAGE_XENOMAI_ENABLE_SMP
+	bool "Enable SMP"
+	default y
+	help
+	  This option enables SMP support in Xenomai userspace.
+
+	  If this option is turned on while no SMP support is enabled
+	  in the kernel, things will still work. However, if SMP is
+	  enabled in the kernel but this option is not turned on,
+	  Xenomai applications will complain with 'feature mismatch:
+	  missing="smp/nosmp'.
+
+	  Please refer to this troubleshooting guide for more
+	  information:
+
+	  http://xenomai.org/troubleshooting-a-dual-kernel-configuration/#feature_mismatch_missing8221smpnosmp8221
+
 config BR2_PACKAGE_XENOMAI_TESTSUITE
 	bool "Install testsuite"
 	help
package/xenomai/xenomai.mk +6 -0
index 73d9617b1..bd147a9ec 100644
@@ -29,6 +29,12 @@ else
 XENOMAI_CONF_OPTS += --with-core=cobalt
 endif
 
+ifeq ($(BR2_PACKAGE_XENOMAI_ENABLE_SMP),y)
+XENOMAI_CONF_OPTS += --enable-smp
+else
+XENOMAI_CONF_OPTS += --disable-smp
+endif
+
 define XENOMAI_REMOVE_DEVFILES
 	for i in xeno-config xeno-info wrap-link.sh ; do \
 		rm -f $(TARGET_DIR)/usr/bin/$$i ; \
Signature · 1 line
2.12.1
#2 lore raw

PATCH v4 2/2 xenomai: Add config for enabling/disabling SMP

Quoted 20 lines · Pawel Sikora

Add a config option for enabling/disabling SMP
in Xenomai userspace in version 3.x

Enabled by default.

---
Changes v3 -> v4:
- No changes, just merging in series with 'core Cobalt/Mercury' patch

 package/xenomai/Config.in  | 17 +++++++++++++++++
 package/xenomai/xenomai.mk |  6 ++++++
 2 files changed, 23 insertions(+)
package/xenomai/Config.in +0 -0
index 324f5025a..efb504b35 100644

package/xenomai/Config.in config BR2_PACKAGE_XENOMAI_COBALT · line 82

Quoted 5 lines
package/xenomai/Config.in +2 -0
@@ -78,6 +78,23 @@ config BR2_PACKAGE_XENOMAI_COBALT
          in the Linux Kernel Extensions menu.
 endchoice
 
+config BR2_PACKAGE_XENOMAI_ENABLE_SMP
+       bool "Enable SMP"

nit: I would make it "Enable SMP support"

package/xenomai/Config.in config BR2_PACKAGE_XENOMAI_COBALT · line 91

Quoted 9 lines
package/xenomai/Config.in +9 -0
+       default y
+       help
+         This option enables SMP support in Xenomai userspace.
+
+         If this option is turned on while no SMP support is enabled
+         in the kernel, things will still work. However, if SMP is
+         enabled in the kernel but this option is not turned on,
+         Xenomai applications will complain with 'feature mismatch:
+         missing="smp/nosmp'.

and here I would put the error message on a separate line to increase readability.

Obviously both of these are real nits, that perhaps could be fixed up when applying.

#3 lore raw

PATCH v4 2/2 xenomai: Add config for enabling/disabling SMP

In reply to Pawel Sikora

Hello,

Quoted 10 lines · Pawel Sikora

Add a config option for enabling/disabling SMP
in Xenomai userspace in version 3.x

Enabled by default.

---
Changes v3 -> v4:
- No changes, just merging in series with 'core Cobalt/Mercury' patch

Applied to master after taking into account the comments made by Thomas De Schampheleire.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#4 lore raw

PATCH v4 1/2 xenomai: Add choice for enabling/disabling Cobalt/Mercury core

In reply to Pawel Sikora

Hello,

Quoted 8 lines · Pawel Sikora

Add an option choice for Cobalt or Mercury core
depending on option BR2_LINUX_KERNEL_EXT_XENOMAI.

---
Changes v3 -> v4:
- No changes, just merging in series with SMP patch.

Applied to master, thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com