extern void smp_gc_finish (void);
extern void smp_kill_gc (processor_t *);
+extern void smp_kill_timer (processor_t *);
#ifdef ENABLE_DEBUGGING_TOOLS
#endif
}
+DEFINE_PRIMITIVE ("SMP-WAKE", Prim_smp_wake, 1, 1, "(SMP-WAKE id)\n\
+Send a timer interrupt to processor ID.")
+{
+ PRIMITIVE_HEADER (0);
+
+#ifdef ENABLE_SMP
+ {
+ int id = arg_integer (1);
+ trace (";%d SMP-Wake %d.", self->id, id);
+ for (processor_t *p = processors; p != NULL; p = p->next)
+ if (p->id == id)
+ {
+ smp_kill_timer (p);
+ PRIMITIVE_RETURN (UNSPECIFIC);
+ }
+ outf_error_line (";%d smp-wake: bogus processor id %d", self->id, id);
+ }
+#else
+ signal_error_from_primitive (ERR_UNIMPLEMENTED_PRIMITIVE);
+#endif
+ PRIMITIVE_RETURN (UNSPECIFIC);
+}
+
DEFINE_PRIMITIVE ("SMP-GC-WAIT", Prim_smp_gc_wait, 0, 0, "(SMP-GC-WAIT)\n\
Put the current processor in the GC-WAIT state.\n\
Called by the global-gc interrupt handler.")
pthread_kill (p->pthread, SIGUSR2);
}
+void
+smp_kill_timer (processor_t *p)
+{
+ pthread_kill (p->pthread, SIGALRM);
+}
+
#endif /* ENABLE_SMP */
/* The following conditionalization would more naturally be expressed