summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2020-02-15 11:52:00 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2020-02-25 07:18:35 +0100
commite50e42b820c4163a1c5e07c6697c3102fc2d4740 (patch)
tree845deffec09923b3a284512397298132c3a8f26a /cpukit/rtems
parentconfig: CONFIGURE_INIT_TASK_INITIAL_MODES (diff)
downloadrtems-e50e42b820c4163a1c5e07c6697c3102fc2d4740.tar.bz2
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.
Diffstat (limited to 'cpukit/rtems')
-rw-r--r--cpukit/rtems/src/taskmode.c9
1 files changed, 6 insertions, 3 deletions
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;