summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cpukit/score/include/rtems/score/schedulerimpl.h7
-rw-r--r--testsuites/smptests/smpscheduler02/init.c7
2 files changed, 7 insertions, 7 deletions
diff --git a/cpukit/score/include/rtems/score/schedulerimpl.h b/cpukit/score/include/rtems/score/schedulerimpl.h
index 6f220acf57..49aaf029e1 100644
--- a/cpukit/score/include/rtems/score/schedulerimpl.h
+++ b/cpukit/score/include/rtems/score/schedulerimpl.h
@@ -612,10 +612,9 @@ RTEMS_INLINE_ROUTINE bool _Scheduler_default_Set_affinity_body(
const Processor_mask *affinity
)
{
- return _Processor_mask_Is_subset(
- affinity,
- _Scheduler_Get_processors( scheduler )
- );
+ (void) scheduler;
+ (void) the_thread;
+ return _Processor_mask_Is_subset( affinity, _SMP_Get_online_processors() );
}
bool _Scheduler_Set_affinity(
diff --git a/testsuites/smptests/smpscheduler02/init.c b/testsuites/smptests/smpscheduler02/init.c
index db7d863991..a15218b368 100644
--- a/testsuites/smptests/smpscheduler02/init.c
+++ b/testsuites/smptests/smpscheduler02/init.c
@@ -223,9 +223,7 @@ static void test(void)
CPU_ZERO(&second_cpu);
CPU_SET(1, &second_cpu);
- CPU_ZERO(&all_cpus);
- CPU_SET(0, &all_cpus);
- CPU_SET(1, &all_cpus);
+ CPU_FILL(&all_cpus);
CPU_ZERO(&online_cpus);
CPU_SET(0, &online_cpus);
@@ -348,6 +346,9 @@ static void test(void)
rtems_test_assert(scheduler_id == scheduler_b_id);
sc = rtems_task_set_affinity(task_id, sizeof(second_cpu), &second_cpu);
+ rtems_test_assert(sc == RTEMS_INVALID_NUMBER);
+
+ sc = rtems_task_set_affinity(task_id, sizeof(online_cpus), &online_cpus);
rtems_test_assert(sc == RTEMS_SUCCESSFUL);
sc = rtems_task_get_scheduler(task_id, &scheduler_id);