| #define _BSD_SOURCE |
| |
| #include <unistd.h> |
| #include "psxglue.h" |
| #include "pthread_impl.h" |
| |
| extern const struct __ldso_vtbl * __ldso_vtbl; |
| extern const struct __psx_vtbl * __psx_vtbl; |
| |
| void *__copy_tls(unsigned char * mem) |
| { |
| |
| |
| |
| |
| |
| |
| pthread_t td; |
| uintptr_t addr; |
| |
| addr = (uintptr_t)mem; |
| addr += 0xf; |
| addr |= 0xf; |
| addr ^= 0xf; |
| |
| td = (struct __pthread *)addr; |
| td->dtv = 0; |
| |
| return td; |
| } |