xref: /freebsd/lib/libc/i386/gen/sigsetjmp.S (revision 2ceb2ce9eed6efe8076988a9e81722d6a920245d)
12ceb2ce9SGarrett Wollman/*-
22ceb2ce9SGarrett Wollman * Copyright (c) 1990 The Regents of the University of California.
32ceb2ce9SGarrett Wollman * All rights reserved.
42ceb2ce9SGarrett Wollman *
52ceb2ce9SGarrett Wollman * This code is derived from software contributed to Berkeley by
62ceb2ce9SGarrett Wollman * William Jolitz.
72ceb2ce9SGarrett Wollman *
82ceb2ce9SGarrett Wollman * Redistribution and use in source and binary forms, with or without
92ceb2ce9SGarrett Wollman * modification, are permitted provided that the following conditions
102ceb2ce9SGarrett Wollman * are met:
112ceb2ce9SGarrett Wollman * 1. Redistributions of source code must retain the above copyright
122ceb2ce9SGarrett Wollman *    notice, this list of conditions and the following disclaimer.
132ceb2ce9SGarrett Wollman * 2. Redistributions in binary form must reproduce the above copyright
142ceb2ce9SGarrett Wollman *    notice, this list of conditions and the following disclaimer in the
152ceb2ce9SGarrett Wollman *    documentation and/or other materials provided with the distribution.
162ceb2ce9SGarrett Wollman * 3. All advertising materials mentioning features or use of this software
172ceb2ce9SGarrett Wollman *    must display the following acknowledgement:
182ceb2ce9SGarrett Wollman *	This product includes software developed by the University of
192ceb2ce9SGarrett Wollman *	California, Berkeley and its contributors.
202ceb2ce9SGarrett Wollman * 4. Neither the name of the University nor the names of its contributors
212ceb2ce9SGarrett Wollman *    may be used to endorse or promote products derived from this software
222ceb2ce9SGarrett Wollman *    without specific prior written permission.
232ceb2ce9SGarrett Wollman *
242ceb2ce9SGarrett Wollman * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
252ceb2ce9SGarrett Wollman * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
262ceb2ce9SGarrett Wollman * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
272ceb2ce9SGarrett Wollman * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
282ceb2ce9SGarrett Wollman * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
292ceb2ce9SGarrett Wollman * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
302ceb2ce9SGarrett Wollman * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
312ceb2ce9SGarrett Wollman * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
322ceb2ce9SGarrett Wollman * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
332ceb2ce9SGarrett Wollman * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
342ceb2ce9SGarrett Wollman * SUCH DAMAGE.
352ceb2ce9SGarrett Wollman *
362ceb2ce9SGarrett Wollman *
372ceb2ce9SGarrett Wollman *	from: @(#)setjmp.s	5.1 (Berkeley) 4/23/90"
382ceb2ce9SGarrett Wollman *	$Id: sigsetjmp.S,v 1.1 1993/12/05 13:01:05 ats Exp $
392ceb2ce9SGarrett Wollman */
402ceb2ce9SGarrett Wollman
412ceb2ce9SGarrett Wollman#if defined(LIBC_SCCS) && !defined(lint)
422ceb2ce9SGarrett Wollman	.text
432ceb2ce9SGarrett Wollman	.asciz "$Id: sigsetjmp.S,v 1.1 1993/12/05 13:01:05 ats Exp $"
442ceb2ce9SGarrett Wollman#endif /* LIBC_SCCS and not lint */
452ceb2ce9SGarrett Wollman
462ceb2ce9SGarrett Wollman#include "DEFS.h"
472ceb2ce9SGarrett Wollman#include "SYS.h"
482ceb2ce9SGarrett Wollman
492ceb2ce9SGarrett WollmanENTRY(sigsetjmp)
502ceb2ce9SGarrett Wollman	movl	8(%esp),%eax
512ceb2ce9SGarrett Wollman	movl	4(%esp),%ecx
522ceb2ce9SGarrett Wollman	movl	%eax,24(%ecx)
532ceb2ce9SGarrett Wollman	testl	%eax,%eax
542ceb2ce9SGarrett Wollman	jz	1f
552ceb2ce9SGarrett Wollman	pushl	$0
562ceb2ce9SGarrett Wollman	call	PIC_PLT(_sigblock)
572ceb2ce9SGarrett Wollman	addl	$4,%esp
582ceb2ce9SGarrett Wollman	movl	4(%esp),%ecx
592ceb2ce9SGarrett Wollman	movl	%eax,28(%ecx)
602ceb2ce9SGarrett Wollman1:	movl	0(%esp),%edx
612ceb2ce9SGarrett Wollman	movl	%edx, 0(%ecx)
622ceb2ce9SGarrett Wollman	movl	%ebx, 4(%ecx)
632ceb2ce9SGarrett Wollman	movl	%esp, 8(%ecx)
642ceb2ce9SGarrett Wollman	movl	%ebp,12(%ecx)
652ceb2ce9SGarrett Wollman	movl	%esi,16(%ecx)
662ceb2ce9SGarrett Wollman	movl	%edi,20(%ecx)
672ceb2ce9SGarrett Wollman	xorl	%eax,%eax
682ceb2ce9SGarrett Wollman	ret
692ceb2ce9SGarrett Wollman
702ceb2ce9SGarrett WollmanENTRY(siglongjmp)
712ceb2ce9SGarrett Wollman	movl	4(%esp),%edx
722ceb2ce9SGarrett Wollman	cmpl	$0,24(%edx)
732ceb2ce9SGarrett Wollman	jz	1f
742ceb2ce9SGarrett Wollman	pushl	28(%edx)
752ceb2ce9SGarrett Wollman	call	PIC_PLT(_sigsetmask)
762ceb2ce9SGarrett Wollman	addl	$4,%esp
772ceb2ce9SGarrett Wollman1:	movl	4(%esp),%edx
782ceb2ce9SGarrett Wollman	movl	8(%esp),%eax
792ceb2ce9SGarrett Wollman	movl	0(%edx),%ecx
802ceb2ce9SGarrett Wollman	movl	4(%edx),%ebx
812ceb2ce9SGarrett Wollman	movl	8(%edx),%esp
822ceb2ce9SGarrett Wollman	movl	12(%edx),%ebp
832ceb2ce9SGarrett Wollman	movl	16(%edx),%esi
842ceb2ce9SGarrett Wollman	movl	20(%edx),%edi
852ceb2ce9SGarrett Wollman	testl	%eax,%eax
862ceb2ce9SGarrett Wollman	jnz	2f
872ceb2ce9SGarrett Wollman	incl	%eax
882ceb2ce9SGarrett Wollman2:	movl	%ecx,0(%esp)
892ceb2ce9SGarrett Wollman	ret
90