summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems/src/taskgetaffinity.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-04-03 15:03:35 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-04-04 11:01:18 +0200
commit24934e36e2513f972510d7c746103be1f766dc6a (patch)
tree66e3c8840cec6c1262f142e25ec545926140dbf9 /cpukit/rtems/src/taskgetaffinity.c
parentscore: Add and use Scheduler_simple_Control (diff)
downloadrtems-24934e36e2513f972510d7c746103be1f766dc6a.tar.bz2
score: Add scheduler control to scheduler ops
Scheduler operations must be free of a global scheduler context to enable partitioned/clustered scheduling.
Diffstat (limited to 'cpukit/rtems/src/taskgetaffinity.c')
-rw-r--r--cpukit/rtems/src/taskgetaffinity.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/cpukit/rtems/src/taskgetaffinity.c b/cpukit/rtems/src/taskgetaffinity.c
index d9cc25e646..c389f1b991 100644
--- a/cpukit/rtems/src/taskgetaffinity.c
+++ b/cpukit/rtems/src/taskgetaffinity.c
@@ -34,7 +34,7 @@ rtems_status_code rtems_task_get_affinity(
{
Thread_Control *the_thread;
Objects_Locations location;
- rtems_status_code status = RTEMS_SUCCESSFUL;
+ bool ok;
if ( !cpuset )
return RTEMS_INVALID_ADDRESS;
@@ -44,11 +44,14 @@ rtems_status_code rtems_task_get_affinity(
switch ( location ) {
case OBJECTS_LOCAL:
- if ( ! _Scheduler_Get_affinity( the_thread, cpusetsize, cpuset )) {
- status = RTEMS_INVALID_NUMBER;
- }
+ ok = _Scheduler_Get_affinity(
+ _Scheduler_Get( the_thread ),
+ the_thread,
+ cpusetsize,
+ cpuset
+ );
_Objects_Put( &the_thread->Object );
- return status;
+ return ok ? RTEMS_SUCCESSFUL : RTEMS_INVALID_NUMBER;
#if defined(RTEMS_MULTIPROCESSING)
case OBJECTS_REMOTE: