summaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2005-12-28 05:42:30 +0000
committerRoland McGrath <roland@gnu.org>2005-12-28 05:42:30 +0000
commitdb169ed561acef18093cc6739fb159d6274bf5a5 (patch)
tree18d7b799dd18051b570bcec3826b6392074cde43 /sysdeps
parent0317eaecb1f1a0667a18412b2209f0ae70f94420 (diff)
* sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h
(PTR_MANGLE): Fix cast. * sysdeps/alpha/bits/setjmp.h (_JMPBUF_UNWINDS): Take third argument DEMANGLE, and pass SP value through it. * sysdeps/hppa/bits/setjmp.h (_JMPBUF_UNWINDS): Likewise. * sysdeps/i386/bits/setjmp.h (_JMPBUF_UNWINDS): Likewise. * sysdeps/m68k/bits/setjmp.h (_JMPBUF_UNWINDS): Likewise. * sysdeps/mips/bits/setjmp.h (_JMPBUF_UNWINDS): Likewise. * sysdeps/powerpc/bits/setjmp.h (_JMPBUF_UNWINDS): Likewise. * sysdeps/s390/bits/setjmp.h (_JMPBUF_UNWINDS): Likewise. * sysdeps/sh/bits/setjmp.h (_JMPBUF_UNWINDS): Likewise. * sysdeps/sparc/sparc32/bits/setjmp.h (_JMPBUF_UNWINDS): Likewise. * sysdeps/unix/sysv/linux/ia64/bits/setjmp.h: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/setjmp.h: Likewise. * sysdeps/x86_64/bits/setjmp.h (_JMPBUF_UNWINDS): Likewise. * hurd/sigunwind.c (_hurdsig_longjmp_from_handler): Pass inline demangler function to _JMPBUF_UNWINDS. * sysdeps/mach/hurd/jmp-unwind.c (demangle_ptr): New function. (_longjmp_unwind): Pass it to _JMPBUF_UNWINDS.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/alpha/bits/setjmp.h6
-rw-r--r--sysdeps/hppa/bits/setjmp.h7
-rw-r--r--sysdeps/i386/bits/setjmp.h6
-rw-r--r--sysdeps/m68k/bits/setjmp.h6
-rw-r--r--sysdeps/mach/hurd/jmp-unwind.c15
-rw-r--r--sysdeps/mips/bits/setjmp.h4
-rw-r--r--sysdeps/powerpc/bits/setjmp.h6
-rw-r--r--sysdeps/s390/bits/setjmp.h6
-rw-r--r--sysdeps/sh/bits/setjmp.h4
-rw-r--r--sysdeps/sparc/sparc32/bits/setjmp.h6
-rw-r--r--sysdeps/unix/sysv/linux/ia64/bits/setjmp.h6
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h2
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/setjmp.h10
-rw-r--r--sysdeps/x86_64/bits/setjmp.h10
14 files changed, 52 insertions, 42 deletions
diff --git a/sysdeps/alpha/bits/setjmp.h b/sysdeps/alpha/bits/setjmp.h
index c603a35554..71b7738c37 100644
--- a/sysdeps/alpha/bits/setjmp.h
+++ b/sysdeps/alpha/bits/setjmp.h
@@ -1,5 +1,5 @@
/* Define the machine-dependent type `jmp_buf'. Alpha version.
- Copyright (C) 1992, 1997, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1992, 1997, 2003, 2005 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
@@ -80,8 +80,8 @@ typedef long int __jmp_buf[17];
/* 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_SP]))
+#define _JMPBUF_UNWINDS(_jmpbuf, _address, _demangle) \
+ ((void *)(_address) < (void *) _demangle ((_jmpbuf)[JB_SP]))
#endif
#endif /* bits/setjmp.h */
diff --git a/sysdeps/hppa/bits/setjmp.h b/sysdeps/hppa/bits/setjmp.h
index 4395b8f562..07ea01eb97 100644
--- a/sysdeps/hppa/bits/setjmp.h
+++ b/sysdeps/hppa/bits/setjmp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2005 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
@@ -39,7 +39,8 @@ typedef double __jmp_buf[21];
/* Test if longjmp to JMPBUF would unwind the frame containing a local
variable at ADDRESS. */
-#define _JMPBUF_UNWINDS(_jmpbuf, _address) \
- ((void *)(_address) > (void *)(((unsigned long *) _jmpbuf)[JB_SP]))
+#define _JMPBUF_UNWINDS(_jmpbuf, _address, _demangle) \
+ ((void *) (_address) > \
+ (void *) _demangle ((((unsigned long *) _jmpbuf)[JB_SP])))
#endif /* bits/setjmp.h */
diff --git a/sysdeps/i386/bits/setjmp.h b/sysdeps/i386/bits/setjmp.h
index 107fe58b35..d99a726ba3 100644
--- a/sysdeps/i386/bits/setjmp.h
+++ b/sysdeps/i386/bits/setjmp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 2000, 2001, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 2000, 2001, 2003, 2005 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
@@ -40,7 +40,7 @@ typedef int __jmp_buf[6];
/* 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_SP])
+#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
+ ((void *) (address) < (void *) demangle ((jmpbuf)[JB_SP]))
#endif /* bits/setjmp.h */
diff --git a/sysdeps/m68k/bits/setjmp.h b/sysdeps/m68k/bits/setjmp.h
index 193eec3509..612582af26 100644
--- a/sysdeps/m68k/bits/setjmp.h
+++ b/sysdeps/m68k/bits/setjmp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 2005 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
@@ -44,7 +44,7 @@ typedef struct
/* Test if longjmp to JMPBUF would unwind the frame
containing a local variable at ADDRESS. */
-#define _JMPBUF_UNWINDS(jmpbuf, address) \
- ((void *) (address) < (void *) (jmpbuf)->__sp)
+#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
+ ((void *) (address) < (void *) demangle ((jmpbuf)->__sp))
#endif /* bits/setjmp.h */
diff --git a/sysdeps/mach/hurd/jmp-unwind.c b/sysdeps/mach/hurd/jmp-unwind.c
index 4624ad9e26..0c9700b739 100644
--- a/sysdeps/mach/hurd/jmp-unwind.c
+++ b/sysdeps/mach/hurd/jmp-unwind.c
@@ -1,5 +1,5 @@
/* _longjmp_unwind -- Clean up stack frames unwound by longjmp. Hurd version.
- Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 2005 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
@@ -28,6 +28,15 @@
#error "<bits/setjmp.h> fails to define _JMPBUF_UNWINDS"
#endif
+static inline uintptr_t
+demangle_ptr (uintptr_t x)
+{
+# ifdef PTR_DEMANGLE
+ PTR_DEMANGLE (x);
+# endif
+ return x;
+}
+
/* This function is called by `longjmp' (with its arguments) to restore
active resources to a sane state before the frames code using them are
jumped out of. */
@@ -46,7 +55,7 @@ _longjmp_unwind (jmp_buf env, int val)
/* Remove local signal preemptors being unwound past. */
while (ss->preemptors &&
- _JMPBUF_UNWINDS (env[0].__jmpbuf, ss->preemptors))
+ _JMPBUF_UNWINDS (env[0].__jmpbuf, ss->preemptors, demangle_ptr))
ss->preemptors = ss->preemptors->next;
__spin_unlock (&ss->lock);
@@ -56,7 +65,7 @@ _longjmp_unwind (jmp_buf env, int val)
in stack frames being unwound by this jump. */
for (link = ss->active_resources;
- link && _JMPBUF_UNWINDS (env[0].__jmpbuf, link);
+ link && _JMPBUF_UNWINDS (env[0].__jmpbuf, link, demangle_ptr);
link = link->thread.next)
/* Remove this link from the resource's users list,
since the frame using the resource is being unwound.
diff --git a/sysdeps/mips/bits/setjmp.h b/sysdeps/mips/bits/setjmp.h
index 74caae8cba..5f7c82b864 100644
--- a/sysdeps/mips/bits/setjmp.h
+++ b/sysdeps/mips/bits/setjmp.h
@@ -80,7 +80,7 @@ typedef struct
/* Test if longjmp to JMPBUF would unwind the frame
containing a local variable at ADDRESS. */
-#define _JMPBUF_UNWINDS(jmpbuf, address) \
- ((void *) (address) < (void *) (jmpbuf)[0].__sp)
+#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
+ ((void *) (address) < (void *) demangle ((jmpbuf)[0].__sp))
#endif /* _MIPS_BITS_SETJMP_H */
diff --git a/sysdeps/powerpc/bits/setjmp.h b/sysdeps/powerpc/bits/setjmp.h
index 3134916a51..6b35fb440b 100644
--- a/sysdeps/powerpc/bits/setjmp.h
+++ b/sysdeps/powerpc/bits/setjmp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 2000, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 2000, 2003, 2004, 2005 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
@@ -74,7 +74,7 @@ typedef long int __jmp_buf[64 + (12 * 4)] __attribute__ ((__aligned__ (16)));
/* 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])
+#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
+ ((void *) (address) < (void *) demangle ((jmpbuf)[JB_GPR1]))
#endif /* bits/setjmp.h */
diff --git a/sysdeps/s390/bits/setjmp.h b/sysdeps/s390/bits/setjmp.h
index 4009514763..01533ca367 100644
--- a/sysdeps/s390/bits/setjmp.h
+++ b/sysdeps/s390/bits/setjmp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2001, 2002, 2005 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
@@ -57,7 +57,7 @@ typedef struct {
/* Test if longjmp to JMPBUF would unwind the frame
containing a local variable at ADDRESS. */
-#define _JMPBUF_UNWINDS(jmpbuf, address) \
- ((void *) (address) < (void *) (jmpbuf)->__gregs[__JB_GPR15])
+#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
+ ((void *) (address) < (void *) demangle ((jmpbuf)->__gregs[__JB_GPR15]))
#endif /* __S390_SETJMP_H__ */
diff --git a/sysdeps/sh/bits/setjmp.h b/sysdeps/sh/bits/setjmp.h
index 242720ca53..8ebb5c598e 100644
--- a/sysdeps/sh/bits/setjmp.h
+++ b/sysdeps/sh/bits/setjmp.h
@@ -50,7 +50,7 @@ typedef struct
/* Test if longjmp to JMPBUF would unwind the frame
containing a local variable at ADDRESS. */
-#define _JMPBUF_UNWINDS(jmpbuf, address) \
- ((void *) (address) < (void *) (jmpbuf)[0].__regs[7])
+#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
+ ((void *) (address) < (void *) demangle ((jmpbuf)[0].__regs[7]))
#endif /* bits/setjmp.h */
diff --git a/sysdeps/sparc/sparc32/bits/setjmp.h b/sysdeps/sparc/sparc32/bits/setjmp.h
index 76d7af02c7..12250d6980 100644
--- a/sysdeps/sparc/sparc32/bits/setjmp.h
+++ b/sysdeps/sparc/sparc32/bits/setjmp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 2005 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
@@ -34,5 +34,5 @@ typedef int __jmp_buf[3];
/* Test if longjmp to JMPBUF would unwind the frame
containing a local variable at ADDRESS. */
-#define _JMPBUF_UNWINDS(jmpbuf, address) \
- ((int) (address) < (jmpbuf)[JB_SP])
+#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
+ ((int) (address) < demangle ((jmpbuf)[JB_SP]))
diff --git a/sysdeps/unix/sysv/linux/ia64/bits/setjmp.h b/sysdeps/unix/sysv/linux/ia64/bits/setjmp.h
index 76625753d9..07d4d80958 100644
--- a/sysdeps/unix/sysv/linux/ia64/bits/setjmp.h
+++ b/sysdeps/unix/sysv/linux/ia64/bits/setjmp.h
@@ -1,5 +1,5 @@
/* Define the machine-dependent type `jmp_buf'. Linux/IA-64 version.
- Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2003, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>.
@@ -34,7 +34,7 @@ typedef long __jmp_buf[_JBLEN] __attribute__ ((aligned (16))); /* guarantees 128
/* Test if longjmp to JMPBUF would unwind the frame containing a local
variable at ADDRESS. */
-#define _JMPBUF_UNWINDS(_jmpbuf, _address) \
- ((void *)(_address) < (void *)(((long *)_jmpbuf)[0]))
+#define _JMPBUF_UNWINDS(_jmpbuf, _address, _demangle) \
+ ((void *) (_address) < (void *) demangle (((long int *) _jmpbuf)[0]))
#endif /* bits/setjmp.h */
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h b/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h
index 546e712edc..d3cd45ce99 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h
@@ -183,7 +183,7 @@
# define PTR_DEMANGLE(reg, tmpreg) PTR_MANGLE (reg, tmpreg)
# else
# define PTR_MANGLE(var) \
- (var) = (void *) ((uintptr_t) (var) ^ THREAD_GET_POINTER_GUARD ())
+ (var) = (__typeof (var)) ((uintptr_t) (var) ^ THREAD_GET_POINTER_GUARD ())
# define PTR_DEMANGLE(var) PTR_MANGLE (var)
# endif
#endif
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/setjmp.h b/sysdeps/unix/sysv/linux/sparc/bits/setjmp.h
index dac9ac5cba..45aa2655ee 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/setjmp.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/setjmp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997,1999,2000,2003 Free Software Foundation, Inc.
+/* Copyright (C) 1997,1999,2000,2003, 2005 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
@@ -59,8 +59,8 @@ typedef struct __sparc64_jmp_buf
/* Test if longjmp to JMPBUF would unwind the frame
containing a local variable at ADDRESS. */
-#define _JMPBUF_UNWINDS(jmpbuf, address) \
- ((unsigned long int) (address) < (jmpbuf)->uc_mcontext.mc_fp)
+#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
+ ((unsigned long int) (address) < demangle ((jmpbuf)->uc_mcontext.mc_fp))
#else
@@ -76,8 +76,8 @@ typedef int __jmp_buf[3];
/* Test if longjmp to JMPBUF would unwind the frame
containing a local variable at ADDRESS. */
-#define _JMPBUF_UNWINDS(jmpbuf, address) \
- ((int) (address) < (jmpbuf)[JB_SP])
+#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
+ ((int) (address) < demangle ((jmpbuf)[JB_SP]))
#endif
diff --git a/sysdeps/x86_64/bits/setjmp.h b/sysdeps/x86_64/bits/setjmp.h
index 96646efdda..1031d5027b 100644
--- a/sysdeps/x86_64/bits/setjmp.h
+++ b/sysdeps/x86_64/bits/setjmp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2002, 2003, 2005 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
@@ -67,11 +67,11 @@ typedef int __jmp_buf[6];
/* Test if longjmp to JMPBUF would unwind the frame
containing a local variable at ADDRESS. */
# if __WORDSIZE == 64
-# define _JMPBUF_UNWINDS(jmpbuf, address) \
- ((void *) (address) < (void *) (jmpbuf)[JB_RSP])
+# define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
+ ((void *) (address) < (void *) demangle ((jmpbuf)[JB_RSP]))
# else
-# define _JMPBUF_UNWINDS(jmpbuf, address) \
- ((void *) (address) < (void *) (jmpbuf)[JB_SP])
+# define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
+ ((void *) (address) < (void *) demangle ((jmpbuf)[JB_SP]))
# endif
#endif