Differential D28871 Diff 84858 emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_spinlock-r0drv-freebsd.c
Changeset View
Changeset View
Standalone View
Standalone View
emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_spinlock-r0drv-freebsd.c
--- src/VBox/Runtime/r0drv/freebsd/spinlock-r0drv-freebsd.c.orig 2018-10-15 14:31:31 UTC | --- src/VBox/Runtime/r0drv/freebsd/spinlock-r0drv-freebsd.c.orig 2021-01-07 15:42:09 UTC | ||||
+++ src/VBox/Runtime/r0drv/freebsd/spinlock-r0drv-freebsd.c | +++ src/VBox/Runtime/r0drv/freebsd/spinlock-r0drv-freebsd.c | ||||
@@ -82,7 +82,9 @@ RTDECL(int) RTSpinlockCreate(PRTSPINLOCK pSpinlock, u | @@ -106,7 +106,9 @@ RTDECL(int) RTSpinlockCreate(PRTSPINLOCK pSpinlock, u | ||||
* Allocate. | * Allocate. | ||||
*/ | */ | ||||
AssertCompile(sizeof(RTSPINLOCKINTERNAL) > sizeof(void *)); | AssertCompile(sizeof(RTSPINLOCKINTERNAL) > sizeof(void *)); | ||||
+ IPRT_FREEBSD_SAVE_EFL_AC(); | + IPRT_FREEBSD_SAVE_EFL_AC(); | ||||
PRTSPINLOCKINTERNAL pThis = (PRTSPINLOCKINTERNAL)RTMemAllocZ(sizeof(*pThis)); | PRTSPINLOCKINTERNAL pThis = (PRTSPINLOCKINTERNAL)RTMemAllocZ(sizeof(*pThis)); | ||||
+ IPRT_FREEBSD_RESTORE_EFL_AC(); | + IPRT_FREEBSD_RESTORE_EFL_AC(); | ||||
if (!pThis) | if (!pThis) | ||||
return VERR_NO_MEMORY; | return VERR_NO_MEMORY; | ||||
@@ -116,7 +118,9 @@ RTDECL(int) RTSpinlockDestroy(RTSPINLOCK Spinlock) | @@ -140,7 +142,9 @@ RTDECL(int) RTSpinlockDestroy(RTSPINLOCK Spinlock) | ||||
* Make the lock invalid and release the memory. | * Make the lock invalid and release the memory. | ||||
*/ | */ | ||||
ASMAtomicIncU32(&pThis->u32Magic); | ASMAtomicIncU32(&pThis->u32Magic); | ||||
+ IPRT_FREEBSD_SAVE_EFL_AC(); | + IPRT_FREEBSD_SAVE_EFL_AC(); | ||||
RTMemFree(pThis); | RTMemFree(pThis); | ||||
+ IPRT_FREEBSD_RESTORE_EFL_AC(); | + IPRT_FREEBSD_RESTORE_EFL_AC(); | ||||
return VINF_SUCCESS; | return VINF_SUCCESS; | ||||
} | } | ||||
@@ -142,6 +146,7 @@ RTDECL(void) RTSpinlockAcquire(RTSPINLOCK Spinlock) | @@ -166,6 +170,7 @@ RTDECL(void) RTSpinlockAcquire(RTSPINLOCK Spinlock) | ||||
{ | { | ||||
RT_ASSERT_PREEMPT_CPUID_SPIN_ACQUIRED(pThis); | RT_ASSERT_PREEMPT_CPUID_SPIN_ACQUIRED(pThis); | ||||
pThis->fIntSaved = fIntSaved; | pThis->fIntSaved = fIntSaved; | ||||
+ IPRT_FREEBSD_RESTORE_EFL_ONLY_AC_EX(fIntSaved); | + IPRT_FREEBSD_RESTORE_EFL_ONLY_AC_EX(fIntSaved); | ||||
return; | return; | ||||
} | } | ||||
if (--c <= 0) | if (--c <= 0) |