Browse Source

make use of jmpbuf-offsets.h and jmpbuf-unwind.h

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Peter S. Mazinger 13 years ago
parent
commit
14647468df
39 changed files with 43 additions and 151 deletions
  1. 1 4
      libc/sysdeps/linux/alpha/__longjmp.S
  2. 18 17
      libc/sysdeps/linux/alpha/setjmp.S
  3. 0 4
      libc/sysdeps/linux/arm/__longjmp.S
  4. 0 4
      libc/sysdeps/linux/cris/__longjmp.S
  5. 0 3
      libc/sysdeps/linux/cris/setjmp.S
  6. 0 4
      libc/sysdeps/linux/frv/__longjmp.S
  7. 1 3
      libc/sysdeps/linux/h8300/bsd-_setjmp.S
  8. 1 3
      libc/sysdeps/linux/h8300/bsd-setjmp.S
  9. 1 3
      libc/sysdeps/linux/h8300/setjmp.S
  10. 0 5
      libc/sysdeps/linux/hppa/__longjmp.S
  11. 1 4
      libc/sysdeps/linux/i386/__longjmp.S
  12. 1 3
      libc/sysdeps/linux/i386/bsd-_setjmp.S
  13. 0 4
      libc/sysdeps/linux/i386/bsd-setjmp.S
  14. 0 5
      libc/sysdeps/linux/i386/setjmp.S
  15. 1 3
      libc/sysdeps/linux/m68k/__longjmp.S
  16. 1 3
      libc/sysdeps/linux/m68k/bsd-_setjmp.S
  17. 1 3
      libc/sysdeps/linux/m68k/bsd-setjmp.S
  18. 1 3
      libc/sysdeps/linux/m68k/setjmp.S
  19. 0 4
      libc/sysdeps/linux/microblaze/__longjmp.S
  20. 0 4
      libc/sysdeps/linux/microblaze/setjmp.S
  21. 1 5
      libc/sysdeps/linux/nios/__longjmp.S
  22. 1 4
      libc/sysdeps/linux/nios/setjmp.S
  23. 1 3
      libc/sysdeps/linux/nios2/__longjmp.S
  24. 1 3
      libc/sysdeps/linux/nios2/bsd-_setjmp.S
  25. 1 3
      libc/sysdeps/linux/nios2/bsd-setjmp.S
  26. 1 3
      libc/sysdeps/linux/nios2/setjmp.S
  27. 1 3
      libc/sysdeps/linux/powerpc/__longjmp.S
  28. 1 3
      libc/sysdeps/linux/powerpc/setjmp.S
  29. 0 3
      libc/sysdeps/linux/sh/__longjmp.S
  30. 1 3
      libc/sysdeps/linux/sh/setjmp.S
  31. 1 5
      libc/sysdeps/linux/sparc/__longjmp.S
  32. 1 4
      libc/sysdeps/linux/sparc/setjmp.S
  33. 0 5
      libc/sysdeps/linux/v850/__longjmp.S
  34. 0 4
      libc/sysdeps/linux/v850/setjmp.S
  35. 1 4
      libc/sysdeps/linux/x86_64/__longjmp.S
  36. 0 5
      libc/sysdeps/linux/x86_64/bsd-setjmp.S
  37. 1 4
      libc/sysdeps/linux/x86_64/setjmp.S
  38. 1 0
      libpthread/linuxthreads.old/ptlongjmp.c
  39. 1 1
      libpthread/linuxthreads/ptcleanup.c

+ 1 - 4
libc/sysdeps/linux/alpha/__longjmp.S

@@ -16,10 +16,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#include <features.h>
-#define _SETJMP_H
-#define __ASSEMBLY__
-#include <bits/setjmp.h>
+#include <setjmp-offsets.h>
 
 #define a0  $16
 

+ 18 - 17
libc/sysdeps/linux/alpha/setjmp.S

@@ -16,11 +16,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#include <features.h>
-#define _ASM
-#define _SETJMP_H
-#define __ASSEMBLY__
-#include <bits/setjmp.h>
+#include <jmpbuf-offsets.h>
 
 #define a0  $16
 
@@ -30,10 +26,16 @@ __sigsetjmp:
        ldgp    $29, 0($27)
 
 $sigsetjmp_local:
-       subq    $30, 16, $30
-       .frame  $26, 16, $26, 0
-       stq     $26, 0($30)
-       .mask   0x04000000, -16
+#ifndef __PIC__
+# define FRAME 16
+	subq    $30, FRAME, $30
+	.frame  $30, FRAME, $26, 0
+	stq     $26, 0($30)
+	.mask   0x04000000, -FRAME
+#else
+# define FRAME 0
+	.frame	$30, FRAME, $26, 0
+#endif
 	.prologue 1
 
 	stq	$9, JB_S0*8(a0)
@@ -43,9 +45,9 @@ $sigsetjmp_local:
 	stq	$13, JB_S4*8(a0)
 	stq	$14, JB_S5*8(a0)
 	stq	$26, JB_PC*8(a0)
-	addq	$30, 16, $1
-	stq	$15, JB_FP*8(a0)
+	addq	$30, FRAME, $1
 	stq	$1, JB_SP*8(a0)
+	stq	$15, JB_FP*8(a0)
 	stt	$f2, JB_F2*8(a0)
 	stt	$f3, JB_F3*8(a0)
 	stt	$f4, JB_F4*8(a0)
@@ -55,12 +57,16 @@ $sigsetjmp_local:
 	stt	$f8, JB_F8*8(a0)
 	stt	$f9, JB_F9*8(a0)
 
+#ifndef __PIC__
 	/* Call to C to (potentially) save our signal mask.  */
 	jsr	$26, __sigjmp_save
-
 	ldq	$26, 0($30)
 	addq	$30, 16, $30
 	ret
+#else
+	/* Tailcall to save the signal mask.  */
+	br	$31, __sigjmp_save	!samegp
+#endif
 
 .end __sigsetjmp
 
@@ -71,7 +77,6 @@ $sigsetjmp_local:
 .align 3;
 .ent  _setjmp , 0;
 _setjmp:
-	.frame $30 , 0, $26
 	ldgp	$29, 0($27)
 	mov	0, $17
 	br	$sigsetjmp_local
@@ -81,11 +86,7 @@ _setjmp:
 .align 3;
 .ent  setjmp , 0;
 setjmp:
-	.frame $30 , 0, $26
 	ldgp	$29, 0($27)
 	mov	1, $17
 	br	$sigsetjmp_local
 .end setjmp
-
-.weak   _setjmp
-.weak   setjmp

+ 0 - 4
libc/sysdeps/linux/arm/__longjmp.S

@@ -19,10 +19,6 @@
 
 #include <features.h>
 #include <bits/arm_asm.h>
-#define _SETJMP_H
-#define _ASM
-#include <bits/setjmp.h>
-
 
 .global __longjmp
 .type __longjmp,%function

+ 0 - 4
libc/sysdeps/linux/cris/__longjmp.S

@@ -17,11 +17,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#include <features.h>
 #include "sysdep.h"
-#define _SETJMP_H
-#define _ASM
-#include <bits/setjmp.h>
 
 	.syntax no_register_prefix
 

+ 0 - 3
libc/sysdeps/linux/cris/setjmp.S

@@ -18,9 +18,6 @@
    Boston, MA 02111-1307, USA.  */
 
 #include "sysdep.h"
-#define _SETJMP_H
-#define _ASM
-#include <bits/setjmp.h>
 
         .syntax no_register_prefix
 

+ 0 - 4
libc/sysdeps/linux/frv/__longjmp.S

@@ -4,10 +4,6 @@
  * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  */
 
-#define _SETJMP_H
-#define _ASM
-#include <bits/setjmp.h>
-
 # setjmp/longjmp for Frv.  The jmpbuf looks like this:
 #	
 # Register	jmpbuf offset

+ 1 - 3
libc/sysdeps/linux/h8300/bsd-_setjmp.S

@@ -1,8 +1,6 @@
 /* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'.  H8/300 version. */
 
-#define _ASM
-#define _SETJMP_H
-#include <bits/setjmp.h>
+#include <jmpbuf-offsets.h>
 
 #ifdef __H8300S__
 	.h8300s

+ 1 - 3
libc/sysdeps/linux/h8300/bsd-setjmp.S

@@ -1,8 +1,6 @@
 /* BSD `_setjmp' entry point to `sigsetjmp (..., 1)'.  H8/300 version. */
 
-#define _ASM
-#define _SETJMP_H
-#include <bits/setjmp.h>
+#include <jmpbuf-offsets.h>
 
 #ifdef __H8300S__
 	.h8300s

+ 1 - 3
libc/sysdeps/linux/h8300/setjmp.S

@@ -1,6 +1,4 @@
-#define _ASM
-#define _SETJMP_H
-#include <bits/setjmp.h>
+#include <jmpbuf-offsets.h>
 
 #ifdef __H8300S__
 	.h8300s

+ 0 - 5
libc/sysdeps/linux/hppa/__longjmp.S

@@ -17,11 +17,6 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#include <features.h>
-#define _SETJMP_H
-#define _ASM
-#include <bits/setjmp.h>
-
 /* __longjmp(jmpbuf, val) */
 
 	.text

+ 1 - 4
libc/sysdeps/linux/i386/__longjmp.S

@@ -17,10 +17,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#include <features.h>
-#define _ASM
-#define _SETJMP_H
-#include <bits/setjmp.h>
+#include <jmpbuf-offsets.h>
 
 .global __longjmp
 .type   __longjmp,%function

+ 1 - 3
libc/sysdeps/linux/i386/bsd-_setjmp.S

@@ -21,9 +21,7 @@
    We cannot do it in C because it must be a tail-call, so frame-unwinding
    in setjmp doesn't clobber the state restored by longjmp.  */
 
-#define _ASM
-#define _SETJMP_H
-#include <bits/setjmp.h>
+#include <jmpbuf-offsets.h>
 
 .global _setjmp
 .type   _setjmp,%function

+ 0 - 4
libc/sysdeps/linux/i386/bsd-setjmp.S

@@ -17,10 +17,6 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#define _ASM
-#define _SETJMP_H
-#include <bits/setjmp.h>
-
 .global setjmp
 .type   setjmp,%function
 setjmp:

+ 0 - 5
libc/sysdeps/linux/i386/setjmp.S

@@ -17,11 +17,6 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#define _ASM
-#define _SETJMP_H
-#include <bits/setjmp.h>
-
-
 .global __sigsetjmp
 .type   __sigsetjmp,%function
 

+ 1 - 3
libc/sysdeps/linux/m68k/__longjmp.S

@@ -2,10 +2,8 @@
 /* Copyright (C) 2002, David McCullough <davidm@snapgear.com> */
 /* This file is released under the LGPL, any version you like */
 
-#define _ASM
-#define _SETJMP_H
 #include <features.h>
-#include <bits/setjmp.h>
+#include <jmpbuf-offsets.h>
 
 .globl __longjmp
 .type  __longjmp,@function

+ 1 - 3
libc/sysdeps/linux/m68k/bsd-_setjmp.S

@@ -2,9 +2,7 @@
 /* Copyright (C) 2002, David McCullough <davidm@snapgear.com> */
 /* This file is released under the LGPL, any version you like */
 
-#define _ASM
-#define _SETJMP_H
-#include <bits/setjmp.h>
+#include <jmpbuf-offsets.h>
 
 .globl _setjmp;
 .type  _setjmp,@function

+ 1 - 3
libc/sysdeps/linux/m68k/bsd-setjmp.S

@@ -2,9 +2,7 @@
 /* Copyright (C) 2002, David McCullough <davidm@snapgear.com> */
 /* This file is released under the LGPL, any version you like */
 
-#define _ASM
-#define _SETJMP_H
-#include <bits/setjmp.h>
+#include <jmpbuf-offsets.h>
 #include "m68k_pic.S"
 
 .globl setjmp;

+ 1 - 3
libc/sysdeps/linux/m68k/setjmp.S

@@ -2,9 +2,7 @@
 /* Copyright (C) 2002, David McCullough <davidm@snapgear.com> */
 /* This file is released under the LGPL, any version you like */
 
-#define _ASM
-#define _SETJMP_H
-#include <bits/setjmp.h>
+#include <jmpbuf-offsets.h>
 #include "m68k_pic.S"
 
 .globl __sigsetjmp;

+ 0 - 4
libc/sysdeps/linux/microblaze/__longjmp.S

@@ -12,10 +12,6 @@
  * Written by Miles Bader <miles@gnu.org>
  */
 
-#define _SETJMP_H
-#define _ASM
-#include <bits/setjmp.h>
-
 #include <libc-symbols.h>
 
 	.text

+ 0 - 4
libc/sysdeps/linux/microblaze/setjmp.S

@@ -29,10 +29,6 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#define _SETJMP_H
-#define _ASM
-#include <bits/setjmp.h>
-
 #include <libc-symbols.h>
 
 	.text

+ 1 - 5
libc/sysdeps/linux/nios/__longjmp.S

@@ -16,11 +16,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#include <features.h>
-#define _ASM
-#define _SETJMP_H
-#include <bits/setjmp.h>
-
+#include <jmpbuf-offsets.h>
 
 ;----------------------------------------
 ;         Name: __longjmp

+ 1 - 4
libc/sysdeps/linux/nios/setjmp.S

@@ -16,10 +16,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#include <features.h>
-#define _ASM
-#define _SETJMP_H
-#include <bits/setjmp.h>
+#include <jmpbuf-offsets.h>
 #include "NM_Macros.S"
 
 ;----------------------------------------

+ 1 - 3
libc/sysdeps/linux/nios2/__longjmp.S

@@ -12,9 +12,7 @@
  */
 
 #include <features.h>
-#define _ASM
-#define _SETJMP_H
-#include <bits/setjmp.h>
+#include <jmpbuf-offsets.h>
 
 .globl __longjmp
 .type  __longjmp,@function

+ 1 - 3
libc/sysdeps/linux/nios2/bsd-_setjmp.S

@@ -11,9 +11,7 @@
  * 
  */
 
-#define _ASM
-#define _SETJMP_H
-#include <bits/setjmp.h>
+#include <jmpbuf-offsets.h>
 
    .globl _setjmp
    .type  _setjmp,@function

+ 1 - 3
libc/sysdeps/linux/nios2/bsd-setjmp.S

@@ -12,9 +12,7 @@
  */
 
 
-#define _ASM
-#define _SETJMP_H
-#include <bits/setjmp.h>
+#include <jmpbuf-offsets.h>
 
    .globl setjmp
    .type  setjmp,@function

+ 1 - 3
libc/sysdeps/linux/nios2/setjmp.S

@@ -12,9 +12,7 @@
  */
 
 #include <features.h>
-#define _ASM
-#define _SETJMP_H
-#include <bits/setjmp.h>
+#include <jmpbuf-offsets.h>
 
 .globl __sigsetjmp
 .type  __sigsetjmp,@function

+ 1 - 3
libc/sysdeps/linux/powerpc/__longjmp.S

@@ -21,9 +21,7 @@
 
 #include <features.h>
 #include "ppc_asm.h"
-#define _ASM
-#define _SETJMP_H
-#include <bits/setjmp.h>
+#include <jmpbuf-offsets.h>
 
 
 #if defined __UCLIBC_HAS_FLOATS__ && ! defined __UCLIBC_HAS_SOFT_FLOAT__

+ 1 - 3
libc/sysdeps/linux/powerpc/setjmp.S

@@ -21,9 +21,7 @@
 
 #include <features.h>
 #include "ppc_asm.h"
-#define _ASM
-#define _SETJMP_H
-#include <bits/setjmp.h>
+#include <jmpbuf-offsets.h>
 
 #if defined __UCLIBC_HAS_FLOATS__ && ! defined __UCLIBC_HAS_SOFT_FLOAT__
 #define FP(x...) x

+ 0 - 3
libc/sysdeps/linux/sh/__longjmp.S

@@ -17,9 +17,6 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#define _SETJMP_H
-#define _ASM
-#include <bits/setjmp.h>
 #include <features.h>
 
 /* __longjmp(jmpbuf, val) */

+ 1 - 3
libc/sysdeps/linux/sh/setjmp.S

@@ -18,9 +18,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #include <features.h>
-#define _SETJMP_H
-#define _ASM
-#include <bits/setjmp.h>
+#include <jmpbuf-offsets.h>
 
 	.text
 

+ 1 - 5
libc/sysdeps/linux/sparc/__longjmp.S

@@ -16,12 +16,8 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#include <features.h>
-#include <sys/syscall.h>
+#include <jmpbuf-offsets.h>
 
-#define _ASM 1
-#define _SETJMP_H
-#include <bits/setjmp.h>
 #define ENV(base,reg) [%base + (reg * 4)]
 #define ST_FLUSH_WINDOWS 3
 #define RW_FP [%fp + 0x48]

+ 1 - 4
libc/sysdeps/linux/sparc/setjmp.S

@@ -16,11 +16,8 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#include <sys/syscall.h>
+#include <jmpbuf-offsets.h>
 
-#define _ASM 1
-#define _SETJMP_H
-#include <bits/setjmp.h>
 #define ST_FLUSH_WINDOWS 3
 
 .global _setjmp

+ 0 - 5
libc/sysdeps/linux/v850/__longjmp.S

@@ -11,11 +11,6 @@
  * Written by Miles Bader <miles@gnu.org>
  */
 
-#include <features.h>
-#define _SETJMP_H
-#define _ASM
-#include <bits/setjmp.h>
-
 #include <clinkage.h>
 
 	.text

+ 0 - 4
libc/sysdeps/linux/v850/setjmp.S

@@ -11,10 +11,6 @@
  * Written by Miles Bader <miles@gnu.org>
  */
 
-#define _SETJMP_H
-#define _ASM
-#include <bits/setjmp.h>
-
 #include <clinkage.h>
 
 	.text

+ 1 - 4
libc/sysdeps/linux/x86_64/__longjmp.S

@@ -16,10 +16,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#include <features.h>
-#define _ASM
-#define _SETJMP_H
-#include <bits/setjmp.h>
+#include <jmpbuf-offsets.h>
 
 /* Jump to the position specified by ENV, causing the
    setjmp call there to return VAL, or 1 if VAL is 0.

+ 0 - 5
libc/sysdeps/linux/x86_64/bsd-setjmp.S

@@ -17,11 +17,6 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#define _ASM
-#define _SETJMP_H
-#include <bits/setjmp.h>
-#include <sysdep.h>
-
 .global setjmp
 .type   setjmp,%function
 setjmp:

+ 1 - 4
libc/sysdeps/linux/x86_64/setjmp.S

@@ -17,10 +17,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#define _ASM
-#define _SETJMP_H
-#include <bits/setjmp.h>
-#include <sysdep.h>
+#include <jmpbuf-offsets.h>
 
 .global __sigsetjmp
 .type   __sigsetjmp,%function

+ 1 - 0
libpthread/linuxthreads.old/ptlongjmp.c

@@ -19,6 +19,7 @@
 #include "pthread.h"
 #include "internals.h"
 #include <bits/stackinfo.h>
+#include <jmpbuf-unwind.h>
 
 static void pthread_cleanup_upto(__jmp_buf target)
 {

+ 1 - 1
libpthread/linuxthreads/ptcleanup.c

@@ -20,8 +20,8 @@
 #include <setjmp.h>
 #include "pthread.h"
 #include "internals.h"
-#ifndef NO_PTR_DEMANGLE
 #include <jmpbuf-unwind.h>
+#ifndef NO_PTR_DEMANGLE
 #define __JMPBUF_UNWINDS(a,b,c) _JMPBUF_UNWINDS(a,b,c)
 #else
 #define __JMPBUF_UNWINDS(a,b,c) _JMPBUF_UNWINDS(a,b)