Module: xenomai-forge
Branch: next
Commit: 2c19afd084a47dae2998d5814ffc20c65e76b93f
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=2c19afd084a47dae2998d5814ffc20c65e76b93f

Author: Philippe Gerum <r...@xenomai.org>
Date:   Thu Feb 20 11:06:00 2014 +0100

cobalt/init: expose real-time core enabled/disabled status

---

 include/cobalt/kernel/Makefile.am   |    1 +
 include/cobalt/kernel/Makefile.in   |    1 +
 include/cobalt/kernel/init.h        |   30 ++++++++++++++++++++++++++++++
 include/cobalt/kernel/rtdm/driver.h |    1 +
 kernel/cobalt/init.c                |    9 +++++----
 5 files changed, 38 insertions(+), 4 deletions(-)

diff --git a/include/cobalt/kernel/Makefile.am 
b/include/cobalt/kernel/Makefile.am
index e79a298..d2375dc 100644
--- a/include/cobalt/kernel/Makefile.am
+++ b/include/cobalt/kernel/Makefile.am
@@ -7,6 +7,7 @@ noinst_HEADERS =        \
        bufd.h          \
        clock.h         \
        heap.h          \
+       init.h          \
        intr.h          \
        list.h          \
        lock.h          \
diff --git a/include/cobalt/kernel/Makefile.in 
b/include/cobalt/kernel/Makefile.in
index 747b275..730b235 100644
--- a/include/cobalt/kernel/Makefile.in
+++ b/include/cobalt/kernel/Makefile.in
@@ -353,6 +353,7 @@ noinst_HEADERS = \
        bufd.h          \
        clock.h         \
        heap.h          \
+       init.h          \
        intr.h          \
        list.h          \
        lock.h          \
diff --git a/include/cobalt/kernel/init.h b/include/cobalt/kernel/init.h
new file mode 100644
index 0000000..49ec0bb
--- /dev/null
+++ b/include/cobalt/kernel/init.h
@@ -0,0 +1,30 @@
+/*
+ * @note Copyright (C) 2013 Philippe Gerum <r...@xenomai.org>.
+ *
+ * Xenomai is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2 of the License,
+ * or (at your option) any later version.
+ *
+ * Xenomai is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Xenomai; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#ifndef _COBALT_KERNEL_INIT_H
+#define _COBALT_KERNEL_INIT_H
+
+extern int __xnsys_disabled;
+
+static inline int realtime_core_enabled(void)
+{
+       return !__xnsys_disabled;
+}
+
+#endif /* !_COBALT_KERNEL_INIT_H_ */
diff --git a/include/cobalt/kernel/rtdm/driver.h 
b/include/cobalt/kernel/rtdm/driver.h
index 3e1795c..78ce5e4 100644
--- a/include/cobalt/kernel/rtdm/driver.h
+++ b/include/cobalt/kernel/rtdm/driver.h
@@ -38,6 +38,7 @@
 #include <cobalt/kernel/clock.h>
 #include <cobalt/kernel/apc.h>
 #include <cobalt/kernel/shadow.h>
+#include <cobalt/kernel/init.h>
 #include <rtdm/rtdm.h>
 
 /* debug support */
diff --git a/kernel/cobalt/init.c b/kernel/cobalt/init.c
index aeb9c14..b364676 100644
--- a/kernel/cobalt/init.c
+++ b/kernel/cobalt/init.c
@@ -52,9 +52,6 @@ static unsigned long supported_cpus_arg = -1;
 module_param_named(supported_cpus, supported_cpus_arg, ulong, 0444);
 #endif /* CONFIG_SMP */
 
-static unsigned long disable_arg;
-module_param_named(disable, disable_arg, ulong, 0444);
-
 static unsigned long sysheap_size_arg;
 module_param_named(sysheap_size, sysheap_size_arg, ulong, 0444);
 
@@ -64,6 +61,10 @@ EXPORT_SYMBOL_GPL(xnarch_machdata);
 struct xnarch_percpu_machdata xnarch_percpu_machdata;
 EXPORT_PER_CPU_SYMBOL_GPL(xnarch_percpu_machdata);
 
+int __xnsys_disabled;
+module_param_named(disable, __xnsys_disabled, int, 0444);
+EXPORT_SYMBOL_GPL(__xnsys_disabled);
+
 struct xnsys_ppd __xnsys_global_ppd = {
        .exe_path = "vmlinux",
 };
@@ -374,7 +375,7 @@ static int __init xenomai_init(void)
 {
        int ret;
 
-       if (disable_arg) {
+       if (__xnsys_disabled) {
                printk(XENO_WARN "disabled on kernel command line\n");
                return -ENOSYS;
        }


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to