VirtualBox

Changeset 29706 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
May 20, 2010 4:44:45 PM (15 years ago)
Author:
vboxsync
Message:

LsiLogic: Debugger callback to dump the controller state

File:
1 edited

Legend:

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

    r29610 r29706  
    37763776
    37773777/**
     3778 * LsiLogic status info callback.
     3779 *
     3780 * @param   pDevIns     The device instance.
     3781 * @param   pHlp        The output helpers.
     3782 * @param   pszArgs     The arguments.
     3783 */
     3784static DECLCALLBACK(void) lsilogicInfo(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs)
     3785{
     3786    PLSILOGICSCSI pThis = PDMINS_2_DATA(pDevIns, PLSILOGICSCSI);
     3787    bool          fVerbose = false;
     3788
     3789    /*
     3790     * Parse args.
     3791     */
     3792    if (pszArgs)
     3793        fVerbose = strstr(pszArgs, "verbose");
     3794
     3795    /*
     3796     * Show info.
     3797     */
     3798    pHlp->pfnPrintf(pHlp,
     3799                    "%s#%d: port=%RTiop mmio=%RGp max-devices=%u GC=%RTbool R0=%RTbool\n",
     3800                    pDevIns->pReg->szName,
     3801                    pDevIns->iInstance,
     3802                    pThis->IOPortBase, pThis->GCPhysMMIOBase,
     3803                    pThis->cDeviceStates,
     3804                    pThis->fGCEnabled ? true : false,
     3805                    pThis->fR0Enabled ? true : false);
     3806
     3807    /*
     3808     * Show general state.
     3809     */
     3810    pHlp->pfnPrintf(pHlp, "enmState=%u\n", pThis->enmState);
     3811    pHlp->pfnPrintf(pHlp, "enmWhoInit=%u\n", pThis->enmWhoInit);
     3812    pHlp->pfnPrintf(pHlp, "fDoorbellInProgress=%RTbool\n", pThis->fDoorbellInProgress);
     3813    pHlp->pfnPrintf(pHlp, "fDiagnosticEnabled=%RTbool\n", pThis->fDiagnosticEnabled);
     3814    pHlp->pfnPrintf(pHlp, "fNotificationSend=%RTbool\n", pThis->fNotificationSend);
     3815    pHlp->pfnPrintf(pHlp, "fEventNotificationEnabled=%RTbool\n", pThis->fEventNotificationEnabled);
     3816    pHlp->pfnPrintf(pHlp, "uInterruptMask=%#x\n", pThis->uInterruptMask);
     3817    pHlp->pfnPrintf(pHlp, "uInterruptStatus=%#x\n", pThis->uInterruptStatus);
     3818    pHlp->pfnPrintf(pHlp, "u16IOCFaultCode=%#06x\n", pThis->u16IOCFaultCode);
     3819    pHlp->pfnPrintf(pHlp, "u32HostMFAHighAddr=%#x\n", pThis->u32HostMFAHighAddr);
     3820    pHlp->pfnPrintf(pHlp, "u32SenseBufferHighAddr=%#x\n", pThis->u32SenseBufferHighAddr);
     3821    pHlp->pfnPrintf(pHlp, "cMaxDevices=%u\n", pThis->cMaxDevices);
     3822    pHlp->pfnPrintf(pHlp, "cMaxBuses=%u\n", pThis->cMaxBuses);
     3823    pHlp->pfnPrintf(pHlp, "cbReplyFrame=%u\n", pThis->cbReplyFrame);
     3824    pHlp->pfnPrintf(pHlp, "cReplyQueueEntries=%u\n", pThis->cReplyQueueEntries);
     3825    pHlp->pfnPrintf(pHlp, "cRequestQueueEntries=%u\n", pThis->cRequestQueueEntries);
     3826    pHlp->pfnPrintf(pHlp, "cPorts=%u\n", pThis->cPorts);
     3827
     3828    /*
     3829     * Show queue status.
     3830     */
     3831    pHlp->pfnPrintf(pHlp, "uReplyFreeQueueNextEntryFreeWrite=%u\n", pThis->uReplyFreeQueueNextEntryFreeWrite);
     3832    pHlp->pfnPrintf(pHlp, "uReplyFreeQueueNextAddressRead=%u\n", pThis->uReplyFreeQueueNextAddressRead);
     3833    pHlp->pfnPrintf(pHlp, "uReplyPostQueueNextEntryFreeWrite=%u\n", pThis->uReplyPostQueueNextEntryFreeWrite);
     3834    pHlp->pfnPrintf(pHlp, "uReplyPostQueueNextAddressRead=%u\n", pThis->uReplyPostQueueNextAddressRead);
     3835    pHlp->pfnPrintf(pHlp, "uRequestQueueNextEntryFreeWrite=%u\n", pThis->uRequestQueueNextEntryFreeWrite);
     3836    pHlp->pfnPrintf(pHlp, "uRequestQueueNextAddressRead=%u\n", pThis->uRequestQueueNextAddressRead);
     3837
     3838    /*
     3839     * Show queue content if verbose
     3840     */
     3841    if (fVerbose)
     3842    {
     3843        for (unsigned i = 0; i < pThis->cReplyQueueEntries; i++)
     3844            pHlp->pfnPrintf(pHlp, "RFQ[%u]=%#x\n", i, pThis->pReplyFreeQueueBaseR3[i]);
     3845
     3846        pHlp->pfnPrintf(pHlp, "\n");
     3847
     3848        for (unsigned i = 0; i < pThis->cReplyQueueEntries; i++)
     3849            pHlp->pfnPrintf(pHlp, "RPQ[%u]=%#x\n", i, pThis->pReplyPostQueueBaseR3[i]);
     3850
     3851        pHlp->pfnPrintf(pHlp, "\n");
     3852
     3853        for (unsigned i = 0; i < pThis->cRequestQueueEntries; i++)
     3854            pHlp->pfnPrintf(pHlp, "ReqQ[%u]=%#x\n", i, pThis->pRequestQueueBaseR3[i]);
     3855    }
     3856}
     3857
     3858/**
    37783859 * Allocate the queues.
    37793860 *
     
    48784959
    48794960    pThis->enmWhoInit = LSILOGICWHOINIT_SYSTEM_BIOS;
     4961
     4962    /*
     4963     * Register the info item.
     4964     */
     4965    char szTmp[128];
     4966    RTStrPrintf(szTmp, sizeof(szTmp), "%s%d", pDevIns->pReg->szName, pDevIns->iInstance);
     4967    PDMDevHlpDBGFInfoRegister(pDevIns, szTmp,
     4968                              pThis->enmCtrlType == LSILOGICCTRLTYPE_SCSI_SPI
     4969                              ? "LsiLogic SPI info."
     4970                              : "LsiLogic SAS info.", lsilogicInfo);
    48804971
    48814972    /* Perform hard reset. */
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