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