From 54f345f5a5c9160b8839d080cdfd36ee13f4dada Mon Sep 17 00:00:00 2001 From: Jennifer Averett Date: Tue, 18 Mar 2014 13:55:54 -0500 Subject: rtems: Move affinity from thread to scheduler. --- cpukit/rtems/src/tasksetaffinity.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'cpukit/rtems/src/tasksetaffinity.c') diff --git a/cpukit/rtems/src/tasksetaffinity.c b/cpukit/rtems/src/tasksetaffinity.c index 2b40fcbd7e..4d767410a9 100644 --- a/cpukit/rtems/src/tasksetaffinity.c +++ b/cpukit/rtems/src/tasksetaffinity.c @@ -23,6 +23,7 @@ #include #include #include +#include rtems_status_code rtems_task_set_affinity( rtems_id id, @@ -32,21 +33,20 @@ rtems_status_code rtems_task_set_affinity( { Thread_Control *the_thread; Objects_Locations location; - int error; + int ok; if ( !cpuset ) return RTEMS_INVALID_ADDRESS; - error = _CPU_set_Is_valid( cpuset, cpusetsize ); - if ( error != 0 ) - return RTEMS_INVALID_NUMBER; - the_thread = _Thread_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: - CPU_COPY( the_thread->affinity.set, cpuset ); + ok = _Scheduler_Set_affinity( the_thread, cpusetsize, cpuset ); _Objects_Put( &the_thread->Object ); + if (! ok) { + return RTEMS_INVALID_NUMBER; + } return RTEMS_SUCCESSFUL; #if defined(RTEMS_MULTIPROCESSING) -- cgit v1.2.3