From e50e42b820c4163a1c5e07c6697c3102fc2d4740 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Sat, 15 Feb 2020 11:52:00 +0100 Subject: score: _Scheduler_Is_non_preempt_mode_supported() If the non-preempt mode for threads is supported depends on the scheduler implementation. Add _Scheduler_Is_non_preempt_mode_supported() to indicate this. Update #3876. --- cpukit/rtems/src/taskmode.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'cpukit/rtems/src/taskmode.c') diff --git a/cpukit/rtems/src/taskmode.c b/cpukit/rtems/src/taskmode.c index 8830f6bb5d..3ba5ce7f95 100644 --- a/cpukit/rtems/src/taskmode.c +++ b/cpukit/rtems/src/taskmode.c @@ -41,6 +41,8 @@ rtems_status_code rtems_task_mode( bool needs_asr_dispatching; rtems_mode old_mode; + executing = _Thread_Get_executing(); + if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; @@ -48,7 +50,9 @@ rtems_status_code rtems_task_mode( if ( ( mask & RTEMS_PREEMPT_MASK ) != 0 && !_Modes_Is_preempt( mode_set ) - && rtems_configuration_is_smp_enabled() + && !_Scheduler_Is_non_preempt_mode_supported( + _Thread_Scheduler_get_home( executing ) + ) ) { return RTEMS_NOT_IMPLEMENTED; } @@ -71,8 +75,7 @@ rtems_status_code rtems_task_mode( * impact the executing thread. There should be no errors returned * past this point. */ - - executing = _Thread_Get_executing(); + api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; -- cgit v1.2.3