linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <michael@ellerman.id.au>
To: Michael Neuling <mikey@neuling.org>
Cc: linuxppc-dev@ozlabs.org, RAISCH@de.ibm.com,
	Paul Mackerras <paulus@samba.org>,
	THEMANN@de.ibm.com
Subject: Re: [PATCH 1/2] Make setjmp/longjmp code generic
Date: Thu, 13 Dec 2007 09:56:55 +1100	[thread overview]
Message-ID: <1197500215.7695.11.camel@concordia> (raw)
In-Reply-To: <20071212054512.882AC62C070@localhost.localdomain>

[-- Attachment #1: Type: text/plain, Size: 3401 bytes --]

On Wed, 2007-12-12 at 16:45 +1100, Michael Neuling wrote:
> This makes the setjmp/longjmp code used by xmon, generically available
> to other code.  It also removes the requirement for debugger hooks to
> be only called on 0x300 (data storage) exception.
> 
> Signed-off-by: Michael Neuling <mikey@neuling.org>
> ---
> 
>  arch/powerpc/kernel/misc_64.S |  124 ++++++++++++++++++++++++++++++++++++++
>  arch/powerpc/mm/fault.c       |    6 -
>  arch/powerpc/xmon/Makefile    |    2 
>  arch/powerpc/xmon/setjmp.S    |  135 ------------------------------------------
>  arch/powerpc/xmon/xmon.c      |   10 ---
>  include/asm-powerpc/setjmp.h  |   12 +++
>  6 files changed, 142 insertions(+), 147 deletions(-)
> 
> Index: linux-2.6-ozlabs/arch/powerpc/kernel/misc_64.S
> ===================================================================
> --- linux-2.6-ozlabs.orig/arch/powerpc/kernel/misc_64.S
> +++ linux-2.6-ozlabs/arch/powerpc/kernel/misc_64.S
> @@ -518,6 +518,130 @@ _GLOBAL(giveup_altivec)
>  
>  #endif /* CONFIG_ALTIVEC */
>  
> +_GLOBAL(setjmp)
> +	mflr	r0
> +	PPC_STL	r0,0(r3)
> +	PPC_STL	r1,SZL(r3)
> +	PPC_STL	r2,2*SZL(r3)
> +	mfcr	r0
> +	PPC_STL	r0,3*SZL(r3)
> +	PPC_STL	r13,4*SZL(r3)
> +	PPC_STL	r14,5*SZL(r3)
> +	PPC_STL	r15,6*SZL(r3)
> +	PPC_STL	r16,7*SZL(r3)
> +	PPC_STL	r17,8*SZL(r3)
> +	PPC_STL	r18,9*SZL(r3)
> +	PPC_STL	r19,10*SZL(r3)
> +	PPC_STL	r20,11*SZL(r3)
> +	PPC_STL	r21,12*SZL(r3)
> +	PPC_STL	r22,13*SZL(r3)
> +	PPC_STL	r23,14*SZL(r3)
> +	PPC_STL	r24,15*SZL(r3)
> +	PPC_STL	r25,16*SZL(r3)
> +	PPC_STL	r26,17*SZL(r3)
> +	PPC_STL	r27,18*SZL(r3)
> +	PPC_STL	r28,19*SZL(r3)
> +	PPC_STL	r29,20*SZL(r3)
> +	PPC_STL	r30,21*SZL(r3)
> +	PPC_STL	r31,22*SZL(r3)
> +	li	r3,0
> +	blr
> +
> +_GLOBAL(longjmp)
> +	PPC_LCMPI r4,0
> +	bne	1f
> +	li	r4,1
> +1:	PPC_LL	r13,4*SZL(r3)
> +	PPC_LL	r14,5*SZL(r3)
> +	PPC_LL	r15,6*SZL(r3)
> +	PPC_LL	r16,7*SZL(r3)
> +	PPC_LL	r17,8*SZL(r3)
> +	PPC_LL	r18,9*SZL(r3)
> +	PPC_LL	r19,10*SZL(r3)
> +	PPC_LL	r20,11*SZL(r3)
> +	PPC_LL	r21,12*SZL(r3)
> +	PPC_LL	r22,13*SZL(r3)
> +	PPC_LL	r23,14*SZL(r3)
> +	PPC_LL	r24,15*SZL(r3)
> +	PPC_LL	r25,16*SZL(r3)
> +	PPC_LL	r26,17*SZL(r3)
> +	PPC_LL	r27,18*SZL(r3)
> +	PPC_LL	r28,19*SZL(r3)
> +	PPC_LL	r29,20*SZL(r3)
> +	PPC_LL	r30,21*SZL(r3)
> +	PPC_LL	r31,22*SZL(r3)
> +	PPC_LL	r0,3*SZL(r3)
> +	mtcrf	0x38,r0
> +	PPC_LL	r0,0(r3)
> +	PPC_LL	r1,SZL(r3)
> +	PPC_LL	r2,2*SZL(r3)
> +	mtlr	r0
> +	mr	r3,r4
> +	blr
> +
> +#ifdef CONFIG_XMON
> +/*
> + * Grab the register values as they are now.
> + * This won't do a particularily good job because we really
> + * want our caller's caller's registers, and our caller has
> + * already executed its prologue.
> + * ToDo: We could reach back into the caller's save area to do
> + * a better job of representing the caller's state (note that
> + * that will be different for 32-bit and 64-bit, because of the
> + * different ABIs, though).
> + */
> +_GLOBAL(xmon_save_regs)
> +	PPC_STL	r0,0*SZL(r3)
> +	PPC_STL	r2,2*SZL(r3)
> +	PPC_STL	r3,3*SZL(r3)
> +	PPC_STL	r4,4*SZL(r3)

Does xmon_save_regs belong here?

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

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  parent reply	other threads:[~2007-12-12 22:56 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-12  5:45 [PATCH 1/2] Make setjmp/longjmp code generic Michael Neuling
2007-12-12  7:59 ` Kumar Gala
2007-12-12  8:06   ` Benjamin Herrenschmidt
2007-12-12  9:37     ` Stephen Rothwell
2007-12-12  9:44       ` Benjamin Herrenschmidt
2007-12-12 11:09         ` Michael Neuling
2007-12-12 22:56 ` Michael Ellerman [this message]
2007-12-12 23:40   ` Michael Neuling
  -- strict thread matches above, loose matches on Subject: below --
2007-12-13  3:16 [PATCH 0/2] Add crashdump shutdown hooks Michael Neuling
2007-12-13  3:16 ` [PATCH 1/2] Make setjmp/longjmp code generic Michael Neuling
2007-12-13  9:59 [PATCH 0/2] Add crashdump shutdown hooks Michael Neuling
2007-12-13  9:59 ` [PATCH 1/2] Make setjmp/longjmp code generic Michael Neuling
2008-01-17  4:45 [PATCH 0/2] Add crashdump shutdown hooks Michael Neuling
2008-01-17  4:45 ` [PATCH 1/2] Make setjmp/longjmp code generic Michael Neuling
2008-01-17  5:38   ` Olof Johansson
2008-01-17  5:36     ` Michael Neuling
2008-01-17  6:36       ` Stephen Rothwell
2008-01-17 12:45       ` Josh Boyer
2008-01-17 21:49         ` Michael Ellerman
2008-01-17  6:39   ` Stephen Rothwell
2008-01-18  4:50 [PATCH 0/2] Add crashdump shutdown hooks Michael Neuling
2008-01-18  4:50 ` [PATCH 1/2] Make setjmp/longjmp code generic Michael Neuling

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1197500215.7695.11.camel@concordia \
    --to=michael@ellerman.id.au \
    --cc=RAISCH@de.ibm.com \
    --cc=THEMANN@de.ibm.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mikey@neuling.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).