Changeset d64f2e7 in rtems


Ignore:
Timestamp:
Mar 17, 2016, 12:30:54 PM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
90de3001
Parents:
d731bc6f
git-author:
Sebastian Huber <sebastian.huber@…> (03/17/16 12:30:54)
git-committer:
Sebastian Huber <sebastian.huber@…> (03/18/16 06:43:46)
Message:

sparc: Fix SMP context switch

The value of register %g1 was overwritten in a delay slot. Use
additional %g4 register.

Bug introduced by 258ad71e9626c16f30b40e06c321326636c976ff.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/sparc/shared/irq_asm.S

    rd731bc6f rd64f2e7  
    237237
    238238        ! Read the executing and heir
    239         ld      [%g6 + PER_CPU_OFFSET_EXECUTING], %g1
    240         ld      [%g6 + PER_CPU_OFFSET_HEIR], %g2
     239        ld      [%g6 + PER_CPU_OFFSET_EXECUTING], %g2
     240        ld      [%g6 + PER_CPU_OFFSET_HEIR], %g4
    241241
    242242        ! Update the executing only if necessary to avoid cache line
    243243        ! monopolization.
    244         cmp     %g1, %g2
     244        cmp     %g2, %g4
    245245        beq     try_update_is_executing
    246246         mov    1, %g1
    247247
    248248        ! Calculate the heir context pointer
    249         sub     %o1, %g1, %g1
    250         add     %g1, %g2, %o1
     249        sub     %o1, %g2, %g2
     250        add     %g2, %g4, %o1
    251251
    252252        ! Update the executing
    253         st      %g2, [%g6 + PER_CPU_OFFSET_EXECUTING]
     253        st      %g4, [%g6 + PER_CPU_OFFSET_EXECUTING]
    254254
    255255        ba      try_update_is_executing
Note: See TracChangeset for help on using the changeset viewer.