Changeset 52408 in vbox for trunk/src/VBox/Devices/Storage
- Timestamp:
- Aug 19, 2014 10:04:54 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevAHCI.cpp
r52026 r52408 5660 5660 5661 5661 /** 5662 * Free all cached tasks on the given port. 5663 * 5664 * @returns nothing. 5665 * @param pAhciPort The AHCI port. 5666 */ 5667 static void ahciR3PortCachedReqsFree(PAHCIPort pAhciPort) 5668 { 5669 for (uint32_t i = 0; i < AHCI_NR_COMMAND_SLOTS; i++) 5670 { 5671 if (pAhciPort->aCachedTasks[i]) 5672 { 5673 ahciReqMemFree(pAhciPort, pAhciPort->aCachedTasks[i], true /* fForceFree */); 5674 RTMemFree(pAhciPort->aCachedTasks[i]); 5675 pAhciPort->aCachedTasks[i] = NULL; 5676 } 5677 } 5678 } 5679 5680 /** 5662 5681 * Cancels all active tasks on the port. 5663 5682 * … … 7588 7607 PAHCI pThis = PDMINS_2_DATA(pDevIns, PAHCI); 7589 7608 ASMAtomicWriteBool(&pThis->fSignalIdle, false); 7609 /* 7610 * Free all cached tasks here, not possible on destruct because the driver 7611 * is destroyed before us. 7612 */ 7613 for (unsigned iPort = 0; iPort < pThis->cPortsImpl; iPort++) 7614 ahciR3PortCachedReqsFree(&pThis->ahciPort[iPort]); 7590 7615 return true; 7591 7616 } … … 7602 7627 PDMDevHlpSetAsyncNotification(pDevIns, ahciR3IsAsyncSuspendOrPowerOffDone); 7603 7628 else 7629 { 7630 /* 7631 * Free all cached tasks here, not possible on destruct because the driver 7632 * is destroyed before us. 7633 */ 7634 for (unsigned iPort = 0; iPort < pThis->cPortsImpl; iPort++) 7635 ahciR3PortCachedReqsFree(&pThis->ahciPort[iPort]); 7636 7604 7637 ASMAtomicWriteBool(&pThis->fSignalIdle, false); 7638 } 7605 7639 } 7606 7640 … … 7810 7844 if (pAhciPort->fATAPI) 7811 7845 ahciMediumRemoved(pAhciPort); 7846 7847 /* Free all cached I/O tasks. */ 7848 ahciR3PortCachedReqsFree(pAhciPort); 7812 7849 7813 7850 if (!(fFlags & PDM_TACH_FLAGS_NOT_HOT_PLUG)) … … 8017 8054 static DECLCALLBACK(void) ahciR3PowerOff(PPDMDEVINS pDevIns) 8018 8055 { 8056 PAHCI pThis = PDMINS_2_DATA(pDevIns, PAHCI); 8057 8019 8058 Log(("achiR3PowerOff\n")); 8020 8059 ahciR3SuspendOrPowerOff(pDevIns); … … 8056 8095 } 8057 8096 8058 /* Free all cached tasks. */ 8059 for (uint32_t i = 0; i < AHCI_NR_COMMAND_SLOTS; i++) 8060 if (pAhciPort->aCachedTasks[i]) 8061 { 8062 ahciReqMemFree(pAhciPort, pAhciPort->aCachedTasks[i], true /* fForceFree */); 8063 RTMemFree(pAhciPort->aCachedTasks[i]); 8064 pAhciPort->aCachedTasks[i] = NULL; 8065 } 8097 #ifdef VBOX_STRICT 8098 /* Check that all cached tasks were freed at this point. */ 8099 for (unsigned iPort = 0; iPort < pThis->cPortsImpl; iPort++) 8100 { 8101 PAHCIPort pAhciPort = &pThis->ahciPort[iPort]; 8102 8103 for (uint32_t i = 0; i < AHCI_NR_COMMAND_SLOTS; i++) 8104 Assert(!pAhciPort->aCachedTasks[i]); 8105 } 8106 #endif 8066 8107 } 8067 8108
Note:
See TracChangeset
for help on using the changeset viewer.