mirror of
git://git.musl-libc.org/musl
synced 2024-12-24 07:32:49 +00:00
ea343364a7
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.
26 lines
707 B
C
26 lines
707 B
C
struct __ptcb {
|
|
long __jb[7];
|
|
int __dummy;
|
|
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
|