VirtualBox

Changeset 43600 in vbox


Ignore:
Timestamp:
Oct 10, 2012 2:48:28 PM (12 years ago)
Author:
vboxsync
Message:

AHCI: New CFGM keyto configure the amount of logical sectors per physical sector

File:
1 edited

Legend:

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

    r43596 r43600  
    439439    volatile bool                   fRedo;
    440440
    441 #if HC_ARCH_BITS == 64
    442     bool                            fAlignment2;
    443 #endif
    444 
    445441    /** Number of total sectors. */
    446442    uint64_t                        cTotalSectors;
     
    453449    /** HACK: Countdown till we report a newly unmounted drive as mounted. */
    454450    uint8_t                         cNotifiedMediaChange;
     451    /** Exponent of logical sectors in a physical sector, number of logical sectors is 2^exp. */
     452    uint8_t                         cLogSectorsPerPhysicalExp;
    455453    /** The same for GET_EVENT_STATUS for mechanism */
    456454    volatile uint32_t               MediaEventStatus;
     
    529527    /** Statistics: Time to complete one request. */
    530528    STAMPROFILE                     StatProfileProcessTime;
    531     /** Statistics: Time to map requests into R3. */
    532     STAMPROFILE                     StatProfileMapIntoR3;
    533529    /** Statistics: Amount of time to read/write data. */
    534530    STAMPROFILE                     StatProfileReadWrite;
    535     /** Statistics: Amount of time to destroy a list. */
    536     STAMPROFILE                     StatProfileDestroyScatterGatherList;
    537531#endif /* VBOX_WITH_STATISTICS */
    538532
     
    30123006    p[102] = RT_H2LE_U16(pAhciPort->cTotalSectors >> 32);
    30133007    p[103] = RT_H2LE_U16(pAhciPort->cTotalSectors >> 48);
     3008
     3009    /* valid information, more than one logical sector per physical sector, 2^cLogSectorsPerPhysicalExp logical sectors per physical sector */
     3010    if (pAhciPort->cLogSectorsPerPhysicalExp)
     3011        p[106] = RT_H2LE_U16(RT_BIT(14) | RT_BIT(13) | pAhciPort->cLogSectorsPerPhysicalExp);
    30143012
    30153013    if (pAhciPort->fNonRotational)
     
    75297527                    N_("AHCI configuration error: failed to read \"NonRotationalMedium\" as boolean"));
    75307528
     7529    rc = CFGMR3QueryU8Def(pCfgNode, "LogicalSectorsPerPhysical", &pAhciPort->cLogSectorsPerPhysicalExp, 0);
     7530    if (RT_FAILURE(rc))
     7531        return PDMDEV_SET_ERROR(pDevIns, rc,
     7532                    N_("AHCI configuration error: failed to read \"LogicalSectorsPerPhysical\" as integer"));
     7533    if (pAhciPort->cLogSectorsPerPhysicalExp >= 16)
     7534        return PDMDEV_SET_ERROR(pDevIns, rc,
     7535                    N_("AHCI configuration error: \"LogicalSectorsPerPhysical\" must be between 0 and 15"));
     7536
    75317537    /* There are three other identification strings for CD drives used for INQUIRY */
    75327538    if (pAhciPort->fATAPI)
     
    80548060        PDMDevHlpSTAMRegisterF(pDevIns, &pAhciPort->StatProfileProcessTime, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_NS_PER_CALL,
    80558061                               "Amount of time to process one request.", "/Devices/SATA%d/Port%d/ProfileProcessTime", iInstance, i);
    8056         PDMDevHlpSTAMRegisterF(pDevIns, &pAhciPort->StatProfileMapIntoR3, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_NS_PER_CALL,
    8057                                "Amount of time to map the guest buffers into R3.", "/Devices/SATA%d/Port%d/ProfileMapIntoR3", iInstance, i);
    80588062        PDMDevHlpSTAMRegisterF(pDevIns, &pAhciPort->StatProfileReadWrite, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_NS_PER_CALL,
    80598063                               "Amount of time for the read/write operation to complete.", "/Devices/SATA%d/Port%d/ProfileReadWrite", iInstance, i);
    8060         PDMDevHlpSTAMRegisterF(pDevIns, &pAhciPort->StatProfileDestroyScatterGatherList, STAMTYPE_PROFILE, STAMVISIBILITY_USED, STAMUNIT_NS_PER_CALL,
    8061                                "Amount of time to destroy the scatter gather list and free associated resources.", "/Devices/SATA%d/Port%d/ProfileDestroyScatterGatherList", iInstance, i);
    80628064#endif
    80638065
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