Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[dragonfly.git] / lib / libcr / alpha / gen / sigsetjmp.S
1 /*      $NetBSD: sigsetjmp.S,v 1.2 1996/10/17 03:08:07 cgd Exp $        */
2
3 /*
4  * Copyright (c) 1994, 1995 Carnegie-Mellon University.
5  * All rights reserved.
6  *
7  * Author: Chris G. Demetriou
8  * 
9  * Permission to use, copy, modify and distribute this software and
10  * its documentation is hereby granted, provided that both the copyright
11  * notice and this permission notice appear in all copies of the
12  * software, derivative works or modified versions, and any portions
13  * thereof, and that both notices appear in supporting documentation.
14  * 
15  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 
16  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND 
17  * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
18  * 
19  * Carnegie Mellon requests users of this software to return to
20  *
21  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
22  *  School of Computer Science
23  *  Carnegie Mellon University
24  *  Pittsburgh PA 15213-3890
25  *
26  * any improvements or extensions that they make and grant Carnegie the
27  * rights to redistribute these changes.
28  *
29  * $FreeBSD: src/lib/libc/alpha/gen/sigsetjmp.S,v 1.4 2000/01/20 21:58:23 jasone Exp $
30  * $DragonFly: src/lib/libcr/alpha/gen/Attic/sigsetjmp.S,v 1.2 2003/06/17 04:26:41 dillon Exp $
31  */
32
33 #include <machine/asm.h>
34
35 /*
36  * C library -- sigsetjmp, siglongjmp
37  *
38  *      siglongjmp(a,v)
39  * will generate a "return(v)" from
40  * the last call to
41  *      sigsetjmp(a, mask)
42  * by restoring registers from the stack.
43  * If `mask' is non-zero, the previous signal
44  * state will be restored.
45  */
46
47         .set    noreorder
48
49 LEAF(sigsetjmp, 2)
50         LDGP(pv)
51         stq     a1, (81 * 8)(a0)                /* save the mask */
52         bne     a1, Lsavesig                    /* if !zero, save signals */
53         jmp     zero, _setjmp                           /* else don't. */
54 Lsavesig:
55         jmp     zero, setjmp
56 END(sigsetjmp)
57
58 #ifdef _THREAD_SAFE
59 LEAF(__siglongjmp, 2)
60 #else
61 XLEAF(__siglongjmp, 2)
62 LEAF(siglongjmp, 2)
63 #endif
64         LDGP(pv)
65         ldq     t0, (81 * 8)(a0)                /* get the mask */
66         bne     t0, Lrestoresig                 /* if !zero, restore signals */
67         jmp     zero, _longjmp
68 Lrestoresig:
69         jmp     zero, longjmp
70 #ifdef _THREAD_SAFE
71 END(__siglongjmp)
72 #else
73 END(siglongjmp)
74 #endif