summaryrefslogtreecommitdiff
path: root/linux/linux-ext-xenomai.mk
diff options
context:
space:
mode:
Diffstat (limited to 'linux/linux-ext-xenomai.mk')
-rw-r--r--linux/linux-ext-xenomai.mk30
1 files changed, 30 insertions, 0 deletions
diff --git a/linux/linux-ext-xenomai.mk b/linux/linux-ext-xenomai.mk
new file mode 100644
index 000000000..e855deddf
--- /dev/null
+++ b/linux/linux-ext-xenomai.mk
@@ -0,0 +1,30 @@
+##################################################
+# Linux Adeos/Xenomai extensions
+#
+# Patch the linux kernel with xenomai extension
+##################################################
+
+ifeq ($(BR2_LINUX_KERNEL_EXT_XENOMAI),y)
+# Add dependency to xenomai (user-space) which provide ksrc part
+LINUX_DEPENDENCIES += xenomai
+
+# Adeos patch version
+XENOMAI_ADEOS_PATCH = $(call qstrip,$(BR2_LINUX_KERNEL_EXT_XENOMAI_ADEOS_PATCH))
+ifeq ($(XENOMAI_ADEOS_PATCH),)
+XENOMAI_ADEOS_OPT = --default
+else
+XENOMAI_ADEOS_OPT = --adeos=$(XENOMAI_ADEOS_PATCH)
+endif
+
+# Prepare kernel patch
+define XENOMAI_PREPARE_KERNEL
+ $(XENOMAI_DIR)/scripts/prepare-kernel.sh \
+ --linux=$(LINUX_DIR) \
+ --arch=$(KERNEL_ARCH) \
+ $(XENOMAI_ADEOS_OPT) \
+ --verbose
+endef
+
+LINUX_POST_EXTRACT_HOOKS += XENOMAI_PREPARE_KERNEL
+
+endif #BR2_LINUX_EXT_XENOMAI