/* 
 * Mach Operating System
 * Copyright (c) 1991 Carnegie Mellon University
 * All Rights Reserved.
 * 
 * Permission to use, copy, modify and distribute this software and its
 * documentation is hereby granted, provided that both the copyright
 * notice and this permission notice appear in all copies of the
 * software, derivative works or modified versions, and any portions
 * thereof, and that both notices appear in supporting documentation.
 * 
 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
 * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
 * 
 * Carnegie Mellon requests users of this software to return to
 * 
 *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
 *  School of Computer Science
 *  Carnegie Mellon University
 *  Pittsburgh PA 15213-3890
 * 
 * any improvements or extensions that they make and grant Carnegie Mellon 
 * the rights to redistribute these changes.
 */
/*
 *
 * HISTORY
 * $Log:	_setjmp.h,v $
 * Revision 2.2  91/07/09  23:23:58  danner
 * 	Created. Incomplete
 * 	[91/07/08  23:01:08  danner]
 * 
 *
 */


	text

/*
 *      setjmp needs to save r1, r14-r31 
 *      We assume the buffer is only word aligned.
 *
 *      r2 contains the address of the jumpbuf.
 *      We save r1, r14-r31, a total of 19 registers.
 */

	align 4
__setjmp:	global __setjmp
_setjmp:        global _setjmp  
        extu    r3, r2, 3<0>     /* get the low three bits */
        bcnd.n	ne0, r3, 1f      /* only word aligned */
	st	r1,  r2, 0
	st	r14, r2, 4       /* now back to word aligned */
	st.d	r15, r2, 8
	st.d	r17, r2, 16
	st.d	r19, r2, 24
	st.d	r21, r2, 32
	st.d	r23, r2, 40
	st.d	r25, r2, 48
	st.d	r27, r2, 56
	st.d	r29, r2, 64
	st	r31, r2, 70
  	jmp.n	r1              /* hop back */
  	or	r2, r0, r0
  1f:
  
