Ticket #1932: switch_first_task_smp1.patch

File switch_first_task_smp1.patch, 1.5 KB (added by Daniel Hellstrom, on 10/07/11 at 10:46:42)

_CPU_Context_switch_to_first_task_smp() WIM patch

  • cpukit/score/cpu/sparc/cpu_asm.S

    RCS file: /home/cvspserver/SMP_Repository/rtems-smp/cpukit/score/cpu/sparc/cpu_asm.S,v
    retrieving revision 1.1.1.1
    diff -u -r1.1.1.1 cpu_asm.S
     
    336336 *
    337337 *  This routine is only used to switch to the first task on a
    338338 *  secondary core in an SMP configuration.  We do not need to
    339  *  flush all the windows and, in fact, this can be dangerous
     339 *  flush any windows and, in fact, this can be dangerous
    340340 *  as they may or may not be initialized properly.  So we just
    341341 *  reinitialize the PSR and WIM.
    342342 */
    343343        PUBLIC(_CPU_Context_switch_to_first_task_smp)
    344344SYM(_CPU_Context_switch_to_first_task_smp):
    345         save    %sp, -CPU_MINIMUM_STACK_FRAME_SIZE, %sp
    346 
    347         mov     %psr, %g1               ! Initialize WIM
    348         add     %g1, 1, %g2
    349         and     %g2, 0x7, %g2
    350         set     1, %g3
    351         sll     %g3, %g2, %g3
    352         mov     %g3, %wim
    353         ba      done_flushing
    354         mov     %i0, %o1                      ! in the delay slot
     345        mov     %psr, %g1               ! Turn of traps when modifying WIM
     346        andn    %g1, SPARC_PSR_ET_MASK, %g1
     347        mov     %g1, %psr
     348        /* WIM and PSR will be set in done_flushing, it need args:
     349         * g1=PSR, g3=CWP, o1=Context
     350         */
     351        and     %g1, SPARC_NUMBER_OF_REGISTER_WINDOWS - 1, %g3
     352        nop
     353        mov     %o0, %o1                ! in the delay slot
     354        ba,a    done_flushing
    355355#endif
    356356
    357357/* end of file */