Subject: Re: [PATCH 7/8] powerpc: implement crash_setup_regs for ppc32

From: Michael Ellerman <[email-masked]>
Date: Thu, 07 Aug 2008 20:32:56 +1000

On Fri, 2008-08-01 at 18:14 +0400, Anton Vorontsov wrote:
> From: Dale Farnsworth <[email-masked]>
> 
> Signed-off-by: Dale Farnsworth <[email-masked]>
> Signed-off-by: Anton Vorontsov <[email-masked]>

> @@ -51,6 +50,7 @@ static inline void crash_setup_regs(struct pt_regs *newregs,
>  	else {
>  		/* FIXME Merge this with xmon_save_regs ?? */
>  		unsigned long tmp1, tmp2;
> +#ifdef __powerpc64__
>  		__asm__ __volatile__ (
>  			"std    0,0(%2)\n"
>  			"std    1,8(%2)\n"
> @@ -99,16 +99,58 @@ static inline void crash_setup_regs(struct pt_regs *newregs,
>  			: "=&r" (tmp1), "=&r" (tmp2)
>  			: "b" (newregs)
>  			: "memory");
> +#else /* __powerpc64__ */
> +		__asm__ __volatile__ (
> +			"stw    0,0(%2)\n"
> +			"stw    1,4(%2)\n"
> +			"stw    2,8(%2)\n"
> +			"stw    3,12(%2)\n"
> +			"stw    4,16(%2)\n"
> +			"stw    5,20(%2)\n"
> +			"stw    6,24(%2)\n"
> +			"stw    7,28(%2)\n"
> +			"stw    8,32(%2)\n"

..

Hi Anton,

You should be able to avoid any use of #ifdefs in this routine. Look at
SAVE_GPR() and friends in asm/ppc_asm.h.

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person