Changeset 36717 in vbox for trunk/src/VBox/HostDrivers/VBoxPci
- Timestamp:
- Apr 18, 2011 2:58:46 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 71233
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxPci/VBoxPci.c
r36678 r36717 74 74 return NULL; 75 75 } 76 77 DECLINLINE(int) vboxPciDevLock(PVBOXRAWPCIINS pThis) 78 { 76 DECLINLINE(int) vboxPciDevLock(PVBOXRAWPCIINS pThis, 77 PRTSPINLOCKTMP pTmp) 78 { 79 #ifdef VBOX_WITH_SHARED_PCI_INTERRUPTS 80 RTSpinlockAcquireNoInts(pThis->hSpinlock, pTmp); 81 return VINF_SUCCESS; 82 #else 79 83 int rc = RTSemFastMutexRequest(pThis->hFastMtx); 84 85 NOREF(pTmp); 80 86 AssertRC(rc); 81 87 return rc; 82 } 83 84 DECLINLINE(void) vboxPciDevUnlock(PVBOXRAWPCIINS pThis) 85 { 88 #endif 89 } 90 91 DECLINLINE(void) vboxPciDevUnlock(PVBOXRAWPCIINS pThis, 92 PRTSPINLOCKTMP pTmp) 93 { 94 #ifdef VBOX_WITH_SHARED_PCI_INTERRUPTS 95 RTSpinlockReleaseNoInts(pThis->hSpinlock, pTmp); 96 #else 97 NOREF(pTmp); 86 98 RTSemFastMutexRelease(pThis->hFastMtx); 99 #endif 87 100 } 88 101 … … 171 184 PVBOXRAWPCIINS pThis = DEVPORT_2_VBOXRAWPCIINS(pPort); 172 185 int rc; 173 174 vboxPciDevLock(pThis); 186 RTSPINLOCKTMP aTmp; 187 188 vboxPciDevLock(pThis, &aTmp); 175 189 176 190 rc = vboxPciOsDevInit(pThis, fFlags); 177 191 178 vboxPciDevUnlock(pThis );192 vboxPciDevUnlock(pThis, &aTmp); 179 193 180 194 return rc; … … 187 201 { 188 202 PVBOXRAWPCIINS pThis = DEVPORT_2_VBOXRAWPCIINS(pPort); 189 int rc; 190 191 vboxPciDevLock(pThis); 203 int rc; 204 RTSPINLOCKTMP aTmp; 205 206 vboxPciDevLock(pThis, &aTmp); 192 207 193 208 if (pThis->IrqHandler.pfnIrqHandler) … … 200 215 rc = vboxPciOsDevDeinit(pThis, fFlags); 201 216 202 vboxPciDevUnlock(pThis );217 vboxPciDevUnlock(pThis, &aTmp); 203 218 204 219 return rc; … … 249 264 { 250 265 PVBOXRAWPCIINS pThis = DEVPORT_2_VBOXRAWPCIINS(pPort); 251 int rc; 252 253 vboxPciDevLock(pThis); 266 int rc; 267 RTSPINLOCKTMP aTmp; 268 269 vboxPciDevLock(pThis, &aTmp); 254 270 255 271 rc = vboxPciOsDevGetRegionInfo(pThis, iRegion, 256 272 pRegionStart, pu64RegionSize, 257 273 pfPresent, pfFlags); 258 vboxPciDevUnlock(pThis );274 vboxPciDevUnlock(pThis, &aTmp); 259 275 260 276 return rc; … … 272 288 { 273 289 PVBOXRAWPCIINS pThis = DEVPORT_2_VBOXRAWPCIINS(pPort); 274 int rc; 275 276 vboxPciDevLock(pThis); 290 int rc; 291 RTSPINLOCKTMP aTmp; 292 293 vboxPciDevLock(pThis, &aTmp); 277 294 278 295 rc = vboxPciOsDevMapRegion(pThis, iRegion, RegionStart, u64RegionSize, fFlags, pRegionBase); 279 296 280 vboxPciDevUnlock(pThis );297 vboxPciDevUnlock(pThis, &aTmp); 281 298 282 299 return rc; … … 293 310 { 294 311 PVBOXRAWPCIINS pThis = DEVPORT_2_VBOXRAWPCIINS(pPort); 295 int rc; 296 297 vboxPciDevLock(pThis); 312 int rc; 313 RTSPINLOCKTMP aTmp; 314 315 vboxPciDevLock(pThis, &aTmp); 298 316 299 317 rc = vboxPciOsDevUnmapRegion(pThis, iRegion, RegionStart, u64RegionSize, RegionBase); 300 318 301 vboxPciDevUnlock(pThis );319 vboxPciDevUnlock(pThis, &aTmp); 302 320 303 321 return rc; … … 312 330 { 313 331 PVBOXRAWPCIINS pThis = DEVPORT_2_VBOXRAWPCIINS(pPort); 314 315 int rc;316 317 vboxPciDevLock(pThis );332 RTSPINLOCKTMP aTmp; 333 int rc; 334 335 vboxPciDevLock(pThis, &aTmp); 318 336 319 337 rc = vboxPciOsDevPciCfgRead(pThis, Register, pValue); 320 338 321 vboxPciDevUnlock(pThis );339 vboxPciDevUnlock(pThis, &aTmp); 322 340 323 341 return rc; … … 332 350 { 333 351 PVBOXRAWPCIINS pThis = DEVPORT_2_VBOXRAWPCIINS(pPort); 334 int rc; 335 336 vboxPciDevLock(pThis); 352 int rc; 353 RTSPINLOCKTMP aTmp; 354 355 vboxPciDevLock(pThis, &aTmp); 337 356 338 357 rc = vboxPciOsDevPciCfgWrite(pThis, Register, pValue); 339 358 340 vboxPciDevUnlock(pThis );359 vboxPciDevUnlock(pThis, &aTmp); 341 360 342 361 return rc; … … 349 368 { 350 369 PVBOXRAWPCIINS pThis = DEVPORT_2_VBOXRAWPCIINS(pPort); 351 int rc; 352 int32_t iHostIrq = 0; 370 int rc; 371 int32_t iHostIrq = 0; 372 RTSPINLOCKTMP aTmp; 353 373 354 374 if (pfnHandler == NULL) 355 375 return VERR_INVALID_PARAMETER; 356 376 357 vboxPciDevLock(pThis );377 vboxPciDevLock(pThis, &aTmp); 358 378 359 379 if (pThis->IrqHandler.pfnIrqHandler) … … 373 393 } 374 394 375 vboxPciDevUnlock(pThis );395 vboxPciDevUnlock(pThis, &aTmp); 376 396 377 397 return rc; … … 382 402 { 383 403 PVBOXRAWPCIINS pThis = DEVPORT_2_VBOXRAWPCIINS(pPort); 384 int rc; 404 int rc; 405 RTSPINLOCKTMP aTmp; 385 406 386 407 if (hIsr != 0xcafe0000) 387 408 return VERR_INVALID_PARAMETER; 388 409 389 vboxPciDevLock(pThis );410 vboxPciDevLock(pThis, &aTmp); 390 411 391 412 rc = vboxPciOsDevUnregisterIrqHandler(pThis, pThis->IrqHandler.iHostIrq); … … 396 417 pThis->IrqHandler.iHostIrq = 0; 397 418 } 398 vboxPciDevUnlock(pThis );419 vboxPciDevUnlock(pThis, &aTmp); 399 420 400 421 return rc; … … 406 427 { 407 428 PVBOXRAWPCIINS pThis = DEVPORT_2_VBOXRAWPCIINS(pPort); 408 int rc; 409 410 vboxPciDevLock(pThis); 429 int rc; 430 RTSPINLOCKTMP aTmp; 431 432 vboxPciDevLock(pThis, &aTmp); 411 433 412 434 rc = vboxPciOsDevPowerStateChange(pThis, aState); … … 426 448 427 449 428 vboxPciDevUnlock(pThis );450 vboxPciDevUnlock(pThis, &aTmp); 429 451 430 452 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.