1 /* Copyright (C) 1999, 2000, 2001, 2002, 2004, 2005
2 Free Software Foundation, Inc.
3 Contributed by David Mosberger-Tang <davidm@hpl.hp.com>.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <http://www.gnu.org/licenses/>.
19 The layout of the jmp_buf is as follows. This is subject to change
20 and user-code should never depend on the particular layout of
26 0x000 stack pointer (r12) ; unchangeable (see _JMPBUF_UNWINDS)
43 0x088 ar.bsp ; unchangeable (see __longjmp.S)
45 0x098 &__jmp_buf ; address of the jmpbuf (needed to locate NaT bits in unat)
70 /* The following two entry points are the traditional entry points: */
73 alloc r8=ar.pfs,2,0,0,0
75 br.cond.sptk.many _GI___sigsetjmp
79 alloc r8=ar.pfs,2,0,0,0
81 br.cond.sptk.many _GI___sigsetjmp
83 libc_hidden_def (_setjmp)
85 /* __sigsetjmp(__jmp_buf buf, int savemask) */
88 .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(2)
89 alloc loc1=ar.pfs,2,5,2,0
97 .mem.offset 8,0; st8.spill.nta [r2]=sp,16 // r12 (sp)
98 .mem.offset 0,0; st8.spill.nta [r3]=gp,16 // r1 (gp)
100 st8.nta [r2]=loc2,16 // save caller's unat
101 st8.nta [r3]=r17,16 // save fpsr
104 .mem.offset 8,0; st8.spill.nta [r2]=r4,16 // r4
105 .mem.offset 0,0; st8.spill.nta [r3]=r5,16 // r5
108 stf.spill.nta [r8]=f2,32
109 stf.spill.nta [r9]=f3,32
113 stf.spill.nta [r8]=f4,32
114 stf.spill.nta [r9]=f5,32
117 stf.spill.nta [r8]=f16,32
118 stf.spill.nta [r9]=f17,32
121 stf.spill.nta [r8]=f18,32
122 stf.spill.nta [r9]=f19,32
125 stf.spill.nta [r8]=f20,32
126 stf.spill.nta [r9]=f21,32
129 stf.spill.nta [r8]=f22,32
130 stf.spill.nta [r9]=f23,32
133 stf.spill.nta [r8]=f24,32
134 stf.spill.nta [r9]=f25,32
137 stf.spill.nta [r8]=f26,32
138 stf.spill.nta [r9]=f27,32
141 stf.spill.nta [r8]=f28,32
142 stf.spill.nta [r9]=f29,32
146 PTR_MANGLE (loc3, loc4)
150 stf.spill.nta [r8]=f30
151 stf.spill.nta [r9]=f31
153 .mem.offset 8,0; st8.spill.nta [r2]=r6,16 // r6
154 .mem.offset 0,0; st8.spill.nta [r3]=r7,16 // r7
161 st8.nta [r2]=loc3,16 // b0
163 st8.nta [r2]=loc0,16 // b0
165 st8.nta [r3]=r17,16 // b1
168 st8.nta [r2]=r18,16 // b2
169 st8.nta [r3]=r19,16 // b3
171 st8.nta [r2]=r20,16 // b4
172 st8.nta [r3]=r21,16 // b5
174 st8.nta [r2]=loc1,16 // ar.pfs
175 st8.nta [r3]=r22,16 // ar.lc
177 st8.nta [r2]=r24,16 // pr
178 st8.nta [r3]=r23,16 // ar.bsp
180 st8.nta [r2]=r25 // ar.unat
181 st8.nta [r3]=in0 // &__jmp_buf
182 #if defined NOT_IN_libc && defined IS_IN_rtld
183 /* In ld.so we never save the signal mask. */
186 br.call.dpnt.few rp=__sigjmp_save
188 .ret0: // force a new bundle ::q
189 mov.m ar.unat=loc2 // restore caller's unat
195 strong_alias(__sigsetjmp, _GI___sigsetjmp)