Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linuxkpi/common/include/linux/interrupt.h
Show All 25 Lines | |||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||
* | * | ||||
* $FreeBSD$ | * $FreeBSD$ | ||||
*/ | */ | ||||
#ifndef _LINUX_INTERRUPT_H_ | #ifndef _LINUX_INTERRUPT_H_ | ||||
#define _LINUX_INTERRUPT_H_ | #define _LINUX_INTERRUPT_H_ | ||||
#include <linux/cpu.h> | |||||
#include <linux/device.h> | #include <linux/device.h> | ||||
#include <linux/pci.h> | #include <linux/pci.h> | ||||
#include <linux/irqreturn.h> | #include <linux/irqreturn.h> | ||||
#include <linux/hardirq.h> | |||||
#include <sys/bus.h> | #include <sys/bus.h> | ||||
#include <sys/rman.h> | #include <sys/rman.h> | ||||
#include <sys/interrupt.h> | |||||
typedef irqreturn_t (*irq_handler_t)(int, void *); | typedef irqreturn_t (*irq_handler_t)(int, void *); | ||||
bz: This is also defined in irqreturn but differently. Sigh. | |||||
#define IRQF_SHARED RF_SHAREABLE | #define IRQF_SHARED RF_SHAREABLE | ||||
struct irq_ent { | struct irq_ent { | ||||
struct list_head links; | struct list_head links; | ||||
struct device *dev; | struct device *dev; | ||||
struct resource *res; | struct resource *res; | ||||
void *arg; | void *arg; | ||||
▲ Show 20 Lines • Show All 126 Lines • ▼ Show 20 Lines | free_irq(unsigned int irq, void *device) | ||||
irqe = linux_irq_ent(dev, irq); | irqe = linux_irq_ent(dev, irq); | ||||
if (irqe == NULL) | if (irqe == NULL) | ||||
return; | return; | ||||
if (irqe->tag != NULL) | if (irqe->tag != NULL) | ||||
bus_teardown_intr(dev->bsddev, irqe->res, irqe->tag); | bus_teardown_intr(dev->bsddev, irqe->res, irqe->tag); | ||||
bus_release_resource(dev->bsddev, SYS_RES_IRQ, rid, irqe->res); | bus_release_resource(dev->bsddev, SYS_RES_IRQ, rid, irqe->res); | ||||
list_del(&irqe->links); | list_del(&irqe->links); | ||||
kfree(irqe); | 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); | |||||
} | } | ||||
/* | /* | ||||
Done Inline ActionsSynchronize IRQ is already defined here: Please resolve! hselasky: Synchronize IRQ is already defined here:
sys/compat/linuxkpi/common/include/linux/hardirq.h… | |||||
Done Inline ActionsSeems we can just include linux/hardirq.h here. bz: Seems we can just include linux/hardirq.h here. | |||||
* LinuxKPI tasklet support | * LinuxKPI tasklet support | ||||
*/ | */ | ||||
typedef void tasklet_func_t(unsigned long); | typedef void tasklet_func_t(unsigned long); | ||||
struct tasklet_struct { | struct tasklet_struct { | ||||
TAILQ_ENTRY(tasklet_struct) entry; | TAILQ_ENTRY(tasklet_struct) entry; | ||||
tasklet_func_t *func; | tasklet_func_t *func; | ||||
/* Our "state" implementation is different. Avoid same name as Linux. */ | /* Our "state" implementation is different. Avoid same name as Linux. */ | ||||
Show All 22 Lines |
This is also defined in irqreturn but differently. Sigh.