about summary refs log tree commit diff
path: root/arch
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-03-25 22:13:57 -0400
committerRich Felker <dalias@aerifal.cx>2011-03-25 22:13:57 -0400
commitea343364a719add2cd8adf8a50c15bb5f9400dd8 (patch)
tree36056bd0bd1c4c49118b6b3366db6432f7c80fc1 /arch
parent92b52b70e8c0786c95cb73a691e1f6e89a73be46 (diff)
downloadmusl-ea343364a719add2cd8adf8a50c15bb5f9400dd8.tar.gz
musl-ea343364a719add2cd8adf8a50c15bb5f9400dd8.tar.xz
musl-ea343364a719add2cd8adf8a50c15bb5f9400dd8.zip
match glibc/lsb cancellation abi on i386
glibc made the ridiculous choice to use pass-by-register calling
convention for these functions, which is impossible to duplicate
directly on non-gcc compilers. instead, we use ugly asm to wrap and
convert the calling convention. presumably this works with every
compiler anyone could potentially want to use.
Diffstat (limited to 'arch')
-rw-r--r--arch/i386/bits/pthread.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/i386/bits/pthread.h b/arch/i386/bits/pthread.h
index 7d19065d..7690ea39 100644
--- a/arch/i386/bits/pthread.h
+++ b/arch/i386/bits/pthread.h
@@ -4,3 +4,22 @@ struct __ptcb {
 	struct __ptcb *__next;
 	void *__ptrs[3];
 };
+
+static inline void __pthread_register_cancel_2(struct __ptcb *__cb)
+{
+	__asm__ __volatile__( "call __pthread_register_cancel" : : "a"(__cb) );
+}
+
+static inline void __pthread_unregister_cancel_2(struct __ptcb *__cb)
+{
+	__asm__ __volatile__( "call __pthread_unregister_cancel" : : "a"(__cb) );
+}
+
+static inline void __pthread_unwind_next_2(struct __ptcb *__cb)
+{
+	__asm__ __volatile__( "call __pthread_unwind_next" : : "a"(__cb) );
+}
+
+#define __pthread_register_cancel __pthread_register_cancel_2
+#define __pthread_unregister_cancel __pthread_unregister_cancel_2
+#define __pthread_unwind_next __pthread_unwind_next_2