+
+// =======================================================================
+
+// invoked when a limited time quantum (cmp_time) is exceeded
+Thread_CPU_budget_algorithm_callout edf_budget_overrun_callout() {
+ printf(" overrun %d \n", _Watchdog_Ticks_since_boot);
+ Thread_Control *the_thread = _Per_CPU_Information.executing;
+ RBT_Node *node = (RBT_Node*)the_thread->scheduler_info;
+ rtems_signal_send(the_thread->Object.id, RTEMS_SIGNAL_15);
+ _Thread_Suspend (the_thread);
+ /*TODO: the thread gets suspended forever, so it is not released in the next period again,
+ * but does not even service the registered signal. Try to disable _Thread_Suspend, the signal
+ * is serviced but the thread just continues.
+ */
+ uint32_t ticks = node->abs_deadline - _Watchdog_Ticks_since_boot; //FIXME: wrong calc?
+ rtems_timer_fire_after(node->timer_id, ticks, (void *) edf_budget_overrun_reenable, the_thread);
+ return 0;
+}
+
+rtems_timer_service_routine_entry edf_budget_overrun_reenable(Thread_Control *the_thread) {
+ _Thread_Resume(the_thread, false);
+ printf(" Come back %d\n", _Watchdog_Ticks_since_boot);
+ return 0;
+}