Port-sparc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

re: CVS commit: src/sys/arch/sparc/include



> Module Name:  src
> Committed By: mrg
> Date:         Sun Aug 28 22:30:09 UTC 2011
> 
> Modified Files:
>       src/sys/arch/sparc/include: psl.h
> 
> Log Message:
> apply some always_inline attribute to setpsr and spl*.  while i am
> not yet sure exactly why this is necessary, but does avoid crashes
> seen on sparc INSTALL with gcc 4.5.

uwe@ helped me understand why this fixes the problem.  thanks!
it goes like this:

        - srmmu_vcache_flush_context() turns off traps to do
        its work.

        - at the end, when it is trying to turn on traps again
        which happens via the now no longer inlined setpsr()
        call, the caller has a tail-call optimisation on the
        call to setpsr() and the asm looks like:

0xf0012f08 <srmmu_vcache_flush_context+108>:    b  0xf0012618 <setpsr>
0xf0012f0c <srmmu_vcache_flush_context+112>:    restore

        - but wait, we have traps turned off and we're going
        to execute the restore, so any time we need to clean a
        register window upon restore we go boom here.

the inlined version calls restore after setting %psr, and the
trap can be handled normally.


.mrg.


Home | Main Index | Thread Index | Old Index