xref: /csrg-svn/lib/libcompat/4.1/tahoe/reset.s (revision 61238)
147920Sbostic/*-
2*61238Sbostic * Copyright (c) 1986, 1993
3*61238Sbostic *	The Regents of the University of California.  All rights reserved.
447920Sbostic *
547920Sbostic * %sccs.include.proprietary.c%
629524Ssam */
729524Ssam
847920Sbostic#if defined(LIBC_SCCS) && !defined(lint)
9*61238Sbostic	.asciz "@(#)reset.s	8.1 (Berkeley) 06/04/93"
1047920Sbostic#endif /* LIBC_SCCS and not lint */
1147920Sbostic
1229524Ssam/*
1329524Ssam * C library -- reset, setexit
1429524Ssam *
1529524Ssam *	reset(x)
1629524Ssam * will generate a "return" from
1729524Ssam * the last call to
1829524Ssam *	setexit()
1929524Ssam * by restoring r2 - r12, fp
2029524Ssam * and doing a return.
2129524Ssam * The returned value is x; on the original
2229524Ssam * call the returned value is 0.
2329524Ssam *
2429524Ssam * useful for going back to the main loop
2529524Ssam * after a horrible error in a lowlevel
2629524Ssam * routine.
2729524Ssam */
2829524Ssam#include "DEFS.h"
2929524Ssam
3029710SsamENTRY(setexit, 0)
3129524Ssam	movab	setsav,r0
3229524Ssam	storer	$0x1ffc, (r0)
3329524Ssam	movl	(fp),44(r0)		# fp
3429524Ssam	moval	4(fp),48(r0)		# sp
3529524Ssam	movl	-8(fp),52(r0)		# pc
3629524Ssam	clrl	r0
3729524Ssam	ret
3829524Ssam
3929710SsamENTRY(reset, 0)
4029524Ssam	movl	4(fp),r0	# returned value
4129524Ssam	movab	setsav,r1
4229524Ssam	loadr	$0x1ffc,(r1)
4329524Ssam	movl	44(r1),fp
4429524Ssam	movl	48(r1),sp
4529524Ssam	jmp 	*52(r1)
4629524Ssam
4729524Ssam	.data
4829524Ssamsetsav:	.space	14*4
49