Back to index

glibc  2.9
longjmp.c
Go to the documentation of this file.
00001 /* Copyright (C) 1991,92,94,95,97,98,2000,2002,2004
00002    Free Software Foundation, Inc.
00003    This file is part of the GNU C Library.
00004 
00005    The GNU C Library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Lesser General Public
00007    License as published by the Free Software Foundation; either
00008    version 2.1 of the License, or (at your option) any later version.
00009 
00010    The GNU C Library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Lesser General Public License for more details.
00014 
00015    You should have received a copy of the GNU Lesser General Public
00016    License along with the GNU C Library; if not, write to the Free
00017    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00018    02111-1307 USA.  */
00019 
00020 /* Versioned copy of sysdeps/generic/longjmp.c modified for AltiVec support. */
00021 
00022 #include  <shlib-compat.h>
00023 #include <stddef.h>
00024 #include <setjmp.h>
00025 #include <signal.h>
00026 
00027 extern void __vmx__longjmp (__jmp_buf __env, int __val)
00028      __attribute__ ((noreturn));
00029 extern void __vmx__libc_longjmp (sigjmp_buf env, int val)
00030      __attribute__ ((noreturn));
00031 libc_hidden_proto (__vmx__libc_longjmp)
00032 
00033 /* Set the signal mask to the one specified in ENV, and jump
00034    to the position specified in ENV, causing the setjmp
00035    call there to return VAL, or 1 if VAL is 0.  */
00036 void
00037 __vmx__libc_siglongjmp (sigjmp_buf env, int val)
00038 {
00039   /* Perform any cleanups needed by the frames being unwound.  */
00040   _longjmp_unwind (env, val);
00041 
00042   if (env[0].__mask_was_saved)
00043     /* Restore the saved signal mask.  */
00044     (void) __sigprocmask (SIG_SETMASK, &env[0].__saved_mask,
00045                        (sigset_t *) NULL);
00046 
00047   /* Call the machine-dependent function to restore machine state.  */
00048   __vmx__longjmp (env[0].__jmpbuf, val ?: 1);
00049 }
00050 
00051 strong_alias (__vmx__libc_siglongjmp, __vmx__libc_longjmp)
00052 libc_hidden_def (__vmx__libc_longjmp)
00053 weak_alias (__vmx__libc_siglongjmp, __vmx_longjmp)
00054 weak_alias (__vmx__libc_siglongjmp, __vmxlongjmp)
00055 weak_alias (__vmx__libc_siglongjmp, __vmxsiglongjmp)
00056 
00057 
00058 default_symbol_version (__vmx__libc_longjmp, __libc_longjmp, GLIBC_PRIVATE);
00059 default_symbol_version (__vmx__libc_siglongjmp, __libc_siglongjmp, GLIBC_PRIVATE);
00060 default_symbol_version (__vmx_longjmp, _longjmp, GLIBC_2.3.4);
00061 default_symbol_version (__vmxlongjmp, longjmp, GLIBC_2.3.4);
00062 default_symbol_version (__vmxsiglongjmp, siglongjmp, GLIBC_2.3.4);