Differential D28871 Diff 84858 emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_semevent-r0drv-freebsd.c
Changeset View
Changeset View
Standalone View
Standalone View
emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_semevent-r0drv-freebsd.c
--- src/VBox/Runtime/r0drv/freebsd/semevent-r0drv-freebsd.c.orig 2018-10-15 14:31:31 UTC | --- src/VBox/Runtime/r0drv/freebsd/semevent-r0drv-freebsd.c.orig 2021-01-07 15:42:08 UTC | ||||
+++ src/VBox/Runtime/r0drv/freebsd/semevent-r0drv-freebsd.c | +++ src/VBox/Runtime/r0drv/freebsd/semevent-r0drv-freebsd.c | ||||
@@ -77,7 +77,9 @@ RTDECL(int) RTSemEventCreateEx(PRTSEMEVENT phEventSem | @@ -101,7 +101,9 @@ RTDECL(int) RTSemEventCreateEx(PRTSEMEVENT phEventSem | ||||
Assert(!(fFlags & RTSEMEVENT_FLAGS_BOOTSTRAP_HACK) || (fFlags & RTSEMEVENT_FLAGS_NO_LOCK_VAL)); | Assert(!(fFlags & RTSEMEVENT_FLAGS_BOOTSTRAP_HACK) || (fFlags & RTSEMEVENT_FLAGS_NO_LOCK_VAL)); | ||||
AssertPtrReturn(phEventSem, VERR_INVALID_POINTER); | AssertPtrReturn(phEventSem, VERR_INVALID_POINTER); | ||||
+ IPRT_FREEBSD_SAVE_EFL_AC(); | + IPRT_FREEBSD_SAVE_EFL_AC(); | ||||
PRTSEMEVENTINTERNAL pThis = (PRTSEMEVENTINTERNAL)RTMemAllocZ(sizeof(*pThis)); | PRTSEMEVENTINTERNAL pThis = (PRTSEMEVENTINTERNAL)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; | ||||
@@ -128,10 +130,12 @@ RTDECL(int) RTSemEventDestroy(RTSEMEVENT hEventSem) | @@ -152,10 +154,12 @@ RTDECL(int) RTSemEventDestroy(RTSEMEVENT hEventSem) | ||||
/* | /* | ||||
* Invalidate it and signal the object just in case. | * Invalidate it and signal the object just in case. | ||||
*/ | */ | ||||
+ IPRT_FREEBSD_SAVE_EFL_AC(); | + IPRT_FREEBSD_SAVE_EFL_AC(); | ||||
ASMAtomicWriteU32(&pThis->u32Magic, ~RTSEMEVENT_MAGIC); | ASMAtomicWriteU32(&pThis->u32Magic, ~RTSEMEVENT_MAGIC); | ||||
ASMAtomicWriteU32(&pThis->fState, 0); | ASMAtomicWriteU32(&pThis->fState, 0); | ||||
rtR0SemBsdBroadcast(pThis); | rtR0SemBsdBroadcast(pThis); | ||||
rtR0SemEventBsdRelease(pThis); | rtR0SemEventBsdRelease(pThis); | ||||
+ IPRT_FREEBSD_RESTORE_EFL_AC(); | + IPRT_FREEBSD_RESTORE_EFL_AC(); | ||||
return VINF_SUCCESS; | return VINF_SUCCESS; | ||||
} | } | ||||
@@ -149,9 +153,11 @@ RTDECL(int) RTSemEventSignal(RTSEMEVENT hEventSem) | @@ -173,9 +177,11 @@ RTDECL(int) RTSemEventSignal(RTSEMEVENT hEventSem) | ||||
/* | /* | ||||
* Signal the event object. | * Signal the event object. | ||||
*/ | */ | ||||
+ IPRT_FREEBSD_SAVE_EFL_AC(); | + IPRT_FREEBSD_SAVE_EFL_AC(); | ||||
ASMAtomicWriteU32(&pThis->fState, 1); | ASMAtomicWriteU32(&pThis->fState, 1); | ||||
rtR0SemBsdSignal(pThis); | rtR0SemBsdSignal(pThis); | ||||
rtR0SemEventBsdRelease(pThis); | rtR0SemEventBsdRelease(pThis); | ||||
+ IPRT_FREEBSD_RESTORE_EFL_AC(); | + IPRT_FREEBSD_RESTORE_EFL_AC(); | ||||
return VINF_SUCCESS; | return VINF_SUCCESS; | ||||
} | } | ||||
@@ -175,6 +181,7 @@ static int rtR0SemEventWait(PRTSEMEVENTINTERNAL pThis, | @@ -199,6 +205,7 @@ static int rtR0SemEventWait(PRTSEMEVENTINTERNAL pThis, | ||||
AssertPtrReturn(pThis, VERR_INVALID_PARAMETER); | AssertPtrReturn(pThis, VERR_INVALID_PARAMETER); | ||||
AssertMsgReturn(pThis->u32Magic == RTSEMEVENT_MAGIC, ("%p u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_PARAMETER); | AssertMsgReturn(pThis->u32Magic == RTSEMEVENT_MAGIC, ("%p u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_PARAMETER); | ||||
AssertReturn(RTSEMWAIT_FLAGS_ARE_VALID(fFlags), VERR_INVALID_PARAMETER); | AssertReturn(RTSEMWAIT_FLAGS_ARE_VALID(fFlags), VERR_INVALID_PARAMETER); | ||||
+ IPRT_FREEBSD_SAVE_EFL_AC(); | + IPRT_FREEBSD_SAVE_EFL_AC(); | ||||
rtR0SemEventBsdRetain(pThis); | rtR0SemEventBsdRetain(pThis); | ||||
/* | /* | ||||
@@ -224,6 +231,7 @@ static int rtR0SemEventWait(PRTSEMEVENTINTERNAL pThis, | @@ -248,6 +255,7 @@ static int rtR0SemEventWait(PRTSEMEVENTINTERNAL pThis, | ||||
} | } | ||||
rtR0SemEventBsdRelease(pThis); | rtR0SemEventBsdRelease(pThis); | ||||
+ IPRT_FREEBSD_RESTORE_EFL_AC(); | + IPRT_FREEBSD_RESTORE_EFL_AC(); | ||||
return rc; | return rc; | ||||
} | } | ||||