Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linuxkpi/common/include/linux/irq_work.h
Show All 25 Lines | |||||
* SUCH DAMAGE. | * SUCH DAMAGE. | ||||
* | * | ||||
* $FreeBSD$ | * $FreeBSD$ | ||||
*/ | */ | ||||
#ifndef __LINUX_IRQ_WORK_H__ | #ifndef __LINUX_IRQ_WORK_H__ | ||||
#define __LINUX_IRQ_WORK_H__ | #define __LINUX_IRQ_WORK_H__ | ||||
#include <linux/workqueue.h> | #include <sys/param.h> | ||||
#include <sys/taskqueue.h> | |||||
struct irq_work; | |||||
typedef void (*irq_work_func_t)(struct irq_work *); | |||||
struct irq_work { | struct irq_work { | ||||
struct work_struct work; | struct task irq_task; | ||||
irq_work_func_t func; | |||||
}; | }; | ||||
static inline void | #define DEFINE_IRQ_WORK(name, _func) struct irq_work name = { \ | ||||
init_irq_work(struct irq_work *irqw, void (*func)(struct irq_work *)) | .irq_task = TASK_INITIALIZER(0, linux_irq_work_fn, &(name)), \ | ||||
{ | .func = (_func), \ | ||||
INIT_WORK(&irqw->work, (work_func_t)func); | |||||
} | } | ||||
void linux_irq_work_fn(void *, int); | |||||
static inline void | static inline void | ||||
irq_work_queue(struct irq_work *irqw) | init_irq_work(struct irq_work *irqw, irq_work_func_t func) | ||||
{ | { | ||||
schedule_work(&irqw->work); | TASK_INIT(&irqw->irq_task, 0, linux_irq_work_fn, irqw); | ||||
irqw->func = func; | |||||
} | } | ||||
#define irq_work_queue(irqw) linux_irq_work_queue(irqw) | |||||
void linux_irq_work_queue(struct irq_work *); | |||||
#endif /* __LINUX_IRQ_WORK_H__ */ | #endif /* __LINUX_IRQ_WORK_H__ */ |