(CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
[glibc.git] / sysdeps / alpha / setjmp.S
blob14a0320cd39d64c1a2b91f56adb7c6618275faaa
1 /* Copyright (C) 1992, 1994, 1996, 1997, 2002 Free Software Foundation, Inc.
2    This file is part of the GNU C Library.
4    The GNU C Library is free software; you can redistribute it and/or
5    modify it under the terms of the GNU Lesser General Public
6    License as published by the Free Software Foundation; either
7    version 2.1 of the License, or (at your option) any later version.
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    Lesser General Public License for more details.
14    You should have received a copy of the GNU Lesser General Public
15    License along with the GNU C Library; if not, write to the Free
16    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17    02111-1307 USA.  */
19 #define __ASSEMBLY__
21 #include <sysdep.h>
22 #define _ASM
23 #define _SETJMP_H
24 #include <bits/setjmp.h>
26        .ent __sigsetjmp
27        .global __sigsetjmp
28 __sigsetjmp:
29        ldgp    gp, 0(pv)
31 $sigsetjmp_local:
32        subq    sp, 16, sp
33        .frame  sp, 16, ra, 0
34        stq     ra, 0(sp)
35        .mask   0x04000000, -16
36 #ifdef PROF
37         .set noat
38         lda     AT, _mcount
39         jsr     AT, (AT), _mcount
40         .set at
41 #endif
42         .prologue 1
44         stq     s0, JB_S0*8(a0)
45         stq     s1, JB_S1*8(a0)
46         stq     s2, JB_S2*8(a0)
47         stq     s3, JB_S3*8(a0)
48         stq     s4, JB_S4*8(a0)
49         stq     s5, JB_S5*8(a0)
50         stq     ra, JB_PC*8(a0)
51         addq    sp, 16, t0
52         stq     fp, JB_FP*8(a0)
53         stq     t0, JB_SP*8(a0)
54         stt     $f2, JB_F2*8(a0)
55         stt     $f3, JB_F3*8(a0)
56         stt     $f4, JB_F4*8(a0)
57         stt     $f5, JB_F5*8(a0)
58         stt     $f6, JB_F6*8(a0)
59         stt     $f7, JB_F7*8(a0)
60         stt     $f8, JB_F8*8(a0)
61         stt     $f9, JB_F9*8(a0)
63         /* Call to C to (potentially) save our signal mask.  */
64         jsr     ra, __sigjmp_save
66         ldq     ra, 0(sp)
67         addq    sp, 16, sp
68         ret
70 END(__sigsetjmp)
72 /* Put these traditional entry points in the same file so that we can
73    elide much of the nonsense in trying to jmp to the real function.  */
75 ENTRY(_setjmp)
76         ldgp    gp, 0(pv)
77         .prologue 1
78         mov     0, a1
79         br      $sigsetjmp_local
80 END(_setjmp)
81 libc_hidden_def (_setjmp)
83 ENTRY(setjmp)
84         ldgp    gp, 0(pv)
85         .prologue 1
86         mov     1, a1
87         br      $sigsetjmp_local
88 END(setjmp)
90 weak_extern(_setjmp)
91 weak_extern(setjmp)