summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/sparc/shared/irq_asm.S
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-03-17 13:30:54 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-03-18 07:43:46 +0100
commitd64f2e7a852326c5a6f06ec0197d0afae6d5eb2d (patch)
tree2bafe21fa7241889c45143d1d27a2d7a37e27861 /c/src/lib/libbsp/sparc/shared/irq_asm.S
parentbspgetworkarea.c: File header now uses Doxygen (diff)
downloadrtems-d64f2e7a852326c5a6f06ec0197d0afae6d5eb2d.tar.bz2
sparc: Fix SMP context switch
The value of register %g1 was overwritten in a delay slot. Use additional %g4 register. Bug introduced by 258ad71e9626c16f30b40e06c321326636c976ff.
Diffstat (limited to '')
-rw-r--r--c/src/lib/libbsp/sparc/shared/irq_asm.S12
1 files changed, 6 insertions, 6 deletions
diff --git a/c/src/lib/libbsp/sparc/shared/irq_asm.S b/c/src/lib/libbsp/sparc/shared/irq_asm.S
index 0d70e8b3bf..b7f372c654 100644
--- a/c/src/lib/libbsp/sparc/shared/irq_asm.S
+++ b/c/src/lib/libbsp/sparc/shared/irq_asm.S
@@ -236,21 +236,21 @@ check_is_executing:
! We may have a new heir
! Read the executing and heir
- ld [%g6 + PER_CPU_OFFSET_EXECUTING], %g1
- ld [%g6 + PER_CPU_OFFSET_HEIR], %g2
+ ld [%g6 + PER_CPU_OFFSET_EXECUTING], %g2
+ ld [%g6 + PER_CPU_OFFSET_HEIR], %g4
! Update the executing only if necessary to avoid cache line
! monopolization.
- cmp %g1, %g2
+ cmp %g2, %g4
beq try_update_is_executing
mov 1, %g1
! Calculate the heir context pointer
- sub %o1, %g1, %g1
- add %g1, %g2, %o1
+ sub %o1, %g2, %g2
+ add %g2, %g4, %o1
! Update the executing
- st %g2, [%g6 + PER_CPU_OFFSET_EXECUTING]
+ st %g4, [%g6 + PER_CPU_OFFSET_EXECUTING]
ba try_update_is_executing
mov 1, %g1