Changeset 38847 in vbox
- Timestamp:
- Sep 23, 2011 1:19:23 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
include/VBox/vmm/pdmdev.h (modified) (14 diffs)
-
src/VBox/VMM/VMMR3/PDM.cpp (modified) (8 diffs)
-
src/VBox/VMM/VMMR3/PDMDevice.cpp (modified) (3 diffs)
-
src/VBox/VMM/VMMR3/PDMDriver.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/pdmdev.h
r37516 r38847 76 76 * 77 77 * @returns VBox status. 78 * @param pDevIns The device instance data. 78 * @param pDevIns The device instance data. 79 * 80 * @remarks The device critical section is not entered. The routine may delete 81 * the critical section, so the caller cannot exit it. 79 82 */ 80 83 typedef DECLCALLBACK(int) FNPDMDEVDESTRUCT(PPDMDEVINS pDevIns); … … 96 99 * @param offDelta The relocation delta relative to the old location. 97 100 * 98 * @remark A relocation CANNOT fail. 101 * @remarks A relocation CANNOT fail. 102 * 103 * @remarks The device critical section is not entered. The relocations should 104 * not normally require any locking. 99 105 */ 100 106 typedef DECLCALLBACK(void) FNPDMDEVRELOCATE(PPDMDEVINS pDevIns, RTGCINTPTR offDelta); … … 117 123 * @param cbOut Size of output data. 118 124 * @param pcbOut Where to store the actual size of the output data. 125 * 126 * @remarks Not used. 119 127 */ 120 128 typedef DECLCALLBACK(int) FNPDMDEVIOCTL(PPDMDEVINS pDevIns, RTUINT uFunction, … … 129 137 * @returns VBox status. 130 138 * @param pDevIns The device instance data. 139 * 140 * @remarks Caller enters the device critical section. 131 141 */ 132 142 typedef DECLCALLBACK(void) FNPDMDEVPOWERON(PPDMDEVINS pDevIns); … … 139 149 * @returns VBox status. 140 150 * @param pDevIns The device instance data. 151 * 152 * @remarks Caller enters the device critical section. 141 153 */ 142 154 typedef DECLCALLBACK(void) FNPDMDEVRESET(PPDMDEVINS pDevIns); … … 150 162 * @param pDevIns The device instance data. 151 163 * @thread EMT(0) 164 * 165 * @remarks Caller enters the device critical section. 152 166 */ 153 167 typedef DECLCALLBACK(void) FNPDMDEVSUSPEND(PPDMDEVINS pDevIns); … … 160 174 * @returns VBox status. 161 175 * @param pDevIns The device instance data. 176 * 177 * @remarks Caller enters the device critical section. 162 178 */ 163 179 typedef DECLCALLBACK(void) FNPDMDEVRESUME(PPDMDEVINS pDevIns); … … 174 190 * @param pDevIns The device instance data. 175 191 * @thread EMT(0) 192 * 193 * @remarks Caller enters the device critical section. 176 194 */ 177 195 typedef DECLCALLBACK(void) FNPDMDEVPOWEROFF(PPDMDEVINS pDevIns); … … 192 210 * @param iLUN The logical unit which is being detached. 193 211 * @param fFlags Flags, combination of the PDM_TACH_FLAGS_* \#defines. 212 * 213 * @remarks Caller enters the device critical section. 194 214 */ 195 215 typedef DECLCALLBACK(int) FNPDMDEVATTACH(PPDMDEVINS pDevIns, unsigned iLUN, uint32_t fFlags); … … 209 229 * @param iLUN The logical unit which is being detached. 210 230 * @param fFlags Flags, combination of the PDMDEVATT_FLAGS_* \#defines. 231 * 232 * @remarks Caller enters the device critical section. 211 233 */ 212 234 typedef DECLCALLBACK(void) FNPDMDEVDETACH(PPDMDEVINS pDevIns, unsigned iLUN, uint32_t fFlags); … … 221 243 * @param iLUN The logicial unit to query. 222 244 * @param ppBase Where to store the pointer to the base interface of the LUN. 245 * 246 * @remarks The device critical section is not entered. 223 247 */ 224 248 typedef DECLCALLBACK(int) FNPDMDEVQUERYINTERFACE(PPDMDEVINS pDevIns, unsigned iLUN, PPDMIBASE *ppBase); … … 233 257 * @returns VBOX status code. 234 258 * @param pDevIns The device instance. 259 * 260 * @remarks Caller enters the device critical section. 235 261 */ 236 262 typedef DECLCALLBACK(int) FNPDMDEVINITCOMPLETE(PPDMDEVINS pDevIns); … … 273 299 /** Construct instance - required. */ 274 300 PFNPDMDEVCONSTRUCT pfnConstruct; 275 /** Destruct instance - optional. */ 301 /** Destruct instance - optional. 302 * Critical section NOT entered (will be destroyed). */ 276 303 PFNPDMDEVDESTRUCT pfnDestruct; 277 /** Relocation command - optional. */ 304 /** Relocation command - optional. 305 * Critical section NOT entered. */ 278 306 PFNPDMDEVRELOCATE pfnRelocate; 279 /** I/O Control interface - optional. */ 307 /** I/O Control interface - optional. 308 * Not used. */ 280 309 PFNPDMDEVIOCTL pfnIOCtl; 281 /** Power on notification - optional. */ 310 /** Power on notification - optional. 311 * Critical section is entered. */ 282 312 PFNPDMDEVPOWERON pfnPowerOn; 283 /** Reset notification - optional. */ 313 /** Reset notification - optional. 314 * Critical section is entered. */ 284 315 PFNPDMDEVRESET pfnReset; 285 /** Suspend notification - optional. */ 316 /** Suspend notification - optional. 317 * Critical section is entered. */ 286 318 PFNPDMDEVSUSPEND pfnSuspend; 287 /** Resume notification - optional. */ 319 /** Resume notification - optional. 320 * Critical section is entered. */ 288 321 PFNPDMDEVRESUME pfnResume; 289 /** Attach command - optional. */ 322 /** Attach command - optional. 323 * Critical section is entered. */ 290 324 PFNPDMDEVATTACH pfnAttach; 291 /** Detach notification - optional. */ 325 /** Detach notification - optional. 326 * Critical section is entered. */ 292 327 PFNPDMDEVDETACH pfnDetach; 293 /** Query a LUN base interface - optional. */ 328 /** Query a LUN base interface - optional. 329 * Critical section is NOT entered. */ 294 330 PFNPDMDEVQUERYINTERFACE pfnQueryInterface; 295 /** Init complete notification - optional. */ 331 /** Init complete notification - optional. 332 * Critical section is entered. */ 296 333 PFNPDMDEVINITCOMPLETE pfnInitComplete; 297 /** Power off notification - optional. */ 334 /** Power off notification - optional. 335 * Critical section is entered. */ 298 336 PFNPDMDEVPOWEROFF pfnPowerOff; 299 337 /** @todo */ … … 3863 3901 /** The critical section for the device. 3864 3902 * 3865 * TM and IOM will enter this critical section before calling into the 3866 * device code. SSM will currently not, but this will be changed later on. 3903 * TM and IOM will enter this critical section before calling into the device 3904 * code. PDM will when doing power on, power off, reset, suspend and resume 3905 * notifications. SSM will currently not, but this will be changed later on. 3867 3906 * 3868 3907 * The device gets a critical section automatically assigned to it before -
trunk/src/VBox/VMM/VMMR3/PDM.cpp
r38838 r38847 1057 1057 { 1058 1058 LogFlow(("PDMR3PowerOn: Notifying - device '%s'/%d\n", pDevIns->pReg->szName, pDevIns->iInstance)); 1059 PDMCritSectEnter(pDevIns->pCritSectRoR3, VERR_IGNORED); 1059 1060 int rc = VINF_SUCCESS; pDevIns->pReg->pfnPowerOn(pDevIns); 1061 PDMCritSectLeave(pDevIns->pCritSectRoR3); 1060 1062 if (RT_FAILURE(rc)) 1061 1063 { … … 1343 1345 if (pDevIns->pReg->pfnReset) 1344 1346 { 1347 uint64_t cNsElapsed = RTTimeNanoTS(); 1348 PDMCritSectEnter(pDevIns->pCritSectRoR3, VERR_IGNORED); 1349 1345 1350 if (!pDevIns->Internal.s.pfnAsyncNotify) 1346 1351 { … … 1360 1365 pdmR3NotifyAsyncAdd(pAsync, pDevIns->Internal.s.pDevR3->pReg->szName, pDevIns->iInstance); 1361 1366 } 1367 1368 PDMCritSectLeave(pDevIns->pCritSectRoR3); 1369 cNsElapsed = RTTimeNanoTS() - cNsElapsed; 1370 if (cNsElapsed >= PDMSUSPEND_WARN_AT_NS) 1371 LogRel(("PDMR3Reset: device '%s'/%d took %'llu ns to reset\n", 1372 pDevIns->pReg->szName, pDevIns->iInstance, cNsElapsed)); 1362 1373 } 1363 1374 } … … 1580 1591 { 1581 1592 uint64_t cNsElapsed = RTTimeNanoTS(); 1593 PDMCritSectEnter(pDevIns->pCritSectRoR3, VERR_IGNORED); 1582 1594 1583 1595 if (!pDevIns->Internal.s.pfnAsyncNotify) … … 1599 1611 } 1600 1612 1613 PDMCritSectLeave(pDevIns->pCritSectRoR3); 1601 1614 cNsElapsed = RTTimeNanoTS() - cNsElapsed; 1602 1615 if (cNsElapsed >= PDMSUSPEND_WARN_AT_NS) … … 1756 1769 { 1757 1770 LogFlow(("PDMR3Resume: Notifying - device '%s'/%d\n", pDevIns->pReg->szName, pDevIns->iInstance)); 1771 PDMCritSectEnter(pDevIns->pCritSectRoR3, VERR_IGNORED); 1758 1772 int rc = VINF_SUCCESS; pDevIns->pReg->pfnResume(pDevIns); 1773 PDMCritSectLeave(pDevIns->pCritSectRoR3); 1759 1774 if (RT_FAILURE(rc)) 1760 1775 { … … 1939 1954 { 1940 1955 uint64_t cNsElapsed = RTTimeNanoTS(); 1956 PDMCritSectEnter(pDevIns->pCritSectRoR3, VERR_IGNORED); 1941 1957 1942 1958 if (!pDevIns->Internal.s.pfnAsyncNotify) … … 1958 1974 } 1959 1975 1976 PDMCritSectLeave(pDevIns->pCritSectRoR3); 1960 1977 cNsElapsed = RTTimeNanoTS() - cNsElapsed; 1961 1978 if (cNsElapsed >= PDMPOWEROFF_WARN_AT_NS) -
trunk/src/VBox/VMM/VMMR3/PDMDevice.cpp
r37812 r38847 420 420 if (pDevIns->pReg->pfnInitComplete) 421 421 { 422 PDMCritSectEnter(pDevIns->pCritSectRoR3, VERR_IGNORED); 422 423 rc = pDevIns->pReg->pfnInitComplete(pDevIns); 424 PDMCritSectLeave(pDevIns->pCritSectRoR3); 423 425 if (RT_FAILURE(rc)) 424 426 { … … 796 798 if (!pLun->pTop) 797 799 { 800 PDMCritSectEnter(pDevIns->pCritSectRoR3, VERR_IGNORED); 798 801 rc = pDevIns->pReg->pfnAttach(pDevIns, iLun, fFlags); 802 PDMCritSectLeave(pDevIns->pCritSectRoR3); 799 803 } 800 804 else … … 904 908 if (pDevIns->pReg->pfnAttach) 905 909 { 910 PDMCritSectEnter(pDevIns->pCritSectRoR3, VERR_IGNORED); 906 911 rc = pDevIns->pReg->pfnAttach(pDevIns, iLun, fFlags); 907 912 if (RT_SUCCESS(rc) && ppBase) 908 913 *ppBase = pLun->pTop ? &pLun->pTop->IBase : NULL; 914 PDMCritSectLeave(pDevIns->pCritSectRoR3); 909 915 } 910 916 else -
trunk/src/VBox/VMM/VMMR3/PDMDriver.cpp
r37418 r38847 641 641 pLun->pTop = NULL; 642 642 if (!(fFlags & PDM_TACH_FLAGS_NO_CALLBACKS) && pLun->pDevIns->pReg->pfnDetach) 643 { 644 PDMCritSectEnter(pLun->pDevIns->pCritSectRoR3, VERR_IGNORED); 643 645 pLun->pDevIns->pReg->pfnDetach(pLun->pDevIns, pLun->iLun, fFlags); 646 PDMCritSectLeave(pLun->pDevIns->pCritSectRoR3); 647 } 644 648 } 645 649
Note:
See TracChangeset
for help on using the changeset viewer.

