]> xenbits.xensource.com Git - people/liuw/freebsd.git/commitdiff
Add support for binding IRQs to CPUs in the LinuxKPI. The new function
authorhselasky <hselasky@FreeBSD.org>
Mon, 26 Oct 2015 13:28:34 +0000 (13:28 +0000)
committerhselasky <hselasky@FreeBSD.org>
Mon, 26 Oct 2015 13:28:34 +0000 (13:28 +0000)
added is for BSD only and does not exist in Linux.

MFC after: 1 week
Sponsored by: Mellanox Technologies

sys/ofed/include/linux/interrupt.h

index 26ad59205b829d643be4a626959e64ff26400b0c..4c0ad8087582eb2f09e68117190ee66494a42b3a 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (c) 2010 Isilon Systems, Inc.
  * Copyright (c) 2010 iX Systems, Inc.
  * Copyright (c) 2010 Panasas, Inc.
- * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd.
+ * Copyright (c) 2013-2015 Mellanox Technologies, Ltd.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -118,6 +118,23 @@ request_irq(unsigned int irq, irq_handler_t handler, unsigned long flags,
        return 0;
 }
 
+static inline int
+bind_irq_to_cpu(unsigned int irq, int cpu_id)
+{
+       struct irq_ent *irqe;
+       struct device *dev;
+
+       dev = _pci_find_irq_dev(irq);
+       if (dev == NULL)
+               return (-ENOENT);
+
+       irqe = _irq_ent(dev, irq);
+       if (irqe == NULL)
+               return (-ENOENT);
+
+       return (-bus_bind_intr(dev->bsddev, irqe->res, cpu_id));
+}
+
 static inline void
 free_irq(unsigned int irq, void *device)
 {