diff options
Diffstat (limited to 'arch/sparc/kernel/etrap_32.S')
| -rw-r--r-- | arch/sparc/kernel/etrap_32.S | 68 | 
1 files changed, 14 insertions, 54 deletions
diff --git a/arch/sparc/kernel/etrap_32.S b/arch/sparc/kernel/etrap_32.S index e806fcdc46d..e3e80d65e39 100644 --- a/arch/sparc/kernel/etrap_32.S +++ b/arch/sparc/kernel/etrap_32.S @@ -216,9 +216,7 @@ tsetup_patch6:  	/* Call MMU-architecture dependent stack checking  	 * routine.  	 */ -	.globl	tsetup_mmu_patchme -tsetup_mmu_patchme: -	b	tsetup_sun4c_stackchk +	b	tsetup_srmmu_stackchk  	 andcc	%sp, 0x7, %g0  	/* Architecture specific stack checking routines.  When either @@ -228,52 +226,6 @@ tsetup_mmu_patchme:  	 */  #define glob_tmp     g1 -tsetup_sun4c_stackchk: -	/* Done by caller: andcc %sp, 0x7, %g0 */ -	bne	trap_setup_user_stack_is_bolixed -	 sra	%sp, 29, %glob_tmp - -	add	%glob_tmp, 0x1, %glob_tmp -	andncc	%glob_tmp, 0x1, %g0 -	bne	trap_setup_user_stack_is_bolixed -	 and	%sp, 0xfff, %glob_tmp		! delay slot - -	/* See if our dump area will be on more than one -	 * page. -	 */ -	add	%glob_tmp, 0x38, %glob_tmp -	andncc	%glob_tmp, 0xff8, %g0 -	be	tsetup_sun4c_onepage		! only one page to check -	 lda	[%sp] ASI_PTE, %glob_tmp	! have to check first page anyways - -tsetup_sun4c_twopages: -	/* Is first page ok permission wise? */ -	srl	%glob_tmp, 29, %glob_tmp -	cmp	%glob_tmp, 0x6 -	bne	trap_setup_user_stack_is_bolixed -	 add	%sp, 0x38, %glob_tmp		/* Is second page in vma hole? */ - -	sra	%glob_tmp, 29, %glob_tmp -	add	%glob_tmp, 0x1, %glob_tmp -	andncc	%glob_tmp, 0x1, %g0 -	bne	trap_setup_user_stack_is_bolixed -	 add	%sp, 0x38, %glob_tmp - -	lda	[%glob_tmp] ASI_PTE, %glob_tmp - -tsetup_sun4c_onepage: -	srl	%glob_tmp, 29, %glob_tmp -	cmp	%glob_tmp, 0x6				! can user write to it? -	bne	trap_setup_user_stack_is_bolixed	! failure -	 nop - -	STORE_WINDOW(sp) - -	restore %g0, %g0, %g0 - -	jmpl	%t_retpc + 0x8, %g0 -	 mov	%t_kstack, %sp -  	.globl	tsetup_srmmu_stackchk  tsetup_srmmu_stackchk:  	/* Check results of callers andcc %sp, 0x7, %g0 */ @@ -282,7 +234,8 @@ tsetup_srmmu_stackchk:  	cmp	%glob_tmp, %sp  	bleu,a	1f -	 lda	[%g0] ASI_M_MMUREGS, %glob_tmp		! read MMU control +LEON_PI( lda	[%g0] ASI_LEON_MMUREGS, %glob_tmp)	! read MMU control +SUN_PI_( lda	[%g0] ASI_M_MMUREGS, %glob_tmp)		! read MMU control  trap_setup_user_stack_is_bolixed:  	/* From user/kernel into invalid window w/bad user @@ -297,18 +250,25 @@ trap_setup_user_stack_is_bolixed:  1:  	/* Clear the fault status and turn on the no_fault bit. */  	or	%glob_tmp, 0x2, %glob_tmp		! or in no_fault bit -	sta	%glob_tmp, [%g0] ASI_M_MMUREGS		! set it +LEON_PI(sta	%glob_tmp, [%g0] ASI_LEON_MMUREGS)		! set it +SUN_PI_(sta	%glob_tmp, [%g0] ASI_M_MMUREGS)		! set it  	/* Dump the registers and cross fingers. */  	STORE_WINDOW(sp)  	/* Clear the no_fault bit and check the status. */  	andn	%glob_tmp, 0x2, %glob_tmp -	sta	%glob_tmp, [%g0] ASI_M_MMUREGS +LEON_PI(sta	%glob_tmp, [%g0] ASI_LEON_MMUREGS) +SUN_PI_(sta	%glob_tmp, [%g0] ASI_M_MMUREGS) +  	mov	AC_M_SFAR, %glob_tmp -	lda	[%glob_tmp] ASI_M_MMUREGS, %g0 +LEON_PI(lda	[%glob_tmp] ASI_LEON_MMUREGS, %g0) +SUN_PI_(lda	[%glob_tmp] ASI_M_MMUREGS, %g0) +  	mov	AC_M_SFSR, %glob_tmp -	lda	[%glob_tmp] ASI_M_MMUREGS, %glob_tmp	! save away status of winstore +LEON_PI(lda	[%glob_tmp] ASI_LEON_MMUREGS, %glob_tmp)! save away status of winstore +SUN_PI_(lda	[%glob_tmp] ASI_M_MMUREGS, %glob_tmp)	! save away status of winstore +  	andcc	%glob_tmp, 0x2, %g0			! did we fault?  	bne	trap_setup_user_stack_is_bolixed	! failure  	 nop  | 
