git: 602e4e433d3e - main - LinuxKPI: add irq_set_affinity_hint()

Bjoern A. Zeeb bz at FreeBSD.org
Tue May 25 18:15:09 UTC 2021


The branch main has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=602e4e433d3e7dbb03d4fd30a4720a02cdeca6aa

commit 602e4e433d3e7dbb03d4fd30a4720a02cdeca6aa
Author:     Bjoern A. Zeeb <bz at FreeBSD.org>
AuthorDate: 2021-05-24 18:14:37 +0000
Commit:     Bjoern A. Zeeb <bz at FreeBSD.org>
CommitDate: 2021-05-25 18:01:47 +0000

    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
---
 sys/compat/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 <linux/cpu.h>
 #include <linux/device.h>
 #include <linux/pci.h>
 #include <linux/irqreturn.h>
+#include <linux/hardirq.h>
 
 #include <sys/bus.h>
 #include <sys/rman.h>
+#include <sys/interrupt.h>
 
 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
  */


More information about the dev-commits-src-main mailing list