xref: /original-bsd/lib/libcompat/4.1/vax/reset.s (revision c3e32dec)
1/*-
2 * Copyright (c) 1983, 1993
3 *	The Regents of the University of California.  All rights reserved.
4 *
5 * %sccs.include.proprietary.c%
6 */
7
8#if defined(LIBC_SCCS) && !defined(lint)
9	.asciz "@(#)reset.s	8.1 (Berkeley) 06/04/93"
10#endif /* LIBC_SCCS and not lint */
11
12/*
13 * C library -- reset, setexit
14 *
15 *	reset(x)
16 * will generate a "return" from
17 * the last call to
18 *	setexit()
19 * by restoring r6 - r12, ap, fp
20 * and doing a return.
21 * The returned value is x; on the original
22 * call the returned value is 0.
23 *
24 * useful for going back to the main loop
25 * after a horrible error in a lowlevel
26 * routine.
27 */
28#include "DEFS.h"
29
30ENTRY(setexit)
31	movab	setsav,r0
32	movq	r6,(r0)+
33	movq	r8,(r0)+
34	movq	r10,(r0)+
35	movq	8(fp),(r0)+		# ap, fp
36	movab	4(ap),(r0)+		# sp
37	movl	16(fp),(r0)		# pc
38	clrl	r0
39	ret
40
41ENTRY(reset)
42	movl	4(ap),r0	# returned value
43	movab	setsav,r1
44	movq	(r1)+,r6
45	movq	(r1)+,r8
46	movq	(r1)+,r10
47	movq	(r1)+,r12
48	movl	(r1)+,sp
49	jmp 	*(r1)
50
51	.data
52setsav:	.space	10*4
53