/* $Copyright:	$
 * Copyright (c) 1984, 1985, 1986, 1987, 1988, 1989, 1990 
 * Sequent Computer Systems, Inc.   All rights reserved.
 *  
 * This software is furnished under a license and may be used
 * only in accordance with the terms of that license and with the
 * inclusion of the above copyright notice.   This software may not
 * be provided or otherwise made available to, or used by, any
 * other person.  No title to or ownership of the software is
 * hereby transferred.
 */

#ident		"$Header: inline.h 1.5 89/08/07 $"

#ifndef	_SYS_INLINE_H_

/*
 * inline.h
 *	Various in-line expansion asm functions.  i386 version.
 *
 * These don't deal with reading/writing particular registers.
 */

/* $Log:	inline.h,v $
 */

#ifndef	lint				/* lint can't handle asm fcts yet */

/*
 * Fast in-line version of setjmp().
 * This code is very dependent on order of fields in types.h
 *
 * NOTE: saves "esp" instead of esp-4 for stack pointer since in-line
 * expanded call has no argument on the stack.
 */

asm fsetjmp(jmpbuf)
{
%mem jmpbuf;
	movl	jmpbuf, %eax
	movl	%esp, 0(%eax)
	movl	%ebp, 4(%eax)
	movl	$9f, 8(%eax)
	subl	%eax, %eax
9:
}

/*
 * saveregs()
 *	Save all regs on the stack and return esp
 *	Called by pause_self() in machdep.c
 */

asm saveregs()
{
	pushal
	movl	%esp, %eax
}

#endif	/* lint */

#define	_SYS_INLINE_H_
#endif	/* _SYS_INLINE_H_ */
