mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-23 09:47:44 +00:00
hv: pirq: remove unnecessary dev_handler_node struct
Since we don't support shared irq, dev_handler_node which works as action node, is not needed anymore. This commit removes the dev_handler_node struct and does some relevant changes, including: - moves necessary fields to struct irq_desc: action, priv_data, name; and removes unused handler_data; - changes return type of pri_/normal_register_handler() from dev_handler_node* to int32_t, which is irq num (>= 0) on success, and errno (> 0) on failure. - changes unregister_irq_handler() to take argument unint32_t instead of dev_handler_node*; - changes are made to the places where these APIs are called. Signed-off-by: Yan, Like <like.yan@intel.com> Reviewed-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -118,7 +118,7 @@ release_all_entries(struct vm *vm)
|
||||
}
|
||||
|
||||
/* interrupt context */
|
||||
static int ptdev_interrupt_handler(__unused int irq, void *data)
|
||||
static int ptdev_interrupt_handler(__unused uint32_t irq, void *data)
|
||||
{
|
||||
struct ptdev_remapping_info *entry =
|
||||
(struct ptdev_remapping_info *) data;
|
||||
@@ -131,14 +131,14 @@ static int ptdev_interrupt_handler(__unused int irq, void *data)
|
||||
void
|
||||
ptdev_activate_entry(struct ptdev_remapping_info *entry, uint32_t phys_irq)
|
||||
{
|
||||
struct dev_handler_node *node;
|
||||
int32_t retval;
|
||||
|
||||
/* register and allocate host vector/irq */
|
||||
node = normal_register_handler(phys_irq, ptdev_interrupt_handler,
|
||||
(void *)entry, "dev assign");
|
||||
retval = normal_register_handler(phys_irq, ptdev_interrupt_handler,
|
||||
(void *)entry, "dev assign");
|
||||
|
||||
ASSERT(node != NULL, "dev register failed");
|
||||
entry->node = node;
|
||||
ASSERT(retval >= 0, "dev register failed");
|
||||
entry->allocated_pirq = (uint32_t)retval;
|
||||
|
||||
atomic_set32(&entry->active, ACTIVE_FLAG);
|
||||
}
|
||||
@@ -150,8 +150,8 @@ ptdev_deactivate_entry(struct ptdev_remapping_info *entry)
|
||||
|
||||
atomic_clear32(&entry->active, ACTIVE_FLAG);
|
||||
|
||||
unregister_handler_common(entry->node);
|
||||
entry->node = NULL;
|
||||
unregister_handler_common(entry->allocated_pirq);
|
||||
entry->allocated_pirq = IRQ_INVALID;
|
||||
|
||||
/* remove from softirq list if added */
|
||||
spinlock_irqsave_obtain(&softirq_dev_lock);
|
||||
|
Reference in New Issue
Block a user