From ee1c75fc5f7deb95ae461c1023c37fabc32d55b3 Mon Sep 17 00:00:00 2001
From: Armin Luntzer <armin.luntzer@univie.ac.at>
Date: Wed, 26 Apr 2017 12:47:11 +0200
Subject: [PATCH] add config option for Xentium processing demo kernel

---
 init/Kconfig  | 7 +++++++
 init/Makefile | 2 +-
 init/main.c   | 2 ++
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/init/Kconfig b/init/Kconfig
index 9632183..6b27a0b 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -85,6 +85,13 @@ config BUILD_XEN_KERNELS
 	  Enable this option in order to build the Xentium kernel programs
 	  in dsp/xentium.
 
+config XENTIUM_PROC_DEMO
+	bool "Build a Xentium Processing Demo kernel"
+	depends on BUILD_XEN_KERNELS && XENTIUM
+	help
+	  Enable this option in order to build a kernel that runs a Xentium
+	  processing demo.
+
 
 menu "Compile-time checks and compiler options"
 
diff --git a/init/Makefile b/init/Makefile
index 45dfaa0..7ea4cb2 100644
--- a/init/Makefile
+++ b/init/Makefile
@@ -1,3 +1,3 @@
 obj-y += main.o
-obj-y += xentium_demo.o
+obj-$(CONFIG_XENTIUM_PROC_DEMO) += xentium_demo.o
 obj-$(CONFIG_EMBED_MODULES_IMAGE) += modules-image.o
diff --git a/init/main.c b/init/main.c
index 7243ad8..1162c3a 100644
--- a/init/main.c
+++ b/init/main.c
@@ -102,8 +102,10 @@ int main(void)
 	cpu_dcache_disable();
 #endif
 
+#ifdef CONFIG_XENTIUM_PROC_DEMO
 	/* run the demo */
 	xen_demo();
+#endif
 
 	return 0;
 }
-- 
GitLab