Changeset 25461 in vbox for trunk/src/VBox/HostDrivers/Support
- Timestamp:
- Dec 17, 2009 1:10:34 PM (15 years ago)
- Location:
- trunk/src/VBox/HostDrivers/Support
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPDrv.c
r25460 r25461 357 357 memset(pDevExt, 0, sizeof(*pDevExt)); 358 358 rc = RTSpinlockCreate(&pDevExt->Spinlock); 359 if ( !rc)359 if (RT_SUCCESS(rc)) 360 360 { 361 361 #ifdef SUPDRV_USE_MUTEX_FOR_LDR … … 364 364 rc = RTSemFastMutexCreate(&pDevExt->mtxLdr); 365 365 #endif 366 if ( !rc)366 if (RT_SUCCESS(rc)) 367 367 { 368 368 rc = RTSemFastMutexCreate(&pDevExt->mtxComponentFactory); 369 if ( !rc)369 if (RT_SUCCESS(rc)) 370 370 { 371 #ifdef SUPDRV_USE_MUTEX_FOR_LDR 372 rc = RTSemMutexCreate(&pDevExt->mtxGip); 373 #else 371 374 rc = RTSemFastMutexCreate(&pDevExt->mtxGip); 372 if (!rc) 375 #endif 376 if (RT_SUCCESS(rc)) 373 377 { 374 378 rc = supdrvGipCreate(pDevExt); … … 432 436 } 433 437 438 #ifdef SUPDRV_USE_MUTEX_FOR_GIP 439 RTSemMutexDestroy(pDevExt->mtxGip); 440 pDevExt->mtxGip = NIL_RTSEMMUTEX; 441 #else 434 442 RTSemFastMutexDestroy(pDevExt->mtxGip); 435 443 pDevExt->mtxGip = NIL_RTSEMFASTMUTEX; 444 #endif 436 445 } 437 446 RTSemFastMutexDestroy(pDevExt->mtxComponentFactory); … … 471 480 * Kill mutexes and spinlocks. 472 481 */ 482 #ifdef SUPDRV_USE_MUTEX_FOR_GIP 483 RTSemMutexDestroy(pDevExt->mtxGip); 484 pDevExt->mtxGip = NIL_RTSEMMUTEX; 485 #else 473 486 RTSemFastMutexDestroy(pDevExt->mtxGip); 474 487 pDevExt->mtxGip = NIL_RTSEMFASTMUTEX; 488 #endif 475 489 #ifdef SUPDRV_USE_MUTEX_FOR_LDR 476 490 RTSemMutexDestroy(pDevExt->mtxLdr); … … 2835 2849 AssertPtrNullReturn(pHCPhysGip, VERR_INVALID_POINTER); 2836 2850 2851 #ifdef SUPDRV_USE_MUTEX_FOR_GIP 2852 RTSemMutexRequest(pDevExt->mtxGip); 2853 #else 2837 2854 RTSemFastMutexRequest(pDevExt->mtxGip); 2855 #endif 2838 2856 if (pDevExt->pGip) 2839 2857 { … … 2898 2916 Log(("SUPR0GipMap: GIP is not available!\n")); 2899 2917 } 2918 #ifdef SUPDRV_USE_MUTEX_FOR_GIP 2919 RTSemMutexRelease(pDevExt->mtxGip); 2920 #else 2900 2921 RTSemFastMutexRelease(pDevExt->mtxGip); 2922 #endif 2901 2923 2902 2924 /* … … 2938 2960 AssertReturn(SUP_IS_SESSION_VALID(pSession), VERR_INVALID_PARAMETER); 2939 2961 2962 #ifdef SUPDRV_USE_MUTEX_FOR_GIP 2963 RTSemMutexRequest(pDevExt->mtxGip); 2964 #else 2940 2965 RTSemFastMutexRequest(pDevExt->mtxGip); 2966 #endif 2941 2967 2942 2968 /* … … 2965 2991 } 2966 2992 2993 #ifdef SUPDRV_USE_MUTEX_FOR_GIP 2994 RTSemMutexRelease(pDevExt->mtxGip); 2995 #else 2967 2996 RTSemFastMutexRelease(pDevExt->mtxGip); 2997 #endif 2968 2998 2969 2999 return rc; -
trunk/src/VBox/HostDrivers/Support/SUPDrvInternal.h
r25460 r25461 185 185 * @todo fix the mutex implementation on linux and make this the default. */ 186 186 # define SUPDRV_USE_MUTEX_FOR_LDR 187 188 /** Use a normal mutex for the GIP so we remain at the same IRQL after 189 * taking it. 190 * @todo fix the mutex implementation on linux and make this the default. */ 191 # define SUPDRV_USE_MUTEX_FOR_GIP 187 192 188 193 /* … … 607 612 * Any changes to any of the GIP members requires ownership of this mutex, 608 613 * except on driver init and termination. */ 614 #ifdef SUPDRV_USE_MUTEX_FOR_GIP 615 RTSEMMUTEX mtxGip; 616 #else 609 617 RTSEMFASTMUTEX mtxGip; 618 #endif 610 619 /** Pointer to the Global Info Page (GIP). */ 611 620 PSUPGLOBALINFOPAGE pGip;
Note:
See TracChangeset
for help on using the changeset viewer.