Add setjmp/longjmp for ddb
This commit is contained in:
parent
8c22e2f77b
commit
0afbc83dfd
@ -33,6 +33,8 @@
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#include "opt_ddb.h"
|
||||
|
||||
#include <machine/asmacros.h>
|
||||
#include <machine/pmap.h>
|
||||
|
||||
@ -624,3 +626,36 @@ ENTRY(lgdt)
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user