1 /* $FreeBSD: src/sys/boot/arc/lib/arch/alpha/setjmp.S,v 1.2 1999/08/28 00:39:40 peter Exp $ */
2 /* $DragonFly: src/sys/boot/arc/lib/arch/alpha/Attic/setjmp.S,v 1.2 2003/06/17 04:28:16 dillon Exp $ */
4 * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
7 * Author: Chris G. Demetriou
9 * Permission to use, copy, modify and distribute this software and
10 * its documentation is hereby granted, provided that both the copyright
11 * notice and this permission notice appear in all copies of the
12 * software, derivative works or modified versions, and any portions
13 * thereof, and that both notices appear in supporting documentation.
15 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
16 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
17 * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
19 * Carnegie Mellon requests users of this software to return to
21 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
22 * School of Computer Science
23 * Carnegie Mellon University
24 * Pittsburgh PA 15213-3890
26 * any improvements or extensions that they make and grant Carnegie the
27 * rights to redistribute these changes.
30 #include <machine/asm.h>
34 * Kernel setjmp and longjmp. Rather minimalist.
37 * will generate a "return (1)" from the last call to
39 * by restoring registers from the stack,
47 stq ra, (0 * 8)(a0) /* return address */
48 stq s0, (1 * 8)(a0) /* callee-saved registers */
57 ldiq t0, 0xbeeffedadeadbabe /* set magic number */
60 mov zero, v0 /* return zero */
67 ldiq t0, 0xbeeffedadeadbabe /* check magic number */
70 beq t0, longjmp_botch /* if bad, punt */
72 ldq ra, (0 * 8)(a0) /* return address */
73 ldq s0, (1 * 8)(a0) /* callee-saved registers */
86 lda a0, longjmp_botchmsg
93 .asciz "longjmp botch from %p"