I think cpu_restore_next can't be called inside port.c -> sched_process_pending_events. Should I move it out or conditionalize it.