From 79d428d334c03eaa7a572d683e39cafc08f0b6d6 Mon Sep 17 00:00:00 2001 From: sisyphus12 <1258407709@qq.com> Date: Fri, 22 Nov 2024 23:01:37 +0800 Subject: [PATCH] Update submodules --- ...60\346\215\256\347\273\223\346\236\204.md" | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git "a/linux/\345\206\205\346\240\270-\351\251\261\345\212\250/\344\270\255\346\226\255/\347\241\254\344\270\255\346\226\255--\346\225\260\346\215\256\347\273\223\346\236\204.md" "b/linux/\345\206\205\346\240\270-\351\251\261\345\212\250/\344\270\255\346\226\255/\347\241\254\344\270\255\346\226\255--\346\225\260\346\215\256\347\273\223\346\236\204.md" index 2785c17..73a3cea 100755 --- "a/linux/\345\206\205\346\240\270-\351\251\261\345\212\250/\344\270\255\346\226\255/\347\241\254\344\270\255\346\226\255--\346\225\260\346\215\256\347\273\223\346\236\204.md" +++ "b/linux/\345\206\205\346\240\270-\351\251\261\345\212\250/\344\270\255\346\226\255/\347\241\254\344\270\255\346\226\255--\346\225\260\346\215\256\347\273\223\346\236\204.md" @@ -104,6 +104,56 @@ struct irq_chip { unsigned long flags; }; + +/** + * struct irq_domain_ops - Methods for irq_domain objects + * @match: Match an interrupt controller device node to a host, returns + * 1 on a match + * match是判断一个指定的 interrupt controller(node 参数)是否和一个irq domain 匹配(d 参数), + * 如果匹配的话, 返回 1. 实际上, 内核中很少定义这个 callback 函数(!!!), + * 实际上struct irq_domain中有一个of_node指向了对应的 interrupt controller的device node, + * 因此, 如果不提供该函数, 那么default 的匹配函数其实就是判断 irq domain的of_node 成员是否等于传入的node 参数. + * + * @map: Create or update a mapping between a virtual irq number and a hw + * irq number. This is called only once for a given mapping. + * @unmap: Dispose of such a mapping + * @xlate: Given a device tree node and interrupt specifier, decode + * the hardware irq number and linux irq type value. + * + * Functions below are provided by the driver and called whenever a new mapping + * is created or an old mapping is disposed. The driver can then proceed to + * whatever internal data structures management is required. It also needs + * to setup the irq_desc when returning from map(). + * + *在 __irq_domain_add 中将ops 传递给domain + */ +struct irq_domain_ops { + int (*match)(struct irq_domain *d, struct device_node *node, + enum irq_domain_bus_token bus_token); + int (*select)(struct irq_domain *d, struct irq_fwspec *fwspec, + enum irq_domain_bus_token bus_token); + int (*map)(struct irq_domain *d, unsigned int virq, irq_hw_number_t hw); + void (*unmap)(struct irq_domain *d, unsigned int virq); + int (*xlate)(struct irq_domain *d, struct device_node *node, + const u32 *intspec, unsigned int intsize, + unsigned long *out_hwirq, unsigned int *out_type); +#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY + /* extended V2 interfaces to support hierarchy irq_domains */ + int (*alloc)(struct irq_domain *d, unsigned int virq, + unsigned int nr_irqs, void *arg); + void (*free)(struct irq_domain *d, unsigned int virq, + unsigned int nr_irqs); + int (*activate)(struct irq_domain *d, struct irq_data *irqd, bool reserve); + void (*deactivate)(struct irq_domain *d, struct irq_data *irq_data); + int (*translate)(struct irq_domain *d, struct irq_fwspec *fwspec, + unsigned long *out_hwirq, unsigned int *out_type); +#endif +#ifdef CONFIG_GENERIC_IRQ_DEBUGFS + void (*debug_show)(struct seq_file *m, struct irq_domain *d, + struct irq_data *irqd, int ind); +#endif +}; + struct irq_domain { struct list_head link; // 常规操作,所有的 irq_domain 连接到全局链表上 const char *name;