sched: Add some helper functions.