|
@@ -23,8 +23,6 @@
|
|
|
|
|
|
#include "qemu/osdep.h"
|
|
|
#include "hw/irq.h"
|
|
|
-#include "hw/pci/msi.h"
|
|
|
-#include "hw/pci/pci.h"
|
|
|
#include "hw/qdev-properties.h"
|
|
|
#include "migration/vmstate.h"
|
|
|
|
|
@@ -34,8 +32,6 @@
|
|
|
#include "qemu/module.h"
|
|
|
#include "sysemu/block-backend.h"
|
|
|
#include "sysemu/dma.h"
|
|
|
-#include "hw/ide/pci.h"
|
|
|
-#include "hw/ide/ahci-pci.h"
|
|
|
#include "hw/ide/ahci-sysbus.h"
|
|
|
#include "ahci-internal.h"
|
|
|
#include "ide-internal.h"
|
|
@@ -179,34 +175,6 @@ static uint32_t ahci_port_read(AHCIState *s, int port, int offset)
|
|
|
return val;
|
|
|
}
|
|
|
|
|
|
-static void ahci_irq_raise(AHCIState *s)
|
|
|
-{
|
|
|
- DeviceState *dev_state = s->container;
|
|
|
- PCIDevice *pci_dev = (PCIDevice *) object_dynamic_cast(OBJECT(dev_state),
|
|
|
- TYPE_PCI_DEVICE);
|
|
|
-
|
|
|
- trace_ahci_irq_raise(s);
|
|
|
-
|
|
|
- if (pci_dev && msi_enabled(pci_dev)) {
|
|
|
- msi_notify(pci_dev, 0);
|
|
|
- } else {
|
|
|
- qemu_irq_raise(s->irq);
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-static void ahci_irq_lower(AHCIState *s)
|
|
|
-{
|
|
|
- DeviceState *dev_state = s->container;
|
|
|
- PCIDevice *pci_dev = (PCIDevice *) object_dynamic_cast(OBJECT(dev_state),
|
|
|
- TYPE_PCI_DEVICE);
|
|
|
-
|
|
|
- trace_ahci_irq_lower(s);
|
|
|
-
|
|
|
- if (!pci_dev || !msi_enabled(pci_dev)) {
|
|
|
- qemu_irq_lower(s->irq);
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
static void ahci_check_irq(AHCIState *s)
|
|
|
{
|
|
|
int i;
|
|
@@ -222,9 +190,11 @@ static void ahci_check_irq(AHCIState *s)
|
|
|
trace_ahci_check_irq(s, old_irq, s->control_regs.irqstatus);
|
|
|
if (s->control_regs.irqstatus &&
|
|
|
(s->control_regs.ghc & HOST_CTL_IRQ_EN)) {
|
|
|
- ahci_irq_raise(s);
|
|
|
+ trace_ahci_irq_raise(s);
|
|
|
+ qemu_irq_raise(s->irq);
|
|
|
} else {
|
|
|
- ahci_irq_lower(s);
|
|
|
+ trace_ahci_irq_lower(s);
|
|
|
+ qemu_irq_lower(s->irq);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1608,7 +1578,6 @@ static const IDEDMAOps ahci_dma_ops = {
|
|
|
|
|
|
void ahci_init(AHCIState *s, DeviceState *qdev)
|
|
|
{
|
|
|
- s->container = qdev;
|
|
|
/* XXX BAR size should be 1k, but that breaks, so bump it to 4k for now */
|
|
|
memory_region_init_io(&s->mem, OBJECT(qdev), &ahci_mem_ops, s,
|
|
|
"ahci", AHCI_MEM_BAR_SIZE);
|