VirtualBox

Changeset 32939 in vbox for trunk/src


Ignore:
Timestamp:
Oct 6, 2010 10:07:32 AM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
66425
Message:

AHCI: MSI support

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/DevAHCI.cpp

    r32879 r32939  
    7070 * This was before the config was added and ahciIOTasks was dropped. */
    7171#define AHCI_SAVED_STATE_VERSION_VBOX_30        2
     72
     73/* If AHCI shall emulate MSI support */
     74#define AHCI_WITH_MSI
    7275
    7376/**
     
    76687671    PCIDevSetDeviceId    (&pThis->dev, 0x2829); /* ICH-8M */
    76697672    PCIDevSetCommand     (&pThis->dev, 0x0000);
    7670     // @todo: must be set, to use caps list
    7671     //PCIDevSetStatus      (&pThis->dev, VBOX_PCI_STATUS_CAP_LIST);
     7673#ifdef AHCI_WITH_MSI
     7674    PCIDevSetStatus      (&pThis->dev, VBOX_PCI_STATUS_CAP_LIST);
     7675    PCIDevSetCapabilityList(&pThis->dev, 0x80);
     7676#else
     7677    PCIDevSetCapabilityList(&pThis->dev, 0x70);
     7678#endif
    76727679    PCIDevSetRevisionId  (&pThis->dev, 0x02);
    76737680    PCIDevSetClassProg   (&pThis->dev, 0x01);
     
    76767683    PCIDevSetBaseAddress (&pThis->dev, 5, false, false, false, 0x00000000);
    76777684
    7678     // @todo: maybe 0x70, as MSI currently not implemented
    7679     PCIDevSetCapabilityList(&pThis->dev, 0x80);
    7680 
    76817685    PCIDevSetInterruptLine(&pThis->dev, 0x00);
    76827686    PCIDevSetInterruptPin (&pThis->dev, 0x01);
     
    76857689    pThis->dev.config[0x71] = 0x00; /* next */
    76867690    pThis->dev.config[0x72] = 0x03; /* version ? */
    7687 
    7688     // @todo: this way it claims MSI *enabled*, not disabled, which is only
    7689     // compensated by above lack of VBOX_PCI_STATUS_CAP_LIST in status
    7690     pThis->dev.config[0x80] = VBOX_PCI_CAP_ID_MSI; /* Capability ID: Message Signaled Interrupts. Disabled. */
    7691     pThis->dev.config[0x81] = 0x70; /* next. */
    76927691
    76937692    pThis->dev.config[0x90] = 0x40; /* AHCI mode. */
     
    77037702    if (RT_FAILURE(rc))
    77047703        return rc;
     7704
     7705#ifdef AHCI_WITH_MSI
     7706    PDMMSIREG aMsiReg;
     7707    aMsiReg.cVectors = 1;
     7708    aMsiReg.iCapOffset = 0x80;
     7709    aMsiReg.iNextOffset = 0x70;
     7710    aMsiReg.iMsiFlags = 0;
     7711    rc = PDMDevHlpPCIRegisterMsi(pDevIns, &aMsiReg);
     7712    if (RT_FAILURE (rc))
     7713    {
     7714        LogRel(("Chipset cannot do MSI: %Rrc\n", rc));
     7715        PCIDevSetCapabilityList(&pThis->dev, 0x70);
     7716        /* That's OK, we can work without MSI */
     7717    }
     7718#endif
    77057719
    77067720    /*
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette