From 1eb6cdde60d702cb7a05927842a1752c133d9927 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 30 Apr 2021 16:58:50 +0200 Subject: score: Add _Thread_Dispatch_direct_no_return() The __builtin_unreachable() cannot be used with current GCC versions to tell the compiler that a function does not return to the caller, see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99151 Add a no return variant of _Thread_Dispatch_direct() to avoid generation of dead code. --- cpukit/include/rtems/score/threaddispatch.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'cpukit/include') diff --git a/cpukit/include/rtems/score/threaddispatch.h b/cpukit/include/rtems/score/threaddispatch.h index 707b449771..7f3673a0d5 100644 --- a/cpukit/include/rtems/score/threaddispatch.h +++ b/cpukit/include/rtems/score/threaddispatch.h @@ -125,6 +125,17 @@ void _Thread_Dispatch( void ); */ void _Thread_Dispatch_direct( Per_CPU_Control *cpu_self ); +/** + * @brief Directly do a thread dispatch and do not return. + * + * @param cpu_self is the current processor. + * + * @see _Thread_Dispatch_direct(). + */ +RTEMS_NO_RETURN void _Thread_Dispatch_direct_no_return( + Per_CPU_Control *cpu_self +); + /** * @brief Performs a thread dispatch on the current processor. * -- cgit v1.2.3