1 /* Copyright (C) 1999-2024 Free Software Foundation, Inc.
3 The GNU C Library is free software; you can redistribute it and/or
4 modify it under the terms of the GNU Lesser General Public
5 License as published by the Free Software Foundation; either
6 version 2.1 of the License, or (at your option) any later version.
8 The GNU C Library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Lesser General Public License for more details.
13 You should have received a copy of the GNU Lesser General Public
14 License along with the GNU C Library; if not, see
15 <https://www.gnu.org/licenses/>.
17 The layout of the jmp_buf is as follows. This is subject to change
18 and user-code should never depend on the particular layout of
24 0x000 stack pointer (r12) ; unchangeable (see _JMPBUF_UNWINDS)
27 0x018 fpsr ; disabled per the C standard; BZ 16379
41 0x088 ar.bsp ; unchangeable (see __longjmp.S)
43 0x098 &__jmp_buf ; address of the jmpbuf (needed to locate NaT bits in unat)
66 #include <pointer_guard.h>
69 /* The following two entry points are the traditional entry points: */
72 alloc r8=ar.pfs,2,0,0,0
74 br.cond.sptk.many HIDDEN_JUMPTARGET(__sigsetjmp)
78 alloc r8=ar.pfs,2,0,0,0
80 br.cond.sptk.many HIDDEN_JUMPTARGET(__sigsetjmp)
82 libc_hidden_def (_setjmp)
84 /* __sigsetjmp(__jmp_buf buf, int savemask) */
87 .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(2)
88 alloc loc1=ar.pfs,2,5,2,0
96 .mem.offset 8,0; st8.spill.nta [r2]=sp,16 // r12 (sp)
97 .mem.offset 0,0; st8.spill.nta [r3]=gp,32 // r1 (gp)
99 st8.nta [r2]=loc2,16 // save caller's unat
100 // st8.nta [r3]=r17,16 // save fpsr
103 .mem.offset 8,0; st8.spill.nta [r2]=r4,16 // r4
104 .mem.offset 0,0; st8.spill.nta [r3]=r5,16 // r5
107 stf.spill.nta [r8]=f2,32
108 stf.spill.nta [r9]=f3,32
112 stf.spill.nta [r8]=f4,32
113 stf.spill.nta [r9]=f5,32
116 stf.spill.nta [r8]=f16,32
117 stf.spill.nta [r9]=f17,32
120 stf.spill.nta [r8]=f18,32
121 stf.spill.nta [r9]=f19,32
124 stf.spill.nta [r8]=f20,32
125 stf.spill.nta [r9]=f21,32
128 stf.spill.nta [r8]=f22,32
129 stf.spill.nta [r9]=f23,32
132 stf.spill.nta [r8]=f24,32
133 stf.spill.nta [r9]=f25,32
136 stf.spill.nta [r8]=f26,32
137 stf.spill.nta [r9]=f27,32
140 stf.spill.nta [r8]=f28,32
141 stf.spill.nta [r9]=f29,32
145 PTR_MANGLE (loc3, loc4)
149 stf.spill.nta [r8]=f30
150 stf.spill.nta [r9]=f31
152 .mem.offset 8,0; st8.spill.nta [r2]=r6,16 // r6
153 .mem.offset 0,0; st8.spill.nta [r3]=r7,16 // r7
160 st8.nta [r2]=loc3,16 // b0
162 st8.nta [r2]=loc0,16 // b0
164 st8.nta [r3]=r17,16 // b1
167 st8.nta [r2]=r18,16 // b2
168 st8.nta [r3]=r19,16 // b3
170 st8.nta [r2]=r20,16 // b4
171 st8.nta [r3]=r21,16 // b5
173 st8.nta [r2]=loc1,16 // ar.pfs
174 st8.nta [r3]=r22,16 // ar.lc
176 st8.nta [r2]=r24,16 // pr
177 st8.nta [r3]=r23,16 // ar.bsp
179 st8.nta [r2]=r25 // ar.unat
180 st8.nta [r3]=in0 // &__jmp_buf
182 /* In ld.so we never save the signal mask. */
185 br.call.dpnt.few rp=__sigjmp_save
187 .ret0: // force a new bundle ::q
188 mov.m ar.unat=loc2 // restore caller's unat
194 libc_hidden_def (__sigsetjmp)
195 rtld_hidden_def (__sigsetjmp)