Re: [PATCH] [MIPS] Fix resume for 64K page size

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

 



On Tue, Jul 10, 2007 at 06:34:54PM +0100, Thiemo Seufer wrote:

> > -#if (_THREAD_SIZE - 32) < 0x10000
> > +#if (_THREAD_SIZE) < 0x10000
> >  	PTR_ADDIU	t0, $28, _THREAD_SIZE - 32
> >  #else
> >  	PTR_LI		t0, _THREAD_SIZE - 32
> 
> This doesn't look right. I think it should be
> 
> #if (_THREAD_SIZE - 32) < 0x8000
> 
> in order to avoid an overflow of the immediate.

Indeed - that's the limitation of the (d)addiu instruction.  But (d)addu
instead handle large constants just fine, so I'd below patch instead.  So
why not let the assembler do the dirty work.

  Ralf

Signed-off-by: Ralf Baechle <ralf@xxxxxxxxxxxxxx>

diff --git a/arch/mips/kernel/r4k_switch.S b/arch/mips/kernel/r4k_switch.S
index 65f0f91..d9bfae5 100644
--- a/arch/mips/kernel/r4k_switch.S
+++ b/arch/mips/kernel/r4k_switch.S
@@ -85,12 +85,7 @@
 	move	$28, a2
 	cpu_restore_nonscratch a1
 
-#if (_THREAD_SIZE) < 0x10000
-	PTR_ADDIU	t0, $28, _THREAD_SIZE - 32
-#else
-	PTR_LI		t0, _THREAD_SIZE - 32
-	PTR_ADDU	t0, $28
-#endif
+	PTR_ADDU	t0, $28, _THREAD_SIZE - 32
 	set_saved_sp	t0, t1, t2
 #ifdef CONFIG_MIPS_MT_SMTC
 	/* Read-modify-writes of Status must be atomic on a VPE */


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux