[PATCH 2/2] Remove obsolete __RTEMS_HAVE_SYS_CPUSET_H__

Joel Sherrill joel at rtems.org
Tue Jan 10 23:57:56 UTC 2017


---
 cpukit/configure.ac                              |    7 --
 cpukit/libcsupport/Makefile.am                   |    2 +-
 cpukit/libcsupport/src/devctl.c                  |   72 ----------------
 cpukit/libcsupport/src/posix_devctl.c            |   72 ++++++++++++++++
 cpukit/posix/include/rtems/posix/pthreadimpl.h   |    2 +-
 cpukit/posix/src/pthread.c                       |   10 +--
 cpukit/posix/src/pthreadattrcompare.c            |   30 +++----
 cpukit/posix/src/pthreadcreate.c                 |    6 +-
 cpukit/rtems/include/rtems/rtems/tasks.h         |    4 -
 cpukit/rtems/src/schedulergetprocessorset.c      |    4 -
 cpukit/rtems/src/taskgetaffinity.c               |    3 -
 cpukit/rtems/src/tasksetaffinity.c               |    3 -
 cpukit/score/include/rtems/score/cpuset.h        |    4 -
 cpukit/score/include/rtems/score/cpusetimpl.h    |    3 -
 cpukit/score/include/rtems/score/scheduler.h     |    6 +-
 cpukit/score/include/rtems/score/schedulerimpl.h |    4 -
 cpukit/score/src/cpuset.c                        |    4 -
 cpukit/score/src/cpusetprintsupport.c            |   95 +++++++++++-----------
 cpukit/score/src/schedulergetaffinity.c          |    4 -
 cpukit/score/src/schedulersetaffinity.c          |    4 -
 testsuites/psxtests/configure.ac                 |    3 -
 testsuites/smptests/configure.ac                 |    4 -
 testsuites/smptests/smpaffinity01/init.c         |   12 ---
 testsuites/sptests/Makefile.am                   |    3 -
 testsuites/sptests/configure.ac                  |    4 -
 testsuites/sptests/spcpuset01/init.c             |   13 ---
 testsuites/sptests/spcpuset01/system.h           |    2 -
 testsuites/sptests/spcpuset01/test.c             |    2 -
 testsuites/sptests/spscheduler01/init.c          |    4 -
 29 files changed, 143 insertions(+), 243 deletions(-)
 delete mode 100644 cpukit/libcsupport/src/devctl.c
 create mode 100644 cpukit/libcsupport/src/posix_devctl.c

diff --git a/cpukit/configure.ac b/cpukit/configure.ac
index 3ebf596..4410bf1 100644
--- a/cpukit/configure.ac
+++ b/cpukit/configure.ac
@@ -119,7 +119,6 @@ RTEMS_CHECK_FUNC([pthread_getaffinity_np],[
 RTEMS_CHECK_FUNC([pthread_getattr_np],[
   #define _GNU_SOURCE
   #include <pthread.h>])
-AC_CHECK_HEADERS([sys/cpuset.h])
 
 # This was added to newlib in August 2014 to improve conformance.
 # Disable use of internal definition if it is present.
@@ -252,12 +251,6 @@ RTEMS_CPUOPT([RTEMS_VERSION],
   [RTEMS version string])
 
 ## Header file differences that need to be known in .h after install
-RTEMS_CPUOPT([__RTEMS_HAVE_SYS_CPUSET_H__],
-  [test x"${ac_cv_header_sys_cpuset_h}" = x"yes"],
-  [1],
-  [indicate if <sys/cpuset.h> is present in toolset])
-
-## Header file differences that need to be known in .h after install
 RTEMS_CPUOPT([__RTEMS_HAVE_DECL_SIGALTSTACK__],
   [test x"${ac_cv_have_decl_sigaltstack}" = x"yes"],
   [1],
diff --git a/cpukit/libcsupport/Makefile.am b/cpukit/libcsupport/Makefile.am
index c9d2c7b..559ad81 100644
--- a/cpukit/libcsupport/Makefile.am
+++ b/cpukit/libcsupport/Makefile.am
@@ -138,7 +138,7 @@ libcsupport_a_SOURCES += src/printertask.c
 libcsupport_a_SOURCES += $(LIBC_GLUE_C_FILES) $(PASSWORD_GROUP_C_FILES) \
     $(TERMINAL_IDENTIFICATION_C_FILES) $(SYSTEM_CALL_C_FILES) \
     $(DIRECTORY_SCAN_C_FILES) $(ID_C_FILES) src/envlock.c \
-    $(TERMIOS_C_FILES) src/getpagesize.c src/getrusage.c src/devctl.c
+    $(TERMIOS_C_FILES) src/getpagesize.c src/getrusage.c src/posix_devctl.c
 
 
 libcsupport_a_SOURCES += src/flockfile.c src/funlockfile.c src/ftrylockfile.c
diff --git a/cpukit/libcsupport/src/devctl.c b/cpukit/libcsupport/src/devctl.c
deleted file mode 100644
index 353e0a5..0000000
--- a/cpukit/libcsupport/src/devctl.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2016 Joel Sherrill <joel at rtems.org>.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#define _POSIX_26_C_SOURCE
-
-#include <devctl.h>
-#include <sys/ioctl.h>
-#include <rtems/seterr.h>
-
-int posix_devctl(
-  int            fd,
-  int            dcmd,
-  void *restrict dev_data_ptr,
-  size_t         nbyte,
-  int *restrict  dev_info_ptr
-)
-{
-  /*
-   * The POSIX 1003.26 standard allows for library implementations
-   * that implement posix_devctl() using ioctl(). In this case,
-   * the extra parameters are largely ignored.
-   *
-   * The FACE Technical Standard requires only that FIONBIO
-   * be supported for sockets.
-   *
-   * This method appears to be rarely implemented and there are
-   * no known required use cases for this method beyond those 
-   * from ther FACE Technical Standard.
-   */
-
-  /*
-   * POSIX 1003.26 mentions that nbyte must be non-negative but this
-   * doesn't make sense because size_t is guaranteed to be unsigned.
-   */
-
-  /*
-   * Since this is implemented on top of ioctl(), the device information
-   * is not going to be passed down. Fill it in with zero so the behavior
-   * is defined.
-   */
-  if (dev_info_ptr != NULL) {
-    *dev_info_ptr = 0;
-  }
-
-  return ioctl(fd, dcmd, dev_data_ptr);
-}
diff --git a/cpukit/libcsupport/src/posix_devctl.c b/cpukit/libcsupport/src/posix_devctl.c
new file mode 100644
index 0000000..353e0a5
--- /dev/null
+++ b/cpukit/libcsupport/src/posix_devctl.c
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2016 Joel Sherrill <joel at rtems.org>.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#define _POSIX_26_C_SOURCE
+
+#include <devctl.h>
+#include <sys/ioctl.h>
+#include <rtems/seterr.h>
+
+int posix_devctl(
+  int            fd,
+  int            dcmd,
+  void *restrict dev_data_ptr,
+  size_t         nbyte,
+  int *restrict  dev_info_ptr
+)
+{
+  /*
+   * The POSIX 1003.26 standard allows for library implementations
+   * that implement posix_devctl() using ioctl(). In this case,
+   * the extra parameters are largely ignored.
+   *
+   * The FACE Technical Standard requires only that FIONBIO
+   * be supported for sockets.
+   *
+   * This method appears to be rarely implemented and there are
+   * no known required use cases for this method beyond those 
+   * from ther FACE Technical Standard.
+   */
+
+  /*
+   * POSIX 1003.26 mentions that nbyte must be non-negative but this
+   * doesn't make sense because size_t is guaranteed to be unsigned.
+   */
+
+  /*
+   * Since this is implemented on top of ioctl(), the device information
+   * is not going to be passed down. Fill it in with zero so the behavior
+   * is defined.
+   */
+  if (dev_info_ptr != NULL) {
+    *dev_info_ptr = 0;
+  }
+
+  return ioctl(fd, dcmd, dev_data_ptr);
+}
diff --git a/cpukit/posix/include/rtems/posix/pthreadimpl.h b/cpukit/posix/include/rtems/posix/pthreadimpl.h
index acf6682..90a60b6 100644
--- a/cpukit/posix/include/rtems/posix/pthreadimpl.h
+++ b/cpukit/posix/include/rtems/posix/pthreadimpl.h
@@ -127,7 +127,7 @@ RTEMS_INLINE_ROUTINE void _POSIX_Threads_Copy_attributes(
 )
 {
   *dst_attr = *src_attr;
-#if defined(RTEMS_SMP) && defined(__RTEMS_HAVE_SYS_CPUSET_H__)
+#if defined(RTEMS_SMP)
   _Assert(
     dst_attr->affinitysetsize == sizeof(dst_attr->affinitysetpreallocated)
   );
diff --git a/cpukit/posix/src/pthread.c b/cpukit/posix/src/pthread.c
index e096dd6..65242f7 100644
--- a/cpukit/posix/src/pthread.c
+++ b/cpukit/posix/src/pthread.c
@@ -75,11 +75,9 @@ pthread_attr_t _POSIX_Threads_Default_attributes = {
     .cputime_clock_allowed = 1,                        /* cputime_clock_allowed */
   #endif
   .detachstate             = PTHREAD_CREATE_JOINABLE,    /* detachstate */
-  #if defined(__RTEMS_HAVE_SYS_CPUSET_H__)
-    .affinitysetsize         = 0,
-    .affinityset             = NULL,
-    .affinitysetpreallocated = {{0x0}}
-  #endif
+  .affinitysetsize         = 0,
+  .affinityset             = NULL,
+  .affinitysetpreallocated = {{0x0}}
 };
 
 void _POSIX_Threads_Sporadic_timer( Watchdog_Control *watchdog )
@@ -244,7 +242,7 @@ User_extensions_Control _POSIX_Threads_User_extensions = {
  */
 static void _POSIX_Threads_Manager_initialization(void)
 {
-  #if defined(RTEMS_SMP) && defined(__RTEMS_HAVE_SYS_CPUSET_H__)
+  #if defined(RTEMS_SMP)
     const CPU_set_Control *affinity;
     pthread_attr_t *attr;
 
diff --git a/cpukit/posix/src/pthreadattrcompare.c b/cpukit/posix/src/pthreadattrcompare.c
index 4cc4098..6a3b625 100644
--- a/cpukit/posix/src/pthreadattrcompare.c
+++ b/cpukit/posix/src/pthreadattrcompare.c
@@ -67,24 +67,22 @@ int rtems_pthread_attribute_compare(
   if ( attr1->detachstate != attr2->detachstate )
     return 1;
 
-  #if defined(__RTEMS_HAVE_SYS_CPUSET_H__)
-    if ( attr1->affinitysetsize != attr2->affinitysetsize )
-      return 1;
+  if ( attr1->affinitysetsize != attr2->affinitysetsize )
+    return 1;
 
-    if (!CPU_EQUAL_S(
-      attr1->affinitysetsize,
-      attr1->affinityset,
-      attr2->affinityset
-    ))
-      return 1;
+  if (!CPU_EQUAL_S(
+    attr1->affinitysetsize,
+    attr1->affinityset,
+    attr2->affinityset
+  ))
+    return 1;
 
-    if (!CPU_EQUAL_S(
-      attr1->affinitysetsize,
-      &attr1->affinitysetpreallocated,
-      &attr2->affinitysetpreallocated
-    ))
-      return 1;
-  #endif
+  if (!CPU_EQUAL_S(
+    attr1->affinitysetsize,
+    &attr1->affinitysetpreallocated,
+    &attr2->affinitysetpreallocated
+  ))
+    return 1;
 
   return 0;
 }
diff --git a/cpukit/posix/src/pthreadcreate.c b/cpukit/posix/src/pthreadcreate.c
index a04ac00..5c5ea5f 100644
--- a/cpukit/posix/src/pthreadcreate.c
+++ b/cpukit/posix/src/pthreadcreate.c
@@ -170,12 +170,10 @@ int pthread_create(
   }
 
 #if defined(RTEMS_SMP)
-#if __RTEMS_HAVE_SYS_CPUSET_H__
-  status = _CPU_set_Is_valid( the_attr->affinityset, the_attr->affinitysetsize );
+  status = _CPU_set_Is_valid(the_attr->affinityset, the_attr->affinitysetsize);
   if ( !status )
     return EINVAL;
 #endif
-#endif
 
   /*
    *  Currently all POSIX threads are floating point if the hardware
@@ -224,7 +222,7 @@ int pthread_create(
 
   the_thread->Life.state |= THREAD_LIFE_CHANGE_DEFERRED;
 
-#if defined(RTEMS_SMP) && __RTEMS_HAVE_SYS_CPUSET_H__
+#if defined(RTEMS_SMP)
   _ISR_lock_ISR_disable( &lock_context );
    status = _Scheduler_Set_affinity(
      the_thread,
diff --git a/cpukit/rtems/include/rtems/rtems/tasks.h b/cpukit/rtems/include/rtems/rtems/tasks.h
index 6baefa0..05f7ef3 100644
--- a/cpukit/rtems/include/rtems/rtems/tasks.h
+++ b/cpukit/rtems/include/rtems/rtems/tasks.h
@@ -402,7 +402,6 @@ rtems_status_code rtems_task_is_suspended(
   rtems_id   id
 );
 
-#if defined(__RTEMS_HAVE_SYS_CPUSET_H__)
 /**
  * @brief Gets the processor affinity set of a task.
  *
@@ -458,7 +457,6 @@ rtems_status_code rtems_task_set_affinity(
   size_t           cpusetsize,
   const cpu_set_t *cpuset
 );
-#endif
 
 /**
  * @brief Gets the scheduler of a task.
@@ -561,7 +559,6 @@ rtems_status_code rtems_scheduler_ident(
   rtems_id   *id
 );
 
-#if defined(__RTEMS_HAVE_SYS_CPUSET_H__)
 /**
  * @brief Gets the set of processors owned by the specified scheduler instance.
  *
@@ -583,7 +580,6 @@ rtems_status_code rtems_scheduler_get_processor_set(
   size_t     cpusetsize,
   cpu_set_t *cpuset
 );
-#endif
 
 /**
  * @brief Adds a processor to the set of processors owned by the specified
diff --git a/cpukit/rtems/src/schedulergetprocessorset.c b/cpukit/rtems/src/schedulergetprocessorset.c
index 275c563..3b46ad0 100644
--- a/cpukit/rtems/src/schedulergetprocessorset.c
+++ b/cpukit/rtems/src/schedulergetprocessorset.c
@@ -16,8 +16,6 @@
   #include "config.h"
 #endif
 
-#if defined(__RTEMS_HAVE_SYS_CPUSET_H__)
-
 #include <rtems/rtems/tasks.h>
 #include <rtems/score/cpusetimpl.h>
 #include <rtems/score/schedulerimpl.h>
@@ -47,5 +45,3 @@ rtems_status_code rtems_scheduler_get_processor_set(
 
   return RTEMS_SUCCESSFUL;
 }
-
-#endif /* defined(__RTEMS_HAVE_SYS_CPUSET_H__) */
diff --git a/cpukit/rtems/src/taskgetaffinity.c b/cpukit/rtems/src/taskgetaffinity.c
index b24966d..4519534 100644
--- a/cpukit/rtems/src/taskgetaffinity.c
+++ b/cpukit/rtems/src/taskgetaffinity.c
@@ -18,8 +18,6 @@
 #include "config.h"
 #endif
 
-#if defined(__RTEMS_HAVE_SYS_CPUSET_H__)
-
 #include <rtems/rtems/tasks.h>
 #include <rtems/score/threadimpl.h>
 #include <rtems/score/cpusetimpl.h>
@@ -65,4 +63,3 @@ rtems_status_code rtems_task_get_affinity(
   _Thread_Dispatch_enable( cpu_self );
   return ok ? RTEMS_SUCCESSFUL : RTEMS_INVALID_NUMBER;
 }
-#endif
diff --git a/cpukit/rtems/src/tasksetaffinity.c b/cpukit/rtems/src/tasksetaffinity.c
index 6caf862..290a13b 100644
--- a/cpukit/rtems/src/tasksetaffinity.c
+++ b/cpukit/rtems/src/tasksetaffinity.c
@@ -18,8 +18,6 @@
 #include "config.h"
 #endif
 
-#if defined(__RTEMS_HAVE_SYS_CPUSET_H__)
-
 #include <rtems/rtems/tasks.h>
 #include <rtems/score/threadimpl.h>
 #include <rtems/score/cpusetimpl.h>
@@ -65,4 +63,3 @@ rtems_status_code rtems_task_set_affinity(
   _Thread_Dispatch_enable( cpu_self );
   return ok ? RTEMS_SUCCESSFUL : RTEMS_INVALID_NUMBER;
 }
-#endif
diff --git a/cpukit/score/include/rtems/score/cpuset.h b/cpukit/score/include/rtems/score/cpuset.h
index ebdb35d..564f4a5 100644
--- a/cpukit/score/include/rtems/score/cpuset.h
+++ b/cpukit/score/include/rtems/score/cpuset.h
@@ -21,8 +21,6 @@
 
 #include <rtems/score/basedefs.h>
 
-#ifdef __RTEMS_HAVE_SYS_CPUSET_H__
-
 #include <sys/cpuset.h>
 
 #ifdef __cplusplus
@@ -61,7 +59,5 @@ typedef struct {
 }
 #endif
 
-#endif /* __RTEMS_HAVE_SYS_CPUSET_H__ */
-
 #endif /* _RTEMS_SCORE_CPUSET_H */
 /* end of include file */
diff --git a/cpukit/score/include/rtems/score/cpusetimpl.h b/cpukit/score/include/rtems/score/cpusetimpl.h
index f9a0f0f..6a6bf97 100644
--- a/cpukit/score/include/rtems/score/cpusetimpl.h
+++ b/cpukit/score/include/rtems/score/cpusetimpl.h
@@ -28,8 +28,6 @@
 extern "C" {
 #endif
 
-#ifdef __RTEMS_HAVE_SYS_CPUSET_H__
-
 /**
  * @brief Determine If the CPU Set if Valid
  *
@@ -121,7 +119,6 @@ static inline void _CPU_set_Set(
   set->setsize = setsize;
   CPU_COPY( set->set, cpuset );
 }
-#endif
 
 /**@}*/
 
diff --git a/cpukit/score/include/rtems/score/scheduler.h b/cpukit/score/include/rtems/score/scheduler.h
index 7d461f8..fd59f16 100644
--- a/cpukit/score/include/rtems/score/scheduler.h
+++ b/cpukit/score/include/rtems/score/scheduler.h
@@ -20,7 +20,7 @@
 #define _RTEMS_SCORE_SCHEDULER_H
 
 #include <rtems/score/thread.h>
-#if defined(__RTEMS_HAVE_SYS_CPUSET_H__) && defined(RTEMS_SMP)
+#if defined(RTEMS_SMP)
   #include <sys/cpuset.h>
 #endif
 
@@ -212,7 +212,7 @@ typedef struct {
     struct Per_CPU_Control *
   );
 
-#if defined(__RTEMS_HAVE_SYS_CPUSET_H__) && defined(RTEMS_SMP)
+#if defined(RTEMS_SMP)
   /** @see _Scheduler_Get_affinity() */
   bool ( *get_affinity )(
     const Scheduler_Control *,
@@ -523,7 +523,7 @@ void _Scheduler_default_Start_idle(
   struct Per_CPU_Control  *cpu
 );
 
-#if defined(__RTEMS_HAVE_SYS_CPUSET_H__) && defined(RTEMS_SMP)
+#if defined(RTEMS_SMP)
   /**
    * @brief Get affinity for the default scheduler.
    *
diff --git a/cpukit/score/include/rtems/score/schedulerimpl.h b/cpukit/score/include/rtems/score/schedulerimpl.h
index 737d1a3..90a9bcc 100644
--- a/cpukit/score/include/rtems/score/schedulerimpl.h
+++ b/cpukit/score/include/rtems/score/schedulerimpl.h
@@ -659,8 +659,6 @@ RTEMS_INLINE_ROUTINE bool _Scheduler_Has_processor_ownership(
 #endif
 }
 
-#if defined(__RTEMS_HAVE_SYS_CPUSET_H__)
-
 RTEMS_INLINE_ROUTINE void _Scheduler_Get_processor_set(
   const Scheduler_Control *scheduler,
   size_t                   cpusetsize,
@@ -744,8 +742,6 @@ bool _Scheduler_Set_affinity(
   const cpu_set_t *cpuset
 );
 
-#endif /* defined(__RTEMS_HAVE_SYS_CPUSET_H__) */
-
 RTEMS_INLINE_ROUTINE void _Scheduler_Generic_block(
   const Scheduler_Control *scheduler,
   Thread_Control          *the_thread,
diff --git a/cpukit/score/src/cpuset.c b/cpukit/score/src/cpuset.c
index 3247582..1540d3c 100644
--- a/cpukit/score/src/cpuset.c
+++ b/cpukit/score/src/cpuset.c
@@ -19,7 +19,6 @@
 #include "config.h"
 #endif
 
-#ifdef __RTEMS_HAVE_SYS_CPUSET_H__
 #include <sys/cpuset.h>
 #include <rtems/sysinit.h>
 #include <rtems/score/cpusetimpl.h>
@@ -96,6 +95,3 @@ const CPU_set_Control *_CPU_set_Default()
 {
   return &cpuset_default;
 }
-#endif
-
-
diff --git a/cpukit/score/src/cpusetprintsupport.c b/cpukit/score/src/cpusetprintsupport.c
index 13cffd9..c1ae235 100644
--- a/cpukit/score/src/cpusetprintsupport.c
+++ b/cpukit/score/src/cpusetprintsupport.c
@@ -26,55 +26,52 @@
 #include <rtems/printer.h>
 #include <rtems/score/cpusetimpl.h>
 
-#ifdef __RTEMS_HAVE_SYS_CPUSET_H__
+void _CPU_set_Show_with_plugin(
+  const rtems_printer *printer,
+  const char          *description,
+  const cpu_set_t     *cpuset
+);
 
-  void _CPU_set_Show_with_plugin(
-    const rtems_printer *printer,
-    const char          *description,
-    const cpu_set_t     *cpuset
-  );
-
-  /*
-   * _CPU_set_Show_with_plugin
-   *
-   * This routine shows cpuset cpuset using a
-   * print plugin .
-   */
-  void _CPU_set_Show_with_plugin(
-    const rtems_printer *printer,
-    const char          *description,
-    const cpu_set_t     *cpuset
-  )
-  {
-    int i;
-    rtems_printf(printer ,"%s: ", description);
-    for(i=0; i<_NCPUWORDS; i++)
-      rtems_printf(printer ,"%" PRIx32 "", cpuset->__bits[i]);
-    rtems_printf(printer ,"\n");
-  }
+/*
+ * _CPU_set_Show_with_plugin
+ *
+ * This routine shows cpuset cpuset using a
+ * print plugin .
+ */
+void _CPU_set_Show_with_plugin(
+  const rtems_printer *printer,
+  const char          *description,
+  const cpu_set_t     *cpuset
+)
+{
+  int i;
+  rtems_printf(printer ,"%s: ", description);
+  for(i=0; i<_NCPUWORDS; i++)
+    rtems_printf(printer ,"%" PRIx32 "", cpuset->__bits[i]);
+  rtems_printf(printer ,"\n");
+}
 
-  /*
-   * _CPU_set_Show
-   *
-   * This routine shows a cpuset using the
-   * printk plugin.
-   */
-  void _CPU_set_Show( const char *description, const cpu_set_t   *cpuset)
-  {
-    rtems_printer printer;
-    rtems_print_printer_printk( &printer );
-    _CPU_set_Show_with_plugin( &printer, description, cpuset );
-  }
+/*
+ * _CPU_set_Show
+ *
+ * This routine shows a cpuset using the
+ * printk plugin.
+ */
+void _CPU_set_Show( const char *description, const cpu_set_t   *cpuset)
+{
+  rtems_printer printer;
+  rtems_print_printer_printk( &printer );
+  _CPU_set_Show_with_plugin( &printer, description, cpuset );
+}
 
-  /*
-   * _CPU_set_Show_default
-   *
-   * This routine shows the default cpuset.
-   */
- void _CPU_set_Show_default( const char *description )
-  {
-    const CPU_set_Control *ctl;
-    ctl = _CPU_set_Default();
-    _CPU_set_Show( description, ctl->set );
-  }
-#endif
+/*
+ * _CPU_set_Show_default
+ *
+ * This routine shows the default cpuset.
+ */
+void _CPU_set_Show_default( const char *description )
+{
+  const CPU_set_Control *ctl;
+  ctl = _CPU_set_Default();
+  _CPU_set_Show( description, ctl->set );
+}
diff --git a/cpukit/score/src/schedulergetaffinity.c b/cpukit/score/src/schedulergetaffinity.c
index 8489957..37e10de 100644
--- a/cpukit/score/src/schedulergetaffinity.c
+++ b/cpukit/score/src/schedulergetaffinity.c
@@ -18,8 +18,6 @@
 
 #include <rtems/score/schedulerimpl.h>
 
-#if defined(__RTEMS_HAVE_SYS_CPUSET_H__)
-
 bool _Scheduler_Get_affinity(
   Thread_Control *the_thread,
   size_t          cpusetsize,
@@ -56,5 +54,3 @@ bool _Scheduler_Get_affinity(
   _Scheduler_Release_critical( scheduler, &lock_context );
   return ok;
 }
-
-#endif /* defined(__RTEMS_HAVE_SYS_CPUSET_H__) */
diff --git a/cpukit/score/src/schedulersetaffinity.c b/cpukit/score/src/schedulersetaffinity.c
index 6635ffa..67073df 100644
--- a/cpukit/score/src/schedulersetaffinity.c
+++ b/cpukit/score/src/schedulersetaffinity.c
@@ -18,8 +18,6 @@
 
 #include <rtems/score/schedulerimpl.h>
 
-#if defined(__RTEMS_HAVE_SYS_CPUSET_H__)
-
 bool _Scheduler_Set_affinity(
   Thread_Control  *the_thread,
   size_t           cpusetsize,
@@ -56,5 +54,3 @@ bool _Scheduler_Set_affinity(
   _Scheduler_Release_critical( scheduler, &lock_context );
   return ok;
 }
-
-#endif /* defined(__RTEMS_HAVE_SYS_CPUSET_H__) */
diff --git a/testsuites/psxtests/configure.ac b/testsuites/psxtests/configure.ac
index 6b12e49..1ac2877 100644
--- a/testsuites/psxtests/configure.ac
+++ b/testsuites/psxtests/configure.ac
@@ -81,9 +81,6 @@ AC_CHECK_DECLS([pthread_getattr_np],[],[],[[
   #define _GNU_SOURCE
   #include <pthread.h>]])
 
-# Added to newlib pthreads for RTEMS SMP (np), may not be present
-AC_CHECK_HEADERS([cpuset.h])
-
 # Mandated by POSIX, not declared in some versions of newlib.
 AC_CHECK_DECLS([getrusage],,,[#include sys/resource.h])
 
diff --git a/testsuites/smptests/configure.ac b/testsuites/smptests/configure.ac
index bec8149..f242b0b 100644
--- a/testsuites/smptests/configure.ac
+++ b/testsuites/smptests/configure.ac
@@ -51,10 +51,6 @@ AC_CHECK_DECLS([pthread_getattr_np],[],[],[[
   #define _GNU_SOURCE
   #include <pthread.h>]])
 
-# Added to newlib pthreads for RTEMS SMP (np), may not be present
-AC_CHECK_HEADERS([sys/cpuset.h])
-AM_CONDITIONAL(HAS_CPUSET,test x"${ac_cv_header_sys_cpuset_h}" = x"yes")
-
 # Explicitly list all Makefiles here
 AC_CONFIG_FILES([Makefile
 smpmutex02/Makefile
diff --git a/testsuites/smptests/smpaffinity01/init.c b/testsuites/smptests/smpaffinity01/init.c
index 969a332..1b8fc72 100644
--- a/testsuites/smptests/smpaffinity01/init.c
+++ b/testsuites/smptests/smpaffinity01/init.c
@@ -17,8 +17,6 @@
 
 const char rtems_test_name[] = "SMPAFFINITY 1";
 
-#if defined(__RTEMS_HAVE_SYS_CPUSET_H__)
-
 rtems_id           Init_id;
 rtems_id           Med_id[NUM_CPUS-1];
 rtems_id           Low_id[NUM_CPUS];
@@ -226,16 +224,6 @@ static void Init(rtems_task_argument arg)
   rtems_test_exit(0);
 }
 
-#else
-static void Init(rtems_task_argument arg)
-{
-  TEST_BEGIN();
-  puts( " Affinity NOT Supported");
-  TEST_END();
-  rtems_test_exit(0);
-}
-
-#endif
 #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
 #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
 
diff --git a/testsuites/sptests/Makefile.am b/testsuites/sptests/Makefile.am
index 54a4de7..09b8b79 100644
--- a/testsuites/sptests/Makefile.am
+++ b/testsuites/sptests/Makefile.am
@@ -81,10 +81,7 @@ _SUBDIRS += spinternalerror02
 _SUBDIRS += sptimer_err01 sptimer_err02
 _SUBDIRS += sptimerserver01
 _SUBDIRS += spclock_err02
-
-if HAS_CPUSET
 _SUBDIRS += spcpuset01
-endif
 
 include $(top_srcdir)/../automake/test-subdirs.am
 include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/sptests/configure.ac b/testsuites/sptests/configure.ac
index 76d60e3..0a28824 100644
--- a/testsuites/sptests/configure.ac
+++ b/testsuites/sptests/configure.ac
@@ -36,10 +36,6 @@ AM_CONDITIONAL(HAS__THREAD_QUEUE_QUEUE,test x"${ac_cv_type_struct__Thread_queue_
 AC_CHECK_HEADERS([threads.h])
 AM_CONDITIONAL([HAS_THREADS_H],[test x"$ac_cv_header_threads_h" = x"yes"])
 
-# Added to newlib pthreads for RTEMS SMP (np), may not be present
-AC_CHECK_HEADERS([sys/cpuset.h])
-AM_CONDITIONAL(HAS_CPUSET,test x"${ac_cv_header_sys_cpuset_h}" = x"yes")
-
 # Some tests should not be built/run in SMP configurations
 RTEMS_CHECK_CPUOPTS([RTEMS_SMP])
 AM_CONDITIONAL(HAS_SMP,test "$rtems_cv_RTEMS_SMP" = "yes")
diff --git a/testsuites/sptests/spcpuset01/init.c b/testsuites/sptests/spcpuset01/init.c
index d77a240..5883707 100644
--- a/testsuites/sptests/spcpuset01/init.c
+++ b/testsuites/sptests/spcpuset01/init.c
@@ -15,7 +15,6 @@
 
 const char rtems_test_name[] = "SPCPUSET 1";
 
-#if defined(__RTEMS_HAVE_SYS_CPUSET_H__)
 static void test_cpu_zero_case_1(void)
 {
   size_t i;
@@ -154,15 +153,3 @@ rtems_task Init(
   TEST_END();
   exit( 0 );
 }
-#else
-#error "Init - No cpuset"
-rtems_task Init(
-  rtems_task_argument ignored
-)
-{
-  TEST_BEGIN();
-  puts( "  cpuset not supported\n" );
-  TEST_END();
-  exit( 0 );
-}
-#endif
diff --git a/testsuites/sptests/spcpuset01/system.h b/testsuites/sptests/spcpuset01/system.h
index bc9138d..85571c8 100644
--- a/testsuites/sptests/spcpuset01/system.h
+++ b/testsuites/sptests/spcpuset01/system.h
@@ -10,14 +10,12 @@
 #include "tmacros.h"
 #include "test_support.h"
 
-#if defined(__RTEMS_HAVE_SYS_CPUSET_H__)
 #include <sys/cpuset.h>
 
 /* global variables */
 extern cpu_set_t set1;
 extern cpu_set_t set2;
 extern cpu_set_t set3;
-#endif
 
 /* enable/disable verbose output */
 #ifndef DPRINT
diff --git a/testsuites/sptests/spcpuset01/test.c b/testsuites/sptests/spcpuset01/test.c
index 494880d..8b4673f 100644
--- a/testsuites/sptests/spcpuset01/test.c
+++ b/testsuites/sptests/spcpuset01/test.c
@@ -11,7 +11,6 @@
 #include <assert.h>
 #include "system.h"
 
-#if defined(__RTEMS_HAVE_SYS_CPUSET_H__)
 void test_cpu_and_case_1(size_t cpu1, size_t cpu2);
 void test_cpu_nand_case_1(size_t cpu1, size_t cpu2);
 void test_cpu_or_case_1(size_t cpu1, size_t cpu2);
@@ -124,4 +123,3 @@ void cpuset_logic_test()
     }
   }
 }
-#endif
diff --git a/testsuites/sptests/spscheduler01/init.c b/testsuites/sptests/spscheduler01/init.c
index be9fed2..9bdfacc 100644
--- a/testsuites/sptests/spscheduler01/init.c
+++ b/testsuites/sptests/spscheduler01/init.c
@@ -37,7 +37,6 @@ static rtems_id sema_id;
 
 static void test_task_get_set_affinity(void)
 {
-#if defined(__RTEMS_HAVE_SYS_CPUSET_H__)
   rtems_id self_id = rtems_task_self();
   rtems_id task_id;
   rtems_status_code sc;
@@ -120,7 +119,6 @@ static void test_task_get_set_affinity(void)
 
   CPU_FREE(cpusetbig);
   CPU_FREE(cpusetbigone);
-#endif /* defined(__RTEMS_HAVE_SYS_CPUSET_H__) */
 }
 
 static rtems_task_priority set_prio(rtems_id id, rtems_task_priority prio)
@@ -361,7 +359,6 @@ static void test_scheduler_ident(void)
 
 static void test_scheduler_get_processors(void)
 {
-#if defined(__RTEMS_HAVE_SYS_CPUSET_H__)
   rtems_status_code sc;
   rtems_name name = BLUE;
   rtems_id scheduler_id;
@@ -408,7 +405,6 @@ static void test_scheduler_get_processors(void)
 
   CPU_FREE(cpusetbig);
   CPU_FREE(cpusetbigone);
-#endif /* defined(__RTEMS_HAVE_SYS_CPUSET_H__) */
 }
 
 static void test_scheduler_add_remove_processors(void)
-- 
1.7.1




More information about the devel mailing list