2016-06-19 19:23:19 +02:00
|
|
|
/** AXI-PCIe Interrupt controller
|
|
|
|
*
|
|
|
|
* @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
|
2017-03-03 20:20:13 -04:00
|
|
|
* @copyright 2017, Steffen Vogel
|
2016-06-19 19:23:19 +02:00
|
|
|
**********************************************************************************/
|
|
|
|
|
2017-03-12 17:13:37 -03:00
|
|
|
/** @addtogroup fpga VILLASfpga
|
|
|
|
* @{
|
|
|
|
*/
|
2017-03-03 20:20:13 -04:00
|
|
|
|
2017-02-18 10:43:58 -05:00
|
|
|
#pragma once
|
2016-06-19 19:23:19 +02:00
|
|
|
|
2016-06-26 15:22:25 +02:00
|
|
|
#include <xilinx/xintc.h>
|
|
|
|
|
2016-07-08 13:32:18 +02:00
|
|
|
enum intc_flags {
|
|
|
|
INTC_ENABLED = (1 << 0),
|
|
|
|
INTC_POLLING = (1 << 1)
|
|
|
|
};
|
|
|
|
|
|
|
|
struct intc {
|
|
|
|
int num_irqs; /**< Number of available MSI vectors */
|
|
|
|
|
|
|
|
int efds[32]; /**< Event FDs */
|
|
|
|
int nos[32]; /**< Interrupt numbers from /proc/interrupts */
|
2017-05-05 19:24:16 +00:00
|
|
|
|
2016-07-08 13:32:18 +02:00
|
|
|
int flags[32]; /**< Mask of intc_flags */
|
|
|
|
};
|
|
|
|
|
2017-02-18 10:43:58 -05:00
|
|
|
int intc_init(struct fpga_ip *c);
|
2016-06-19 19:23:19 +02:00
|
|
|
|
2017-02-18 10:43:58 -05:00
|
|
|
int intc_destroy(struct fpga_ip *c);
|
2016-07-08 13:32:18 +02:00
|
|
|
|
2017-02-18 10:43:58 -05:00
|
|
|
int intc_enable(struct fpga_ip *c, uint32_t mask, int poll);
|
2016-06-19 19:23:19 +02:00
|
|
|
|
2017-02-18 10:43:58 -05:00
|
|
|
int intc_disable(struct fpga_ip *c, uint32_t mask);
|
2016-06-19 19:23:19 +02:00
|
|
|
|
2017-02-18 10:43:58 -05:00
|
|
|
uint64_t intc_wait(struct fpga_ip *c, int irq);
|
2016-06-19 19:23:19 +02:00
|
|
|
|
2017-02-18 10:43:58 -05:00
|
|
|
/** @} */
|