/* vim: set filetype=c:
 *
 * setjmp.h86  -  Long jump interface for runtime library
 *
 * Copyright (C) 2003-2007 Gero Kuhlmann   <gero@gkminix.han.de>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 * $Id: setjmp.h86,v 1.6 2007/01/06 18:30:54 gkminix Exp $
 */


#ifndef I386_SETJMP_H86
#define I386_SETJMP_H86



/*
 **************************************************************************
 *
 * This file can only get included into target C or assembler source files.
 */
#define GCC_INCLUDE
#include <compiler.h>



/*
 **************************************************************************
 *
 * Definition of SETJMP buffer
 */

#ifndef _ASSEMBLY_

#define JMP_BUF_SIZE	6			/* number of dwords in buffer */

typedef __u32 jmp_buf[JMP_BUF_SIZE];

extern short setjmp(jmp_buf *env);
extern void longjmp(jmp_buf *env, short val) __attribute__ ((noreturn));

#else

			.struct	0
jmpbuf_ebx:		.struct	.+4		/* saved EBX */
jmpbuf_esi:		.struct	.+4		/* saved ESI */
jmpbuf_edi:		.struct	.+4		/* saved EDI */
jmpbuf_ebp:		.struct	.+4		/* saved EBP */
jmpbuf_esp:		.struct	.+4		/* saved ESP */
jmpbuf_pc:		.struct	.+2		/* saved IP */
jmpbuf_es:		.struct	.+2		/* saved ES */

#endif /* _ASSEMBLY_ */

#endif

