Changeset 81807 in vbox for trunk/src/VBox
- Timestamp:
- Nov 12, 2019 3:14:37 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevBusLogic.cpp
r81805 r81807 3425 3425 { 3426 3426 RT_NOREF(uPass); 3427 PBUSLOGIC pThis = PDMDEVINS_2_DATA(pDevIns, PBUSLOGIC); 3427 PBUSLOGIC pThis = PDMDEVINS_2_DATA(pDevIns, PBUSLOGIC); 3428 PCPDMDEVHLPR3 pHlp = pDevIns->pHlpR3; 3428 3429 3429 3430 /* Save the device config. */ 3430 3431 for (unsigned i = 0; i < RT_ELEMENTS(pThis->aDeviceStates); i++) 3431 SSMR3PutBool(pSSM, pThis->aDeviceStates[i].fPresent);3432 pHlp->pfnSSMPutBool(pSSM, pThis->aDeviceStates[i].fPresent); 3432 3433 3433 3434 return VINF_SSM_DONT_CALL_AGAIN; … … 3437 3438 static DECLCALLBACK(int) buslogicR3SaveExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSM) 3438 3439 { 3439 PBUSLOGIC pBusLogic = PDMDEVINS_2_DATA(pDevIns, PBUSLOGIC); 3440 uint32_t cReqsSuspended = 0; 3440 PBUSLOGIC pBusLogic = PDMDEVINS_2_DATA(pDevIns, PBUSLOGIC); 3441 PCPDMDEVHLPR3 pHlp = pDevIns->pHlpR3; 3442 uint32_t cReqsSuspended = 0; 3441 3443 3442 3444 /* Every device first. */ … … 3447 3449 AssertMsg(!pDevice->cOutstandingRequests, 3448 3450 ("There are still outstanding requests on this device\n")); 3449 SSMR3PutBool(pSSM, pDevice->fPresent);3450 SSMR3PutU32(pSSM, pDevice->cOutstandingRequests);3451 pHlp->pfnSSMPutBool(pSSM, pDevice->fPresent); 3452 pHlp->pfnSSMPutU32(pSSM, pDevice->cOutstandingRequests); 3451 3453 3452 3454 if (pDevice->fPresent) … … 3454 3456 } 3455 3457 /* Now the main device state. */ 3456 SSMR3PutU8 (pSSM, pBusLogic->regStatus);3457 SSMR3PutU8 (pSSM, pBusLogic->regInterrupt);3458 SSMR3PutU8 (pSSM, pBusLogic->regGeometry);3459 SSMR3PutMem (pSSM, &pBusLogic->LocalRam, sizeof(pBusLogic->LocalRam));3460 SSMR3PutU8 (pSSM, pBusLogic->uOperationCode);3461 SSMR3PutMem (pSSM, &pBusLogic->aCommandBuffer, sizeof(pBusLogic->aCommandBuffer));3462 SSMR3PutU8 (pSSM, pBusLogic->iParameter);3463 SSMR3PutU8 (pSSM, pBusLogic->cbCommandParametersLeft);3464 SSMR3PutBool (pSSM, pBusLogic->fUseLocalRam);3465 SSMR3PutMem (pSSM, pBusLogic->aReplyBuffer, sizeof(pBusLogic->aReplyBuffer));3466 SSMR3PutU8 (pSSM, pBusLogic->iReply);3467 SSMR3PutU8 (pSSM, pBusLogic->cbReplyParametersLeft);3468 SSMR3PutBool (pSSM, pBusLogic->fIRQEnabled);3469 SSMR3PutU8 (pSSM, pBusLogic->uISABaseCode);3470 SSMR3PutU32 (pSSM, pBusLogic->cMailbox);3471 SSMR3PutBool (pSSM, pBusLogic->fMbxIs24Bit);3472 SSMR3PutGCPhys(pSSM, pBusLogic->GCPhysAddrMailboxOutgoingBase);3473 SSMR3PutU32 (pSSM, pBusLogic->uMailboxOutgoingPositionCurrent);3474 SSMR3PutU32 (pSSM, pBusLogic->cMailboxesReady);3475 SSMR3PutBool (pSSM, pBusLogic->fNotificationSent);3476 SSMR3PutGCPhys(pSSM, pBusLogic->GCPhysAddrMailboxIncomingBase);3477 SSMR3PutU32 (pSSM, pBusLogic->uMailboxIncomingPositionCurrent);3478 SSMR3PutBool (pSSM, pBusLogic->fStrictRoundRobinMode);3479 SSMR3PutBool (pSSM, pBusLogic->fExtendedLunCCBFormat);3458 pHlp->pfnSSMPutU8 (pSSM, pBusLogic->regStatus); 3459 pHlp->pfnSSMPutU8 (pSSM, pBusLogic->regInterrupt); 3460 pHlp->pfnSSMPutU8 (pSSM, pBusLogic->regGeometry); 3461 pHlp->pfnSSMPutMem (pSSM, &pBusLogic->LocalRam, sizeof(pBusLogic->LocalRam)); 3462 pHlp->pfnSSMPutU8 (pSSM, pBusLogic->uOperationCode); 3463 pHlp->pfnSSMPutMem (pSSM, &pBusLogic->aCommandBuffer, sizeof(pBusLogic->aCommandBuffer)); 3464 pHlp->pfnSSMPutU8 (pSSM, pBusLogic->iParameter); 3465 pHlp->pfnSSMPutU8 (pSSM, pBusLogic->cbCommandParametersLeft); 3466 pHlp->pfnSSMPutBool (pSSM, pBusLogic->fUseLocalRam); 3467 pHlp->pfnSSMPutMem (pSSM, pBusLogic->aReplyBuffer, sizeof(pBusLogic->aReplyBuffer)); 3468 pHlp->pfnSSMPutU8 (pSSM, pBusLogic->iReply); 3469 pHlp->pfnSSMPutU8 (pSSM, pBusLogic->cbReplyParametersLeft); 3470 pHlp->pfnSSMPutBool (pSSM, pBusLogic->fIRQEnabled); 3471 pHlp->pfnSSMPutU8 (pSSM, pBusLogic->uISABaseCode); 3472 pHlp->pfnSSMPutU32 (pSSM, pBusLogic->cMailbox); 3473 pHlp->pfnSSMPutBool (pSSM, pBusLogic->fMbxIs24Bit); 3474 pHlp->pfnSSMPutGCPhys(pSSM, pBusLogic->GCPhysAddrMailboxOutgoingBase); 3475 pHlp->pfnSSMPutU32 (pSSM, pBusLogic->uMailboxOutgoingPositionCurrent); 3476 pHlp->pfnSSMPutU32 (pSSM, pBusLogic->cMailboxesReady); 3477 pHlp->pfnSSMPutBool (pSSM, pBusLogic->fNotificationSent); 3478 pHlp->pfnSSMPutGCPhys(pSSM, pBusLogic->GCPhysAddrMailboxIncomingBase); 3479 pHlp->pfnSSMPutU32 (pSSM, pBusLogic->uMailboxIncomingPositionCurrent); 3480 pHlp->pfnSSMPutBool (pSSM, pBusLogic->fStrictRoundRobinMode); 3481 pHlp->pfnSSMPutBool (pSSM, pBusLogic->fExtendedLunCCBFormat); 3480 3482 3481 3483 vboxscsiR3SaveExec(pDevIns->pHlpR3, &pBusLogic->VBoxSCSI, pSSM); 3482 3484 3483 SSMR3PutU32(pSSM, cReqsSuspended);3485 pHlp->pfnSSMPutU32(pSSM, cReqsSuspended); 3484 3486 3485 3487 /* Save the physical CCB address of all suspended requests. */ … … 3502 3504 for (;;) 3503 3505 { 3504 SSMR3PutU32(pSSM, (uint32_t)pReq->GCPhysAddrCCB);3506 pHlp->pfnSSMPutU32(pSSM, (uint32_t)pReq->GCPhysAddrCCB); 3505 3507 3506 3508 cThisReqsSuspended--; … … 3516 3518 } 3517 3519 3518 return SSMR3PutU32(pSSM, UINT32_MAX);3520 return pHlp->pfnSSMPutU32(pSSM, UINT32_MAX); 3519 3521 } 3520 3522 … … 3554 3556 static DECLCALLBACK(int) buslogicR3LoadExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass) 3555 3557 { 3556 PBUSLOGIC pBusLogic = PDMDEVINS_2_DATA(pDevIns, PBUSLOGIC); 3557 int rc = VINF_SUCCESS; 3558 PBUSLOGIC pBusLogic = PDMDEVINS_2_DATA(pDevIns, PBUSLOGIC); 3559 PCPDMDEVHLPR3 pHlp = pDevIns->pHlpR3; 3560 int rc = VINF_SUCCESS; 3558 3561 3559 3562 /* We support saved states only from this and older versions. */ … … 3569 3572 ("There are still outstanding requests on this device\n")); 3570 3573 bool fPresent; 3571 rc = SSMR3GetBool(pSSM, &fPresent);3574 rc = pHlp->pfnSSMGetBool(pSSM, &fPresent); 3572 3575 AssertRCReturn(rc, rc); 3573 3576 if (pDevice->fPresent != fPresent) 3574 return SSMR3SetCfgError(pSSM, RT_SRC_POS, N_("Target %u config mismatch: config=%RTbool state=%RTbool"), i, pDevice->fPresent, fPresent);3577 return pHlp->pfnSSMSetCfgError(pSSM, RT_SRC_POS, N_("Target %u config mismatch: config=%RTbool state=%RTbool"), i, pDevice->fPresent, fPresent); 3575 3578 3576 3579 if (uPass == SSM_PASS_FINAL) 3577 SSMR3GetU32V(pSSM, &pDevice->cOutstandingRequests);3580 pHlp->pfnSSMGetU32V(pSSM, &pDevice->cOutstandingRequests); 3578 3581 } 3579 3582 … … 3582 3585 3583 3586 /* Now the main device state. */ 3584 SSMR3GetU8V (pSSM, &pBusLogic->regStatus);3585 SSMR3GetU8V (pSSM, &pBusLogic->regInterrupt);3586 SSMR3GetU8V (pSSM, &pBusLogic->regGeometry);3587 SSMR3GetMem (pSSM, &pBusLogic->LocalRam, sizeof(pBusLogic->LocalRam));3588 SSMR3GetU8 (pSSM, &pBusLogic->uOperationCode);3587 pHlp->pfnSSMGetU8V (pSSM, &pBusLogic->regStatus); 3588 pHlp->pfnSSMGetU8V (pSSM, &pBusLogic->regInterrupt); 3589 pHlp->pfnSSMGetU8V (pSSM, &pBusLogic->regGeometry); 3590 pHlp->pfnSSMGetMem (pSSM, &pBusLogic->LocalRam, sizeof(pBusLogic->LocalRam)); 3591 pHlp->pfnSSMGetU8 (pSSM, &pBusLogic->uOperationCode); 3589 3592 if (uVersion > BUSLOGIC_SAVED_STATE_MINOR_PRE_CMDBUF_RESIZE) 3590 SSMR3GetMem(pSSM, &pBusLogic->aCommandBuffer, sizeof(pBusLogic->aCommandBuffer));3593 pHlp->pfnSSMGetMem(pSSM, &pBusLogic->aCommandBuffer, sizeof(pBusLogic->aCommandBuffer)); 3591 3594 else 3592 SSMR3GetMem(pSSM, &pBusLogic->aCommandBuffer, BUSLOGIC_COMMAND_SIZE_OLD);3593 SSMR3GetU8 (pSSM, &pBusLogic->iParameter);3594 SSMR3GetU8 (pSSM, &pBusLogic->cbCommandParametersLeft);3595 SSMR3GetBool (pSSM, &pBusLogic->fUseLocalRam);3596 SSMR3GetMem (pSSM, pBusLogic->aReplyBuffer, sizeof(pBusLogic->aReplyBuffer));3597 SSMR3GetU8 (pSSM, &pBusLogic->iReply);3598 SSMR3GetU8 (pSSM, &pBusLogic->cbReplyParametersLeft);3599 SSMR3GetBool (pSSM, &pBusLogic->fIRQEnabled);3600 SSMR3GetU8 (pSSM, &pBusLogic->uISABaseCode);3601 SSMR3GetU32 (pSSM, &pBusLogic->cMailbox);3595 pHlp->pfnSSMGetMem(pSSM, &pBusLogic->aCommandBuffer, BUSLOGIC_COMMAND_SIZE_OLD); 3596 pHlp->pfnSSMGetU8 (pSSM, &pBusLogic->iParameter); 3597 pHlp->pfnSSMGetU8 (pSSM, &pBusLogic->cbCommandParametersLeft); 3598 pHlp->pfnSSMGetBool (pSSM, &pBusLogic->fUseLocalRam); 3599 pHlp->pfnSSMGetMem (pSSM, pBusLogic->aReplyBuffer, sizeof(pBusLogic->aReplyBuffer)); 3600 pHlp->pfnSSMGetU8 (pSSM, &pBusLogic->iReply); 3601 pHlp->pfnSSMGetU8 (pSSM, &pBusLogic->cbReplyParametersLeft); 3602 pHlp->pfnSSMGetBool (pSSM, &pBusLogic->fIRQEnabled); 3603 pHlp->pfnSSMGetU8 (pSSM, &pBusLogic->uISABaseCode); 3604 pHlp->pfnSSMGetU32 (pSSM, &pBusLogic->cMailbox); 3602 3605 if (uVersion > BUSLOGIC_SAVED_STATE_MINOR_PRE_24BIT_MBOX) 3603 SSMR3GetBool(pSSM, &pBusLogic->fMbxIs24Bit);3604 SSMR3GetGCPhys(pSSM, &pBusLogic->GCPhysAddrMailboxOutgoingBase);3605 SSMR3GetU32 (pSSM, &pBusLogic->uMailboxOutgoingPositionCurrent);3606 SSMR3GetU32V (pSSM, &pBusLogic->cMailboxesReady);3607 SSMR3GetBoolV (pSSM, &pBusLogic->fNotificationSent);3608 SSMR3GetGCPhys(pSSM, &pBusLogic->GCPhysAddrMailboxIncomingBase);3609 SSMR3GetU32 (pSSM, &pBusLogic->uMailboxIncomingPositionCurrent);3610 SSMR3GetBool (pSSM, &pBusLogic->fStrictRoundRobinMode);3611 SSMR3GetBool (pSSM, &pBusLogic->fExtendedLunCCBFormat);3606 pHlp->pfnSSMGetBool(pSSM, &pBusLogic->fMbxIs24Bit); 3607 pHlp->pfnSSMGetGCPhys(pSSM, &pBusLogic->GCPhysAddrMailboxOutgoingBase); 3608 pHlp->pfnSSMGetU32 (pSSM, &pBusLogic->uMailboxOutgoingPositionCurrent); 3609 pHlp->pfnSSMGetU32V (pSSM, &pBusLogic->cMailboxesReady); 3610 pHlp->pfnSSMGetBoolV (pSSM, &pBusLogic->fNotificationSent); 3611 pHlp->pfnSSMGetGCPhys(pSSM, &pBusLogic->GCPhysAddrMailboxIncomingBase); 3612 pHlp->pfnSSMGetU32 (pSSM, &pBusLogic->uMailboxIncomingPositionCurrent); 3613 pHlp->pfnSSMGetBool (pSSM, &pBusLogic->fStrictRoundRobinMode); 3614 pHlp->pfnSSMGetBool (pSSM, &pBusLogic->fExtendedLunCCBFormat); 3612 3615 3613 3616 rc = vboxscsiR3LoadExec(pDevIns->pHlpR3, &pBusLogic->VBoxSCSI, pSSM); … … 3624 3627 uint32_t cTasks = 0; 3625 3628 3626 SSMR3GetU32(pSSM, &cTasks);3629 pHlp->pfnSSMGetU32(pSSM, &cTasks); 3627 3630 3628 3631 if (cTasks) … … 3637 3640 uint32_t u32PhysAddrCCB; 3638 3641 3639 rc = SSMR3GetU32(pSSM, &u32PhysAddrCCB);3642 rc = pHlp->pfnSSMGetU32(pSSM, &u32PhysAddrCCB); 3640 3643 if (RT_FAILURE(rc)) 3641 3644 break; … … 3652 3655 { 3653 3656 uint32_t u32; 3654 rc = SSMR3GetU32(pSSM, &u32);3657 rc = pHlp->pfnSSMGetU32(pSSM, &u32); 3655 3658 if (RT_SUCCESS(rc)) 3656 3659 AssertMsgReturn(u32 == UINT32_MAX, ("%#x\n", u32), VERR_SSM_DATA_UNIT_FORMAT_CHANGED);
Note:
See TracChangeset
for help on using the changeset viewer.