summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2017-07-03 14:05:26 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-07-07 07:28:29 +0200
commit78515554fd110c9636c38501b699a5da125a5496 (patch)
tree527f8f413668a43a76697dca3e994691bddcaa22 /cpukit/score/include/rtems
parentscore: Add some processor mask functions (diff)
downloadrtems-78515554fd110c9636c38501b699a5da125a5496.tar.bz2
score: Move processor affinity to Thread_Control
Update #3059.
Diffstat (limited to 'cpukit/score/include/rtems')
-rw-r--r--cpukit/score/include/rtems/score/processormask.h2
-rw-r--r--cpukit/score/include/rtems/score/scheduler.h27
-rw-r--r--cpukit/score/include/rtems/score/schedulerimpl.h14
-rw-r--r--cpukit/score/include/rtems/score/schedulerpriorityaffinitysmp.h19
-rw-r--r--cpukit/score/include/rtems/score/thread.h7
5 files changed, 8 insertions, 61 deletions
diff --git a/cpukit/score/include/rtems/score/processormask.h b/cpukit/score/include/rtems/score/processormask.h
index b550aa42a9..ed79e63d6f 100644
--- a/cpukit/score/include/rtems/score/processormask.h
+++ b/cpukit/score/include/rtems/score/processormask.h
@@ -252,6 +252,8 @@ RTEMS_INLINE_ROUTINE Processor_mask_Copy_status _Processor_mask_From_cpu_set_t(
);
}
+extern const Processor_mask _Processor_mask_The_one_and_only;
+
/** @} */
#ifdef __cplusplus
diff --git a/cpukit/score/include/rtems/score/scheduler.h b/cpukit/score/include/rtems/score/scheduler.h
index 1b9509ae4f..6e7bdcbd9a 100644
--- a/cpukit/score/include/rtems/score/scheduler.h
+++ b/cpukit/score/include/rtems/score/scheduler.h
@@ -203,14 +203,6 @@ typedef struct {
);
#if defined(RTEMS_SMP)
- /** @see _Scheduler_Get_affinity() */
- bool ( *get_affinity )(
- const Scheduler_Control *,
- Thread_Control *,
- size_t,
- cpu_set_t *
- );
-
/** @see _Scheduler_Set_affinity() */
bool ( *set_affinity )(
const Scheduler_Control *,
@@ -514,24 +506,6 @@ void _Scheduler_default_Start_idle(
);
#if defined(RTEMS_SMP)
- /**
- * @brief Get affinity for the default scheduler.
- *
- * @param[in] scheduler The scheduler instance.
- * @param[in] thread The associated thread.
- * @param[in] cpusetsize The size of the cpuset.
- * @param[out] cpuset Affinity set containing all CPUs.
- *
- * @retval 0 Successfully got cpuset
- * @retval -1 The cpusetsize is invalid for the system
- */
- bool _Scheduler_default_Get_affinity(
- const Scheduler_Control *scheduler,
- Thread_Control *thread,
- size_t cpusetsize,
- cpu_set_t *cpuset
- );
-
/**
* @brief Set affinity for the default scheduler.
*
@@ -553,7 +527,6 @@ void _Scheduler_default_Start_idle(
);
#define SCHEDULER_OPERATION_DEFAULT_GET_SET_AFFINITY \
- , _Scheduler_default_Get_affinity \
, _Scheduler_default_Set_affinity
#else
#define SCHEDULER_OPERATION_DEFAULT_GET_SET_AFFINITY
diff --git a/cpukit/score/include/rtems/score/schedulerimpl.h b/cpukit/score/include/rtems/score/schedulerimpl.h
index c7c8bf05a0..927c6e1762 100644
--- a/cpukit/score/include/rtems/score/schedulerimpl.h
+++ b/cpukit/score/include/rtems/score/schedulerimpl.h
@@ -613,20 +613,6 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Get_processor_set(
}
}
-RTEMS_INLINE_ROUTINE bool _Scheduler_default_Get_affinity_body(
- const Scheduler_Control *scheduler,
- Thread_Control *the_thread,
- size_t cpusetsize,
- cpu_set_t *cpuset
-)
-{
- (void) the_thread;
-
- _Scheduler_Get_processor_set( scheduler, cpusetsize, cpuset );
-
- return true;
-}
-
bool _Scheduler_Get_affinity(
Thread_Control *the_thread,
size_t cpusetsize,
diff --git a/cpukit/score/include/rtems/score/schedulerpriorityaffinitysmp.h b/cpukit/score/include/rtems/score/schedulerpriorityaffinitysmp.h
index 850c72bb40..fd4a33670f 100644
--- a/cpukit/score/include/rtems/score/schedulerpriorityaffinitysmp.h
+++ b/cpukit/score/include/rtems/score/schedulerpriorityaffinitysmp.h
@@ -68,7 +68,6 @@ extern "C" {
_Scheduler_default_Cancel_job, \
_Scheduler_default_Tick, \
_Scheduler_SMP_Start_idle, \
- _Scheduler_priority_affinity_SMP_Get_affinity, \
_Scheduler_priority_affinity_SMP_Set_affinity \
}
@@ -102,24 +101,6 @@ void _Scheduler_priority_affinity_SMP_Unblock(
Scheduler_Node *node
);
-/**
- * @brief Get affinity for the priority affinity SMP scheduler.
- *
- * @param[in] scheduler The scheduler of the thread.
- * @param[in] thread The associated thread.
- * @param[in] cpusetsize The size of the cpuset.
- * @param[in,out] cpuset The associated affinity set.
- *
- * @retval 0 Successfully got cpuset
- * @retval -1 The cpusetsize is invalid for the system
- */
-bool _Scheduler_priority_affinity_SMP_Get_affinity(
- const Scheduler_Control *scheduler,
- Thread_Control *thread,
- size_t cpusetsize,
- cpu_set_t *cpuset
-);
-
void _Scheduler_priority_affinity_SMP_Update_priority(
const Scheduler_Control *scheduler,
Thread_Control *the_thread,
diff --git a/cpukit/score/include/rtems/score/thread.h b/cpukit/score/include/rtems/score/thread.h
index 54b207f137..ecab766fee 100644
--- a/cpukit/score/include/rtems/score/thread.h
+++ b/cpukit/score/include/rtems/score/thread.h
@@ -37,7 +37,7 @@
#include <rtems/score/watchdog.h>
#if defined(RTEMS_SMP)
- #include <rtems/score/cpuset.h>
+#include <rtems/score/processormask.h>
#endif
struct _pthread_cleanup_context;
@@ -311,6 +311,11 @@ typedef struct {
* This list is protected by the thread scheduler lock.
*/
Scheduler_Node *requests;
+
+ /**
+ * @brief The thread processor affinity set.
+ */
+ Processor_mask Affinity;
#endif
/**