Changeset 40806 in vbox for trunk/src/VBox/HostDrivers
- Timestamp:
- Apr 6, 2012 9:05:19 PM (13 years ago)
- Location:
- trunk/src/VBox/HostDrivers
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPDrv.c
r40804 r40806 342 342 { "RTSemMutexRequestNoResumeDebug", (void *)RTSemMutexRequestNoResumeDebug }, 343 343 { "RTSpinlockAcquire", (void *)RTSpinlockAcquire }, 344 { "RTSpinlockAcquireNoInts", (void *)RTSpinlockAcquireNoInts },345 344 { "RTSpinlockCreate", (void *)RTSpinlockCreate }, 346 345 { "RTSpinlockDestroy", (void *)RTSpinlockDestroy }, … … 452 451 */ 453 452 memset(pDevExt, 0, sizeof(*pDevExt)); 454 rc = RTSpinlockCreate(&pDevExt->Spinlock );453 rc = RTSpinlockCreate(&pDevExt->Spinlock, RTSPINLOCK_FLAGS_INTERRUPT_UNSAFE, "SUPDrvDevExt"); 455 454 if (RT_SUCCESS(rc)) 456 455 { 457 rc = RTSpinlockCreate(&pDevExt-> spinGip);456 rc = RTSpinlockCreate(&pDevExt->hGipSpinlock, RTSPINLOCK_FLAGS_INTERRUPT_SAFE, "SUPDrvGip"); 458 457 if (RT_SUCCESS(rc)) 459 458 { … … 563 562 #endif 564 563 } 565 RTSpinlockDestroy(pDevExt-> spinGip);566 pDevExt-> spinGip= NIL_RTSPINLOCK;564 RTSpinlockDestroy(pDevExt->hGipSpinlock); 565 pDevExt->hGipSpinlock = NIL_RTSPINLOCK; 567 566 } 568 567 RTSpinlockDestroy(pDevExt->Spinlock); … … 636 635 /* kill the GIP. */ 637 636 supdrvGipDestroy(pDevExt); 638 RTSpinlockDestroy(pDevExt-> spinGip);639 pDevExt-> spinGip= NIL_RTSPINLOCK;637 RTSpinlockDestroy(pDevExt->hGipSpinlock); 638 pDevExt->hGipSpinlock = NIL_RTSPINLOCK; 640 639 641 640 supdrvTracerTerm(pDevExt); … … 667 666 { 668 667 /* Initialize session data. */ 669 rc = RTSpinlockCreate(&pSession->Spinlock );668 rc = RTSpinlockCreate(&pSession->Spinlock, RTSPINLOCK_FLAGS_INTERRUPT_UNSAFE, "SUPDrvSession"); 670 669 if (!rc) 671 670 { … … 777 776 if (pSession->pUsage) 778 777 { 779 RTSPINLOCKTMP SpinlockTmp = RTSPINLOCKTMP_INITIALIZER;780 778 PSUPDRVUSAGE pUsage; 781 RTSpinlockAcquire(pDevExt->Spinlock , &SpinlockTmp);779 RTSpinlockAcquire(pDevExt->Spinlock); 782 780 783 781 while ((pUsage = pSession->pUsage) != NULL) … … 790 788 { 791 789 pObj->cUsage -= pUsage->cUsage; 792 RTSpinlockRelease(pDevExt->Spinlock , &SpinlockTmp);790 RTSpinlockRelease(pDevExt->Spinlock); 793 791 } 794 792 else … … 808 806 Assert(pObjPrev); 809 807 } 810 RTSpinlockRelease(pDevExt->Spinlock , &SpinlockTmp);808 RTSpinlockRelease(pDevExt->Spinlock); 811 809 812 810 Log(("supdrvCleanupSession: destroying %p/%d (%p/%p) cpid=%RTproc pid=%RTproc dtor=%p\n", … … 820 818 RTMemFree(pUsage); 821 819 822 RTSpinlockAcquire(pDevExt->Spinlock , &SpinlockTmp);823 } 824 825 RTSpinlockRelease(pDevExt->Spinlock , &SpinlockTmp);820 RTSpinlockAcquire(pDevExt->Spinlock); 821 } 822 823 RTSpinlockRelease(pDevExt->Spinlock); 826 824 AssertMsg(!pSession->pUsage, ("Some buster reregistered an object during desturction!\n")); 827 825 } … … 2002 2000 SUPR0DECL(void *) SUPR0ObjRegister(PSUPDRVSESSION pSession, SUPDRVOBJTYPE enmType, PFNSUPDRVDESTRUCTOR pfnDestructor, void *pvUser1, void *pvUser2) 2003 2001 { 2004 RTSPINLOCKTMP SpinlockTmp = RTSPINLOCKTMP_INITIALIZER;2005 2002 PSUPDRVDEVEXT pDevExt = pSession->pDevExt; 2006 2003 PSUPDRVOBJ pObj; … … 2036 2033 * (We keep freed usage records around to simplify SUPR0ObjAddRefEx().) 2037 2034 */ 2038 RTSpinlockAcquire(pDevExt->Spinlock , &SpinlockTmp);2035 RTSpinlockAcquire(pDevExt->Spinlock); 2039 2036 2040 2037 pUsage = pDevExt->pUsageFree; … … 2043 2040 else 2044 2041 { 2045 RTSpinlockRelease(pDevExt->Spinlock , &SpinlockTmp);2042 RTSpinlockRelease(pDevExt->Spinlock); 2046 2043 pUsage = (PSUPDRVUSAGE)RTMemAlloc(sizeof(*pUsage)); 2047 2044 if (!pUsage) … … 2050 2047 return NULL; 2051 2048 } 2052 RTSpinlockAcquire(pDevExt->Spinlock , &SpinlockTmp);2049 RTSpinlockAcquire(pDevExt->Spinlock); 2053 2050 } 2054 2051 … … 2067 2064 pSession->pUsage = pUsage; 2068 2065 2069 RTSpinlockRelease(pDevExt->Spinlock , &SpinlockTmp);2066 RTSpinlockRelease(pDevExt->Spinlock); 2070 2067 2071 2068 Log(("SUPR0ObjRegister: returns %p (pvUser1=%p, pvUser=%p)\n", pObj, pvUser1, pvUser2)); … … 2113 2110 SUPR0DECL(int) SUPR0ObjAddRefEx(void *pvObj, PSUPDRVSESSION pSession, bool fNoBlocking) 2114 2111 { 2115 RTSPINLOCKTMP SpinlockTmp = RTSPINLOCKTMP_INITIALIZER;2116 2112 PSUPDRVDEVEXT pDevExt = pSession->pDevExt; 2117 2113 PSUPDRVOBJ pObj = (PSUPDRVOBJ)pvObj; … … 2131 2127 VERR_INVALID_PARAMETER); 2132 2128 2133 RTSpinlockAcquire(pDevExt->Spinlock , &SpinlockTmp);2129 RTSpinlockAcquire(pDevExt->Spinlock); 2134 2130 2135 2131 if (RT_UNLIKELY(pObj->u32Magic != SUPDRVOBJ_MAGIC)) 2136 2132 { 2137 RTSpinlockRelease(pDevExt->Spinlock , &SpinlockTmp);2133 RTSpinlockRelease(pDevExt->Spinlock); 2138 2134 2139 2135 AssertMsgFailed(("pvObj=%p magic=%#x\n", pvObj, pObj->u32Magic)); … … 2149 2145 else if (!fNoBlocking) 2150 2146 { 2151 RTSpinlockRelease(pDevExt->Spinlock , &SpinlockTmp);2147 RTSpinlockRelease(pDevExt->Spinlock); 2152 2148 pUsagePre = (PSUPDRVUSAGE)RTMemAlloc(sizeof(*pUsagePre)); 2153 2149 if (!pUsagePre) 2154 2150 return VERR_NO_MEMORY; 2155 2151 2156 RTSpinlockAcquire(pDevExt->Spinlock , &SpinlockTmp);2152 RTSpinlockAcquire(pDevExt->Spinlock); 2157 2153 if (RT_UNLIKELY(pObj->u32Magic != SUPDRVOBJ_MAGIC)) 2158 2154 { 2159 RTSpinlockRelease(pDevExt->Spinlock , &SpinlockTmp);2155 RTSpinlockRelease(pDevExt->Spinlock); 2160 2156 2161 2157 AssertMsgFailed(("pvObj=%p magic=%#x\n", pvObj, pObj->u32Magic)); … … 2206 2202 } 2207 2203 2208 RTSpinlockRelease(pDevExt->Spinlock , &SpinlockTmp);2204 RTSpinlockRelease(pDevExt->Spinlock); 2209 2205 2210 2206 return rc; … … 2228 2224 SUPR0DECL(int) SUPR0ObjRelease(void *pvObj, PSUPDRVSESSION pSession) 2229 2225 { 2230 RTSPINLOCKTMP SpinlockTmp = RTSPINLOCKTMP_INITIALIZER;2231 2226 PSUPDRVDEVEXT pDevExt = pSession->pDevExt; 2232 2227 PSUPDRVOBJ pObj = (PSUPDRVOBJ)pvObj; … … 2246 2241 * Acquire the spinlock and look for the usage record. 2247 2242 */ 2248 RTSpinlockAcquire(pDevExt->Spinlock , &SpinlockTmp);2243 RTSpinlockAcquire(pDevExt->Spinlock); 2249 2244 2250 2245 for (pUsagePrev = NULL, pUsage = pSession->pUsage; … … 2303 2298 } 2304 2299 2305 RTSpinlockRelease(pDevExt->Spinlock , &SpinlockTmp);2300 RTSpinlockRelease(pDevExt->Spinlock); 2306 2301 2307 2302 /* … … 2686 2681 { 2687 2682 PSUPDRVBUNDLE pBundle; 2688 RTSPINLOCKTMP SpinlockTmp = RTSPINLOCKTMP_INITIALIZER;2689 2683 LogFlow(("SUPR0MemGetPhys: pSession=%p uPtr=%p paPages=%p\n", pSession, (void *)uPtr, paPages)); 2690 2684 … … 2699 2693 * Search for the address. 2700 2694 */ 2701 RTSpinlockAcquire(pSession->Spinlock , &SpinlockTmp);2695 RTSpinlockAcquire(pSession->Spinlock); 2702 2696 for (pBundle = &pSession->Bundle; pBundle; pBundle = pBundle->pNext) 2703 2697 { … … 2722 2716 paPages[iPage].uReserved = 0; 2723 2717 } 2724 RTSpinlockRelease(pSession->Spinlock , &SpinlockTmp);2718 RTSpinlockRelease(pSession->Spinlock); 2725 2719 return VINF_SUCCESS; 2726 2720 } … … 2728 2722 } 2729 2723 } 2730 RTSpinlockRelease(pSession->Spinlock , &SpinlockTmp);2724 RTSpinlockRelease(pSession->Spinlock); 2731 2725 Log(("Failed to find %p!!!\n", (void *)uPtr)); 2732 2726 return VERR_INVALID_PARAMETER; … … 2851 2845 int rc; 2852 2846 PSUPDRVBUNDLE pBundle; 2853 RTSPINLOCKTMP SpinlockTmp = RTSPINLOCKTMP_INITIALIZER;2854 2847 RTR0MEMOBJ hMemObj = NIL_RTR0MEMOBJ; 2855 2848 LogFlow(("SUPR0PageMapKernel: pSession=%p pvR3=%p offSub=%#x cbSub=%#x\n", pSession, pvR3, offSub, cbSub)); … … 2868 2861 * Find the memory object. 2869 2862 */ 2870 RTSpinlockAcquire(pSession->Spinlock , &SpinlockTmp);2863 RTSpinlockAcquire(pSession->Spinlock); 2871 2864 for (pBundle = &pSession->Bundle; pBundle; pBundle = pBundle->pNext) 2872 2865 { … … 2891 2884 } 2892 2885 } 2893 RTSpinlockRelease(pSession->Spinlock , &SpinlockTmp);2886 RTSpinlockRelease(pSession->Spinlock); 2894 2887 2895 2888 rc = VERR_INVALID_PARAMETER; … … 2937 2930 int rc; 2938 2931 PSUPDRVBUNDLE pBundle; 2939 RTSPINLOCKTMP SpinlockTmp = RTSPINLOCKTMP_INITIALIZER;2940 2932 RTR0MEMOBJ hMemObjR0 = NIL_RTR0MEMOBJ; 2941 2933 RTR0MEMOBJ hMemObjR3 = NIL_RTR0MEMOBJ; … … 2954 2946 * Find the memory object. 2955 2947 */ 2956 RTSpinlockAcquire(pSession->Spinlock , &SpinlockTmp);2948 RTSpinlockAcquire(pSession->Spinlock); 2957 2949 for (pBundle = &pSession->Bundle; pBundle; pBundle = pBundle->pNext) 2958 2950 { … … 2980 2972 } 2981 2973 } 2982 RTSpinlockRelease(pSession->Spinlock , &SpinlockTmp);2974 RTSpinlockRelease(pSession->Spinlock); 2983 2975 2984 2976 rc = VERR_INVALID_PARAMETER; … … 3696 3688 { 3697 3689 PSUPDRVBUNDLE pBundle; 3698 RTSPINLOCKTMP SpinlockTmp = RTSPINLOCKTMP_INITIALIZER;3699 3690 3700 3691 /* 3701 3692 * Find free entry and record the allocation. 3702 3693 */ 3703 RTSpinlockAcquire(pSession->Spinlock , &SpinlockTmp);3694 RTSpinlockAcquire(pSession->Spinlock); 3704 3695 for (pBundle = &pSession->Bundle; pBundle; pBundle = pBundle->pNext) 3705 3696 { … … 3713 3704 pBundle->cUsed++; 3714 3705 pBundle->aMem[i] = *pMem; 3715 RTSpinlockRelease(pSession->Spinlock , &SpinlockTmp);3706 RTSpinlockRelease(pSession->Spinlock); 3716 3707 return VINF_SUCCESS; 3717 3708 } … … 3720 3711 } 3721 3712 } 3722 RTSpinlockRelease(pSession->Spinlock , &SpinlockTmp);3713 RTSpinlockRelease(pSession->Spinlock); 3723 3714 3724 3715 /* … … 3735 3726 3736 3727 /* insert into list. */ 3737 RTSpinlockAcquire(pSession->Spinlock , &SpinlockTmp);3728 RTSpinlockAcquire(pSession->Spinlock); 3738 3729 pBundle->pNext = pSession->Bundle.pNext; 3739 3730 pSession->Bundle.pNext = pBundle; 3740 RTSpinlockRelease(pSession->Spinlock , &SpinlockTmp);3731 RTSpinlockRelease(pSession->Spinlock); 3741 3732 3742 3733 return VINF_SUCCESS; … … 3755 3746 { 3756 3747 PSUPDRVBUNDLE pBundle; 3757 RTSPINLOCKTMP SpinlockTmp = RTSPINLOCKTMP_INITIALIZER;3758 3748 3759 3749 /* … … 3769 3759 * Search for the address. 3770 3760 */ 3771 RTSpinlockAcquire(pSession->Spinlock , &SpinlockTmp);3761 RTSpinlockAcquire(pSession->Spinlock); 3772 3762 for (pBundle = &pSession->Bundle; pBundle; pBundle = pBundle->pNext) 3773 3763 { … … 3789 3779 pBundle->aMem[i].MemObj = NIL_RTR0MEMOBJ; 3790 3780 pBundle->aMem[i].MapObjR3 = NIL_RTR0MEMOBJ; 3791 RTSpinlockRelease(pSession->Spinlock , &SpinlockTmp);3781 RTSpinlockRelease(pSession->Spinlock); 3792 3782 3793 3783 if (Mem.MapObjR3 != NIL_RTR0MEMOBJ) … … 3806 3796 } 3807 3797 } 3808 RTSpinlockRelease(pSession->Spinlock , &SpinlockTmp);3798 RTSpinlockRelease(pSession->Spinlock); 3809 3799 Log(("Failed to find %p!!! (eType=%d)\n", (void *)uPtr, eType)); 3810 3800 return VERR_INVALID_PARAMETER; … … 4212 4202 * clean things up in the right order and not leave them all dangling. 4213 4203 */ 4214 RTSPINLOCKTMP SpinlockTmp = RTSPINLOCKTMP_INITIALIZER; 4215 RTSpinlockAcquire(pDevExt->Spinlock, &SpinlockTmp); 4204 RTSpinlockAcquire(pDevExt->Spinlock); 4216 4205 if (pImage->cUsage <= 1) 4217 4206 { … … 4234 4223 } 4235 4224 } 4236 RTSpinlockRelease(pDevExt->Spinlock , &SpinlockTmp);4225 RTSpinlockRelease(pDevExt->Spinlock); 4237 4226 if (rc == VINF_SUCCESS) 4238 4227 { … … 4572 4561 unsigned cObjs = 0; 4573 4562 PSUPDRVOBJ pObj; 4574 RTSPINLOCKTMP SpinlockTmp = RTSPINLOCKTMP_INITIALIZER; 4575 RTSpinlockAcquire(pDevExt->Spinlock, &SpinlockTmp); 4563 RTSpinlockAcquire(pDevExt->Spinlock); 4576 4564 for (pObj = pDevExt->pObjs; pObj; pObj = pObj->pNext) 4577 4565 if (RT_UNLIKELY((uintptr_t)pObj->pfnDestructor - (uintptr_t)pImage->pvImage < pImage->cbImageBits)) … … 4580 4568 cObjs++; 4581 4569 } 4582 RTSpinlockRelease(pDevExt->Spinlock , &SpinlockTmp);4570 RTSpinlockRelease(pDevExt->Spinlock); 4583 4571 if (cObjs) 4584 4572 OSDBGPRINT(("supdrvLdrFree: Image '%s' has %d dangling objects!\n", pImage->szName, cObjs)); … … 5087 5075 uint32_t i = 0; 5088 5076 uint64_t u64NanoTS = 0; 5089 RTSPINLOCKTMP SpinlockTmp = RTSPINLOCKTMP_INITIALIZER;5090 5077 PSUPGLOBALINFOPAGE pGip = pDevExt->pGip; 5091 5078 … … 5098 5085 * on all CPUs simultaneously, see #6110. 5099 5086 */ 5100 RTSpinlockAcquire NoInts(pDevExt->spinGip, &SpinlockTmp);5087 RTSpinlockAcquire(pDevExt->hGipSpinlock); 5101 5088 5102 5089 /* … … 5133 5120 ASMAtomicWriteSize(&pGip->aCPUs[i].enmState, SUPGIPCPUSTATE_ONLINE); 5134 5121 5135 RTSpinlockReleaseNoInts(pDevExt-> spinGip, &SpinlockTmp);5122 RTSpinlockReleaseNoInts(pDevExt->hGipSpinlock); 5136 5123 } 5137 5124 … … 5151 5138 5152 5139 PSUPGLOBALINFOPAGE pGip = pDevExt->pGip; 5153 RTSPINLOCKTMP SpinlockTmp = RTSPINLOCKTMP_INITIALIZER;5154 5140 5155 5141 AssertPtrReturnVoid(pGip); 5156 RTSpinlockAcquire NoInts(pDevExt->spinGip, &SpinlockTmp);5142 RTSpinlockAcquire(pDevExt->hGipSpinlock); 5157 5143 5158 5144 iCpuSet = RTMpCpuIdToSetIndex(idCpu); … … 5169 5155 ASMAtomicWriteSize(&pGip->aCPUs[i].enmState, SUPGIPCPUSTATE_OFFLINE); 5170 5156 5171 RTSpinlockReleaseNoInts(pDevExt-> spinGip, &SpinlockTmp);5157 RTSpinlockReleaseNoInts(pDevExt->hGipSpinlock); 5172 5158 } 5173 5159 -
trunk/src/VBox/HostDrivers/Support/SUPDrvIOC.h
r40763 r40806 191 191 * 192 192 * @todo Pending work on next major version change: 193 * - None.194 */ 195 #define SUPDRV_IOC_VERSION 0x001 90002193 * - Remove RTSpinlockReleaseNoInts. 194 */ 195 #define SUPDRV_IOC_VERSION 0x001a0000 196 196 197 197 /** SUP_IOCTL_COOKIE. */ -
trunk/src/VBox/HostDrivers/Support/SUPDrvInternal.h
r40777 r40806 517 517 #endif 518 518 /** GIP spinlock protecting GIP members during Mp events. */ 519 RTSPINLOCK spinGip;519 RTSPINLOCK hGipSpinlock; 520 520 /** Pointer to the Global Info Page (GIP). */ 521 521 PSUPGLOBALINFOPAGE pGip; -
trunk/src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp
r37970 r40806 239 239 */ 240 240 memset(g_apSessionHashTab, 0, sizeof(g_apSessionHashTab)); /* paranoia */ 241 rc = RTSpinlockCreate(&g_Spinlock );241 rc = RTSpinlockCreate(&g_Spinlock, RTSPINLOCK_FLAGS_INTERRUPT_SAFE, "VBoxDrvDarwin"); 242 242 if (RT_SUCCESS(rc)) 243 243 { … … 370 370 RTPROCESS Process = RTProcSelf(); 371 371 unsigned iHash = SESSION_HASH(Process); 372 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; 373 RTSpinlockAcquireNoInts(g_Spinlock, &Tmp); 372 RTSpinlockAcquire(g_Spinlock); 374 373 375 374 pSession = g_apSessionHashTab[iHash]; … … 393 392 rc = VERR_GENERAL_FAILURE; 394 393 395 RTSpinlockReleaseNoInts(g_Spinlock , &Tmp);394 RTSpinlockReleaseNoInts(g_Spinlock); 396 395 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 397 396 kauth_cred_unref(&pCred); … … 442 441 static int VBoxDrvDarwinIOCtl(dev_t Dev, u_long iCmd, caddr_t pData, int fFlags, struct proc *pProcess) 443 442 { 444 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;445 443 const RTPROCESS Process = proc_pid(pProcess); 446 444 const unsigned iHash = SESSION_HASH(Process); … … 450 448 * Find the session. 451 449 */ 452 RTSpinlockAcquire NoInts(g_Spinlock, &Tmp);450 RTSpinlockAcquire(g_Spinlock); 453 451 pSession = g_apSessionHashTab[iHash]; 454 452 if (pSession && pSession->Process != Process) … … 457 455 while (pSession && pSession->Process != Process); 458 456 } 459 RTSpinlockReleaseNoInts(g_Spinlock , &Tmp);457 RTSpinlockReleaseNoInts(g_Spinlock); 460 458 if (!pSession) 461 459 { … … 982 980 */ 983 981 unsigned iHash = SESSION_HASH(m_pSession->Process); 984 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; 985 RTSpinlockAcquireNoInts(g_Spinlock, &Tmp); 982 RTSpinlockAcquire(g_Spinlock); 986 983 987 984 PSUPDRVSESSION pCur = g_apSessionHashTab[iHash]; … … 1002 999 rc = VERR_ALREADY_LOADED; 1003 1000 1004 RTSpinlockReleaseNoInts(g_Spinlock , &Tmp);1001 RTSpinlockReleaseNoInts(g_Spinlock); 1005 1002 if (RT_SUCCESS(rc)) 1006 1003 { … … 1034 1031 */ 1035 1032 const unsigned iHash = SESSION_HASH(Process); 1036 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; 1037 RTSpinlockAcquireNoInts(g_Spinlock, &Tmp); 1033 RTSpinlockAcquire(g_Spinlock); 1038 1034 PSUPDRVSESSION pSession = g_apSessionHashTab[iHash]; 1039 1035 if (pSession) … … 1065 1061 } 1066 1062 } 1067 RTSpinlockReleaseNoInts(g_Spinlock , &Tmp);1063 RTSpinlockReleaseNoInts(g_Spinlock); 1068 1064 if (!pSession) 1069 1065 { -
trunk/src/VBox/HostDrivers/Support/os2/SUPDrv-os2.cpp
r37249 r40806 108 108 * Initialize the session hash table. 109 109 */ 110 rc = RTSpinlockCreate(&g_Spinlock );110 rc = RTSpinlockCreate(&g_Spinlock, RTSPINLOCK_FLAGS_INTERRUPT_SAFE, "VBoxDrvOS2"); 111 111 if (RT_SUCCESS(rc)) 112 112 { … … 160 160 */ 161 161 unsigned iHash = SESSION_HASH(sfn); 162 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; 163 RTSpinlockAcquireNoInts(g_Spinlock, &Tmp); 162 RTSpinlockAcquire(g_Spinlock); 164 163 pSession->pNextHash = g_apSessionHashTab[iHash]; 165 164 g_apSessionHashTab[iHash] = pSession; 166 RTSpinlockReleaseNoInts(g_Spinlock , &Tmp);165 RTSpinlockReleaseNoInts(g_Spinlock); 167 166 } 168 167 … … 182 181 const RTPROCESS Process = RTProcSelf(); 183 182 const unsigned iHash = SESSION_HASH(sfn); 184 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; 185 RTSpinlockAcquireNoInts(g_Spinlock, &Tmp); 183 RTSpinlockAcquire(g_Spinlock); 186 184 187 185 pSession = g_apSessionHashTab[iHash]; … … 214 212 } 215 213 } 216 RTSpinlockReleaseNoInts(g_Spinlock , &Tmp);214 RTSpinlockReleaseNoInts(g_Spinlock); 217 215 if (!pSession) 218 216 { … … 234 232 * Find the session. 235 233 */ 236 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;237 234 const RTPROCESS Process = RTProcSelf(); 238 235 const unsigned iHash = SESSION_HASH(sfn); 239 236 PSUPDRVSESSION pSession; 240 237 241 RTSpinlockAcquire NoInts(g_Spinlock, &Tmp);238 RTSpinlockAcquire(g_Spinlock); 242 239 pSession = g_apSessionHashTab[iHash]; 243 240 if (pSession && pSession->Process != Process) … … 248 245 || pSession->Process != Process)); 249 246 } 250 RTSpinlockReleaseNoInts(g_Spinlock , &Tmp);247 RTSpinlockReleaseNoInts(g_Spinlock); 251 248 if (RT_UNLIKELY(!pSession)) 252 249 { … … 268 265 * Find the session. 269 266 */ 270 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;271 267 const RTPROCESS Process = RTProcSelf(); 272 268 const unsigned iHash = SESSION_HASH(sfn); 273 269 PSUPDRVSESSION pSession; 274 270 275 RTSpinlockAcquire NoInts(g_Spinlock, &Tmp);271 RTSpinlockAcquire(g_Spinlock); 276 272 pSession = g_apSessionHashTab[iHash]; 277 273 if (pSession && pSession->Process != Process) … … 282 278 || pSession->Process != Process)); 283 279 } 284 RTSpinlockReleaseNoInts(g_Spinlock , &Tmp);280 RTSpinlockReleaseNoInts(g_Spinlock); 285 281 if (!pSession) 286 282 { -
trunk/src/VBox/HostDrivers/Support/solaris/SUPDrv-solaris.c
r40616 r40806 224 224 */ 225 225 memset(g_apSessionHashTab, 0, sizeof(g_apSessionHashTab)); 226 rc = RTSpinlockCreate(&g_Spinlock );226 rc = RTSpinlockCreate(&g_Spinlock, RTSPINLOCK_FLAGS_INTERRUPT_SAFE, "VBoxDrvSol"); 227 227 if (RT_SUCCESS(rc)) 228 228 { … … 494 494 if (RT_SUCCESS(rc)) 495 495 { 496 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;497 496 unsigned iHash; 498 497 … … 504 503 */ 505 504 iHash = SESSION_HASH(pSession->Process); 506 RTSpinlockAcquire NoInts(g_Spinlock, &Tmp);505 RTSpinlockAcquire(g_Spinlock); 507 506 pSession->pNextHash = g_apSessionHashTab[iHash]; 508 507 g_apSessionHashTab[iHash] = pSession; 509 RTSpinlockReleaseNoInts(g_Spinlock , &Tmp);508 RTSpinlockReleaseNoInts(g_Spinlock); 510 509 LogFlow((DEVICE_NAME ":VBoxDrvSolarisOpen success\n")); 511 510 } … … 560 559 561 560 #else 562 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;563 561 const RTPROCESS Process = RTProcSelf(); 564 562 const unsigned iHash = SESSION_HASH(Process); … … 568 566 * Remove from the hash table. 569 567 */ 570 RTSpinlockAcquire NoInts(g_Spinlock, &Tmp);568 RTSpinlockAcquire(g_Spinlock); 571 569 pSession = g_apSessionHashTab[iHash]; 572 570 if (pSession) … … 596 594 } 597 595 } 598 RTSpinlockReleaseNoInts(g_Spinlock , &Tmp);596 RTSpinlockReleaseNoInts(g_Spinlock); 599 597 if (!pSession) 600 598 { … … 659 657 } 660 658 #else 661 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;662 659 const RTPROCESS Process = RTProcSelf(); 663 660 const unsigned iHash = SESSION_HASH(Process); … … 667 664 * Find the session. 668 665 */ 669 RTSpinlockAcquire NoInts(g_Spinlock, &Tmp);666 RTSpinlockAcquire(g_Spinlock); 670 667 pSession = g_apSessionHashTab[iHash]; 671 668 if (pSession && pSession->Process != Process) … … 674 671 while (pSession && pSession->Process != Process); 675 672 } 676 RTSpinlockReleaseNoInts(g_Spinlock , &Tmp);673 RTSpinlockReleaseNoInts(g_Spinlock); 677 674 if (!pSession) 678 675 { -
trunk/src/VBox/HostDrivers/VBoxNetAdp/VBoxNetAdp.c
r38408 r40806 106 106 DECLINLINE(void) vboxNetAdpSetStateWithLock(PVBOXNETADP pThis, VBOXNETADPSTATE enmNewState) 107 107 { 108 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;109 108 Log(("vboxNetAdpSetStateWithLock: pThis=%p, state=%d.\n", pThis, enmNewState)); 110 RTSpinlockAcquire NoInts(pThis->hSpinlock, &Tmp);109 RTSpinlockAcquire(pThis->hSpinlock); 111 110 vboxNetAdpSetState(pThis, enmNewState); 112 RTSpinlockReleaseNoInts(pThis->hSpinlock , &Tmp);111 RTSpinlockReleaseNoInts(pThis->hSpinlock); 113 112 } 114 113 … … 125 124 { 126 125 VBOXNETADPSTATE enmState; 127 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; 128 RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); 126 RTSpinlockAcquire(pThis->hSpinlock); 129 127 enmState = vboxNetAdpGetState(pThis); 130 RTSpinlockReleaseNoInts(pThis->hSpinlock , &Tmp);128 RTSpinlockReleaseNoInts(pThis->hSpinlock); 131 129 Log(("vboxNetAdpGetStateWithLock: pThis=%p, state=%d.\n", pThis, enmState)); 132 130 return enmState; … … 147 145 VBOXNETADPSTATE enmActualState; 148 146 bool fRc = true; /* be optimistic */ 149 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; 150 151 RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); 147 148 RTSpinlockAcquire(pThis->hSpinlock); 152 149 enmActualState = vboxNetAdpGetState(pThis); /** @todo r=bird: ASMAtomicCmpXchgU32()*/ 153 150 if (enmActualState == enmOldState) … … 155 152 else 156 153 fRc = false; 157 RTSpinlockReleaseNoInts(pThis->hSpinlock , &Tmp);154 RTSpinlockReleaseNoInts(pThis->hSpinlock); 158 155 159 156 if (fRc) … … 178 175 for (i = 0; i < RT_ELEMENTS(pGlobals->aAdapters); i++) 179 176 { 180 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;181 177 PVBOXNETADP pThis = &pGlobals->aAdapters[i]; 182 RTSpinlockAcquire NoInts(pThis->hSpinlock, &Tmp);178 RTSpinlockAcquire(pThis->hSpinlock); 183 179 if ( vboxNetAdpGetState(pThis) 184 180 && !strcmp(pThis->szName, pszName)) 185 181 { 186 RTSpinlockReleaseNoInts(pThis->hSpinlock , &Tmp);182 RTSpinlockReleaseNoInts(pThis->hSpinlock); 187 183 return pThis; 188 184 } 189 RTSpinlockReleaseNoInts(pThis->hSpinlock , &Tmp);185 RTSpinlockReleaseNoInts(pThis->hSpinlock); 190 186 } 191 187 return NULL; … … 340 336 DECLHIDDEN(bool) vboxNetAdpPrepareToReceive(PVBOXNETADP pThis) 341 337 { 342 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;343 338 bool fCanReceive = false; 344 339 /* … … 347 342 AssertPtr(pThis); 348 343 Assert(pThis->MyPort.u32Version == INTNETTRUNKIFPORT_VERSION); 349 RTSpinlockAcquire NoInts(pThis->hSpinlock, &Tmp);344 RTSpinlockAcquire(pThis->hSpinlock); 350 345 if (vboxNetAdpGetState(pThis) == kVBoxNetAdpState_Active) 351 346 { … … 354 349 vboxNetAdpBusy(pThis); 355 350 } 356 RTSpinlockReleaseNoInts(pThis->hSpinlock , &Tmp);351 RTSpinlockReleaseNoInts(pThis->hSpinlock); 357 352 Log(("vboxNetAdpPrepareToReceive: fCanReceive=%d.\n", fCanReceive)); 358 353 … … 368 363 DECLHIDDEN(void) vboxNetAdpReceive(PVBOXNETADP pThis, PINTNETSG pSG) 369 364 { 370 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;371 365 /* 372 366 * Input validation. … … 401 395 static DECLCALLBACK(int) vboxNetAdpPortXmit(PINTNETTRUNKIFPORT pIfPort, PINTNETSG pSG, uint32_t fDst) 402 396 { 403 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;404 397 PVBOXNETADP pThis = IFPORT_2_VBOXNETADP(pIfPort); 405 398 int rc = VINF_SUCCESS; … … 417 410 * Do a retain/busy, invoke the OS specific code. 418 411 */ 419 RTSpinlockAcquire NoInts(pThis->hSpinlock, &Tmp);412 RTSpinlockAcquire(pThis->hSpinlock); 420 413 if (vboxNetAdpGetState(pThis) != kVBoxNetAdpState_Active) 421 414 { 422 RTSpinlockReleaseNoInts(pThis->hSpinlock , &Tmp);415 RTSpinlockReleaseNoInts(pThis->hSpinlock); 423 416 Log(("vboxNetAdpReceive: Dropping incoming packet for inactive interface %s.\n", 424 417 pThis->szName)); … … 427 420 vboxNetAdpRetain(pThis); 428 421 vboxNetAdpBusy(pThis); 429 RTSpinlockReleaseNoInts(pThis->hSpinlock , &Tmp);422 RTSpinlockReleaseNoInts(pThis->hSpinlock); 430 423 431 424 rc = vboxNetAdpPortOsXmit(pThis, pSG, fDst); … … 494 487 { 495 488 bool fPreviouslyActive; 496 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;497 489 PVBOXNETADP pThis = IFPORT_2_VBOXNETADP(pIfPort); 498 490 … … 505 497 506 498 Log(("vboxNetAdpPortSetActive: pThis=%p, fActive=%d, state before: %d.\n", pThis, fActive, vboxNetAdpGetState(pThis))); 507 RTSpinlockAcquire NoInts(pThis->hSpinlock, &Tmp);499 RTSpinlockAcquire(pThis->hSpinlock); 508 500 509 501 fPreviouslyActive = vboxNetAdpGetState(pThis) == kVBoxNetAdpState_Active; … … 523 515 } 524 516 525 RTSpinlockReleaseNoInts(pThis->hSpinlock , &Tmp);517 RTSpinlockReleaseNoInts(pThis->hSpinlock); 526 518 Log(("vboxNetAdpPortSetActive: state after: %RTbool.\n", vboxNetAdpGetState(pThis))); 527 519 return fPreviouslyActive; … … 535 527 { 536 528 PVBOXNETADP pThis = IFPORT_2_VBOXNETADP(pIfPort); 537 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;538 529 539 530 /* … … 551 542 * Disconnect and release it. 552 543 */ 553 RTSpinlockAcquire NoInts(pThis->hSpinlock, &Tmp);544 RTSpinlockAcquire(pThis->hSpinlock); 554 545 //Assert(vboxNetAdpGetState(pThis) == kVBoxNetAdpState_Connected); 555 546 Assert(!pThis->cBusy); 556 547 vboxNetAdpSetState(pThis, kVBoxNetAdpState_Transitional); 557 RTSpinlockReleaseNoInts(pThis->hSpinlock , &Tmp);548 RTSpinlockReleaseNoInts(pThis->hSpinlock); 558 549 559 550 vboxNetAdpOsDisconnectIt(pThis); 560 551 pThis->pSwitchPort = NULL; 561 552 562 RTSpinlockAcquire NoInts(pThis->hSpinlock, &Tmp);553 RTSpinlockAcquire(pThis->hSpinlock); 563 554 vboxNetAdpSetState(pThis, kVBoxNetAdpState_Available); 564 RTSpinlockReleaseNoInts(pThis->hSpinlock , &Tmp);555 RTSpinlockReleaseNoInts(pThis->hSpinlock); 565 556 566 557 vboxNetAdpRelease(pThis); … … 590 581 int vboxNetAdpCreate(PINTNETTRUNKFACTORY pIfFactory, PVBOXNETADP *ppNew) 591 582 { 583 PVBOXNETADPGLOBALS pGlobals = (PVBOXNETADPGLOBALS)((uint8_t *)pIfFactory - RT_OFFSETOF(VBOXNETADPGLOBALS, TrunkFactory)); 584 unsigned i; 592 585 int rc; 593 unsigned i;594 PVBOXNETADPGLOBALS pGlobals = (PVBOXNETADPGLOBALS)((uint8_t *)pIfFactory - RT_OFFSETOF(VBOXNETADPGLOBALS, TrunkFactory));595 586 596 587 for (i = 0; i < RT_ELEMENTS(pGlobals->aAdapters); i++) 597 588 { 598 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;599 589 PVBOXNETADP pThis = &pGlobals->aAdapters[i]; 600 590 … … 608 598 rc = vboxNetAdpOsCreate(pThis, &Mac); 609 599 *ppNew = pThis; 610 RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); 600 601 RTSpinlockAcquire(pThis->hSpinlock); 611 602 vboxNetAdpSetState(pThis, kVBoxNetAdpState_Available); 612 RTSpinlockReleaseNoInts(pThis->hSpinlock , &Tmp);603 RTSpinlockReleaseNoInts(pThis->hSpinlock); 613 604 return rc; 614 605 } … … 622 613 { 623 614 int rc = VINF_SUCCESS; 624 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; 625 626 RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); 615 616 RTSpinlockAcquire(pThis->hSpinlock); 627 617 if (vboxNetAdpGetState(pThis) != kVBoxNetAdpState_Available || pThis->cBusy) 628 618 { 629 RTSpinlockReleaseNoInts(pThis->hSpinlock , &Tmp);619 RTSpinlockReleaseNoInts(pThis->hSpinlock); 630 620 return VERR_INTNET_FLT_IF_BUSY; 631 621 } 632 622 vboxNetAdpSetState(pThis, kVBoxNetAdpState_Transitional); 633 RTSpinlockReleaseNoInts(pThis->hSpinlock , &Tmp);623 RTSpinlockReleaseNoInts(pThis->hSpinlock); 634 624 vboxNetAdpRelease(pThis); 635 625 636 626 vboxNetAdpOsDestroy(pThis); 637 627 638 RTSpinlockAcquire NoInts(pThis->hSpinlock, &Tmp);628 RTSpinlockAcquire(pThis->hSpinlock); 639 629 vboxNetAdpSetState(pThis, kVBoxNetAdpState_Invalid); 640 RTSpinlockReleaseNoInts(pThis->hSpinlock , &Tmp);630 RTSpinlockReleaseNoInts(pThis->hSpinlock); 641 631 642 632 return rc; … … 856 846 pNew->hEventIdle = NIL_RTSEMEVENT; 857 847 858 rc = RTSpinlockCreate(&pNew->hSpinlock );848 rc = RTSpinlockCreate(&pNew->hSpinlock, RTSPINLOCK_FLAGS_INTERRUPT_SAFE, "VBoxNetAdptSlotCreate"); 859 849 if (RT_SUCCESS(rc)) 860 850 { -
trunk/src/VBox/HostDrivers/VBoxNetFlt/VBoxNetFlt.c
r33540 r40806 375 375 static bool vboxNetFltMaybeRediscovered(PVBOXNETFLTINS pThis) 376 376 { 377 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;378 377 uint64_t Now; 379 378 bool fRediscovered; … … 396 395 */ 397 396 Now = RTTimeNanoTS(); 398 RTSpinlockAcquire NoInts(pThis->hSpinlock, &Tmp);397 RTSpinlockAcquire(pThis->hSpinlock); 399 398 400 399 fRediscovered = !ASMAtomicUoReadBool(&pThis->fDisconnectedFromHost); … … 405 404 ASMAtomicWriteBool(&pThis->fRediscoveryPending, true); 406 405 407 RTSpinlockReleaseNoInts(pThis->hSpinlock , &Tmp);406 RTSpinlockReleaseNoInts(pThis->hSpinlock); 408 407 409 408 /* … … 499 498 { 500 499 PVBOXNETFLTINS pThis = IFPORT_2_VBOXNETFLTINS(pIfPort); 501 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;502 500 INTNETTRUNKIFSTATE enmOldTrunkState; 503 501 … … 515 513 * Take the lock and change the state. 516 514 */ 517 RTSpinlockAcquire NoInts(pThis->hSpinlock, &Tmp);515 RTSpinlockAcquire(pThis->hSpinlock); 518 516 enmOldTrunkState = pThis->enmTrunkState; 519 517 if (enmOldTrunkState != enmState) 520 518 ASMAtomicWriteU32((uint32_t volatile *)&pThis->enmTrunkState, enmState); 521 RTSpinlockReleaseNoInts(pThis->hSpinlock , &Tmp);519 RTSpinlockReleaseNoInts(pThis->hSpinlock); 522 520 523 521 /* … … 602 600 { 603 601 PVBOXNETFLTINS pThis = IFPORT_2_VBOXNETFLTINS(pIfPort); 604 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;605 602 606 603 /* … … 623 620 * Disconnect and release it. 624 621 */ 625 RTSpinlockAcquire NoInts(pThis->hSpinlock, &Tmp);622 RTSpinlockAcquire(pThis->hSpinlock); 626 623 vboxNetFltSetState(pThis, kVBoxNetFltInsState_Disconnecting); 627 RTSpinlockReleaseNoInts(pThis->hSpinlock , &Tmp);624 RTSpinlockReleaseNoInts(pThis->hSpinlock); 628 625 629 626 vboxNetFltOsDisconnectIt(pThis); … … 631 628 632 629 #ifdef VBOXNETFLT_STATIC_CONFIG 633 RTSpinlockAcquire NoInts(pThis->hSpinlock, &Tmp);630 RTSpinlockAcquire(pThis->hSpinlock); 634 631 vboxNetFltSetState(pThis, kVBoxNetFltInsState_Unconnected); 635 RTSpinlockReleaseNoInts(pThis->hSpinlock , &Tmp);632 RTSpinlockReleaseNoInts(pThis->hSpinlock); 636 633 #endif 637 634 … … 814 811 DECLHIDDEN(bool) vboxNetFltTryRetainBusyActive(PVBOXNETFLTINS pThis) 815 812 { 816 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;817 813 uint32_t cRefs; 818 814 bool fRc; … … 834 830 * Do the retaining and checking behind the spinlock. 835 831 */ 836 RTSpinlockAcquire NoInts(pThis->hSpinlock, &Tmp);832 RTSpinlockAcquire(pThis->hSpinlock); 837 833 fRc = pThis->enmTrunkState == INTNETTRUNKIFSTATE_ACTIVE; 838 834 if (fRc) … … 844 840 AssertMsg(cRefs >= 1 && cRefs < UINT32_MAX / 2, ("%d\n", cRefs)); NOREF(cRefs); 845 841 } 846 RTSpinlockReleaseNoInts(pThis->hSpinlock , &Tmp);842 RTSpinlockReleaseNoInts(pThis->hSpinlock); 847 843 848 844 return fRc; … … 861 857 DECLHIDDEN(bool) vboxNetFltTryRetainBusyNotDisconnected(PVBOXNETFLTINS pThis) 862 858 { 863 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;864 859 uint32_t cRefs; 865 860 bool fRc; … … 881 876 * Do the retaining and checking behind the spinlock. 882 877 */ 883 RTSpinlockAcquire NoInts(pThis->hSpinlock, &Tmp);878 RTSpinlockAcquire(pThis->hSpinlock); 884 879 fRc = pThis->enmTrunkState == INTNETTRUNKIFSTATE_ACTIVE 885 880 || pThis->enmTrunkState == INTNETTRUNKIFSTATE_INACTIVE; … … 892 887 AssertMsg(cRefs >= 1 && cRefs < UINT32_MAX / 2, ("%d\n", cRefs)); NOREF(cRefs); 893 888 } 894 RTSpinlockReleaseNoInts(pThis->hSpinlock , &Tmp);889 RTSpinlockReleaseNoInts(pThis->hSpinlock); 895 890 896 891 return fRc; … … 1017 1012 memcpy(pNew->szName, pszName, cchName + 1); 1018 1013 1019 rc = RTSpinlockCreate(&pNew->hSpinlock );1014 rc = RTSpinlockCreate(&pNew->hSpinlock, RTSPINLOCK_FLAGS_INTERRUPT_SAFE, "VBoxNetFltNewInstance"); 1020 1015 if (RT_SUCCESS(rc)) 1021 1016 { -
trunk/src/VBox/HostDrivers/VBoxNetFlt/darwin/VBoxNetFlt-darwin.cpp
r38485 r40806 227 227 DECLINLINE(ifnet_t) vboxNetFltDarwinRetainIfNet(PVBOXNETFLTINS pThis) 228 228 { 229 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;230 229 ifnet_t pIfNet = NULL; 231 230 … … 233 232 * Be careful here to avoid problems racing the detached callback. 234 233 */ 235 RTSpinlockAcquire NoInts(pThis->hSpinlock, &Tmp);234 RTSpinlockAcquire(pThis->hSpinlock); 236 235 if (!ASMAtomicUoReadBool(&pThis->fDisconnectedFromHost)) 237 236 { … … 240 239 ifnet_reference(pIfNet); 241 240 } 242 RTSpinlockReleaseNoInts(pThis->hSpinlock , &Tmp);241 RTSpinlockReleaseNoInts(pThis->hSpinlock); 243 242 244 243 return pIfNet; … … 639 638 { 640 639 PVBOXNETFLTINS pThis = (PVBOXNETFLTINS)pvThis; 641 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;642 640 uint64_t NanoTS = RTTimeSystemNanoTS(); 643 641 LogFlow(("vboxNetFltDarwinIffDetached: pThis=%p NanoTS=%RU64 (%d)\n", … … 658 656 * behind it in order to avoid problematic races with the detached callback. 659 657 */ 660 RTSpinlockAcquire NoInts(pThis->hSpinlock, &Tmp);658 RTSpinlockAcquire(pThis->hSpinlock); 661 659 662 660 pIfNet = ASMAtomicUoReadPtrT(&pThis->u.s.pIfNet, ifnet_t); … … 671 669 ASMAtomicWriteBool(&pThis->fDisconnectedFromHost, true); 672 670 673 RTSpinlockReleaseNoInts(pThis->hSpinlock , &Tmp);671 RTSpinlockReleaseNoInts(pThis->hSpinlock); 674 672 675 673 if (pIfNet) … … 916 914 } 917 915 918 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; 919 RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); 916 RTSpinlockAcquire(pThis->hSpinlock); 920 917 ASMAtomicUoWritePtr(&pThis->u.s.pIfNet, pIfNet); 921 RTSpinlockReleaseNoInts(pThis->hSpinlock , &Tmp);918 RTSpinlockReleaseNoInts(pThis->hSpinlock); 922 919 923 920 /* … … 943 940 Assert(err || pIfFilter); 944 941 945 RTSpinlockAcquire NoInts(pThis->hSpinlock, &Tmp);942 RTSpinlockAcquire(pThis->hSpinlock); 946 943 pIfNet = ASMAtomicUoReadPtrT(&pThis->u.s.pIfNet, ifnet_t); 947 944 if (pIfNet && !err) … … 951 948 pIfNet = NULL; /* don't dereference it */ 952 949 } 953 RTSpinlockReleaseNoInts(pThis->hSpinlock , &Tmp);950 RTSpinlockReleaseNoInts(pThis->hSpinlock); 954 951 955 952 /* Report capabilities. */ … … 1163 1160 void vboxNetFltOsDeleteInstance(PVBOXNETFLTINS pThis) 1164 1161 { 1165 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;1166 1162 interface_filter_t pIfFilter; 1167 1163 … … 1169 1165 * Carefully obtain the interface filter reference and detach it. 1170 1166 */ 1171 RTSpinlockAcquire NoInts(pThis->hSpinlock, &Tmp);1167 RTSpinlockAcquire(pThis->hSpinlock); 1172 1168 pIfFilter = ASMAtomicUoReadPtrT(&pThis->u.s.pIfFilter, interface_filter_t); 1173 1169 if (pIfFilter) 1174 1170 ASMAtomicUoWriteNullPtr(&pThis->u.s.pIfFilter); 1175 RTSpinlockReleaseNoInts(pThis->hSpinlock , &Tmp);1171 RTSpinlockReleaseNoInts(pThis->hSpinlock); 1176 1172 1177 1173 if (pIfFilter) -
trunk/src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c
r37423 r40806 581 581 struct ifnet *ifp; 582 582 node_p node; 583 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;584 583 585 584 VBOXCURVNET_SET_FROM_UCRED(); … … 593 592 return VERR_INTERNAL_ERROR; 594 593 595 RTSpinlockAcquire NoInts(pThis->hSpinlock, &Tmp);594 RTSpinlockAcquire(pThis->hSpinlock); 596 595 597 596 ASMAtomicUoWritePtr(&pThis->u.s.ifp, ifp); … … 610 609 TASK_INIT(&pThis->u.s.tskout, 0, vboxNetFltFreeBSDoutput, pThis); 611 610 612 RTSpinlockReleaseNoInts(pThis->hSpinlock , &Tmp);611 RTSpinlockReleaseNoInts(pThis->hSpinlock); 613 612 614 613 NG_NODE_SET_PRIVATE(node, pThis); -
trunk/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
r40733 r40806 382 382 { 383 383 PVBOXNETDEVICEOPSOVERRIDE pOverride; 384 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;385 384 386 385 /* Cancel override if ethtool_ops is missing (host-only case, #5712) */ … … 402 401 pOverride->pVBoxNetFlt = pThis; 403 402 404 RTSpinlockAcquire NoInts(pThis->hSpinlock, &Tmp); /* (this isn't necessary, but so what) */403 RTSpinlockAcquire(pThis->hSpinlock); /* (this isn't necessary, but so what) */ 405 404 ASMAtomicWritePtr((void * volatile *)&pDev->OVR_OPS, pOverride); 406 405 # if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) 407 406 ASMAtomicXchgPtr((void * volatile *)&pDev->hard_start_xmit, vboxNetFltLinuxStartXmitFilter); 408 407 # endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) */ 409 RTSpinlockReleaseNoInts(pThis->hSpinlock , &Tmp);408 RTSpinlockReleaseNoInts(pThis->hSpinlock); 410 409 } 411 410 … … 420 419 { 421 420 PVBOXNETDEVICEOPSOVERRIDE pOverride; 422 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; 423 424 RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); 421 422 RTSpinlockAcquire(pThis->hSpinlock); 425 423 if (!pDev) 426 424 pDev = ASMAtomicUoReadPtrT(&pThis->u.s.pDev, struct net_device *); … … 444 442 else 445 443 pOverride = NULL; 446 RTSpinlockReleaseNoInts(pThis->hSpinlock , &Tmp);444 RTSpinlockReleaseNoInts(pThis->hSpinlock); 447 445 448 446 if (pOverride) … … 465 463 { 466 464 #if 0 467 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;468 465 struct net_device *pDev = NULL; 469 466 … … 472 469 * Be careful here to avoid problems racing the detached callback. 473 470 */ 474 RTSpinlockAcquire(pThis->hSpinlock , &Tmp);471 RTSpinlockAcquire(pThis->hSpinlock); 475 472 if (!ASMAtomicUoReadBool(&pThis->fDisconnectedFromHost)) 476 473 { … … 489 486 } 490 487 } 491 RTSpinlockRelease(pThis->hSpinlock , &Tmp);488 RTSpinlockRelease(pThis->hSpinlock); 492 489 493 490 Log(("vboxNetFltLinuxRetainNetDev - done\n")); … … 1382 1379 PINTNETTRUNKSWPORT pSwitchPort; 1383 1380 unsigned int fFeatures; 1384 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; 1385 1386 RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); 1381 1382 RTSpinlockAcquire(pThis->hSpinlock); 1387 1383 1388 1384 pSwitchPort = pThis->pSwitchPort; /* this doesn't need to be here, but it doesn't harm. */ … … 1393 1389 fFeatures = 0; 1394 1390 1395 RTSpinlockReleaseNoInts(pThis->hSpinlock , &Tmp);1391 RTSpinlockReleaseNoInts(pThis->hSpinlock); 1396 1392 1397 1393 if (pThis->pSwitchPort) … … 1498 1494 static int vboxNetFltLinuxAttachToInterface(PVBOXNETFLTINS pThis, struct net_device *pDev) 1499 1495 { 1500 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;1501 1496 LogFlow(("vboxNetFltLinuxAttachToInterface: pThis=%p (%s)\n", pThis, pThis->szName)); 1502 1497 … … 1506 1501 dev_hold(pDev); 1507 1502 1508 RTSpinlockAcquire NoInts(pThis->hSpinlock, &Tmp);1503 RTSpinlockAcquire(pThis->hSpinlock); 1509 1504 ASMAtomicUoWritePtr(&pThis->u.s.pDev, pDev); 1510 RTSpinlockReleaseNoInts(pThis->hSpinlock , &Tmp);1505 RTSpinlockReleaseNoInts(pThis->hSpinlock); 1511 1506 1512 1507 Log(("vboxNetFltLinuxAttachToInterface: Device %p(%s) retained. ref=%d\n", … … 1546 1541 * the device notification handle. 1547 1542 */ 1548 RTSpinlockAcquire NoInts(pThis->hSpinlock, &Tmp);1543 RTSpinlockAcquire(pThis->hSpinlock); 1549 1544 pDev = ASMAtomicUoReadPtrT(&pThis->u.s.pDev, struct net_device *); 1550 1545 if (pDev) … … 1554 1549 pDev = NULL; /* don't dereference it */ 1555 1550 } 1556 RTSpinlockReleaseNoInts(pThis->hSpinlock , &Tmp);1551 RTSpinlockReleaseNoInts(pThis->hSpinlock); 1557 1552 Log(("vboxNetFltLinuxAttachToInterface: this=%p: Packet handler installed.\n", pThis)); 1558 1553 … … 1578 1573 vboxNetFltLinuxUnhookDev(pThis, pDev); 1579 1574 #endif 1580 RTSpinlockAcquire NoInts(pThis->hSpinlock, &Tmp);1575 RTSpinlockAcquire(pThis->hSpinlock); 1581 1576 ASMAtomicUoWriteNullPtr(&pThis->u.s.pDev); 1582 RTSpinlockReleaseNoInts(pThis->hSpinlock , &Tmp);1577 RTSpinlockReleaseNoInts(pThis->hSpinlock); 1583 1578 dev_put(pDev); 1584 1579 Log(("vboxNetFltLinuxAttachToInterface: Device %p(%s) released. ref=%d\n", … … 1599 1594 static int vboxNetFltLinuxUnregisterDevice(PVBOXNETFLTINS pThis, struct net_device *pDev) 1600 1595 { 1601 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;1602 1603 1596 Assert(!pThis->fDisconnectedFromHost); 1604 1597 … … 1607 1600 #endif 1608 1601 1609 RTSpinlockAcquire NoInts(pThis->hSpinlock, &Tmp);1602 RTSpinlockAcquire(pThis->hSpinlock); 1610 1603 ASMAtomicWriteBool(&pThis->u.s.fRegistered, false); 1611 1604 ASMAtomicWriteBool(&pThis->fDisconnectedFromHost, true); 1612 1605 ASMAtomicUoWriteNullPtr(&pThis->u.s.pDev); 1613 RTSpinlockReleaseNoInts(pThis->hSpinlock , &Tmp);1606 RTSpinlockReleaseNoInts(pThis->hSpinlock); 1614 1607 1615 1608 dev_remove_pack(&pThis->u.s.PacketType); … … 1902 1895 struct net_device *pDev; 1903 1896 bool fRegistered; 1904 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;1905 1897 1906 1898 #ifdef VBOXNETFLT_WITH_HOST2WIRE_FILTER … … 1913 1905 * ways. */ 1914 1906 1915 RTSpinlockAcquire NoInts(pThis->hSpinlock, &Tmp);1907 RTSpinlockAcquire(pThis->hSpinlock); 1916 1908 pDev = ASMAtomicUoReadPtrT(&pThis->u.s.pDev, struct net_device *); 1917 1909 fRegistered = ASMAtomicUoReadBool(&pThis->u.s.fRegistered); 1918 RTSpinlockReleaseNoInts(pThis->hSpinlock , &Tmp);1910 RTSpinlockReleaseNoInts(pThis->hSpinlock); 1919 1911 1920 1912 if (fRegistered) -
trunk/src/VBox/HostDrivers/VBoxNetFlt/solaris/VBoxNetFlt-solaris.c
r40231 r40806 1081 1081 * the promiscuous OFF acknowledgement case). 1082 1082 */ 1083 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; 1084 RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); 1083 RTSpinlockAcquire(pThis->hSpinlock); 1085 1084 const bool fActive = pThis->enmTrunkState == INTNETTRUNKIFSTATE_ACTIVE; 1086 1085 vboxNetFltRetain(pThis, true /* fBusy */); 1087 RTSpinlockReleaseNoInts(pThis->hSpinlock , &Tmp);1086 RTSpinlockReleaseNoInts(pThis->hSpinlock); 1088 1087 1089 1088 vboxnetflt_promisc_stream_t *pPromiscStream = (vboxnetflt_promisc_stream_t *)pStream; -
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/drv/VBoxNetFltM-win.cpp
r36184 r40806 132 132 DECLHIDDEN(NDIS_STATUS) vboxNetFltWinMpDoDeinitialization(PVBOXNETFLTINS pNetFlt) 133 133 { 134 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;135 134 uint64_t NanoTS = RTTimeSystemNanoTS(); 136 135 137 136 Assert(vboxNetFltWinGetOpState(&pNetFlt->u.s.WinIf.MpState) == kVBoxNetDevOpState_Initialized); 138 137 139 RTSpinlockAcquire NoInts(pNetFlt->hSpinlock, &Tmp);138 RTSpinlockAcquire(pNetFlt->hSpinlock); 140 139 ASMAtomicUoWriteBool(&pNetFlt->fDisconnectedFromHost, true); 141 140 ASMAtomicUoWriteBool(&pNetFlt->fRediscoveryPending, false); … … 144 143 vboxNetFltWinSetOpState(&pNetFlt->u.s.WinIf.MpState, kVBoxNetDevOpState_Deinitializing); 145 144 146 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock , &Tmp);145 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock); 147 146 148 147 vboxNetFltWinWaitDereference(&pNetFlt->u.s.WinIf.MpState); … … 505 504 static UINT vboxNetFltWinMpRequestStatePrep(PVBOXNETFLTINS pNetFlt, NDIS_STATUS *pStatus) 506 505 { 507 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;508 509 506 Assert(!pNetFlt->u.s.WinIf.StateFlags.fRequestInfo); 510 507 … … 516 513 } 517 514 518 RTSpinlockAcquire NoInts(pNetFlt->hSpinlock, &Tmp);515 RTSpinlockAcquire(pNetFlt->hSpinlock); 519 516 Assert(!pNetFlt->u.s.WinIf.StateFlags.fRequestInfo); 520 517 if (vboxNetFltWinGetOpState(&pNetFlt->u.s.WinIf.PtState) > kVBoxNetDevOpState_Initialized /* protocol unbind in progress */ 521 518 || vboxNetFltWinGetPowerState(&pNetFlt->u.s.WinIf.MpState) > NdisDeviceStateD0) 522 519 { 523 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock , &Tmp);520 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock); 524 521 *pStatus = NDIS_STATUS_FAILURE; 525 522 return 0; … … 530 527 { 531 528 pNetFlt->u.s.WinIf.StateFlags.fRequestInfo = VBOXNDISREQUEST_INPROGRESS | VBOXNDISREQUEST_QUEUED; 532 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock , &Tmp);529 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock); 533 530 *pStatus = NDIS_STATUS_PENDING; 534 531 return VBOXNDISREQUEST_INPROGRESS | VBOXNDISREQUEST_QUEUED; … … 537 534 if (pNetFlt->u.s.WinIf.StateFlags.fStandBy) 538 535 { 539 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock , &Tmp);536 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock); 540 537 *pStatus = NDIS_STATUS_FAILURE; 541 538 return 0; … … 544 541 pNetFlt->u.s.WinIf.StateFlags.fRequestInfo = VBOXNDISREQUEST_INPROGRESS; 545 542 546 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock , &Tmp);543 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock); 547 544 548 545 *pStatus = NDIS_STATUS_SUCCESS; … … 776 773 { 777 774 PVBOXNETFLTINS pNetFlt = (PVBOXNETFLTINS)MiniportAdapterContext; 778 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;779 775 NDIS_STATUS Status = NDIS_STATUS_FAILURE; 780 776 -
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/drv/VBoxNetFltM-win.h
r36207 r40806 26 26 DECLHIDDEN(NDIS_STATUS) vboxNetFltWinMpDoInitialization(PVBOXNETFLTINS pThis, NDIS_HANDLE hMiniportAdapter, NDIS_HANDLE hWrapperConfigurationContext); 27 27 DECLHIDDEN(NDIS_STATUS) vboxNetFltWinMpDoDeinitialization(PVBOXNETFLTINS pThis); 28 28 29 #else 30 29 31 DECLHIDDEN(NDIS_STATUS) vboxNetFltWinMpInitializeDevideInstance(PVBOXNETFLTINS pThis); 30 32 DECLHIDDEN(bool) vboxNetFltWinMpDeInitializeDeviceInstance(PVBOXNETFLTINS pThis, PNDIS_STATUS pStatus); 33 31 34 DECLINLINE(VOID) vboxNetFltWinMpRequestStateComplete(PVBOXNETFLTINS pNetFlt) 32 35 { 33 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; 34 RTSpinlockAcquireNoInts(pNetFlt->hSpinlock, &Tmp); 36 RTSpinlockAcquire(pNetFlt->hSpinlock); 35 37 pNetFlt->u.s.WinIf.StateFlags.fRequestInfo = 0; 36 RTSpinlockRelease NoInts(pNetFlt->hSpinlock, &Tmp);38 RTSpinlockRelease(pNetFlt->hSpinlock); 37 39 } 40 38 41 DECLHIDDEN(NDIS_STATUS) vboxNetFltWinMpRequestPost(PVBOXNETFLTINS pNetFlt); 39 42 #endif -
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/drv/VBoxNetFltP-win.cpp
r36184 r40806 162 162 static void vboxNetFltWinPtRequestsWaitComplete(PVBOXNETFLTINS pNetFlt) 163 163 { 164 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;165 166 164 /* wait for request to complete */ 167 165 while (vboxNetFltWinAtomicUoReadWinState(pNetFlt->u.s.WinIf.StateFlags).fRequestInfo == VBOXNDISREQUEST_INPROGRESS) … … 173 171 * If the below miniport is going to low power state, complete the queued request 174 172 */ 175 RTSpinlockAcquire NoInts(pNetFlt->hSpinlock, &Tmp);173 RTSpinlockAcquire(pNetFlt->hSpinlock); 176 174 if (pNetFlt->u.s.WinIf.StateFlags.fRequestInfo & VBOXNDISREQUEST_QUEUED) 177 175 { 178 176 /* mark the request as InProgress before posting it to RequestComplete */ 179 177 pNetFlt->u.s.WinIf.StateFlags.fRequestInfo = VBOXNDISREQUEST_INPROGRESS; 180 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock , &Tmp);178 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock); 181 179 vboxNetFltWinPtRequestComplete(pNetFlt, &pNetFlt->u.s.WinIf.PassDownRequest, NDIS_STATUS_FAILURE); 182 180 } 183 181 else 184 182 { 185 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock , &Tmp);183 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock); 186 184 } 187 185 } … … 190 188 { 191 189 NDIS_STATUS Status; 192 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;193 190 uint64_t NanoTS = RTTimeSystemNanoTS(); 194 191 int cPPUsage; … … 200 197 Assert(vboxNetFltWinGetOpState(&pNetFlt->u.s.WinIf.PtState) == kVBoxNetDevOpState_Initialized); 201 198 202 RTSpinlockAcquire NoInts(pNetFlt->hSpinlock, &Tmp);199 RTSpinlockAcquire(pNetFlt->hSpinlock); 203 200 204 201 ASMAtomicUoWriteBool(&pNetFlt->fDisconnectedFromHost, true); … … 212 209 } 213 210 214 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock , &Tmp);211 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock); 215 212 216 213 vboxNetFltWinPtRequestsWaitComplete(pNetFlt); … … 1400 1397 DECLHIDDEN(bool) vboxNetFltWinPtCloseInterface(PVBOXNETFLTINS pNetFlt, PNDIS_STATUS pStatus) 1401 1398 { 1402 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; 1403 1404 RTSpinlockAcquireNoInts(pNetFlt->hSpinlock, &Tmp); 1399 RTSpinlockAcquire(pNetFlt->hSpinlock); 1405 1400 1406 1401 if (pNetFlt->u.s.WinIf.StateFlags.fInterfaceClosing) 1407 1402 { 1408 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock , &Tmp);1403 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock); 1409 1404 Assert(0); 1410 1405 return false; … … 1412 1407 if (pNetFlt->u.s.WinIf.hBinding == NULL) 1413 1408 { 1414 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock , &Tmp);1409 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock); 1415 1410 Assert(0); 1416 1411 return false; … … 1418 1413 1419 1414 pNetFlt->u.s.WinIf.StateFlags.fInterfaceClosing = TRUE; 1420 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock , &Tmp);1415 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock); 1421 1416 1422 1417 NdisResetEvent(&pNetFlt->u.s.WinIf.OpenCloseEvent); … … 1438 1433 { 1439 1434 NDIS_DEVICE_POWER_STATE enmPrevPowerState = vboxNetFltWinGetPowerState(&pNetFlt->u.s.WinIf.PtState); 1440 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; 1441 1442 RTSpinlockAcquireNoInts(pNetFlt->hSpinlock, &Tmp); 1435 1436 RTSpinlockAcquire(pNetFlt->hSpinlock); 1443 1437 1444 1438 vboxNetFltWinSetPowerState(&pNetFlt->u.s.WinIf.PtState, enmPowerState); … … 1450 1444 pNetFlt->u.s.WinIf.StateFlags.fStandBy = TRUE; 1451 1445 } 1452 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock , &Tmp);1446 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock); 1453 1447 vboxNetFltWinPtRequestsWaitComplete(pNetFlt); 1454 1448 vboxNetFltWinWaitDereference(&pNetFlt->u.s.WinIf.MpState); … … 1475 1469 { 1476 1470 pNetFlt->u.s.WinIf.StateFlags.fRequestInfo = VBOXNDISREQUEST_INPROGRESS; 1477 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock , &Tmp);1471 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock); 1478 1472 1479 1473 vboxNetFltWinMpRequestPost(pNetFlt); … … 1481 1475 else 1482 1476 { 1483 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock , &Tmp);1477 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock); 1484 1478 } 1485 1479 } -
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/drv/VBoxNetFltRt-win.cpp
r37161 r40806 1059 1059 DECLHIDDEN(void) vboxNetFltWinQuFiniPacketQueue(PVBOXNETFLTINS pInstance) 1060 1060 { 1061 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;1062 1061 PINTNETSG pSG; 1063 1062 PPACKET_QUEUE_WORKER pWorker = &pInstance->u.s.PacketQueueWorker; … … 1065 1064 1066 1065 /* using the pPacketQueueSG as an indicator that the packet queue is initialized */ 1067 RTSpinlockAcquire NoInts((pInstance)->hSpinlock, &Tmp);1066 RTSpinlockAcquire((pInstance)->hSpinlock); 1068 1067 if (pWorker->pSG) 1069 1068 { 1070 1069 pSG = pWorker->pSG; 1071 1070 pWorker->pSG = NULL; 1072 RTSpinlockReleaseNoInts((pInstance)->hSpinlock , &Tmp);1071 RTSpinlockReleaseNoInts((pInstance)->hSpinlock); 1073 1072 KeSetEvent(&pWorker->KillEvent, 0, FALSE); 1074 1073 … … 1084 1083 else 1085 1084 { 1086 RTSpinlockReleaseNoInts((pInstance)->hSpinlock , &Tmp);1085 RTSpinlockReleaseNoInts((pInstance)->hSpinlock); 1087 1086 } 1088 1087 } … … 1845 1844 USHORT cbAnsiName = pBindToMiniportName->Length;/* the length is is bytes ; *2 ;RtlUnicodeStringToAnsiSize(pBindToMiniportName)*/ 1846 1845 CREATE_INSTANCE_CONTEXT Context; 1847 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;1848 1846 1849 1847 # ifndef VBOXNETADP … … 2611 2609 static int vboxNetFltWinDeleteInstance(PVBOXNETFLTINS pThis) 2612 2610 { 2613 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;2614 2611 LogFlow(("vboxNetFltWinDeleteInstance: pThis=0x%p \n", pThis)); 2615 2612 … … 2646 2643 DECLHIDDEN(NDIS_STATUS) vboxNetFltWinDetachFromInterface(PVBOXNETFLTINS pNetFlt, bool bOnUnbind) 2647 2644 { 2648 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;2649 2645 NDIS_STATUS Status; 2650 2646 int rc; … … 2787 2783 if (RT_SUCCESS(rc)) 2788 2784 { 2789 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;2790 2785 Assert(vboxNetFltWinGetWinIfState(pThis) == kVBoxWinIfState_Disconnected); 2791 2786 Assert(vboxNetFltWinGetOpState(&pThis->u.s.WinIf.MpState) == kVBoxNetDevOpState_Deinitialized); … … 2830 2825 #endif 2831 2826 /* 4. mark as connected */ 2832 RTSpinlockAcquire NoInts(pThis->hSpinlock, &Tmp);2827 RTSpinlockAcquire(pThis->hSpinlock); 2833 2828 ASMAtomicUoWriteBool(&pThis->fDisconnectedFromHost, false); 2834 RTSpinlockRelease NoInts(pThis->hSpinlock, &Tmp);2829 RTSpinlockRelease(pThis->hSpinlock); 2835 2830 2836 2831 pAttachInfo->Status = VINF_SUCCESS; -
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/drv/VBoxNetFltRt-win.h
r36184 r40806 587 587 DECLINLINE(bool) vboxNetFltWinReferenceWinIfNetFlt(PVBOXNETFLTINS pNetFlt, bool * pbNetFltActive) 588 588 { 589 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; 590 591 RTSpinlockAcquireNoInts((pNetFlt)->hSpinlock, &Tmp); 589 RTSpinlockAcquire((pNetFlt)->hSpinlock); 592 590 #ifndef VBOXNETADP 593 591 if(!vboxNetFltWinDoReferenceDevices(&pNetFlt->u.s.WinIf.MpState, &pNetFlt->u.s.WinIf.PtState)) … … 596 594 #endif 597 595 { 598 RTSpinlockReleaseNoInts((pNetFlt)->hSpinlock , &Tmp);596 RTSpinlockReleaseNoInts((pNetFlt)->hSpinlock); 599 597 *pbNetFltActive = false; 600 598 return false; … … 604 602 { 605 603 vboxNetFltWinReferenceModePassThru(pNetFlt); 606 RTSpinlockReleaseNoInts((pNetFlt)->hSpinlock , &Tmp);604 RTSpinlockReleaseNoInts((pNetFlt)->hSpinlock); 607 605 *pbNetFltActive = false; 608 606 return true; … … 611 609 vboxNetFltRetain((pNetFlt), true /* fBusy */); 612 610 vboxNetFltWinReferenceModeNetFlt(pNetFlt); 613 RTSpinlockReleaseNoInts((pNetFlt)->hSpinlock , &Tmp);611 RTSpinlockReleaseNoInts((pNetFlt)->hSpinlock); 614 612 615 613 *pbNetFltActive = true; … … 619 617 DECLINLINE(bool) vboxNetFltWinIncReferenceWinIfNetFlt(PVBOXNETFLTINS pNetFlt, uint32_t v, bool *pbNetFltActive) 620 618 { 621 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;622 619 uint32_t i; 623 620 … … 629 626 } 630 627 631 RTSpinlockAcquire NoInts((pNetFlt)->hSpinlock, &Tmp);628 RTSpinlockAcquire((pNetFlt)->hSpinlock); 632 629 #ifndef VBOXNETADP 633 630 if(!vboxNetFltWinDoIncReferenceDevices(&pNetFlt->u.s.WinIf.MpState, &pNetFlt->u.s.WinIf.PtState, v)) … … 636 633 #endif 637 634 { 638 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock , &Tmp);635 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock); 639 636 *pbNetFltActive = false; 640 637 return false; … … 645 642 vboxNetFltWinIncReferenceModePassThru(pNetFlt, v); 646 643 647 RTSpinlockReleaseNoInts((pNetFlt)->hSpinlock , &Tmp);644 RTSpinlockReleaseNoInts((pNetFlt)->hSpinlock); 648 645 *pbNetFltActive = false; 649 646 return true; … … 654 651 vboxNetFltWinIncReferenceModeNetFlt(pNetFlt, v); 655 652 656 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock , &Tmp);653 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock); 657 654 658 655 /* we have marked it as busy, so can do the res references outside the lock */ … … 705 702 DECLINLINE(bool) vboxNetFltWinIncReferenceWinIf(PVBOXNETFLTINS pNetFlt, uint32_t v) 706 703 { 707 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;708 709 704 Assert(v); 710 705 if(!v) … … 713 708 } 714 709 715 RTSpinlockAcquire NoInts(pNetFlt->hSpinlock, &Tmp);710 RTSpinlockAcquire(pNetFlt->hSpinlock); 716 711 #ifdef VBOXNETADP 717 712 if(vboxNetFltWinDoIncReferenceDevice(&pNetFlt->u.s.WinIf.MpState, v)) … … 720 715 #endif 721 716 { 722 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock , &Tmp);717 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock); 723 718 return true; 724 719 } 725 720 726 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock , &Tmp);721 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock); 727 722 return false; 728 723 } … … 730 725 DECLINLINE(bool) vboxNetFltWinReferenceWinIf(PVBOXNETFLTINS pNetFlt) 731 726 { 732 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; 733 RTSpinlockAcquireNoInts(pNetFlt->hSpinlock, &Tmp); 727 RTSpinlockAcquire(pNetFlt->hSpinlock); 734 728 #ifdef VBOXNETADP 735 729 if(vboxNetFltWinDoReferenceDevice(&pNetFlt->u.s.WinIf.MpState)) … … 738 732 #endif 739 733 { 740 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock , &Tmp);734 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock); 741 735 return true; 742 736 } 743 737 744 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock , &Tmp);738 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock); 745 739 return false; 746 740 } -
trunk/src/VBox/HostDrivers/VBoxPci/VBoxPci.c
r37423 r40806 74 74 return NULL; 75 75 } 76 DECLINLINE(int) vboxPciDevLock(PVBOXRAWPCIINS pThis, 77 PRTSPINLOCKTMP pTmp) 76 DECLINLINE(int) vboxPciDevLock(PVBOXRAWPCIINS pThis) 78 77 { 79 78 #ifdef VBOX_WITH_SHARED_PCI_INTERRUPTS 80 RTSpinlockAcquire NoInts(pThis->hSpinlock, pTmp);79 RTSpinlockAcquire(pThis->hSpinlock); 81 80 return VINF_SUCCESS; 82 81 #else … … 89 88 } 90 89 91 DECLINLINE(void) vboxPciDevUnlock(PVBOXRAWPCIINS pThis, 92 PRTSPINLOCKTMP pTmp) 90 DECLINLINE(void) vboxPciDevUnlock(PVBOXRAWPCIINS pThis) 93 91 { 94 92 #ifdef VBOX_WITH_SHARED_PCI_INTERRUPTS 95 RTSpinlockReleaseNoInts(pThis->hSpinlock , pTmp);93 RTSpinlockReleaseNoInts(pThis->hSpinlock); 96 94 #else 97 95 NOREF(pTmp); … … 184 182 PVBOXRAWPCIINS pThis = DEVPORT_2_VBOXRAWPCIINS(pPort); 185 183 int rc; 186 RTSPINLOCKTMP aTmp; 187 188 vboxPciDevLock(pThis, &aTmp); 184 185 vboxPciDevLock(pThis); 189 186 190 187 rc = vboxPciOsDevInit(pThis, fFlags); 191 188 192 vboxPciDevUnlock(pThis , &aTmp);189 vboxPciDevUnlock(pThis); 193 190 194 191 return rc; … … 202 199 PVBOXRAWPCIINS pThis = DEVPORT_2_VBOXRAWPCIINS(pPort); 203 200 int rc; 204 RTSPINLOCKTMP aTmp; 205 206 vboxPciDevLock(pThis, &aTmp); 201 202 vboxPciDevLock(pThis); 207 203 208 204 if (pThis->IrqHandler.pfnIrqHandler) … … 215 211 rc = vboxPciOsDevDeinit(pThis, fFlags); 216 212 217 vboxPciDevUnlock(pThis , &aTmp);213 vboxPciDevUnlock(pThis); 218 214 219 215 return rc; … … 265 261 PVBOXRAWPCIINS pThis = DEVPORT_2_VBOXRAWPCIINS(pPort); 266 262 int rc; 267 RTSPINLOCKTMP aTmp; 268 269 vboxPciDevLock(pThis, &aTmp); 263 264 vboxPciDevLock(pThis); 270 265 271 266 rc = vboxPciOsDevGetRegionInfo(pThis, iRegion, 272 267 pRegionStart, pu64RegionSize, 273 268 pfPresent, pfFlags); 274 vboxPciDevUnlock(pThis , &aTmp);269 vboxPciDevUnlock(pThis); 275 270 276 271 return rc; … … 289 284 PVBOXRAWPCIINS pThis = DEVPORT_2_VBOXRAWPCIINS(pPort); 290 285 int rc; 291 RTSPINLOCKTMP aTmp; 292 293 vboxPciDevLock(pThis, &aTmp); 286 287 vboxPciDevLock(pThis); 294 288 295 289 rc = vboxPciOsDevMapRegion(pThis, iRegion, RegionStart, u64RegionSize, fFlags, pRegionBase); 296 290 297 vboxPciDevUnlock(pThis , &aTmp);291 vboxPciDevUnlock(pThis); 298 292 299 293 return rc; … … 311 305 PVBOXRAWPCIINS pThis = DEVPORT_2_VBOXRAWPCIINS(pPort); 312 306 int rc; 313 RTSPINLOCKTMP aTmp; 314 315 vboxPciDevLock(pThis, &aTmp); 307 308 vboxPciDevLock(pThis); 316 309 317 310 rc = vboxPciOsDevUnmapRegion(pThis, iRegion, RegionStart, u64RegionSize, RegionBase); 318 311 319 vboxPciDevUnlock(pThis , &aTmp);312 vboxPciDevUnlock(pThis); 320 313 321 314 return rc; … … 330 323 { 331 324 PVBOXRAWPCIINS pThis = DEVPORT_2_VBOXRAWPCIINS(pPort); 332 RTSPINLOCKTMP aTmp; 333 int rc; 334 335 vboxPciDevLock(pThis, &aTmp); 325 int rc; 326 327 vboxPciDevLock(pThis); 336 328 337 329 rc = vboxPciOsDevPciCfgRead(pThis, Register, pValue); 338 330 339 vboxPciDevUnlock(pThis , &aTmp);331 vboxPciDevUnlock(pThis); 340 332 341 333 return rc; … … 351 343 PVBOXRAWPCIINS pThis = DEVPORT_2_VBOXRAWPCIINS(pPort); 352 344 int rc; 353 RTSPINLOCKTMP aTmp; 354 355 vboxPciDevLock(pThis, &aTmp); 345 346 vboxPciDevLock(pThis); 356 347 357 348 rc = vboxPciOsDevPciCfgWrite(pThis, Register, pValue); 358 349 359 vboxPciDevUnlock(pThis , &aTmp);350 vboxPciDevUnlock(pThis); 360 351 361 352 return rc; … … 370 361 int rc; 371 362 int32_t iHostIrq = 0; 372 RTSPINLOCKTMP aTmp;373 363 374 364 if (pfnHandler == NULL) 375 365 return VERR_INVALID_PARAMETER; 376 366 377 vboxPciDevLock(pThis , &aTmp);367 vboxPciDevLock(pThis); 378 368 379 369 if (pThis->IrqHandler.pfnIrqHandler) … … 393 383 } 394 384 395 vboxPciDevUnlock(pThis , &aTmp);385 vboxPciDevUnlock(pThis); 396 386 397 387 return rc; … … 403 393 PVBOXRAWPCIINS pThis = DEVPORT_2_VBOXRAWPCIINS(pPort); 404 394 int rc; 405 RTSPINLOCKTMP aTmp;406 395 407 396 if (hIsr != 0xcafe0000) 408 397 return VERR_INVALID_PARAMETER; 409 398 410 vboxPciDevLock(pThis , &aTmp);399 vboxPciDevLock(pThis); 411 400 412 401 rc = vboxPciOsDevUnregisterIrqHandler(pThis, pThis->IrqHandler.iHostIrq); … … 417 406 pThis->IrqHandler.iHostIrq = 0; 418 407 } 419 vboxPciDevUnlock(pThis , &aTmp);408 vboxPciDevUnlock(pThis); 420 409 421 410 return rc; … … 428 417 PVBOXRAWPCIINS pThis = DEVPORT_2_VBOXRAWPCIINS(pPort); 429 418 int rc; 430 RTSPINLOCKTMP aTmp; 431 432 vboxPciDevLock(pThis, &aTmp); 419 420 vboxPciDevLock(pThis); 433 421 434 422 rc = vboxPciOsDevPowerStateChange(pThis, aState); … … 448 436 449 437 450 vboxPciDevUnlock(pThis , &aTmp);438 vboxPciDevUnlock(pThis); 451 439 452 440 return rc; -
trunk/src/VBox/HostDrivers/VBoxUSB/VBoxUSBFilterMgr.cpp
r36941 r40806 46 46 47 47 # define VBOXUSBFILTERMGR_LOCK() \ 48 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; \ 49 RTSpinlockAcquireNoInts(g_Spinlock, &Tmp) 48 RTSpinlockAcquire(g_Spinlock) 50 49 51 50 # define VBOXUSBFILTERMGR_UNLOCK() \ 52 RTSpinlockRelease NoInts(g_Spinlock, &Tmp)51 RTSpinlockRelease(g_Spinlock) 53 52 54 53 #else … … 124 123 { 125 124 #ifdef VBOXUSBFILTERMGR_USB_SPINLOCK 126 int rc = RTSpinlockCreate(&g_Spinlock );125 int rc = RTSpinlockCreate(&g_Spinlock, RTSPINLOCK_FLAGS_INTERRUPT_SAFE, "VBoxUSBFilter"); 127 126 #else 128 127 int rc = RTSemFastMutexCreate(&g_Mtx);
Note:
See TracChangeset
for help on using the changeset viewer.