[RTEMS Project] #2472: Wrong value in PSR register after task switch on SPARC

RTEMS trac trac at rtems.org
Tue Nov 17 07:59:53 UTC 2015

#2472: Wrong value in PSR register after task switch on SPARC
 Reporter:  daniel.cederman  |       Owner:  Daniel Cederman <cederman@…>
     Type:  defect           |      Status:  closed
 Priority:  normal           |   Milestone:  4.11
Component:  SMP              |     Version:  4.11
 Severity:  critical         |  Resolution:  fixed
 Keywords:                   |
Changes (by Daniel Cederman <cederman@…>):

 * owner:   => Daniel Cederman <cederman@…>
 * status:  new => closed
 * resolution:   => fixed


 In [changeset:"2d7aad73ea79fdfd80fa466233c7dbeceb98d43c/rtems"]:
 #!CommitTicketReference repository="rtems"
 sparc: Fix context switch on SMP

 We must not load registers (e.g. PSR) from the heir context area before
 the heir stopped execution.

 With this patch the write to PSR is divided into two steps. We first
 the current window pointer and then we restore the status registers and
 enable traps. This allows us to move the first write to PSR to be before
 the write to WIM, as there is now no risk that we get an interrupt where
 the CWP and WIM would be inconsistent. We only need to make sure that we
 do not use any of the non-global registers or instructions that affects
 CWP for three instructions after the write.

 In the earlier code the non-global %o1 register was used right after the
 write to PSR, which required the use of three nop:s.

 Close #2472.

Ticket URL: <http://devel.rtems.org/ticket/2472#comment:1>
RTEMS Project <http://www.rtems.org/>
RTEMS Project

More information about the bugs mailing list