int cacao_suspendhandler(void *);
-void GC_suspend_handler(int sig)
+void GC_suspend_handler(int sig, siginfo_t *info, void *uctx)
{
- void **_p = (void *) &sig;
int dummy;
pthread_t my_thread = pthread_self();
GC_thread me;
if (sig != SIG_SUSPEND) ABORT("Bad signal in suspend_handler");
- if (cacao_suspendhandler(++_p))
+ if (cacao_suspendhandler(uctx))
return;
#if DEBUG_THREADS
if (sem_init(&GC_suspend_ack_sem, 0, 0) != 0)
ABORT("sem_init failed");
- act.sa_flags = SA_RESTART;
+ act.sa_flags = SA_RESTART | SA_SIGINFO;
if (sigfillset(&act.sa_mask) != 0) {
ABORT("sigfillset() failed");
}
{
return SIG_THR_RESTART;
}
-
/* cacao END */
#endif
int cacao_suspendhandler(void *);
-void GC_suspend_handler(int sig)
+void GC_suspend_handler(int sig, siginfo_t *info, void *uctx)
{
- void **_p = (void *) &sig;
int dummy;
pthread_t my_thread = pthread_self();
GC_thread me;
if (sig != SIG_SUSPEND) ABORT("Bad signal in suspend_handler");
- if (cacao_suspendhandler(++_p))
+ if (cacao_suspendhandler(uctx))
return;
#if DEBUG_THREADS
if (sem_init(&GC_suspend_ack_sem, 0, 0) != 0)
ABORT("sem_init failed");
- act.sa_flags = SA_RESTART;
+ act.sa_flags = SA_RESTART | SA_SIGINFO;
if (sigfillset(&act.sa_mask) != 0) {
ABORT("sigfillset() failed");
}
{
return SIG_THR_RESTART;
}
-
/* cacao END */
#endif
unlock_stopworld();
}
-static void sigsuspend_handler(struct sigcontext *ctx)
+static void sigsuspend_handler(ucontext_t *ctx)
{
int sig;
sigset_t sigs;
void *critical;
#ifdef __I386__
- if ((critical = thread_checkcritical((void*) ctx->eip)) != NULL)
- ctx->eip = (long) critical;
+ if ((critical = thread_checkcritical((void*) ctx->uc_mcontext.gregs[REG_EIP])) != NULL)
+ ctx->uc_mcontext.gregs[REG_EIP] = (long) critical;
#endif
sem_post(&suspend_ack);
sigsuspend(&sigs);
}
-int cacao_suspendhandler(struct sigcontext *ctx)
+int cacao_suspendhandler(ucontext_t *ctx)
{
if (stopworldwhere != 2)
return 0;
unlock_stopworld();
}
-static void sigsuspend_handler(struct sigcontext *ctx)
+static void sigsuspend_handler(ucontext_t *ctx)
{
int sig;
sigset_t sigs;
void *critical;
#ifdef __I386__
- if ((critical = thread_checkcritical((void*) ctx->eip)) != NULL)
- ctx->eip = (long) critical;
+ if ((critical = thread_checkcritical((void*) ctx->uc_mcontext.gregs[REG_EIP])) != NULL)
+ ctx->uc_mcontext.gregs[REG_EIP] = (long) critical;
#endif
sem_post(&suspend_ack);
sigsuspend(&sigs);
}
-int cacao_suspendhandler(struct sigcontext *ctx)
+int cacao_suspendhandler(ucontext_t *ctx)
{
if (stopworldwhere != 2)
return 0;