Changeset 8f582bc in rtems


Ignore:
Timestamp:
Oct 7, 2011, 2:31:44 PM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, 5, master
Children:
47a61aa1
Parents:
591e964e
Message:

2011-10-07 Daniel Hellstrom <daniel@…>

PR 1932/cpukit

  • cpu_asm.S: At some point the interrupt trap handler causes a window-overflow and the window overflow trap handler crashes when writing to 0. I found that this is because the WIM was bad, to the window overflow handler uses a uninitialized stack pointer in a window never used.
    • g3=CWP, not WIM
    • CWP is incremented by done_flushing no need doing that here also
    • I see no reason to create an additional stack frame (save)
    • Must turn off traps when updating WIM (maybe already done by caller?)
Location:
cpukit/score/cpu/sparc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/cpu/sparc/ChangeLog

    r591e964e r8f582bc  
     12011-10-07      Daniel Hellstrom <daniel@gaisler.com>
     2
     3        PR 1932/cpukit
     4        * cpu_asm.S: At some point the interrupt trap handler causes a
     5        window-overflow and the window overflow trap handler crashes when
     6        writing to 0. I found that this is because the WIM was bad, to the
     7        window overflow handler uses a uninitialized stack pointer in a
     8        window never used.
     9         * g3=CWP, not WIM
     10         * CWP is incremented by done_flushing no need doing that here also
     11         * I see no reason to create an additional stack frame (save)
     12         * Must turn off traps when updating WIM (maybe already done by caller?)       
    1132011-09-27      Sebastian Huber <sebastian.huber@embedded-brains.de>
    214
  • cpukit/score/cpu/sparc/cpu_asm.S

    r591e964e r8f582bc  
    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.
     
    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
Note: See TracChangeset for help on using the changeset viewer.