Subversion Repositories HelenOS

Rev

Rev 1870 | Rev 1880 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1870 Rev 1876
Line 583... Line 583...
583
	 */
583
	 */
584
	rdpr %tl, %g3
584
	rdpr %tl, %g3
585
	cmp %g3, 1
585
	cmp %g3, 1
586
	be 1f
586
	be 1f
587
	nop
587
	nop
588
0:	ba 0b					! this for debugging, if we ever get here
588
0:	ba 0b					! this is for debugging, if we ever get here
589
	nop					! it will be easy to find
589
	nop					! it will be easy to find
590
 
590
 
591
1:
591
1:
592
.if NOT(\is_syscall)
592
.if NOT(\is_syscall)
593
	rdpr %tstate, %g3
593
	rdpr %tstate, %g3
-
 
594
	
-
 
595
	/*
-
 
596
	 * One of the ways this handler can be invoked is after a nested MMU trap from
-
 
597
	 * either spill_1_normal or fill_1_normal traps. Both of these traps manipulate
-
 
598
	 * the CWP register. We deal with the situation by simulating the MMU trap
-
 
599
	 * on TL=1 and restart the respective SAVE or RESTORE instruction once the MMU
-
 
600
	 * trap is resolved. However, because we are in the wrong window from the
-
 
601
	 * perspective of the MMU trap, we need to synchronize CWP with CWP from TL=0.
-
 
602
	 */ 
-
 
603
	and %g3, TSTATE_CWP_MASK, %g4
-
 
604
	wrpr %g4, 0, %cwp			! resynchronize CWP
-
 
605
 
594
	andcc %g3, TSTATE_PRIV_BIT, %g0		! if this trap came from the privileged mode...
606
	andcc %g3, TSTATE_PRIV_BIT, %g0		! if this trap came from the privileged mode...
595
	bnz 0f					! ...skip setting of kernel stack and primary context
607
	bnz 0f					! ...skip setting of kernel stack and primary context
596
	nop
608
	nop
-
 
609
	
597
.endif
610
.endif
598
	/*
611
	/*
599
	 * Normal window spills will go to the userspace window buffer.
612
	 * Normal window spills will go to the userspace window buffer.
600
	 */
613
	 */
601
	wrpr %g0, WSTATE_OTHER(0) | WSTATE_NORMAL(2), %wstate
614
	wrpr %g0, WSTATE_OTHER(0) | WSTATE_NORMAL(2), %wstate
Line 883... Line 896...
883
	 * 	CANRESTORE 	= NWINDOW - 2
896
	 * 	CANRESTORE 	= NWINDOW - 2
884
	 *	CLEANWIN	= NWINDOW - 2
897
	 *	CLEANWIN	= NWINDOW - 2
885
	 *	CANSAVE 	= 0
898
	 *	CANSAVE 	= 0
886
	 *	OTHERWIN	= 0
899
	 *	OTHERWIN	= 0
887
	 *
900
	 *
888
	 * The RESTORE isntruction is therfore to be skipped.
901
	 * The RESTORE instruction is therfore to be skipped.
889
	 */
902
	 */
890
2:
903
2:
891
	wrpr %g0, 0, %otherwin
904
	wrpr %g0, 0, %otherwin
892
	wrpr %g0, 0, %cansave
905
	wrpr %g0, 0, %cansave
893
	wrpr %g1, 0, %canrestore
906
	wrpr %g1, 0, %canrestore