Module: xenomai-forge
Branch: master
Commit: 1a8db85137c02109c733ebc9c84b3a60e50cd13e
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=1a8db85137c02109c733ebc9c84b3a60e50cd13e

Author: Philippe Gerum <r...@xenomai.org>
Date:   Thu Jun  6 12:32:18 2013 +0200

lib/cobalt: provide CPU_FILL()

---

 include/cobalt/sched.h |    6 ++++++
 lib/cobalt/wrappers.c  |   10 ++++++++++
 2 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/include/cobalt/sched.h b/include/cobalt/sched.h
index b66f42b..4e66003 100644
--- a/include/cobalt/sched.h
+++ b/include/cobalt/sched.h
@@ -43,6 +43,12 @@ COBALT_DECL(int, sched_get_priority_max(int policy));
 int __sched_cpucount(size_t __setsize, const cpu_set_t *__setp);
 #endif /* !CPU_COUNT */
 
+#ifndef CPU_FILL
+#define CPU_FILL(__setp)    __PROVIDE_CPU_FILL(__setp)
+#define __PROVIDE_CPU_FILL(__setp)  __sched_cpufill(sizeof(cpu_set_t), __setp)
+void __sched_cpufill(size_t __setsize, cpu_set_t *__setp);
+#endif /* !CPU_COUNT */
+
 #endif /* !__KERNEL__ */
 
 #ifndef __sched_extensions_defined
diff --git a/lib/cobalt/wrappers.c b/lib/cobalt/wrappers.c
index 7fcbed1..d8dfacd 100644
--- a/lib/cobalt/wrappers.c
+++ b/lib/cobalt/wrappers.c
@@ -37,6 +37,7 @@
 #include <limits.h>
 #include <fcntl.h>
 #include <sched.h>
+#include <memory.h>
 #include <unistd.h>
 #include <malloc.h>
 
@@ -401,3 +402,12 @@ int __sched_cpucount(size_t setsize, const cpu_set_t *setp)
 }
 
 #endif /* __PROVIDE_CPU_COUNT */
+
+#ifdef __PROVIDE_CPU_FILL
+
+void __sched_cpufill(size_t setsize, cpu_set_t *setp)
+{
+       memset(setp, 0xff, setsize);
+}
+
+#endif /* __PROVIDE_CPU_COUNT */


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

Reply via email to