yyg-cn

导航

硬件中断号到软件中断号的映射

 
Linux中每一个产生的中断都会使用一个irq_desc结构体来描述。
struct irq_desc {
        struct irq_common_data        irq_common_data;
        struct irq_data                irq_data;
        unsigned int __percpu        *kstat_irqs;
        irq_flow_handler_t        handle_irq;
        struct irqaction        *action;        /* IRQ action list *
        .........
}

  

struct irq_data {
        u32                        mask;
        unsigned int                irq;
        unsigned long                hwirq;
        struct irq_common_data        *common;
        struct irq_chip                *chip;
        struct irq_domain        *domain;
        void                        *chip_data;
};

irq:软件中断号

hwirq:硬件中断号

irq_chip:代表的是对硬件中断器的操作

irq_domain是一个中断控制器的抽象描述,主要任务是完成硬件中断号到Linux软件中断号的映射。
struct irq_domain {
        struct list_head link;
        const char *name;
        const struct irq_domain_ops *ops;  //实现硬件中断号到软件中断号的映射
        void *host_data;
        unsigned int flags;
        unsigned int mapcount;

        /* Optional data */
        struct fwnode_handle *fwnode;
        enum irq_domain_bus_token bus_token;
        struct irq_domain_chip_generic *gc;

        /* reverse map data. The linear map gets appended to the irq_domain */
        irq_hw_number_t hwirq_max;
        unsigned int revmap_direct_max_irq;
        unsigned int revmap_size;
        struct radix_tree_root revmap_tree;
        unsigned int linear_revmap[];
};

  

posted on 2023-02-28 19:39  干饭的鸭鸭怪  阅读(73)  评论(0编辑  收藏  举报