This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] PPC enable Altivec for setjmp/longjmp part 1 of 5


These patches provide the setjmp/longjmp support to save/restore the non-volitile vector registers per the ABI. This is a bit more complicated then the *context functions because there are 3 layers, 2 of which involve arch independent libc/nplt/linuxthreads code.

Linuxthreads/nplt override longjmp/siglongjmp which call __libc_longjmp/__libc_siglongjmp. __libc_longjmp is strong alias for __libc_siglongjmp which saves the sigprocmask into sigjmp_buf before calling the arch dependent __longjmp. The problem is that the __saved_mask follows the jmp_buf within the sigjmp_buf. As the size of jmp_buf is changing we need to support two verions (old/new) if the sigjmp_buf which implies we need to version all three layers of the longjmp/setjmp function stack.

The following patch provides the PPC specific version code for longjmp.c, setjmp.c, sigjmp.c, plus novmx versions of the setjmp.h and longjmp.c, setjmp.c, sigjmp.c.
2004-01-16  Steven Munroe  <sjmunroe@us.ibm.com>

	* sysdeps/powerpc/Dist: New File.
	* sysdeps/powerpc/Makefile(sysdep_routines): Add novmx-longjmp.c,
	novmx-setjmp.c, and novmx-sigjmp.c
	* sysdeps/powerpc/Versions(libc): Add _longjmp, __sigsetjmp _setjmp,
	longjmp, and setjmp for GLIBC_2.3_4.  Add __novmx__libc_longjmp, 
	__novmx__libc_siglongjmp, __vmx__libc_longjmp, and __vmx__libc_siglongjmp to
	GLIBC_PRIVATE.
	(ld): Add _longjmp, __sigsetjmp _setjmp, longjmp, and setjmp for GLIBC_2.3_4.
	* sysdeps/powerpc/bits/novmxsetjmp.h: New File
	* sysdeps/powerpc/bits/setjmp.h: Define JB_VRSAVE, JB_VRS, and adjust JB_SIZE
	to add VMX regs to __jmp_buf.
	* sysdeps/powerpc/longjmp.c(__vmx__libc_siglongjmp): Default version of 
	__libc_siglongjmp.
	* sysdeps/powerpc/novmxsetjmp.h: New file.
	* sysdeps/powerpc/sigjmp.c(__vmx__sigjmp_save): Default version of 
	__sigjmp_save.
	* sysdeps/powerpc/powerpc32/novmx-longjmp.c
	[SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)]
	(__novmx__libc_siglongjmp): Original version of __libc_siglongjmp.
	* sysdeps/powerpc/powerpc32/novmx-setjmp.c
	[SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)]
	(__novmx__libc_sigsetjmp): Original version of __libc_sigsetjmp.
	* sysdeps/powerpc/powerpc32/novmx-sigjmp.c
	[SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)]
	(__novmx__sigjmp_save): Original version of __sigjmp_save.
	* sysdeps/powerpc/powerpc64/novmx-longjmp.c
	[SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)]
	(__novmx__libc_siglongjmp): Original version of __libc_siglongjmp.
	* sysdeps/powerpc/powerpc64/novmx-setjmp.c
	[SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)]
	(__novmx__libc_sigsetjmp): Original version of __libc_sigsetjmp.
	* sysdeps/powerpc/powerpc64/novmx-sigjmp.c
	[SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)]
	(__novmx__sigjmp_save): Original version of __sigjmp_save.


diff -urN libc23-cvstip-20040116/sysdeps/powerpc/Dist libc23/sysdeps/powerpc/Dist
--- libc23-cvstip-20040116/sysdeps/powerpc/Dist	Wed Dec 31 18:00:00 1969
+++ libc23/sysdeps/powerpc/Dist	Sat Jan 17 17:00:02 2004
@@ -0,0 +1,3 @@
+novmx-longjmp.c
+novmx-setjmp.c 
+novmx-sigjmp.c
diff -urN libc23-cvstip-20040116/sysdeps/powerpc/Makefile libc23/sysdeps/powerpc/Makefile
--- libc23-cvstip-20040116/sysdeps/powerpc/Makefile	2004-01-15 22:42:35.000000000 -0600
+++ libc23/sysdeps/powerpc/Makefile	2004-01-17 16:59:28.000000000 -0600
@@ -15,7 +15,14 @@
 sysdep-dl-routines += dl-machine
 sysdep_routines += dl-machine
 # extra shared linker files to link only into dl-allobjs.so
-sysdep-rtld-routines += dl-machine
+sysdep-rtld-routines += dl-machine 
+endif
+
+ifeq ($(subdir),setjmp)
+ifeq (yes,$(build-shared))
+sysdep_routines += novmx-longjmp \
+                   novmx-sigjmp novmx-setjmp
+endif
 endif
 
 ifeq ($(subdir),csu)
diff -urN libc23-cvstip-20040116/sysdeps/powerpc/Versions libc23/sysdeps/powerpc/Versions
--- libc23-cvstip-20040116/sysdeps/powerpc/Versions	2002-09-05 04:54:59.000000000 -0500
+++ libc23/sysdeps/powerpc/Versions	2004-01-16 14:17:55.000000000 -0600
@@ -4,3 +4,21 @@
     __fe_dfl_env; __fe_enabled_env; __fe_nonieee_env; __fe_nomask_env;
   }
 }
+
+libc {
+  GLIBC_2.3.4 {
+     _longjmp; __sigsetjmp; _setjmp;
+     longjmp; setjmp;
+  }	
+  GLIBC_PRIVATE {
+     __novmx__libc_longjmp; __novmx__libc_siglongjmp;
+	__vmx__libc_longjmp; __vmx__libc_siglongjmp; 
+  }
+}
+
+ld {
+  GLIBC_2.3.4 {
+     _longjmp; __sigsetjmp; _setjmp;
+     longjmp; setjmp;
+  }
+}
diff -urN libc23-cvstip-20040116/sysdeps/powerpc/bits/novmxsetjmp.h libc23/sysdeps/powerpc/bits/novmxsetjmp.h
--- libc23-cvstip-20040116/sysdeps/powerpc/bits/novmxsetjmp.h	Wed Dec 31 18:00:00 1969
+++ libc23/sysdeps/powerpc/bits/novmxsetjmp.h	Fri Jan 16 14:17:55 2004
@@ -0,0 +1,65 @@
+/* Copyright (C) 1997, 1998, 2000, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/* Define the machine-dependent type `jmp_buf'.  PowerPC version.
+   without altivec support copy of old sysdeps/powerpc/bits/setjmp.h */
+#ifndef _BITS_SETJMP_H
+#define _BITS_SETJMP_H  1
+
+#if !defined _SETJMP_H && !defined _PTHREAD_H
+# error "Never include <bits/novmxsetjmp.h> directly; use <novmxsetjmp.h> instead."
+#endif
+
+/* The previous bits/setjmp.h had __jmp_buf defined as a structure.
+   We use an array of 'long int' instead, to make writing the
+   assembler easier. Naturally, user code should not depend on
+   either representation. */
+
+#include <bits/wordsize.h>
+
+#if defined __USE_MISC || defined _ASM
+# define JB_GPR1   0  /* Also known as the stack pointer */
+# define JB_GPR2   1
+# define JB_LR     2  /* The address we will return to */
+# if __WORDSIZE == 64
+#  define JB_GPRS   3  /* GPRs 14 through 31 are saved, 18*2 words total.  */
+#  define JB_CR     21 /* Condition code registers. */
+#  define JB_FPRS   22 /* FPRs 14 through 31 are saved, 18*2 words total.  */
+#  define JB_SIZE   (40*8)
+# else
+#  define JB_GPRS   3  /* GPRs 14 through 31 are saved, 18 in total.  */
+#  define JB_CR     21 /* Condition code registers.  */
+#  define JB_FPRS   22 /* FPRs 14 through 31 are saved, 18*2 words total.  */
+#  define JB_SIZE   (58*4)
+# endif
+#endif
+
+#ifndef	_ASM
+# if __WORDSIZE == 64
+typedef long int __jmp_buf[40];
+# else
+typedef long int __jmp_buf[58];
+# endif
+#endif
+
+/* Test if longjmp to JMPBUF would unwind the frame
+   containing a local variable at ADDRESS.  */
+#define _JMPBUF_UNWINDS(jmpbuf, address) \
+  ((void *) (address) < (void *) (jmpbuf)[JB_GPR1])
+
+#endif  /* bits/novmxsetjmp.h */
diff -urN libc23-cvstip-20040116/sysdeps/powerpc/bits/setjmp.h libc23/sysdeps/powerpc/bits/setjmp.h
--- libc23-cvstip-20040116/sysdeps/powerpc/bits/setjmp.h	2003-04-11 19:53:57.000000000 -0500
+++ libc23/sysdeps/powerpc/bits/setjmp.h	2004-01-16 14:17:55.000000000 -0600
@@ -37,22 +37,44 @@
 # define JB_LR     2  /* The address we will return to */
 # if __WORDSIZE == 64
 #  define JB_GPRS   3  /* GPRs 14 through 31 are saved, 18*2 words total.  */
-#  define JB_CR     21 /* Condition code registers. */
+#  define JB_CR     21 /* Condition code registers with the VRSAVE at */
+                       /* offset 172 (low half of the double word.  */
 #  define JB_FPRS   22 /* FPRs 14 through 31 are saved, 18*2 words total.  */
-#  define JB_SIZE   (40*8)
+#  define JB_SIZE   (64*8) /* As per PPC64-VMXabi.txt */
+#  define JB_VRSAVE 21 /* VRSAVE shares a double word with the CR at offset */
+                       /* 168 (high half of the double word).  */
+#  define JB_VRS    40 /* VRs 20 through 31 are saved, 12*4 words total.  */
 # else
 #  define JB_GPRS   3  /* GPRs 14 through 31 are saved, 18 in total.  */
 #  define JB_CR     21 /* Condition code registers.  */
 #  define JB_FPRS   22 /* FPRs 14 through 31 are saved, 18*2 words total.  */
-#  define JB_SIZE   (58*4)
+#  define JB_SIZE   ((64+(12*4))*4)
+#  define JB_VRSAVE 62
+#  define JB_VRS    64
 # endif
 #endif
 
+
+/* 
+ * ALTIVECPIM.pdf specifies for SVR4 ABI and EABI on 32 bit vrsave must 
+ * be at byte 248 & v20 at byte 256 so we must pad this correctly on 32 
+ * bit it also insists that vecregs are only gauranteed 4 byte alignment 
+ * so we need to use vperm in the setjmp/longjmp routines.  Yes because 
+ * members like  int __mask_was_saved in the jmp_buf have to move as 
+ * jmp_buf is currently larger than 248 bytes we cannot keep the altivec 
+ * jmp_buf backward compatible with the jmp_buf without altivec things 
+ * compiled with jmpbufs -mabi altivec will work on machines without 
+ * altivec but you will not be able to setjmp & longjmp between code 
+ * compiled with & without -mabi altivec you have been warned. 
+ */
 #ifndef	_ASM
 # if __WORDSIZE == 64
-typedef long int __jmp_buf[40];
+typedef long int __jmp_buf[64] __attribute__((aligned(16)));
 # else
-typedef long int __jmp_buf[58];
+/* The alignment is not essential, i.e.the buffer can be copied to a 4 byte aligned buffer
+ * as per the ABI it is just added for performance reasons.
+ */
+typedef long int __jmp_buf[64+(12*4)] __attribute__((aligned(16)));
 # endif
 #endif
 
diff -urN libc23-cvstip-20040116/sysdeps/powerpc/longjmp.c libc23/sysdeps/powerpc/longjmp.c
--- libc23-cvstip-20040116/sysdeps/powerpc/longjmp.c	Wed Dec 31 18:00:00 1969
+++ libc23/sysdeps/powerpc/longjmp.c	Fri Jan 16 14:17:55 2004
@@ -0,0 +1,60 @@
+/* Copyright (C) 1991,92,94,95,97,98,2000,2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+/*
+  Versioned copy of sysdeps/generic/longjmp.c modified for AltiVec support.
+ */
+#include  <shlib-compat.h>
+#include <stddef.h>
+#include <setjmp.h>
+#include <signal.h>
+
+extern void __vmx__longjmp (__jmp_buf __env, int __val);
+extern void __vmx__libc_longjmp (sigjmp_buf env, int val)
+     __attribute__ ((noreturn));
+libc_hidden_proto (__vmx__libc_longjmp)
+
+/* Set the signal mask to the one specified in ENV, and jump
+   to the position specified in ENV, causing the setjmp
+   call there to return VAL, or 1 if VAL is 0.  */
+void
+__vmx__libc_siglongjmp (sigjmp_buf env, int val)
+{
+  /* Perform any cleanups needed by the frames being unwound.  */
+  _longjmp_unwind (env, val);
+
+  if (env[0].__mask_was_saved)
+    /* Restore the saved signal mask.  */
+    (void) __sigprocmask (SIG_SETMASK, &env[0].__saved_mask,
+			  (sigset_t *) NULL);
+
+  /* Call the machine-dependent function to restore machine state.  */
+  __vmx__longjmp (env[0].__jmpbuf, val ?: 1);
+}
+
+strong_alias (__vmx__libc_siglongjmp, __vmx__libc_longjmp)
+libc_hidden_def (__vmx__libc_longjmp)
+weak_alias (__vmx__libc_siglongjmp, __vmx_longjmp)
+weak_alias (__vmx__libc_siglongjmp, __vmxlongjmp)
+weak_alias (__vmx__libc_siglongjmp, __vmxsiglongjmp)
+
+
+default_symbol_version (__vmx__libc_longjmp, __libc_longjmp, GLIBC_2.3.4);
+default_symbol_version (__vmx__libc_siglongjmp, __libc_siglongjmp, GLIBC_2.3.4);
+default_symbol_version (__vmx_longjmp, _longjmp, GLIBC_2.3.4);
+default_symbol_version (__vmxlongjmp, longjmp, GLIBC_2.3.4);
+default_symbol_version (__vmxsiglongjmp, siglongjmp, GLIBC_2.3.4);
diff -urN libc23-cvstip-20040116/sysdeps/powerpc/novmxsetjmp.h libc23/sysdeps/powerpc/novmxsetjmp.h
--- libc23-cvstip-20040116/sysdeps/powerpc/novmxsetjmp.h	Wed Dec 31 18:00:00 1969
+++ libc23/sysdeps/powerpc/novmxsetjmp.h	Sat Jan 17 13:04:19 2004
@@ -0,0 +1,140 @@
+/* Copyright (C) 1991-1999, 2001, 2002 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/*
+ *	ISO C99 Standard: 7.13 Nonlocal jumps	<setjmp.h>
+ */
+
+/*     copied from setjmp/setjmp.h & modified appropriately
+       to keep backward compatible with setjmp without AltiVec/VMX support.  */
+
+#ifndef	_SETJMP_H
+#define	_SETJMP_H	1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+#include <bits/novmxsetjmp.h>		/* Get `__jmp_buf'.  */
+#include <bits/sigset.h>		/* Get `__sigset_t'.  */
+
+__BEGIN_NAMESPACE_STD
+
+/* Calling environment, plus possibly a saved signal mask.  */
+typedef struct __jmp_buf_tag	/* C++ doesn't like tagless structs.  */
+  {
+    /* NOTE: The machine-dependent definitions of `__sigsetjmp'
+       assume that a `jmp_buf' begins with a `__jmp_buf' and that
+       `__mask_was_saved' follows it.  Do not move these members
+       or add others before it.  */
+    __jmp_buf __jmpbuf;		/* Calling environment.  */
+    int __mask_was_saved;	/* Saved the signal mask?  */
+    __sigset_t __saved_mask;	/* Saved signal mask.  */
+  } jmp_buf[1];
+
+
+/* Store the calling environment in ENV, also saving the signal mask.
+   Return 0.  */
+extern int __novmxsetjmp (jmp_buf __env) __THROW;
+
+__END_NAMESPACE_STD
+__USING_NAMESPACE_STD(__jmp_buf_tag)
+
+/* Store the calling environment in ENV, also saving the
+   signal mask if SAVEMASK is nonzero.  Return 0.
+   This is the internal name for `sigsetjmp'.  */
+extern int __novmx__sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) __THROW;
+
+#ifndef	__FAVOR_BSD
+/* Store the calling environment in ENV, not saving the signal mask.
+   Return 0.  */
+extern int __novmx_setjmp (struct __jmp_buf_tag __env[1]) __THROW;
+
+/* Do not save the signal mask.  This is equivalent to the `_setjmp'
+   BSD function.  */
+# define setjmp(env)	__novmx_setjmp (env)
+#else
+/* We are in 4.3 BSD-compatibility mode in which `setjmp'
+   saves the signal mask like `sigsetjmp (ENV, 1)'.  We have to
+   define a macro since ISO C says `setjmp' is one.  */
+# define setjmp(env)	__novmxsetjmp (env)
+#endif /* Favor BSD.  */
+
+
+__BEGIN_NAMESPACE_STD
+
+/* Jump to the environment saved in ENV, making the
+   `setjmp' call there return VAL, or 1 if VAL is 0.  */
+extern void __novmxlongjmp (struct __jmp_buf_tag __env[1], int __val)
+     __THROW __attribute__ ((__noreturn__));
+
+__END_NAMESPACE_STD
+
+#if defined __USE_BSD || defined __USE_XOPEN
+/* Same.  Usually `_longjmp' is used with `_setjmp', which does not save
+   the signal mask.  But it is how ENV was saved that determines whether
+   `longjmp' restores the mask; `_longjmp' is just an alias.  */
+extern void __novmx_longjmp (struct __jmp_buf_tag __env[1], int __val)
+     __THROW __attribute__ ((__noreturn__));
+#endif
+
+
+#ifdef	__USE_POSIX
+/* Use the same type for `jmp_buf' and `sigjmp_buf'.
+   The `__mask_was_saved' flag determines whether
+   or not `longjmp' will restore the signal mask.  */
+typedef struct __jmp_buf_tag sigjmp_buf[1];
+
+/* Store the calling environment in ENV, also saving the
+   signal mask if SAVEMASK is nonzero.  Return 0.  */
+# define sigsetjmp(env, savemask)	__novmx__sigsetjmp (env, savemask)
+
+/* Jump to the environment saved in ENV, making the
+   sigsetjmp call there return VAL, or 1 if VAL is 0.
+   Restore the signal mask if that sigsetjmp call saved it.
+   This is just an alias `longjmp'.  */
+extern void __novmxsiglongjmp (sigjmp_buf __env, int __val)
+     __THROW __attribute__ ((__noreturn__));
+#endif /* Use POSIX.  */
+
+__END_DECLS
+
+/* Now define the internal interfaces.  */
+
+/* Internal machine-dependent function to restore context sans signal mask.  */
+extern void __novmx__longjmp (__jmp_buf __env, int __val)
+     __attribute__ ((__noreturn__));
+
+/* Internal function to possibly save the current mask of blocked signals
+   in ENV, and always set the flag saying whether or not it was saved.
+   This is used by the machine-dependent definition of `__sigsetjmp'.
+   Always returns zero, for convenience.  */
+extern int __novmx__sigjmp_save (jmp_buf __env, int __savemask);
+
+extern void _longjmp_unwind (jmp_buf env, int val);
+
+extern void __novmx__libc_siglongjmp (sigjmp_buf env, int val)
+          __attribute__ ((noreturn));
+extern void __novmx__libc_longjmp (sigjmp_buf env, int val)
+     __attribute__ ((noreturn));
+libc_hidden_proto (__novmx__libc_longjmp)
+
+libc_hidden_proto (__novmx_setjmp)
+libc_hidden_proto (__novmx__sigsetjmp)
+
+#endif
diff -urN libc23-cvstip-20040116/sysdeps/powerpc/sigjmp.c libc23/sysdeps/powerpc/sigjmp.c
--- libc23-cvstip-20040116/sysdeps/powerpc/sigjmp.c	Wed Dec 31 18:00:00 1969
+++ libc23/sysdeps/powerpc/sigjmp.c	Sat Jan 17 17:22:39 2004
@@ -0,0 +1,41 @@
+/* Copyright (C) 1992, 1994, 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+/*
+  Versioned copy of sysdeps/generic/sigjmp.c modified for AltiVec support.
+ */
+#include  <shlib-compat.h>
+#include <stddef.h>
+#include <setjmp.h>
+#include <signal.h>
+
+/* This function is called by the `sigsetjmp' macro
+   before doing a `__setjmp' on ENV[0].__jmpbuf.
+   Always return zero.  */
+
+int
+__vmx__sigjmp_save (sigjmp_buf env, int savemask)
+{
+  env[0].__mask_was_saved = (savemask &&
+			     __sigprocmask (SIG_BLOCK, (sigset_t *) NULL,
+					    &env[0].__saved_mask) == 0);
+
+  return 0;
+}
+
+default_symbol_version (__vmx__sigjmp_save,__sigjmp_save,GLIBC_2.3.4);
+
diff -urN libc23-cvstip-20040116/sysdeps/powerpc/powerpc32/novmx-longjmp.c libc23/sysdeps/powerpc/powerpc32/novmx-longjmp.c
--- libc23-cvstip-20040116/sysdeps/powerpc/powerpc32/novmx-longjmp.c	Wed Dec 31 18:00:00 1969
+++ libc23/sysdeps/powerpc/powerpc32/novmx-longjmp.c	Sat Jan 17 14:21:11 2004
@@ -0,0 +1,58 @@
+/* Copyright (C) 1991,92,94,95,97,98,2000,2002,2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+/*
+  Copy of sysdeps/generic/longjmp.c modified for backward compatibility
+  with old non AltiVec/VMX longjmp.
+ */
+#include  <shlib-compat.h>
+#if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)
+#include <stddef.h>
+#include <novmxsetjmp.h>
+#include <signal.h>
+
+
+/* Set the signal mask to the one specified in ENV, and jump
+   to the position specified in ENV, causing the setjmp
+   call there to return VAL, or 1 if VAL is 0.  */
+void
+__novmx__libc_siglongjmp (sigjmp_buf env, int val)
+{
+  /* Perform any cleanups needed by the frames being unwound.  */
+  _longjmp_unwind (env, val);
+
+  if (env[0].__mask_was_saved)
+    /* Restore the saved signal mask.  */
+    (void) __sigprocmask (SIG_SETMASK, &env[0].__saved_mask,
+			  (sigset_t *) NULL);
+
+  /* Call the machine-dependent function to restore machine state.  */
+  __novmx__longjmp (env[0].__jmpbuf, val ?: 1);
+}
+
+strong_alias (__novmx__libc_siglongjmp, __novmx__libc_longjmp)
+libc_hidden_def (__novmx__libc_longjmp)
+weak_alias (__novmx__libc_siglongjmp, __novmx_longjmp)
+weak_alias (__novmx__libc_siglongjmp, __novmxlongjmp)
+weak_alias (__novmx__libc_siglongjmp, __novmxsiglongjmp)
+
+symbol_version (__novmx__libc_longjmp,__libc_longjmp,GLIBC_2.0);
+symbol_version (__novmx__libc_siglongjmp,__libc_siglongjmp,GLIBC_2.0);
+symbol_version (__novmx_longjmp,_longjmp,GLIBC_2.0);
+symbol_version (__novmxlongjmp,longjmp,GLIBC_2.0);
+symbol_version (__novmxsiglongjmp,siglongjmp,GLIBC_2.0);
+#endif /* defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4))  */ 
diff -urN libc23-cvstip-20040116/sysdeps/powerpc/powerpc32/novmx-setjmp.c libc23/sysdeps/powerpc/powerpc32/novmx-setjmp.c
--- libc23-cvstip-20040116/sysdeps/powerpc/powerpc32/novmx-setjmp.c	Wed Dec 31 18:00:00 1969
+++ libc23/sysdeps/powerpc/powerpc32/novmx-setjmp.c	Sat Jan 17 17:53:38 2004
@@ -0,0 +1,46 @@
+/* Copyright (C) 1991, 94, 95, 96, 97, 98, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+   
+/* Copy of sysdeps/generic/setjmp.c modified for backward compatibility
+   with old non AltiVec/VMX setjmp.  */
+  
+#include  <shlib-compat.h>
+#if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)
+#include <errno.h>
+#include <novmxsetjmp.h>
+
+
+/* Save the current program position in ENV and return 0.  */
+int
+__novmx__libc_sigsetjmp (jmp_buf env, int savemask)
+{
+  /* Save the signal mask if requested.  */
+  __novmx__sigjmp_save (env, savemask);
+
+  __set_errno (ENOSYS);
+  /* No way to signal failure.	*/
+  return 0;
+}
+
+weak_alias (__novmx__libc_sigsetjmp, __novmx__sigsetjmp)
+stub_warning (__novmx__sigsetjmp)
+symbol_version (__novmx__libc_sigsetjmp,__libc_sigsetjmp,GLIBC_2.0);
+symbol_version (__novmx__sigsetjmp,__sigsetjmp,GLIBC_2.0);
+#include <stub-tag.h>
+#endif /*   SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4) */
+
diff -urN libc23-cvstip-20040116/sysdeps/powerpc/powerpc32/novmx-sigjmp.c libc23/sysdeps/powerpc/powerpc32/novmx-sigjmp.c
--- libc23-cvstip-20040116/sysdeps/powerpc/powerpc32/novmx-sigjmp.c	Wed Dec 31 18:00:00 1969
+++ libc23/sysdeps/powerpc/powerpc32/novmx-sigjmp.c	Sat Jan 17 17:53:59 2004
@@ -0,0 +1,43 @@
+/* Copyright (C) 1992, 1994, 1997, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+
+/* Copy of sysdeps/generic/sigjmp.c modified for backward compatibility
+   with old non AltiVec/VMX setjmp.  */
+#include  <shlib-compat.h>
+#if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)
+#include <stddef.h>
+#include <novmxsetjmp.h>
+#include <signal.h>
+
+/* This function is called by the `sigsetjmp' macro
+   before doing a `__setjmp' on ENV[0].__jmpbuf.
+   Always return zero.  */
+
+int
+__novmx__sigjmp_save (sigjmp_buf env, int savemask)
+{
+  env[0].__mask_was_saved = (savemask &&
+			     __sigprocmask (SIG_BLOCK, (sigset_t *) NULL,
+					    &env[0].__saved_mask) == 0);
+
+  return 0;
+}
+
+symbol_version (__novmx__sigjmp_save,__sigjmp_save,GLIBC_2.0);
+#endif /* defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4) */
diff -urN libc23-cvstip-20040116/sysdeps/powerpc/powerpc64/novmx-longjmp.c libc23/sysdeps/powerpc/powerpc64/novmx-longjmp.c
--- libc23-cvstip-20040116/sysdeps/powerpc/powerpc64/novmx-longjmp.c	Wed Dec 31 18:00:00 1969
+++ libc23/sysdeps/powerpc/powerpc64/novmx-longjmp.c	Sat Jan 17 14:31:22 2004
@@ -0,0 +1,59 @@
+/* Copyright (C) 1991,92,94,95,97,98,2000,2002,2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+/*
+  Copy of sysdeps/generic/longjmp.c modified for backward compatibility
+  with old non AltiVec/VMX longjmp.
+ */
+#include  <shlib-compat.h>
+#if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_3_4)
+#include <stddef.h>
+#include <novmxsetjmp.h>
+#include <signal.h>
+
+
+/* Set the signal mask to the one specified in ENV, and jump
+   to the position specified in ENV, causing the setjmp
+   call there to return VAL, or 1 if VAL is 0.  */
+void
+__novmx__libc_siglongjmp (sigjmp_buf env, int val)
+{
+  /* Perform any cleanups needed by the frames being unwound.  */
+  _longjmp_unwind (env, val);
+
+  if (env[0].__mask_was_saved)
+    /* Restore the saved signal mask.  */
+    (void) __sigprocmask (SIG_SETMASK, &env[0].__saved_mask,
+			  (sigset_t *) NULL);
+
+  /* Call the machine-dependent function to restore machine state.  */
+  __novmx__longjmp (env[0].__jmpbuf, val ?: 1);
+}
+
+strong_alias (__novmx__libc_siglongjmp, __novmx__libc_longjmp)
+libc_hidden_def (__novmx__libc_longjmp)
+weak_alias (__novmx__libc_siglongjmp, __novmx_longjmp)
+weak_alias (__novmx__libc_siglongjmp, __novmxlongjmp)
+weak_alias (__novmx__libc_siglongjmp, __novmxsiglongjmp)
+
+symbol_version (__novmx__libc_longjmp,__libc_longjmp,GLIBC_2.3);
+symbol_version (__novmx__libc_siglongjmp,__libc_siglongjmp,GLIBC_2.3);
+symbol_version (__novmx_longjmp,_longjmp,GLIBC_2.3);
+symbol_version (__novmxlongjmp,longjmp,GLIBC_2.3);
+symbol_version (__novmxsiglongjmp,siglongjmp,GLIBC_2.3);
+#endif /* defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_3_4) */
+
diff -urN libc23-cvstip-20040116/sysdeps/powerpc/powerpc64/novmx-setjmp.c libc23/sysdeps/powerpc/powerpc64/novmx-setjmp.c
--- libc23-cvstip-20040116/sysdeps/powerpc/powerpc64/novmx-setjmp.c	Wed Dec 31 18:00:00 1969
+++ libc23/sysdeps/powerpc/powerpc64/novmx-setjmp.c	Sat Jan 17 17:55:10 2004
@@ -0,0 +1,44 @@
+/* Copyright (C) 1991, 94, 95, 96, 97, 98, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+   
+/* Copy of sysdeps/generic/setjmp.c modified for backward compatibility
+   with old non AltiVec/VMX setjmp.  */
+#include  <shlib-compat.h>
+#if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_3_4)
+#include <errno.h>
+#include <novmxsetjmp.h>
+
+
+/* Save the current program position in ENV and return 0.  */
+int
+__novmx__libc_sigsetjmp (jmp_buf env, int savemask)
+{
+  /* Save the signal mask if requested.  */
+  __novmx__sigjmp_save (env, savemask);
+
+  __set_errno (ENOSYS);
+  /* No way to signal failure.	*/
+  return 0;
+}
+
+weak_alias (__novmx__libc_sigsetjmp, __novmx__sigsetjmp)
+stub_warning (__novmx__sigsetjmp)
+symbol_version (__novmx__libc_sigsetjmp,__libc_sigsetjmp,GLIBC_2.3);
+symbol_version (__novmx__sigsetjmp,__sigsetjmp,GLIBC_2.3);
+#include <stub-tag.h>
+#endif /* SHARED && SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_3_4) */
diff -urN libc23-cvstip-20040116/sysdeps/powerpc/powerpc64/novmx-sigjmp.c libc23/sysdeps/powerpc/powerpc64/novmx-sigjmp.c
--- libc23-cvstip-20040116/sysdeps/powerpc/powerpc64/novmx-sigjmp.c	Wed Dec 31 18:00:00 1969
+++ libc23/sysdeps/powerpc/powerpc64/novmx-sigjmp.c	Sat Jan 17 17:54:49 2004
@@ -0,0 +1,42 @@
+/* Copyright (C) 1992, 1994, 1997, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/* Copy of sysdeps/generic/sigjmp.c modified for backward compatibility
+   with old non AltiVec/VMX setjmp.  */
+#include  <shlib-compat.h>
+#ifdef SHARED && SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_3_4)
+#include <stddef.h>
+#include <novmxsetjmp.h>
+#include <signal.h>
+
+/* This function is called by the `sigsetjmp' macro
+   before doing a `__setjmp' on ENV[0].__jmpbuf.
+   Always return zero.  */
+
+int
+__novmx__sigjmp_save (sigjmp_buf env, int savemask)
+{
+  env[0].__mask_was_saved = (savemask &&
+			     __sigprocmask (SIG_BLOCK, (sigset_t *) NULL,
+					    &env[0].__saved_mask) == 0);
+
+  return 0;
+}
+
+symbol_version (__novmx__sigjmp_save,__sigjmp_save,GLIBC_2.3);
+#endif /* SHARED && SHLIB_COMPAT (libc, GLIBC_2_3, GLIBC_2_3_4) */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]