[rtems commit] sparc: Remove sequences that the B2BST scan script warns about

Daniel Hellstrom danielh at rtems.org
Thu Mar 11 16:51:34 UTC 2021


Module:    rtems
Branch:    master
Commit:    0cae482a454e4e554b8f391f2752eb40b5068cef
Changeset: http://git.rtems.org/rtems/commit/?id=0cae482a454e4e554b8f391f2752eb40b5068cef

Author:    Daniel Cederman <cederman at gaisler.com>
Date:      Tue Dec 19 13:37:08 2017 +0100

sparc: Remove sequences that the B2BST scan script warns about

Update #4336.

---

 cpukit/score/cpu/sparc/cpu_asm.S | 6 ++++--
 cpukit/score/cpu/sparc/syscall.S | 3 ++-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/cpukit/score/cpu/sparc/cpu_asm.S b/cpukit/score/cpu/sparc/cpu_asm.S
index d5afd5f..bfad3fb 100644
--- a/cpukit/score/cpu/sparc/cpu_asm.S
+++ b/cpukit/score/cpu/sparc/cpu_asm.S
@@ -683,11 +683,13 @@ isr_dispatch:
         cmp     %l6, %l7
         bne,a   .Ldisable_fp
          andn   %l0, %l5, %l0
+        st      %g0, [%g6 + SPARC_PER_CPU_FP_OWNER_OFFSET]
         ba      .Lthread_dispatch_done
-         st     %g0, [%g6 + SPARC_PER_CPU_FP_OWNER_OFFSET]
+         nop
 .Ldisable_fp:
+        st       %l0, [%fp + ISF_PSR_OFFSET]
         ba      .Lthread_dispatch_done
-         st      %l0, [%fp + ISF_PSR_OFFSET]
+         nop
 .Lnon_fp_thread_dispatch:
 #elif defined(SPARC_USE_SYNCHRONOUS_FP_SWITCH)
         /* Test if we interrupted a floating point thread (PSR[EF] == 1) */
diff --git a/cpukit/score/cpu/sparc/syscall.S b/cpukit/score/cpu/sparc/syscall.S
index 4f4ef32..737a501 100644
--- a/cpukit/score/cpu/sparc/syscall.S
+++ b/cpukit/score/cpu/sparc/syscall.S
@@ -218,9 +218,10 @@ SYM(syscall_lazy_fp_switch):
 .Lfp_save_done:
 
 	/* Restore the floating point context if necessary */
+	st	%g0, [%l4 + %lo(SPARC_THREAD_CONTROL_REGISTERS_FP_CONTEXT_OFFSET)]
 	cmp	%l6, 0
 	be	.Lfp_restore_done
-	 st	%g0, [%l4 + %lo(SPARC_THREAD_CONTROL_REGISTERS_FP_CONTEXT_OFFSET)]
+	 nop
 	ldd	[%l6 + SPARC_FP_CONTEXT_OFFSET_F0_F1], %f0
 	ldd	[%l6 + SPARC_FP_CONTEXT_OFFSET_F2_F3], %f2
 	ldd	[%l6 + SPARC_FP_CONTEXT_OFFSET_F4_F5], %f4



More information about the vc mailing list