summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems/src
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2021-05-14 14:54:42 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2021-05-14 16:56:03 +0200
commit73ebf9a27ed5cd0fd3e0dc0da98345d7faa610a2 (patch)
treeab75daf199833c984b346c856c4526e28f14d510 /cpukit/rtems/src
parentrtems: Always set the real priority during restart (diff)
downloadrtems-73ebf9a27ed5cd0fd3e0dc0da98345d7faa610a2.tar.bz2
rtems: Fix task restart within interrupt context
rtems_task_restart() may be called from within interrupt context. So checking only that the thread to restart is equal to the executing thread is insufficient to determine a self restart. We have to also check that no ISR is in progress. Merge _Thread_Restart_other() and _Thread_Restart_self() into one _Thread_Restart() since they share a lot of common code. Close #4412.
Diffstat (limited to 'cpukit/rtems/src')
-rw-r--r--cpukit/rtems/src/taskrestart.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/cpukit/rtems/src/taskrestart.c b/cpukit/rtems/src/taskrestart.c
index 00b0635cef..6bf7358384 100644
--- a/cpukit/rtems/src/taskrestart.c
+++ b/cpukit/rtems/src/taskrestart.c
@@ -48,13 +48,7 @@ rtems_status_code rtems_task_restart(
entry = the_thread->Start.Entry;
entry.Kinds.Numeric.argument = argument;
-
- if ( the_thread == _Thread_Executing ) {
- _Thread_Restart_self( the_thread, &entry, &lock_context );
- RTEMS_UNREACHABLE();
- }
-
- status = _Thread_Restart_other( the_thread, &entry, &lock_context );
+ status = _Thread_Restart( the_thread, &entry, &lock_context );
return _Status_Get( status );
}