Moved timing parameters into proc_global_info (XCC)
[akaros.git] / kern / include / taskqueue.h
index 7b84926..0d3613a 100644 (file)
@@ -17,8 +17,7 @@
  * aren't entirely clear.
  */
 
-#ifndef ROS_KERN_TASKQUEUE_H
-#define ROS_KERN_TASKQUEUE_H
+#pragma once
 
 typedef void (*task_fn_t)(void *context, int pending);
 struct taskqueue {};
@@ -56,6 +55,11 @@ struct delayed_work {
        /* TODO: support for the actual alarm / timer */
 };
 
+static inline struct delayed_work *to_delayed_work(struct work_struct *work)
+{
+       return container_of(work, struct delayed_work, work);
+}
+
 #define INIT_DELAYED_WORK(dwp, funcp) (dwp)->work.func = (funcp)
 #define INIT_WORK(wp, funcp) (wp)->func = (funcp)
 void flush_workqueue(struct workqueue_struct *wq);
@@ -72,5 +76,3 @@ bool queue_delayed_work(struct workqueue_struct *wq, struct delayed_work *dwork,
 bool schedule_delayed_work(struct delayed_work *dwork, unsigned long delay);
 bool cancel_delayed_work(struct delayed_work *dwork);
 bool cancel_delayed_work_sync(struct delayed_work *dwork);
-
-#endif /* ROS_KERN_TASKQUEUE_H */