Update.
[platform/upstream/glibc.git] / sysdeps / alpha / setjmp.S
1 /* Copyright (C) 1992, 1994, 1996, 1997 Free Software Foundation, Inc.
2    This file is part of the GNU C Library.
3
4    The GNU C Library is free software; you can redistribute it and/or
5    modify it under the terms of the GNU Library General Public License as
6    published by the Free Software Foundation; either version 2 of the
7    License, or (at your option) any later version.
8
9    The GNU C Library is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12    Library General Public License for more details.
13
14    You should have received a copy of the GNU Library General Public
15    License along with the GNU C Library; see the file COPYING.LIB.  If not,
16    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17    Boston, MA 02111-1307, USA.  */
18
19 #define __ASSEMBLY__
20
21 #include <sysdep.h>
22 #include <bits/setjmp.h>
23
24        .ent __sigsetjmp
25        .global __sigsetjmp
26 __sigsetjmp:
27        ldgp    gp, 0(pv)
28
29 $sigsetjmp_local:
30        subq    sp, 16, sp
31        .frame  sp, 16, ra, 0
32        stq     ra, 0(sp)
33        .mask   0x04000000, -16
34 #ifdef PROF
35         .set noat
36         lda     AT, _mcount
37         jsr     AT, (AT), _mcount
38         .set at
39 #endif
40         .prologue 1
41
42         stq     s0, JB_S0*8(a0)
43         stq     s1, JB_S1*8(a0)
44         stq     s2, JB_S2*8(a0)
45         stq     s3, JB_S3*8(a0)
46         stq     s4, JB_S4*8(a0)
47         stq     s5, JB_S5*8(a0)
48         stq     ra, JB_PC*8(a0)
49         addq    sp, 16, t0
50         stq     fp, JB_FP*8(a0)
51         stq     t0, JB_SP*8(a0)
52         stt     $f2, JB_F2*8(a0)
53         stt     $f3, JB_F3*8(a0)
54         stt     $f4, JB_F4*8(a0)
55         stt     $f5, JB_F5*8(a0)
56         stt     $f6, JB_F6*8(a0)
57         stt     $f7, JB_F7*8(a0)
58         stt     $f8, JB_F8*8(a0)
59         stt     $f9, JB_F9*8(a0)
60
61         /* Call to C to (potentially) save our signal mask.  */
62         jsr     ra, __sigjmp_save
63
64         ldq     ra, 0(sp)
65         addq    sp, 16, sp
66         ret
67
68 END(__sigsetjmp)
69
70 /* Put these traditional entry points in the same file so that we can
71    elide much of the nonsense in trying to jmp to the real function.  */
72
73 ENTRY(_setjmp)
74         ldgp    gp, 0(pv)
75         mov     0, a1
76         br      $sigsetjmp_local
77 END(_setjmp)
78
79 ENTRY(setjmp)
80         ldgp    gp, 0(pv)
81         mov     1, a1
82         br      $sigsetjmp_local
83 END(setjmp)
84
85 weak_extern(_setjmp)
86 weak_extern(setjmp)