Changeset 84060e2 in mainline for kernel/arch/sparc64/src/trap
- Timestamp:
- 2006-10-09T19:29:42Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8ce8499
- Parents:
- e4398200
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc64/src/trap/trap_table.S
re4398200 r84060e2 674 674 wrpr %g0, WSTATE_OTHER(0) | WSTATE_NORMAL(2), %wstate 675 675 676 wrpr %g0, NWINDOW - 1, %cleanwin ! prevent unnecessary clean_window exceptions676 wrpr %g0, NWINDOWS - 1, %cleanwin ! prevent unnecessary clean_window exceptions 677 677 678 678 /* … … 831 831 and %g1, TSTATE_CWP_MASK, %l0 832 832 inc %l0 833 and %l0, NWINDOW - 1, %l0 ! %l0 mod NWINDOW833 and %l0, NWINDOWS - 1, %l0 ! %l0 mod NWINDOWS 834 834 rdpr %cwp, %l1 835 835 cmp %l0, %l1 … … 902 902 sub %g1, %g2, %g3 903 903 dec %g3 904 and %g3, NWINDOW - 1, %g3904 and %g3, NWINDOWS - 1, %g3 905 905 wrpr %g3, 0, %cwp 906 906 … … 934 934 935 935 dec %g3 936 and %g3, NWINDOW - 1, %g3936 and %g3, NWINDOWS - 1, %g3 937 937 wrpr %g3, 0, %cwp ! switch to the preceeding window 938 938 … … 947 947 wrpr %g1, 0, %cwp 948 948 add %g4, %g2, %g2 949 cmp %g2, NWINDOW - 2950 bg 2f ! fix the CANRESTORE=NWINDOW -1 anomaly951 mov NWINDOW - 2, %g1 ! use dealy slot for both cases949 cmp %g2, NWINDOWS - 2 950 bg 2f ! fix the CANRESTORE=NWINDOWS-1 anomaly 951 mov NWINDOWS - 2, %g1 ! use dealy slot for both cases 952 952 sub %g1, %g2, %g1 953 953 954 954 wrpr %g0, 0, %otherwin 955 wrpr %g1, 0, %cansave ! NWINDOW - 2 - CANRESTORE955 wrpr %g1, 0, %cansave ! NWINDOWS - 2 - CANRESTORE 956 956 wrpr %g2, 0, %canrestore ! OTHERWIN + windows in the buffer 957 957 wrpr %g2, 0, %cleanwin ! avoid information leak … … 973 973 * 974 974 * 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. 976 976 * However, CANRESTORE can be only NWINDOW - 2 at most. 977 977 * 978 * The solution is to manually switch to (CWP - 1) mod NWINDOW 978 * The solution is to manually switch to (CWP - 1) mod NWINDOWS 979 979 * and set the window state registers so that: 980 980 * 981 * CANRESTORE = NWINDOW - 2982 * CLEANWIN = NWINDOW - 2981 * CANRESTORE = NWINDOWS - 2 982 * CLEANWIN = NWINDOWS - 2 983 983 * CANSAVE = 0 984 984 * OTHERWIN = 0 … … 994 994 rdpr %cwp, %g1 995 995 dec %g1 996 and %g1, NWINDOW - 1, %g1996 and %g1, NWINDOWS - 1, %g1 997 997 wrpr %g1, 0, %cwp ! CWP-- 998 998
Note:
See TracChangeset
for help on using the changeset viewer.