+void cfs_schedule_timeout_and_set_state(cfs_task_state_t state, int64_t timeout)
+{
+ cfs_waitlink_t l;
+ /* sleep(timeout) here instead? */
+ cfs_waitq_timedwait(&l, state, timeout);
+}
+
+void
+cfs_pause(cfs_duration_t d)
+{
+ struct timespec s;
+
+ cfs_duration_nsec(d, &s);
+ nanosleep(&s, NULL);
+}
+
+int cfs_need_resched(void)
+{
+ return 0;
+}
+
+void cfs_cond_resched(void)
+{
+}
+
+/*
+ * Timer
+ */
+
+void cfs_init_timer(cfs_timer_t *t)
+{
+ CFS_INIT_LIST_HEAD(&t->tl_list);
+}
+
+void cfs_timer_init(cfs_timer_t *l, cfs_timer_func_t *func, void *arg)
+{
+ CFS_INIT_LIST_HEAD(&l->tl_list);
+ l->function = func;
+ l->data = (ulong_ptr_t)arg;
+ return;
+}
+
+int cfs_timer_is_armed(cfs_timer_t *l)
+{
+ if (cfs_time_before(cfs_time_current(), l->expires))
+ return 1;
+ else
+ return 0;
+}
+
+void cfs_timer_arm(cfs_timer_t *l, cfs_time_t deadline)
+{
+ l->expires = deadline;
+}
+
+void cfs_timer_disarm(cfs_timer_t *l)
+{
+}
+cfs_time_t cfs_timer_deadline(cfs_timer_t *l)
+{
+ return l->expires;
+}
+
+