[Xenomai-git] Philippe Gerum : lib/cobalt: assume CPU_COUNT, CPU_FILL are available

2015-07-27 Thread git repository hosting
Module: xenomai-3
Branch: master
Commit: ba364e772d82241dc6814960ca1b174972edd758
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=ba364e772d82241dc6814960ca1b174972edd758

Author: Philippe Gerum 
Date:   Thu Jul 23 11:08:51 2015 +0200

lib/cobalt: assume CPU_COUNT, CPU_FILL are available

---

 include/cobalt/sched.h |   12 
 lib/cobalt/wrappers.c  |   30 --
 2 files changed, 42 deletions(-)

diff --git a/include/cobalt/sched.h b/include/cobalt/sched.h
index 776272b..d7c72ca 100644
--- a/include/cobalt/sched.h
+++ b/include/cobalt/sched.h
@@ -31,18 +31,6 @@ COBALT_DECL(int, sched_get_priority_min(int policy));
 
 COBALT_DECL(int, sched_get_priority_max(int policy));
 
-#ifndef CPU_COUNT
-#define CPU_COUNT(__setp)__PROVIDE_CPU_COUNT(__setp)
-#define __PROVIDE_CPU_COUNT(__setp)  __sched_cpucount(sizeof(cpu_set_t), 
__setp)
-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 */
-
 #ifdef __cplusplus
 extern "C" {
 #endif
diff --git a/lib/cobalt/wrappers.c b/lib/cobalt/wrappers.c
index 313c3a7..4776e36 100644
--- a/lib/cobalt/wrappers.c
+++ b/lib/cobalt/wrappers.c
@@ -496,33 +496,3 @@ unsigned int __real_sleep(unsigned int seconds)
 {
return sleep(seconds);
 }
-
-#ifdef __PROVIDE_CPU_COUNT
-
-int __sched_cpucount(size_t setsize, const cpu_set_t *setp)
-{
-   int count, shift;
-   const char *p;
-
-   for (count = 0, p = setp; p < (char *)setp + setsize; p++) {
-   shift = *p;
-   while (shift) {
-   if (shift & 1)
-   count++;
-   shift >>= 1;
-   }
-   }
-
-   return count;
-}
-
-#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://xenomai.org/mailman/listinfo/xenomai-git


[Xenomai-git] Philippe Gerum : lib/cobalt: assume CPU_COUNT, CPU_FILL are available

2015-07-23 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: ba364e772d82241dc6814960ca1b174972edd758
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=ba364e772d82241dc6814960ca1b174972edd758

Author: Philippe Gerum 
Date:   Thu Jul 23 11:08:51 2015 +0200

lib/cobalt: assume CPU_COUNT, CPU_FILL are available

---

 include/cobalt/sched.h |   12 
 lib/cobalt/wrappers.c  |   30 --
 2 files changed, 42 deletions(-)

diff --git a/include/cobalt/sched.h b/include/cobalt/sched.h
index 776272b..d7c72ca 100644
--- a/include/cobalt/sched.h
+++ b/include/cobalt/sched.h
@@ -31,18 +31,6 @@ COBALT_DECL(int, sched_get_priority_min(int policy));
 
 COBALT_DECL(int, sched_get_priority_max(int policy));
 
-#ifndef CPU_COUNT
-#define CPU_COUNT(__setp)__PROVIDE_CPU_COUNT(__setp)
-#define __PROVIDE_CPU_COUNT(__setp)  __sched_cpucount(sizeof(cpu_set_t), 
__setp)
-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 */
-
 #ifdef __cplusplus
 extern "C" {
 #endif
diff --git a/lib/cobalt/wrappers.c b/lib/cobalt/wrappers.c
index 313c3a7..4776e36 100644
--- a/lib/cobalt/wrappers.c
+++ b/lib/cobalt/wrappers.c
@@ -496,33 +496,3 @@ unsigned int __real_sleep(unsigned int seconds)
 {
return sleep(seconds);
 }
-
-#ifdef __PROVIDE_CPU_COUNT
-
-int __sched_cpucount(size_t setsize, const cpu_set_t *setp)
-{
-   int count, shift;
-   const char *p;
-
-   for (count = 0, p = setp; p < (char *)setp + setsize; p++) {
-   shift = *p;
-   while (shift) {
-   if (shift & 1)
-   count++;
-   shift >>= 1;
-   }
-   }
-
-   return count;
-}
-
-#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://xenomai.org/mailman/listinfo/xenomai-git