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

Michael Ellerman michael at ellerman.id.au
Thu Aug 7 20:32:56 EST 2008


On Fri, 2008-08-01 at 18:14 +0400, Anton Vorontsov wrote:
> From: Dale Farnsworth <dale at farnsworth.org>
> 
> Signed-off-by: Dale Farnsworth <dale at farnsworth.org>
> Signed-off-by: Anton Vorontsov <avorontsov at ru.mvista.com>

> @@ -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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20080807/2e8244af/attachment.pgp>


More information about the Linuxppc-dev mailing list