Changeset 84060e2 in mainline for kernel/arch/sparc64/src/trap


Ignore:
Timestamp:
2006-10-09T19:29:42Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8ce8499
Parents:
e4398200
Message:

sparc64 work:

  • hw_map() can now support up to 8M requests
  • CPU stacks are now locked in DTLB of the respective processor
  • kernel in the boot phase no longer relies on the stack provided by OpenFirmware
  • instead of of doing FLUSHW during kernel startup, simply set the window state registers to the wanted state
  • NWINDOW → NWINDOWS
  • Add/fix some comments and copyrights.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/sparc64/src/trap/trap_table.S

    re4398200 r84060e2  
    674674        wrpr %g0, WSTATE_OTHER(0) | WSTATE_NORMAL(2), %wstate
    675675
    676         wrpr %g0, NWINDOW - 1, %cleanwin        ! prevent unnecessary clean_window exceptions
     676        wrpr %g0, NWINDOWS - 1, %cleanwin       ! prevent unnecessary clean_window exceptions
    677677
    678678        /*
     
    831831        and %g1, TSTATE_CWP_MASK, %l0
    832832        inc %l0
    833         and %l0, NWINDOW - 1, %l0       ! %l0 mod NWINDOW
     833        and %l0, NWINDOWS - 1, %l0      ! %l0 mod NWINDOWS
    834834        rdpr %cwp, %l1
    835835        cmp %l0, %l1
     
    902902        sub %g1, %g2, %g3
    903903        dec %g3
    904         and %g3, NWINDOW - 1, %g3
     904        and %g3, NWINDOWS - 1, %g3
    905905        wrpr %g3, 0, %cwp
    906906
     
    934934
    935935        dec %g3
    936         and %g3, NWINDOW - 1, %g3
     936        and %g3, NWINDOWS - 1, %g3
    937937        wrpr %g3, 0, %cwp                       ! switch to the preceeding window
    938938
     
    947947        wrpr %g1, 0, %cwp
    948948        add %g4, %g2, %g2
    949         cmp %g2, NWINDOW - 2
    950         bg 2f                                   ! fix the CANRESTORE=NWINDOW-1 anomaly
    951         mov NWINDOW - 2, %g1                    ! use dealy slot for both cases
     949        cmp %g2, NWINDOWS - 2
     950        bg 2f                                   ! fix the CANRESTORE=NWINDOWS-1 anomaly
     951        mov NWINDOWS - 2, %g1                   ! use dealy slot for both cases
    952952        sub %g1, %g2, %g1
    953953       
    954954        wrpr %g0, 0, %otherwin
    955         wrpr %g1, 0, %cansave                   ! NWINDOW - 2 - CANRESTORE
     955        wrpr %g1, 0, %cansave                   ! NWINDOWS - 2 - CANRESTORE
    956956        wrpr %g2, 0, %canrestore                ! OTHERWIN + windows in the buffer
    957957        wrpr %g2, 0, %cleanwin                  ! avoid information leak
     
    973973         *
    974974         * instruction trapped and spilled a register window into the userspace
    975          * window buffer, we have just restored NWINDOW - 1 register windows.
     975         * window buffer, we have just restored NWINDOWS - 1 register windows.
    976976         * However, CANRESTORE can be only NWINDOW - 2 at most.
    977977         *
    978          * The solution is to manually switch to (CWP - 1) mod NWINDOW
     978         * The solution is to manually switch to (CWP - 1) mod NWINDOWS
    979979         * and set the window state registers so that:
    980980         *
    981          *      CANRESTORE      = NWINDOW - 2
    982          *      CLEANWIN        = NWINDOW - 2
     981         *      CANRESTORE      = NWINDOWS - 2
     982         *      CLEANWIN        = NWINDOWS - 2
    983983         *      CANSAVE         = 0
    984984         *      OTHERWIN        = 0
     
    994994        rdpr %cwp, %g1
    995995        dec %g1
    996         and %g1, NWINDOW - 1, %g1
     996        and %g1, NWINDOWS - 1, %g1
    997997        wrpr %g1, 0, %cwp                       ! CWP--
    998998       
Note: See TracChangeset for help on using the changeset viewer.