VirtualBox

Changeset 11184 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Aug 6, 2008 5:06:02 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
34208
Message:

DevATA: Init handle values so the destructor workes quietly. Use the PCIDevSet* methods where possible.

File:
1 edited

Legend:

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

    r11183 r11184  
    49814981    for (uint32_t i = 0; i < RT_ELEMENTS(pData->aCts); i++)
    49824982    {
    4983         if (pData->aCts[i].AsyncIORequestMutex)
     4983        if (pData->aCts[i].AsyncIORequestMutex != NIL_RTSEMEVENT)
    49844984        {
    49854985            RTSemMutexDestroy(pData->aCts[i].AsyncIORequestMutex);
     
    55265526
    55275527    /*
     5528     * Initialize NIL handle values (for the destructor).
     5529     */
     5530    for (uint32_t i = 0; i < RT_ELEMENTS(pData->aCts); i++)
     5531    {
     5532        pData->aCts[i].AsyncIOSem = NIL_RTSEMEVENT;
     5533        pData->aCts[i].SuspendIOSem = NIL_RTSEMEVENT;
     5534        pData->aCts[i].AsyncIORequestMutex = NIL_RTSEMEVENT;
     5535    }
     5536
     5537    /*
    55285538     * Validate and read configuration.
    55295539     */
     
    55645574    pData->ILeds.pfnQueryStatusLed = ataStatus_QueryStatusLed;
    55655575
    5566     /* pci */
    5567     pData->dev.config[0x00] = 0x86; /* Vendor: Intel */
    5568     pData->dev.config[0x01] = 0x80;
     5576    /* PCI configuration space. */
     5577    PCIDevSetVendorId(&pData->dev, 0x8086); /* Intel */
    55695578    if (pData->fPIIX4)
    55705579    {
    5571         pData->dev.config[0x02] = 0x11; /* Device: PIIX4 IDE */
    5572         pData->dev.config[0x03] = 0x71;
    5573         pData->dev.config[0x08] = 0x01; /* Revision: PIIX4E */
     5580        PCIDevSetDeviceId(&pData->dev, 0x7111); /* PIIX4 IDE */
     5581        PCIDevSetRevisionId(&pData->dev, 0x01); /* PIIX4E */
    55745582        pData->dev.config[0x48] = 0x00; /* UDMACTL */
    55755583        pData->dev.config[0x4A] = 0x00; /* UDMATIM */
     
    55775585    }
    55785586    else
    5579     {
    5580         pData->dev.config[0x02] = 0x10; /* Device: PIIX3 IDE */
    5581         pData->dev.config[0x03] = 0x70;
    5582     }
    5583     pData->dev.config[0x04] = PCI_COMMAND_IOACCESS | PCI_COMMAND_MEMACCESS | PCI_COMMAND_BUSMASTER;
    5584     pData->dev.config[0x09] = 0x8a; /* programming interface = PCI_IDE bus master is supported */
    5585     pData->dev.config[0x0a] = 0x01; /* class_sub = PCI_IDE */
    5586     pData->dev.config[0x0b] = 0x01; /* class_base = PCI_mass_storage */
    5587     pData->dev.config[0x0e] = 0x00; /* header_type */
     5587        PCIDevSetDeviceId(&pData->dev, 0x7010); /* PIIX3 IDE */
     5588    PCIDevSetCommand(   &pData->dev, PCI_COMMAND_IOACCESS | PCI_COMMAND_MEMACCESS | PCI_COMMAND_BUSMASTER);
     5589    PCIDevSetClassProg( &pData->dev, 0x8a); /* programming interface = PCI_IDE bus master is supported */
     5590    PCIDevSetClassSub(  &pData->dev, 0x01); /* class_sub = PCI_IDE */
     5591    PCIDevSetClassBase( &pData->dev, 0x01); /* class_base = PCI_mass_storage */
     5592    PCIDevSetHeaderType(&pData->dev, 0x00);
    55885593
    55895594    pData->pDevIns          = pDevIns;
Note: See TracChangeset for help on using the changeset viewer.

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