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