本文简介
- 以 gicv3-its-pci 为例
grep -nr "\->get_hwirq("
相关结构体
/**
* struct msi_domain_ops - MSI interrupt domain callbacks
* @get_hwirq: Retrieve the resulting hw irq number
* @msi_init: Domain specific init function for MSI interrupts
* @msi_free: Domain specific function to free a MSI interrupts
* @msi_check: Callback for verification of the domain/info/dev data
* @msi_prepare: Prepare the allocation of the interrupts in the domain
* @msi_finish: Optional callback to finalize the allocation
* @set_desc: Set the msi descriptor for an interrupt
* @handle_error: Optional error handler if the allocation fails
* @domain_alloc_irqs: Optional function to override the default allocation
* function.
* @domain_free_irqs: Optional function to override the default free
* function.
*
* @get_hwirq, @msi_init and @msi_free are callbacks used by
* msi_create_irq_domain() and related interfaces
*
* @msi_check, @msi_prepare, @msi_finish, @set_desc and @handle_error
* are callbacks used by msi_domain_alloc_irqs() and related
* interfaces which are based on msi_desc.
*
* @domain_alloc_irqs, @domain_free_irqs can be used to override the
* default allocation/free functions (__msi_domain_alloc/free_irqs). This
* is initially for a wrapper around XENs seperate MSI universe which can't
* be wrapped into the regular irq domains concepts by mere mortals. This
* allows to universally use msi_domain_alloc/free_irqs without having to
* special case XEN all over the place.
*
* Contrary to other operations @domain_alloc_irqs and @domain_free_irqs
* are set to the default implementation if NULL and even when
* MSI_FLAG_USE_DEF_DOM_OPS is not set to avoid breaking existing users and
* because these callbacks are obviously mandatory.
*
* This is NOT meant to be abused, but it can be useful to build wrappers
* for specialized MSI irq domains which need extra work before and after
* calling __msi_domain_alloc_irqs()/__msi_domain_free_irqs().
*/
struct msi_domain_ops {
irq_hw_number_t (*get_hwirq)(struct msi_domain_info *info, // msi_domain_alloc -> "ops->get_hwirq"
msi_alloc_info_t *arg);
int (*msi_init)(struct irq_domain *domain, // msi_domain_alloc -> "ops->msi_init"
struct msi_domain_info *info,
unsigned int virq, irq_hw_number_t hwirq,
msi_alloc_info_t *arg);
void (*msi_free)(struct irq_domain *domain,
struct msi_domain_info *info,
unsigned int virq);
int (*msi_check)(struct irq_domain *domain, // msi_domain_prepare_irqs-> "ops->msi_check"
struct msi_domain_info *info,
struct device *dev);
int (*msi_prepare)(struct irq_domain *domain, // msi_domain_prepare_irqs -> "ops->msi_prepare"
struct device *dev, int nvec, // its_pci_msi_prepare -> "ops->msi_prepare"
msi_alloc_info_t *arg);
void (*msi_finish)(msi_alloc_info_t *arg, int retval); // __msi_domain_alloc_irqs -> "ops->msi_finish"
void (*set_desc)(msi_alloc_info_t *arg, // msi_domain_populate_irqs -> "ops->set_desc"
struct msi_desc *desc); // __msi_domain_alloc_irqs -> "ops->set_desc"
int (*handle_error)(struct irq_domain *domain, // __msi_domain_alloc_irqs -> "ops->handle_error"
struct msi_desc *desc, int error);
int (*domain_alloc_irqs)(struct irq_domain *domain, // msi_domain_alloc_irqs -> "ops->domain_alloc_irqs"
struct device *dev, int nvec);
void (*domain_free_irqs)(struct irq_domain *domain,
struct device *dev);
};