return retval;
}
+
+int
+roc_bphy_intr_register(struct roc_bphy_irq_chip *irq_chip,
+ struct roc_bphy_intr *intr)
+{
+ roc_cpuset_t orig_cpuset, intr_cpuset;
+ int retval;
+ int ret;
+
+ if (!roc_bphy_intr_available(irq_chip, intr->irq_num))
+ return -ENOTSUP;
+
+ retval = pthread_getaffinity_np(pthread_self(), sizeof(orig_cpuset),
+ &orig_cpuset);
+ if (retval < 0) {
+ plt_err("Failed to get affinity mask");
+ return retval;
+ }
+
+ CPU_ZERO(&intr_cpuset);
+ CPU_SET(intr->cpu, &intr_cpuset);
+ retval = pthread_setaffinity_np(pthread_self(), sizeof(intr_cpuset),
+ &intr_cpuset);
+ if (retval < 0) {
+ plt_err("Failed to set affinity mask");
+ return retval;
+ }
+
+ ret = roc_bphy_irq_handler_set(irq_chip, intr->irq_num,
+ intr->intr_handler, intr->isr_data);
+
+ retval = pthread_setaffinity_np(pthread_self(), sizeof(orig_cpuset),
+ &orig_cpuset);
+ if (retval < 0)
+ plt_warn("Failed to restore affinity mask");
+
+ return ret;
+}
char *mz_name;
};
+struct roc_bphy_intr {
+ int irq_num;
+ void (*intr_handler)(int irq_num, void *isr_data);
+ void *isr_data;
+ int cpu;
+ /* stack for this interrupt, not supplied by a user */
+ uint8_t *sp;
+};
+
__roc_api struct roc_bphy_irq_chip *roc_bphy_intr_init(void);
__roc_api void roc_bphy_intr_fini(struct roc_bphy_irq_chip *irq_chip);
__roc_api void roc_bphy_irq_stack_remove(int cpu);
int irq_num);
__roc_api int roc_bphy_handler_clear(struct roc_bphy_irq_chip *chip,
int irq_num);
+__roc_api int roc_bphy_intr_register(struct roc_bphy_irq_chip *irq_chip,
+ struct roc_bphy_intr *intr);
#endif /* _ROC_BPHY_IRQ_ */