[PATCH 1/2] powerpc: add Book E support to 64-bit hibernation

Scott Wood scottwood at freescale.com
Thu Jun 13 08:03:48 EST 2013


On 06/09/2013 05:37:39 AM, Wang Dongsheng wrote:
>  /* these macros rely on the save area being
>   * pointed to by r11 */
> +
> +#define SAVE_SPR(register)		\
> +	mfspr	r0,SPRN_##register	;\
> +	std	r0,SL_##register(r11)
> +#define RESTORE_SPR(register)		\
> +	ld	r0,SL_##register(r11)	;\
> +	mtspr	SPRN_##register,r0
> +#define RESTORE_SPRG(n)			\
> +	ld	r0,SL_SPRG##n(r11)	;\
> +	mtsprg	n,r0
>  #define SAVE_SPECIAL(special)		\
>  	mf##special	r0		;\
>  	std	r0, SL_##special(r11)

Is there a particular SPR that you're trying to save, for which  
SAVE_SPECIAL doesn't work?

> +#else
> +	/* Save SPRGs */
> +	RESTORE_SPRG(0)
> +	RESTORE_SPRG(1)
> +	RESTORE_SPRG(2)
> +	RESTORE_SPRG(3)
> +	RESTORE_SPRG(4)
> +	RESTORE_SPRG(5)
> +	RESTORE_SPRG(6)
> +	RESTORE_SPRG(7)

Why do we need this on book3e and not on book3s?

> +
> +	RESTORE_SPECIAL(MSR)
> +
> +	/* Restore TCR and clear any pending bits in TSR. */
> +	RESTORE_SPR(TCR)
> +	lis	r0, (TSR_ENW | TSR_WIS | TSR_DIS | TSR_FIS)@h
> +	mtspr	SPRN_TSR,r0

Please be internally consistent with whitespace after commas, even if  
the rest of the file is already inconsistent. :-P

> +
> +	/* Kick decrementer */
> +	li	r0,1
> +	mtdec	r0

Why doesn't book3s need to kick the decrementer?

-Scott


More information about the Linuxppc-dev mailing list