/* Includes */
-#include <bits/libc-lock.h> /* for _LIBC_TSD_KEY_N */
+#include <bits/libc-tsd.h> /* for _LIBC_TSD_KEY_N */
+#include <limits.h>
#include <setjmp.h>
#include <signal.h>
#include <unistd.h>
#include "pt-machine.h"
+#ifndef THREAD_GETMEM
+# define THREAD_GETMEM(descr, member) descr->member
+#endif
+#ifndef THREAD_GETMEM_NC
+# define THREAD_GETMEM_NC(descr, member) descr->member
+#endif
+#ifndef THREAD_SETMEM
+# define THREAD_SETMEM(descr, member, value) descr->member = (value)
+#endif
+#ifndef THREAD_SETMEM_NC
+# define THREAD_SETMEM_NC(descr, member, value) descr->member = (value)
+#endif
+
/* Arguments passed to thread creation routine */
struct pthread_start_args {
int p_userstack; /* nonzero if the user provided the stack */
void *p_guardaddr; /* address of guard area or NULL */
size_t p_guardsize; /* size of guard area */
+ pthread_descr p_self; /* Pointer to this structure */
+ int p_nr; /* Index of descriptor in __pthread_handles */
};
/* The type of thread handles. */
/* Signals used for suspend/restart and for cancellation notification. */
-#ifdef SIGRTMIN
-/* The have real-time signals. */
extern int __pthread_sig_restart;
extern int __pthread_sig_cancel;
-# define PTHREAD_SIG_RESTART __pthread_sig_restart
-# define PTHREAD_SIG_CANCEL __pthread_sig_cancel
-#else
-# define PTHREAD_SIG_RESTART SIGUSR1
-# define PTHREAD_SIG_CANCEL SIGUSR2
-#endif
+
+/* Default signals used if we don't have realtime signals */
+
+#define DEFAULT_SIG_RESTART SIGUSR1
+#define DEFAULT_SIG_CANCEL SIGUSR2
/* Global array of thread handles, used for validating a thread id
and retrieving the corresponding thread descriptor. Also used for