mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-02 17:34:27 +00:00
DM: wrap ASSERT/DEASSERT IRQ line with Set/Clear IRQ line
- remove ASSERT & DEASSET IRQ line IOCTLs - remove PULSE IRQ line IOCTLs, use set/clear IRQ line instead. - Use IC_SET_IRQLINE to set or clear IRQ line Tracked-On: #861 Signed-off-by: Yonghua Huang <yonghua.huang@intel.com> Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com> Reviewed-by: Eddie Dong <eddie.dong@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
committed by
Xie, Nanlin
parent
e12f88b8c7
commit
b686b562f4
@@ -94,10 +94,10 @@ pirq_write(struct vmctx *ctx, int pin, uint8_t val)
|
||||
pthread_mutex_lock(&pirq->lock);
|
||||
if (pirq->reg != (val & (PIRQ_DIS | PIRQ_IRQ))) {
|
||||
if (pirq->active_count != 0 && pirq_valid_irq(pirq->reg))
|
||||
vm_isa_deassert_irq(ctx, pirq->reg & PIRQ_IRQ, -1);
|
||||
vm_set_gsi_irq(ctx, pirq->reg & PIRQ_IRQ, GSI_SET_LOW);
|
||||
pirq->reg = val & (PIRQ_DIS | PIRQ_IRQ);
|
||||
if (pirq->active_count != 0 && pirq_valid_irq(pirq->reg))
|
||||
vm_isa_assert_irq(ctx, pirq->reg & PIRQ_IRQ, -1);
|
||||
vm_set_gsi_irq(ctx, pirq->reg & PIRQ_IRQ, GSI_SET_HIGH);
|
||||
}
|
||||
pthread_mutex_unlock(&pirq->lock);
|
||||
}
|
||||
@@ -147,43 +147,13 @@ void pci_irq_deinit(struct vmctx *ctx)
|
||||
void
|
||||
pci_irq_assert(struct pci_vdev *dev)
|
||||
{
|
||||
struct pirq *pirq;
|
||||
|
||||
if (dev->lintr.pirq_pin > 0) {
|
||||
assert(dev->lintr.pirq_pin <= nitems(pirqs));
|
||||
pirq = &pirqs[dev->lintr.pirq_pin - 1];
|
||||
pthread_mutex_lock(&pirq->lock);
|
||||
pirq->active_count++;
|
||||
if (pirq->active_count == 1 && pirq_valid_irq(pirq->reg)) {
|
||||
vm_isa_assert_irq(dev->vmctx, pirq->reg & PIRQ_IRQ,
|
||||
dev->lintr.ioapic_irq);
|
||||
pthread_mutex_unlock(&pirq->lock);
|
||||
return;
|
||||
}
|
||||
pthread_mutex_unlock(&pirq->lock);
|
||||
}
|
||||
vm_ioapic_assert_irq(dev->vmctx, dev->lintr.ioapic_irq);
|
||||
vm_set_gsi_irq(dev->vmctx, dev->lintr.ioapic_irq, GSI_SET_HIGH);
|
||||
}
|
||||
|
||||
void
|
||||
pci_irq_deassert(struct pci_vdev *dev)
|
||||
{
|
||||
struct pirq *pirq;
|
||||
|
||||
if (dev->lintr.pirq_pin > 0) {
|
||||
assert(dev->lintr.pirq_pin <= nitems(pirqs));
|
||||
pirq = &pirqs[dev->lintr.pirq_pin - 1];
|
||||
pthread_mutex_lock(&pirq->lock);
|
||||
pirq->active_count--;
|
||||
if (pirq->active_count == 0 && pirq_valid_irq(pirq->reg)) {
|
||||
vm_isa_deassert_irq(dev->vmctx, pirq->reg & PIRQ_IRQ,
|
||||
dev->lintr.ioapic_irq);
|
||||
pthread_mutex_unlock(&pirq->lock);
|
||||
return;
|
||||
}
|
||||
pthread_mutex_unlock(&pirq->lock);
|
||||
}
|
||||
vm_ioapic_deassert_irq(dev->vmctx, dev->lintr.ioapic_irq);
|
||||
vm_set_gsi_irq(dev->vmctx, dev->lintr.ioapic_irq, GSI_SET_LOW);
|
||||
}
|
||||
|
||||
int
|
||||
|
@@ -105,9 +105,9 @@ lpc_uart_intr_assert(void *arg)
|
||||
assert(lpc_uart->irq >= 0);
|
||||
|
||||
if (lpc_bridge)
|
||||
vm_isa_pulse_irq(lpc_bridge->vmctx,
|
||||
vm_set_gsi_irq(lpc_bridge->vmctx,
|
||||
lpc_uart->irq,
|
||||
lpc_uart->irq);
|
||||
GSI_RAISING_PULSE);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Reference in New Issue
Block a user