From 7075fb1134b61f029e77b1428d7de4bb5631369b Mon Sep 17 00:00:00 2001 From: Daniel Hellstrom Date: Fri, 7 Apr 2017 08:30:46 +0200 Subject: drvmgr: ability to configure IRQ affinity --- cpukit/libdrvmgr/drvmgr.h | 20 ++++++++++++++++++++ cpukit/libdrvmgr/drvmgr_drvinf.c | 13 +++++++++++++ 2 files changed, 33 insertions(+) diff --git a/cpukit/libdrvmgr/drvmgr.h b/cpukit/libdrvmgr/drvmgr.h index 194de663b8..a8e1c8c311 100644 --- a/cpukit/libdrvmgr/drvmgr.h +++ b/cpukit/libdrvmgr/drvmgr.h @@ -14,6 +14,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { @@ -137,6 +138,10 @@ struct drvmgr_bus_ops { int (*int_clear)(struct drvmgr_dev *, int index); int (*int_mask)(struct drvmgr_dev *, int index); int (*int_unmask)(struct drvmgr_dev *, int index); +#ifdef RTEMS_SMP + int (*int_set_affinity)(struct drvmgr_dev *, int index, + Processor_mask cpus); +#endif /* Get Parameters */ int (*get_params)(struct drvmgr_dev *, struct drvmgr_bus_params *); @@ -628,6 +633,21 @@ extern int drvmgr_interrupt_mask( struct drvmgr_dev *dev, int index); +/*! Force masking/disable an interrupt on the interrupt controller, this is not normally performed + * since this will stop all other (shared) ISRs to be disabled until _unmask() is called. + * + * \param dev Device to mask interrupt for. + * \param index Index is used to identify the IRQ number if hardware has multiple IRQ sources. + * Normally Index is set to 0 to indicated the first and only IRQ source. + * A negative index is interpreted as a absolute bus IRQ number. + */ +#ifdef RTEMS_SMP +extern int drvmgr_interrupt_set_affinity( + struct drvmgr_dev *dev, + int index, + Processor_mask cpus); +#endif + /*! drvmgr_translate() translation options */ enum drvmgr_tr_opts { /* Translate CPU RAM Address (input) to DMA unit accessible address diff --git a/cpukit/libdrvmgr/drvmgr_drvinf.c b/cpukit/libdrvmgr/drvmgr_drvinf.c index e0cd50d33c..5bb6e6edbf 100644 --- a/cpukit/libdrvmgr/drvmgr_drvinf.c +++ b/cpukit/libdrvmgr/drvmgr_drvinf.c @@ -138,6 +138,19 @@ int drvmgr_interrupt_mask( return dev->parent->ops->int_mask(dev, index); } +#ifdef RTEMS_SMP +int drvmgr_interrupt_set_affinity( + struct drvmgr_dev *dev, + int index, + Processor_mask cpus) +{ + if (!dev || !dev->parent || !dev->parent->ops->int_set_affinity) + return -1; + + return dev->parent->ops->int_set_affinity(dev, index, cpus); +} +#endif + int drvmgr_on_rootbus(struct drvmgr_dev *dev) { if (dev->parent && dev->parent->dev && dev->parent->dev->parent) -- cgit v1.2.3