Differential D28871 Diff 85283 emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_semfastmutex-r0drv-freebsd.c
Changeset View
Changeset View
Standalone View
Standalone View
emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_semfastmutex-r0drv-freebsd.c
--- src/VBox/Runtime/r0drv/freebsd/semfastmutex-r0drv-freebsd.c.orig 2018-10-15 14:31:31 UTC | --- src/VBox/Runtime/r0drv/freebsd/semfastmutex-r0drv-freebsd.c.orig 2021-01-07 15:42:08 UTC | ||||
+++ src/VBox/Runtime/r0drv/freebsd/semfastmutex-r0drv-freebsd.c | +++ src/VBox/Runtime/r0drv/freebsd/semfastmutex-r0drv-freebsd.c | ||||
@@ -62,6 +62,7 @@ RTDECL(int) RTSemFastMutexCreate(PRTSEMFASTMUTEX phFa | @@ -86,6 +86,7 @@ RTDECL(int) RTSemFastMutexCreate(PRTSEMFASTMUTEX phFa | ||||
{ | { | ||||
AssertCompile(sizeof(RTSEMFASTMUTEXINTERNAL) > sizeof(void *)); | AssertCompile(sizeof(RTSEMFASTMUTEXINTERNAL) > sizeof(void *)); | ||||
AssertPtrReturn(phFastMtx, VERR_INVALID_POINTER); | AssertPtrReturn(phFastMtx, VERR_INVALID_POINTER); | ||||
+ IPRT_FREEBSD_SAVE_EFL_AC(); | + IPRT_FREEBSD_SAVE_EFL_AC(); | ||||
PRTSEMFASTMUTEXINTERNAL pThis = (PRTSEMFASTMUTEXINTERNAL)RTMemAllocZ(sizeof(*pThis)); | PRTSEMFASTMUTEXINTERNAL pThis = (PRTSEMFASTMUTEXINTERNAL)RTMemAllocZ(sizeof(*pThis)); | ||||
if (pThis) | if (pThis) | ||||
@@ -70,8 +71,10 @@ RTDECL(int) RTSemFastMutexCreate(PRTSEMFASTMUTEX phFa | @@ -94,8 +95,10 @@ RTDECL(int) RTSemFastMutexCreate(PRTSEMFASTMUTEX phFa | ||||
sx_init_flags(&pThis->SxLock, "IPRT Fast Mutex Semaphore", SX_DUPOK); | sx_init_flags(&pThis->SxLock, "IPRT Fast Mutex Semaphore", SX_DUPOK); | ||||
*phFastMtx = pThis; | *phFastMtx = pThis; | ||||
+ IPRT_FREEBSD_RESTORE_EFL_AC(); | + IPRT_FREEBSD_RESTORE_EFL_AC(); | ||||
return VINF_SUCCESS; | return VINF_SUCCESS; | ||||
} | } | ||||
+ IPRT_FREEBSD_RESTORE_EFL_AC(); | + IPRT_FREEBSD_RESTORE_EFL_AC(); | ||||
return VERR_NO_MEMORY; | return VERR_NO_MEMORY; | ||||
} | } | ||||
@@ -83,11 +86,13 @@ RTDECL(int) RTSemFastMutexDestroy(RTSEMFASTMUTEX hFas | @@ -107,11 +110,13 @@ RTDECL(int) RTSemFastMutexDestroy(RTSEMFASTMUTEX hFas | ||||
return VINF_SUCCESS; | return VINF_SUCCESS; | ||||
AssertPtrReturn(pThis, VERR_INVALID_HANDLE); | AssertPtrReturn(pThis, VERR_INVALID_HANDLE); | ||||
AssertMsgReturn(pThis->u32Magic == RTSEMFASTMUTEX_MAGIC, ("%p: u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE); | AssertMsgReturn(pThis->u32Magic == RTSEMFASTMUTEX_MAGIC, ("%p: u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE); | ||||
+ IPRT_FREEBSD_SAVE_EFL_AC(); | + IPRT_FREEBSD_SAVE_EFL_AC(); | ||||
ASMAtomicWriteU32(&pThis->u32Magic, RTSEMFASTMUTEX_MAGIC_DEAD); | ASMAtomicWriteU32(&pThis->u32Magic, RTSEMFASTMUTEX_MAGIC_DEAD); | ||||
sx_destroy(&pThis->SxLock); | sx_destroy(&pThis->SxLock); | ||||
RTMemFree(pThis); | RTMemFree(pThis); | ||||
+ IPRT_FREEBSD_RESTORE_EFL_AC(); | + IPRT_FREEBSD_RESTORE_EFL_AC(); | ||||
return VINF_SUCCESS; | return VINF_SUCCESS; | ||||
} | } | ||||
@@ -97,8 +102,11 @@ RTDECL(int) RTSemFastMutexRequest(RTSEMFASTMUTEX hFas | @@ -121,8 +126,11 @@ RTDECL(int) RTSemFastMutexRequest(RTSEMFASTMUTEX hFas | ||||
PRTSEMFASTMUTEXINTERNAL pThis = hFastMtx; | PRTSEMFASTMUTEXINTERNAL pThis = hFastMtx; | ||||
AssertPtrReturn(pThis, VERR_INVALID_HANDLE); | AssertPtrReturn(pThis, VERR_INVALID_HANDLE); | ||||
AssertMsgReturn(pThis->u32Magic == RTSEMFASTMUTEX_MAGIC, ("%p: u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE); | AssertMsgReturn(pThis->u32Magic == RTSEMFASTMUTEX_MAGIC, ("%p: u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE); | ||||
+ IPRT_FREEBSD_SAVE_EFL_AC(); | + IPRT_FREEBSD_SAVE_EFL_AC(); | ||||
sx_xlock(&pThis->SxLock); | sx_xlock(&pThis->SxLock); | ||||
+ | + | ||||
+ IPRT_FREEBSD_RESTORE_EFL_AC(); | + IPRT_FREEBSD_RESTORE_EFL_AC(); | ||||
return VINF_SUCCESS; | return VINF_SUCCESS; | ||||
} | } | ||||
@@ -108,8 +116,11 @@ RTDECL(int) RTSemFastMutexRelease(RTSEMFASTMUTEX hFas | @@ -132,8 +140,11 @@ RTDECL(int) RTSemFastMutexRelease(RTSEMFASTMUTEX hFas | ||||
PRTSEMFASTMUTEXINTERNAL pThis = hFastMtx; | PRTSEMFASTMUTEXINTERNAL pThis = hFastMtx; | ||||
AssertPtrReturn(pThis, VERR_INVALID_HANDLE); | AssertPtrReturn(pThis, VERR_INVALID_HANDLE); | ||||
AssertMsgReturn(pThis->u32Magic == RTSEMFASTMUTEX_MAGIC, ("%p: u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE); | AssertMsgReturn(pThis->u32Magic == RTSEMFASTMUTEX_MAGIC, ("%p: u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE); | ||||
+ IPRT_FREEBSD_SAVE_EFL_AC(); | + IPRT_FREEBSD_SAVE_EFL_AC(); | ||||
sx_xunlock(&pThis->SxLock); | sx_xunlock(&pThis->SxLock); | ||||
+ | + | ||||
+ IPRT_FREEBSD_RESTORE_EFL_AC(); | + IPRT_FREEBSD_RESTORE_EFL_AC(); | ||||
return VINF_SUCCESS; | return VINF_SUCCESS; | ||||
} | } | ||||