Date: Thu, 29 May 2003 15:55:09 -0700 (PDT) From: Peter Wemm <peter@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 32069 for review Message-ID: <200305292255.h4TMt90v068998@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=32069 Change 32069 by peter@peter_hammer on 2003/05/29 15:55:04 add setjmp/longjmp for ddb's benefit. Affected files ... .. //depot/projects/hammer/sys/amd64/amd64/support.S#8 edit Differences ... ==== //depot/projects/hammer/sys/amd64/amd64/support.S#8 (text+ko) ==== @@ -33,6 +33,8 @@ * $FreeBSD: src/sys/amd64/amd64/support.S,v 1.100 2003/05/14 03:38:13 peter Exp $ */ +#include "opt_ddb.h" + #include <machine/asmacros.h> #include <machine/pmap.h> @@ -624,3 +626,36 @@ pushq $KCSEL pushq %rax lretq + +#ifdef DDB +/*****************************************************************************/ +/* setjump, longjump */ +/*****************************************************************************/ + +ENTRY(setjmp) + movq %rbx,0(%rdi) /* save rbx */ + movq %rsp,8(%rdi) /* save rsp */ + movq %rbp,16(%rdi) /* save rbp */ + movq %r12,24(%rdi) /* save r12 */ + movq %r13,32(%rdi) /* save r13 */ + movq %r14,40(%rdi) /* save r14 */ + movq %r15,48(%rdi) /* save r15 */ + movq 0(%rsp),%rdx /* get rta */ + movq %rdx,56(%rdi) /* save rip */ + xorl %eax,%eax /* return(0); */ + ret + +ENTRY(longjmp) + movq 0(%rdi),%rbx /* restore rbx */ + movq 8(%rdi),%rsp /* restore rsp */ + movq 16(%rdi),%rbp /* restore rbp */ + movq 24(%rdi),%r12 /* restore r12 */ + movq 32(%rdi),%r13 /* restore r13 */ + movq 40(%rdi),%r14 /* restore r14 */ + movq 48(%rdi),%r15 /* restore r15 */ + movq 56(%rdi),%rdx /* get rta */ + movq %rdx,0(%rsp) /* put in return frame */ + xorl %eax,%eax /* return(1); */ + incl %eax + ret +#endif
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200305292255.h4TMt90v068998>