chiark / gitweb /
eglibc (2.11.3-4+deb6u3) squeeze-lts; urgency=medium
[eglibc.git] / sysdeps / powerpc / novmx-longjmp.c
1 /* Copyright (C) 1991,92,94,95,97,98,2000,2002,2003,2004
2    Free Software Foundation, Inc.
3    This file is part of the GNU C Library.
4
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.
9
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.
14
15    You should have received a copy of the GNU Lesser General Public
16    License along with the GNU C Library; if not, write to the Free
17    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18    02111-1307 USA.  */
19
20 /* Copy of sysdeps/generic/longjmp.c modified for backward compatibility
21    with old non AltiVec/VMX longjmp.  */
22
23 #include <bits/wordsize.h>
24 #include <shlib-compat.h>
25 #if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)
26 # include <stddef.h>
27 # include <novmxsetjmp.h>
28 # include <signal.h>
29
30
31 /* Set the signal mask to the one specified in ENV, and jump
32    to the position specified in ENV, causing the setjmp
33    call there to return VAL, or 1 if VAL is 0.  */
34 void
35 __novmx__libc_siglongjmp (__novmx__sigjmp_buf env, int val)
36 {
37   /* Perform any cleanups needed by the frames being unwound.  */
38   _longjmp_unwind (env, val);
39
40   if (env[0].__mask_was_saved)
41     /* Restore the saved signal mask.  */
42     (void) __sigprocmask (SIG_SETMASK, &env[0].__saved_mask,
43                           (sigset_t *) NULL);
44
45   /* Call the machine-dependent function to restore machine state.  */
46   __novmx__longjmp (env[0].__jmpbuf, val ?: 1);
47 }
48
49 strong_alias (__novmx__libc_siglongjmp, __novmx__libc_longjmp)
50 libc_hidden_def (__novmx__libc_longjmp)
51 weak_alias (__novmx__libc_siglongjmp, __novmx_longjmp)
52 weak_alias (__novmx__libc_siglongjmp, __novmxlongjmp)
53 weak_alias (__novmx__libc_siglongjmp, __novmxsiglongjmp)
54
55 # if __WORDSIZE == 64
56 symbol_version (__novmx_longjmp,_longjmp,GLIBC_2.3);
57 symbol_version (__novmxlongjmp,longjmp,GLIBC_2.3);
58 symbol_version (__novmxsiglongjmp,siglongjmp,GLIBC_2.3);
59 # else
60 symbol_version (__novmx_longjmp,_longjmp,GLIBC_2.0);
61 symbol_version (__novmxlongjmp,longjmp,GLIBC_2.0);
62 symbol_version (__novmxsiglongjmp,siglongjmp,GLIBC_2.0);
63 # endif
64 #endif /* defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4))  */