From d45f87cf3599b3614ea4b126728aedeb51737695 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 17 May 2021 13:35:42 +0200 Subject: score: Add _CPU_Context_switch_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 _CPU_Context_switch() to avoid generation of dead code in _Thread_Start_multitasking() if RTEMS was built with SMP support enabled. --- cpukit/score/cpu/sparc/cpu_asm.S | 2 ++ cpukit/score/cpu/sparc/include/rtems/score/cpu.h | 5 +++++ 2 files changed, 7 insertions(+) (limited to 'cpukit/score/cpu/sparc') diff --git a/cpukit/score/cpu/sparc/cpu_asm.S b/cpukit/score/cpu/sparc/cpu_asm.S index e884fb2f9e..a7b87ad5f8 100644 --- a/cpukit/score/cpu/sparc/cpu_asm.S +++ b/cpukit/score/cpu/sparc/cpu_asm.S @@ -57,7 +57,9 @@ .align 4 PUBLIC(_CPU_Context_switch) + PUBLIC(_CPU_Context_switch_no_return) SYM(_CPU_Context_switch): +SYM(_CPU_Context_switch_no_return): st %g5, [%o0 + G5_OFFSET] ! save the global registers /* diff --git a/cpukit/score/cpu/sparc/include/rtems/score/cpu.h b/cpukit/score/cpu/sparc/include/rtems/score/cpu.h index 8c5330b8ce..6c167e3f08 100644 --- a/cpukit/score/cpu/sparc/include/rtems/score/cpu.h +++ b/cpukit/score/cpu/sparc/include/rtems/score/cpu.h @@ -971,6 +971,11 @@ void _CPU_Context_switch( Context_Control *heir ); +RTEMS_NO_RETURN void _CPU_Context_switch_no_return( + Context_Control *executing, + Context_Control *heir +); + /** * @brief SPARC specific context restore. * -- cgit v1.2.3