summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/cpuset.h
diff options
context:
space:
mode:
authorJennifer Averett <jennifer.averett@oarcorp.com>2014-02-06 12:42:24 -0600
committerJennifer Averett <jennifer.averett@oarcorp.com>2014-03-07 09:07:59 -0600
commit9db8705cc8ad2863dc0173b846783487742b313e (patch)
tree8e3c8ee82053cc68097e359a3087e418c13e9d69 /cpukit/score/include/rtems/score/cpuset.h
parentspcpuset01: Add check for sys/cpuset.h. (diff)
downloadrtems-9db8705cc8ad2863dc0173b846783487742b313e.tar.bz2
score: Add cpuset support to Score.
This new Score Handler provides a structure to manage a cpu_set_t plus helper routines to validate the contents against the current system configuration.
Diffstat (limited to 'cpukit/score/include/rtems/score/cpuset.h')
-rw-r--r--cpukit/score/include/rtems/score/cpuset.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/cpukit/score/include/rtems/score/cpuset.h b/cpukit/score/include/rtems/score/cpuset.h
new file mode 100644
index 0000000000..0359862a2b
--- /dev/null
+++ b/cpukit/score/include/rtems/score/cpuset.h
@@ -0,0 +1,64 @@
+/**
+ * @file rtems/score/cpuset.h
+ *
+ * @brief Information About the CPU Set
+ *
+ * This include file contains all information about the thread
+ * CPU Set.
+ */
+
+/*
+ * COPYRIGHT (c) 2014.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifndef _RTEMS_SCORE_CPUSET_H
+#define _RTEMS_SCORE_CPUSET_H
+
+#include <rtems/score/basedefs.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef __RTEMS_HAVE_SYS_CPUSET_H__
+
+/**
+ * @defgroup ScoreCpuset
+ *
+ * @ingroup Score
+ *
+ * This handler encapsulates functionality which is used in the management
+ * of thread's CPU set.
+ */
+/**@{*/
+
+/**
+ * The following defines the control block used to manage the cpuset.
+ * The names do not include affinity in the front in case the set is
+ * ever used for something other than affinity. The usage in thread
+ * uses the attribute affinity such that accesses will read
+ * thread->affinity.set.
+ */
+typedef struct {
+ /** This is the size of the set */
+ size_t setsize;
+ /** This is the preallocated space to store the set */
+ cpu_set_t preallocated;
+ /** This is a pointer to the set in use */
+ cpu_set_t *set;
+} CPU_set_Control;
+
+#endif
+
+/**@}*/
+
+#ifdef __cplusplus
+}
+#endif
+#endif
+/* end of include file */