[PATCH 24/26] sparc,leon: avoid triggering TN-0009 bad sequence

Daniel Hellstrom daniel at gaisler.com
Mon Jun 29 11:28:11 UTC 2020


---
 cpukit/score/cpu/sparc/sparc-counter-asm.S | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/cpukit/score/cpu/sparc/sparc-counter-asm.S b/cpukit/score/cpu/sparc/sparc-counter-asm.S
index a1e18ae..fb7783e 100644
--- a/cpukit/score/cpu/sparc/sparc-counter-asm.S
+++ b/cpukit/score/cpu/sparc/sparc-counter-asm.S
@@ -31,8 +31,9 @@ SYM(_SPARC_Counter_read_default):
 	sethi	%hi(_SPARC_Counter + 12), %o1
 	ld	[%o1 + %lo(_SPARC_Counter + 12)], %o0
 	add	%o0, 1, %o0
+	st	%o0, [%o1 + %lo(_SPARC_Counter + 12)]
 	jmp	%o7 + 8
-	 st	%o0, [%o1 + %lo(_SPARC_Counter + 12)]
+	 nop
 
 	PUBLIC(_SPARC_Counter_read_up)
 	PUBLIC(_SPARC_Get_timecount_up)
-- 
2.7.4



More information about the devel mailing list