From 602e4e433d3e7dbb03d4fd30a4720a02cdeca6aa Mon Sep 17 00:00:00 2001 From: "Bjoern A. Zeeb" Date: Mon, 24 May 2021 18:14:37 +0000 Subject: [PATCH] LinuxKPI: add irq_set_affinity_hint() Add an implementation for irq_set_affinity_hint() to linux/interrupt.h and include linux/hardirq.h for synchronize_irq() as needed by wireless drivers. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D30427 --- .../linuxkpi/common/include/linux/interrupt.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/interrupt.h b/sys/compat/linuxkpi/common/include/linux/interrupt.h index fc1241240b39..90994a2f2315 100644 --- a/sys/compat/linuxkpi/common/include/linux/interrupt.h +++ b/sys/compat/linuxkpi/common/include/linux/interrupt.h @@ -31,12 +31,15 @@ #ifndef _LINUX_INTERRUPT_H_ #define _LINUX_INTERRUPT_H_ +#include #include #include #include +#include #include #include +#include typedef irqreturn_t (*irq_handler_t)(int, void *); @@ -183,6 +186,19 @@ free_irq(unsigned int irq, void *device) kfree(irqe); } +static inline int +irq_set_affinity_hint(int vector, cpumask_t *mask) +{ + int error; + + if (mask != NULL) + error = intr_setaffinity(vector, CPU_WHICH_IRQ, mask); + else + error = intr_setaffinity(vector, CPU_WHICH_IRQ, cpuset_root); + + return (-error); +} + /* * LinuxKPI tasklet support */