mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-05 23:57:10 +00:00
hv: pirq: refactor irq num alloc/free
This commit refactors the alloc/free irq num, two functions are defined:
- uint32_t alloc_irq_num(uint32_t irq)
- if irq is valid, mark the irq_desc as used; if it's IRQ_INVALID,
alloc a free irq, or else do nothing;
- return: irq num on success, or IRQ_INVALID on failure.
- void free_irq_num(uint32_t irq)
- free the irq num allocated via alloc_irq_num();
And a global spinlock to protect it from concurrent allocation/free.
Signed-off-by: Yan, Like <like.yan@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
@@ -34,8 +34,6 @@ struct irq_desc {
|
||||
spinlock_t lock;
|
||||
};
|
||||
|
||||
uint32_t irq_mark_used(uint32_t irq);
|
||||
|
||||
uint32_t irq_desc_alloc_vector(uint32_t irq);
|
||||
void irq_desc_try_free_vector(uint32_t irq);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user