#include <sysdep.h>


	.text
	.align	ALIGN
	.globl	SYMBOL_NAME(__getcontext)
	.globl	SYMBOL_NAME(_setcontext)

__getcontext:
	popl	%edx
	pushl	$0  /* Get the context */
	pushl	%edx
	jmp	.L1

	.align	ALIGN
_setcontext:
	popl	%edx
	pushl	$1  /* Set the context */
	pushl	%edx
.L1:
	movl	$ __IBCS_context , %eax
	.byte	0x9a, 0, 0, 0, 0, 7, 0
	popl	%edx  /* Now remove our hidden parameter from the stack */
	movl	%edx,0(%esp)
	jnc	LF(2)
	STORE_NUMBER(%eax,ERRNO)
	mov	$-1,%eax
L(2:)
	ret

#ifdef ELF_LIBRARY
.type _setcontext,@function
.weak setcontext
setcontext = _setcontext
#endif
