From 0863d4f506b44d5ea18a61e4e756a260f074f8d6 Mon Sep 17 00:00:00 2001 From: Jonathan Gray Date: Sat, 11 May 2019 14:39:14 +0000 Subject: move irq_work bits into irq_work header --- sys/dev/pci/drm/include/linux/irq_work.h | 49 +++++++++++++++++++++++++++++++ sys/dev/pci/drm/include/linux/workqueue.h | 22 +------------- 2 files changed, 50 insertions(+), 21 deletions(-) (limited to 'sys/dev/pci') diff --git a/sys/dev/pci/drm/include/linux/irq_work.h b/sys/dev/pci/drm/include/linux/irq_work.h index e69de29bb2d..5964cd99846 100644 --- a/sys/dev/pci/drm/include/linux/irq_work.h +++ b/sys/dev/pci/drm/include/linux/irq_work.h @@ -0,0 +1,49 @@ +/* $OpenBSD: irq_work.h,v 1.2 2019/05/11 14:39:13 jsg Exp $ */ +/* + * Copyright (c) 2015 Mark Kettenis + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _LINUX_IRQ_WORK_H +#define _LINUX_IRQ_WORK_H + +#include +#include +#include + +struct workqueue_struct; + +extern struct workqueue_struct *system_wq; + +struct irq_work { + struct task task; + struct taskq *tq; +}; + +typedef void (*irq_work_func_t)(struct irq_work *); + +static inline void +init_irq_work(struct irq_work *work, irq_work_func_t func) +{ + work->tq = (struct taskq *)system_wq; + task_set(&work->task, (void (*)(void *))func, work); +} + +static inline bool +irq_work_queue(struct irq_work *work) +{ + return task_add(work->tq, &work->task); +} + +#endif diff --git a/sys/dev/pci/drm/include/linux/workqueue.h b/sys/dev/pci/drm/include/linux/workqueue.h index 138ff8e7409..039a0ab9d2a 100644 --- a/sys/dev/pci/drm/include/linux/workqueue.h +++ b/sys/dev/pci/drm/include/linux/workqueue.h @@ -1,4 +1,4 @@ -/* $OpenBSD: workqueue.h,v 1.1 2019/04/14 10:14:53 jsg Exp $ */ +/* $OpenBSD: workqueue.h,v 1.2 2019/05/11 14:39:13 jsg Exp $ */ /* * Copyright (c) 2015 Mark Kettenis * @@ -103,26 +103,6 @@ struct delayed_work { struct taskq *tq; }; -struct irq_work { - struct task task; - struct taskq *tq; -}; - -typedef void (*irq_work_func_t)(struct irq_work *); - -static inline void -init_irq_work(struct irq_work *work, irq_work_func_t func) -{ - work->tq = (struct taskq *)system_wq; - task_set(&work->task, (void (*)(void *))func, work); -} - -static inline bool -irq_work_queue(struct irq_work *work) -{ - return task_add(work->tq, &work->task); -} - #define system_power_efficient_wq ((struct workqueue_struct *)systq) static inline struct delayed_work * -- cgit v1.2.3