18#include <drivers/core/dm.h>
78#define RT_IRQ_STATE_PENDING 0
79#define RT_IRQ_STATE_ACTIVE 1
80#define RT_IRQ_STATE_MASKED 2
87#define RT_PIC_F_IRQ_ROUTING RT_BIT(0)
95#define RT_IRQ_F_NONE 0
100#define RT_IRQ_AFFINITY_DECLARE(name) RT_BITMAP_DECLARE(name, RT_CPUS_NR)
101#define RT_IRQ_AFFINITY_SET(affinity, cpuid) rt_bitmap_set_bit(affinity, cpuid)
102#define RT_IRQ_AFFINITY_CLEAR(affinity, cpuid) rt_bitmap_clear_bit(affinity, cpuid)
104#ifdef RT_USING_PIC_STATISTICS
105struct rt_pic_irq_statistics
118#define RT_IRQ_MODE_NONE 0
119#define RT_IRQ_MODE_EDGE_RISING 1
120#define RT_IRQ_MODE_EDGE_FALLING 2
121#define RT_IRQ_MODE_EDGE_BOTH (RT_IRQ_MODE_EDGE_FALLING | RT_IRQ_MODE_EDGE_RISING)
122#define RT_IRQ_MODE_LEVEL_HIGH 4
123#define RT_IRQ_MODE_LEVEL_LOW 8
124#define RT_IRQ_MODE_LEVEL_MASK (RT_IRQ_MODE_LEVEL_LOW | RT_IRQ_MODE_LEVEL_HIGH)
125#define RT_IRQ_MODE_MASK 0xf
142#ifdef RT_USING_PIC_STATISTICS
143 struct rt_pic_irq_statistics
stat;
213#define RT_PIC_OFW_DECLARE(name, ids, handler) RT_OFW_STUB_EXPORT(name, ids, pic, handler)
int stat(const char *file, struct stat *buf)
rt_err_t rt_pic_irq_get_affinity(int irq, rt_bitmap_t *out_affinity)
rt_err_t rt_pic_irq_parent_set_triger_mode(struct rt_pic_irq *pirq, rt_uint32_t mode)
int rt_pic_config_ipi(struct rt_pic *pic, int ipi_index, int hwirq)
void rt_pic_irq_send_ipi(int irq, rt_bitmap_t *cpumask)
rt_err_t rt_pic_irq_parent_set_affinity(struct rt_pic_irq *pirq, rt_bitmap_t *affinity)
rt_err_t rt_pic_irq_set_affinity(int irq, rt_bitmap_t *affinity)
void rt_pic_default_name(struct rt_pic *pic)
rt_err_t rt_pic_irq_set_state(int irq, int type, rt_bool_t state)
rt_err_t rt_pic_irq_set_triger_mode(int irq, rt_uint32_t mode)
struct rt_pic_irq * rt_pic_find_ipi(struct rt_pic *pic, int ipi_index)
rt_err_t rt_pic_attach_irq(int irq, rt_isr_handler_t handler, void *uid, const char *name, int flags)
rt_err_t rt_pic_cascade(struct rt_pic_irq *pirq, int parent_irq)
void rt_pic_irq_parent_enable(struct rt_pic_irq *pirq)
rt_err_t rt_pic_add_traps(rt_bool_t(*handler)(void *), void *data)
void rt_pic_irq_enable(int irq)
rt_err_t rt_pic_init(void)
rt_err_t rt_pic_irq_set_state_raw(struct rt_pic *pic, int hwirq, int type, rt_bool_t state)
rt_err_t rt_pic_irq_get_state_raw(struct rt_pic *pic, int hwirq, int type, rt_bool_t *out_state)
void rt_pic_irq_mask(int irq)
void rt_pic_irq_eoi(int irq)
rt_err_t rt_pic_uncascade(struct rt_pic_irq *pirq)
rt_err_t rt_pic_cancel_irq(struct rt_pic *pic)
void rt_pic_irq_parent_eoi(struct rt_pic_irq *pirq)
rt_err_t rt_pic_user_extends(struct rt_pic *pic)
rt_err_t rt_pic_irq_get_state(int irq, int type, rt_bool_t *out_state)
rt_err_t rt_pic_irq_finit(void)
void rt_pic_irq_parent_ack(struct rt_pic_irq *pirq)
struct rt_pic_irq * rt_pic_find_pirq(struct rt_pic *pic, int irq)
void rt_pic_irq_ack(int irq)
rt_err_t rt_pic_linear_irq(struct rt_pic *pic, rt_size_t irq_nr)
rt_err_t rt_pic_irq_set_priority(int irq, rt_uint32_t priority)
int rt_pic_config_irq(struct rt_pic *pic, int irq_index, int hwirq)
rt_err_t rt_pic_irq_parent_set_priority(struct rt_pic_irq *pirq, rt_uint32_t priority)
void rt_pic_irq_parent_mask(struct rt_pic_irq *pirq)
void rt_pic_irq_disable(int irq)
rt_uint32_t rt_pic_irq_get_priority(int irq)
struct rt_pic * rt_pic_dynamic_cast(void *ptr)
rt_err_t rt_pic_do_traps(void)
rt_uint32_t rt_pic_irq_get_triger_mode(int irq)
rt_err_t rt_pic_irq_init(void)
void rt_pic_irq_parent_unmask(struct rt_pic_irq *pirq)
rt_err_t rt_pic_handle_isr(struct rt_pic_irq *pirq)
void rt_pic_irq_parent_disable(struct rt_pic_irq *pirq)
rt_inline struct rt_pic_irq * rt_pic_find_irq(struct rt_pic *pic, int irq_index)
rt_err_t rt_pic_detach_irq(int irq, void *uid)
void rt_pic_irq_unmask(int irq)
void(* rt_isr_handler_t)(int vector, void *param)
struct rt_list_node rt_list_t
RT_IRQ_AFFINITY_DECLARE(affinity)
struct rt_pic_irq * parent
struct rt_pci_msi_desc * msi_desc
struct rt_spinlock rw_lock
struct rt_irq_desc action
rt_err_t(* irq_set_priority)(struct rt_pic_irq *pirq, rt_uint32_t priority)
void(* irq_free_msi)(struct rt_pic *pic, int irq)
rt_err_t(* irq_finit)(struct rt_pic *pic)
void(* irq_disable)(struct rt_pic_irq *pirq)
rt_err_t(* irq_parse)(struct rt_pic *pic, struct rt_ofw_cell_args *args, struct rt_pic_irq *out_pirq)
int(* irq_map)(struct rt_pic *pic, int hwirq, rt_uint32_t mode)
void(* irq_eoi)(struct rt_pic_irq *pirq)
void(* irq_compose_msi_msg)(struct rt_pic_irq *pirq, struct rt_pci_msi_msg *msg)
void(* irq_enable)(struct rt_pic_irq *pirq)
void(* irq_unmask)(struct rt_pic_irq *pirq)
rt_err_t(* irq_set_affinity)(struct rt_pic_irq *pirq, rt_bitmap_t *affinity)
void(* irq_send_ipi)(struct rt_pic_irq *pirq, rt_bitmap_t *cpumask)
rt_err_t(* irq_set_triger_mode)(struct rt_pic_irq *pirq, rt_uint32_t mode)
void(* irq_ack)(struct rt_pic_irq *pirq)
rt_err_t(* irq_set_state)(struct rt_pic *pic, int hwirq, int type, rt_bool_t state)
rt_err_t(* irq_get_state)(struct rt_pic *pic, int hwirq, int type, rt_bool_t *out_state)
void(* irq_write_msi_msg)(struct rt_pic_irq *pirq, struct rt_pci_msi_msg *msg)
void(* irq_mask)(struct rt_pic_irq *pirq)
int(* irq_alloc_msi)(struct rt_pic *pic, struct rt_pci_msi_desc *msi_desc)
rt_err_t(* irq_init)(struct rt_pic *pic)
const struct rt_pic_ops * ops
struct rt_pic_irq * pirqs