147919Sbostic/*- 2*61239Sbostic * Copyright (c) 1983, 1993 3*61239Sbostic * The Regents of the University of California. All rights reserved. 447919Sbostic * 547919Sbostic * %sccs.include.proprietary.c% 621412Sdist */ 721412Sdist 847919Sbostic#if defined(LIBC_SCCS) && !defined(lint) 9*61239Sbostic .asciz "@(#)reset.s 8.1 (Berkeley) 06/04/93" 1047919Sbostic#endif /* LIBC_SCCS and not lint */ 1147919Sbostic 1221412Sdist/* 1313790Ssam * C library -- reset, setexit 1413790Ssam * 1513790Ssam * reset(x) 1613790Ssam * will generate a "return" from 1713790Ssam * the last call to 1813790Ssam * setexit() 1913790Ssam * by restoring r6 - r12, ap, fp 2013790Ssam * and doing a return. 2113790Ssam * The returned value is x; on the original 2213790Ssam * call the returned value is 0. 2313790Ssam * 2413790Ssam * useful for going back to the main loop 2513790Ssam * after a horrible error in a lowlevel 2613790Ssam * routine. 2713790Ssam */ 2813790Ssam#include "DEFS.h" 292039Swnj 3013790SsamENTRY(setexit) 312039Swnj movab setsav,r0 322039Swnj movq r6,(r0)+ 332039Swnj movq r8,(r0)+ 342039Swnj movq r10,(r0)+ 352039Swnj movq 8(fp),(r0)+ # ap, fp 362039Swnj movab 4(ap),(r0)+ # sp 372039Swnj movl 16(fp),(r0) # pc 382039Swnj clrl r0 392039Swnj ret 402039Swnj 4113790SsamENTRY(reset) 422039Swnj movl 4(ap),r0 # returned value 432039Swnj movab setsav,r1 442039Swnj movq (r1)+,r6 452039Swnj movq (r1)+,r8 462039Swnj movq (r1)+,r10 472039Swnj movq (r1)+,r12 482039Swnj movl (r1)+,sp 492039Swnj jmp *(r1) 502039Swnj 512039Swnj .data 522039Swnjsetsav: .space 10*4 53