From 73ebf9a27ed5cd0fd3e0dc0da98345d7faa610a2 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 14 May 2021 14:54:42 +0200 Subject: 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. --- cpukit/rtems/src/taskrestart.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'cpukit/rtems/src/taskrestart.c') 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 ); } -- cgit v1.2.3