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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Mon Apr 21 11:22:04 2014 +0200

copperplate: sanity checks for non-SMP libraries over SMP kernel

---

 lib/cobalt/init.c      |    6 ++++++
 lib/copperplate/init.c |    5 +++++
 2 files changed, 11 insertions(+)

diff --git a/lib/cobalt/init.c b/lib/cobalt/init.c
index a903814..7c36745 100644
--- a/lib/cobalt/init.c
+++ b/lib/cobalt/init.c
@@ -216,6 +216,12 @@ static __libcobalt_ctor void __init_cobalt(void)
                _exit(0);
        }
 
+#ifndef CONFIG_SMP
+       ret = get_static_cpu_count();
+       if (ret > 0)
+               report_error("running non-SMP libraries on SMP kernel?");
+#endif
+
        __cobalt_main_tid = tid;
 
        if (__cobalt_defer_init)
diff --git a/lib/copperplate/init.c b/lib/copperplate/init.c
index 4cb0c6f..0603a51 100644
--- a/lib/copperplate/init.c
+++ b/lib/copperplate/init.c
@@ -504,6 +504,11 @@ void copperplate_init(int *argcp, char *const **argvp)
                return;
        }
 
+#if defined(CONFIG_MERCURY) && !defined(CONFIG_SMP)
+       ret = get_static_cpu_count();
+       if (ret > 0)
+               early_panic("running non-SMP libraries on SMP kernel?");
+#endif
        boilerplate_init();
 
        threadobj_init_key();


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

Reply via email to