[PATCH] powerpc/fsl-booke: Use SPRN_SPRGn rather than mfsprg/mtsprg

Dongsheng.Wang at freescale.com Dongsheng.Wang at freescale.com
Mon Jan 6 17:05:45 EST 2014


Reviewed-by: Wang Dongsheng <dongsheng.wang at freescale.com>
Tested-by: Wang Dongsheng <dongsheng.wang at freescale.com>

Works well. :)

-Dongsheng

> -----Original Message-----
> From: Linuxppc-dev [mailto:linuxppc-dev-
> bounces+b40534=freescale.com at lists.ozlabs.org] On Behalf Of
> Dongsheng.Wang at freescale.com
> Sent: Friday, January 03, 2014 6:33 PM
> To: Wood Scott-B07421; Benjamin Herrenschmidt
> Cc: Anton Vorontsov; linuxppc-dev at lists.ozlabs.org
> Subject: RE: [PATCH] powerpc/fsl-booke: Use SPRN_SPRGn rather than mfsprg/mtsprg
> 
> Looks good. I will test it as soon as possible.
> 
> BTW, there is only SPRG3 need to save.
> 32bit: SPRG0-SPRG1, SPRG2-SPRG7, SPRG9 be use to deal with exception,
> those register not need to save.(SPRG8 not be used) Only SPRG3 be used
> to save current thread_info pointer.
> 
> -Dongsheng
> 
> > -----Original Message-----
> > From: Wood Scott-B07421
> > Sent: Friday, January 03, 2014 6:38 AM
> > To: Benjamin Herrenschmidt
> > Cc: linuxppc-dev at lists.ozlabs.org; Wood Scott-B07421; Wang Dongsheng-B40534;
> > Anton Vorontsov
> > Subject: [PATCH] powerpc/fsl-booke: Use SPRN_SPRGn rather than mfsprg/mtsprg
> >
> > This fixes a build break that was probably introduced with the removal
> > of -Wa,-me500 (commit f49596a4cf4753d13951608f24f939a59fdcc653), where
> > the assembler refuses to recognize SPRG4-7 with a generic PPC target.
> >
> > Signed-off-by: Scott Wood <scottwood at freescale.com>
> > Cc: Dongsheng Wang <dongsheng.wang at freescale.com>
> > Cc: Anton Vorontsov <avorontsov at mvista.com>
> > ---
> > Dongsheng, please test.
> > ---
> >  arch/powerpc/kernel/swsusp_booke.S | 32 ++++++++++++++++----------------
> >  1 file changed, 16 insertions(+), 16 deletions(-)
> >
> > diff --git a/arch/powerpc/kernel/swsusp_booke.S
> > b/arch/powerpc/kernel/swsusp_booke.S
> > index 0f20405..553c140 100644
> > --- a/arch/powerpc/kernel/swsusp_booke.S
> > +++ b/arch/powerpc/kernel/swsusp_booke.S
> > @@ -74,21 +74,21 @@ _GLOBAL(swsusp_arch_suspend)
> >  	bne	1b
> >
> >  	/* Save SPRGs */
> > -	mfsprg	r4,0
> > +	mfspr	r4,SPRN_SPRG0
> >  	stw	r4,SL_SPRG0(r11)
> > -	mfsprg	r4,1
> > +	mfspr	r4,SPRN_SPRG1
> >  	stw	r4,SL_SPRG1(r11)
> > -	mfsprg	r4,2
> > +	mfspr	r4,SPRN_SPRG2
> >  	stw	r4,SL_SPRG2(r11)
> > -	mfsprg	r4,3
> > +	mfspr	r4,SPRN_SPRG3
> >  	stw	r4,SL_SPRG3(r11)
> > -	mfsprg	r4,4
> > +	mfspr	r4,SPRN_SPRG4
> >  	stw	r4,SL_SPRG4(r11)
> > -	mfsprg	r4,5
> > +	mfspr	r4,SPRN_SPRG5
> >  	stw	r4,SL_SPRG5(r11)
> > -	mfsprg	r4,6
> > +	mfspr	r4,SPRN_SPRG6
> >  	stw	r4,SL_SPRG6(r11)
> > -	mfsprg	r4,7
> > +	mfspr	r4,SPRN_SPRG7
> >  	stw	r4,SL_SPRG7(r11)
> >
> >  	/* Call the low level suspend stuff (we should probably have made
> > @@ -150,21 +150,21 @@ _GLOBAL(swsusp_arch_resume)
> >  	bl	_tlbil_all
> >
> >  	lwz	r4,SL_SPRG0(r11)
> > -	mtsprg	0,r4
> > +	mtspr	SPRN_SPRG0,r4
> >  	lwz	r4,SL_SPRG1(r11)
> > -	mtsprg	1,r4
> > +	mtspr	SPRN_SPRG1,r4
> >  	lwz	r4,SL_SPRG2(r11)
> > -	mtsprg	2,r4
> > +	mtspr	SPRN_SPRG2,r4
> >  	lwz	r4,SL_SPRG3(r11)
> > -	mtsprg	3,r4
> > +	mtspr	SPRN_SPRG3,r4
> >  	lwz	r4,SL_SPRG4(r11)
> > -	mtsprg	4,r4
> > +	mtspr	SPRN_SPRG4,r4
> >  	lwz	r4,SL_SPRG5(r11)
> > -	mtsprg	5,r4
> > +	mtspr	SPRN_SPRG5,r4
> >  	lwz	r4,SL_SPRG6(r11)
> > -	mtsprg	6,r4
> > +	mtspr	SPRN_SPRG6,r4
> >  	lwz	r4,SL_SPRG7(r11)
> > -	mtsprg	7,r4
> > +	mtspr	SPRN_SPRG7,r4
> >
> >  	/* restore the MSR */
> >  	lwz	r3,SL_MSR(r11)
> > --
> > 1.8.3.2
> 
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev at lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
> 



More information about the Linuxppc-dev mailing list