* 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 {};
#define taskqueue_start_threads(a, b, c, d, e) (1)
int taskqueue_enqueue(struct taskqueue *queue, struct task *task);
-/* We're already fast, no need for another ufnction! (sic) */
+/* We're already fast, no need for another function! */
#define taskqueue_enqueue_fast taskqueue_enqueue
#define TASK_INIT(str, dummy, func, arg) \
(str)->ta_func = func; \
/* 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);
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 */