Context *on_interrupt(Event ev, Context *ctx) { current->context = *ctx; // Can return any valid Context* current = schedule(); return ¤t->context; }