FreeBSD Bugzilla – Attachment 190062 Details for
Bug 225415
graphics/mesa-dri: update to 18.0.0
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Use CLOCK_MONOTONIC for futex_wait()
patch-src_util_futex.h (text/plain), 1.44 KB, created by
Jung-uk Kim
on 2018-01-25 19:59:04 UTC
(
hide
)
Description:
Use CLOCK_MONOTONIC for futex_wait()
Filename:
MIME Type:
Creator:
Jung-uk Kim
Created:
2018-01-25 19:59:04 UTC
Size:
1.44 KB
patch
obsolete
>- Implement futex_wake() and futex_wait() via _umtx_op() > >--- src/util/futex.h.orig 2018-01-23 18:08:50 UTC >+++ src/util/futex.h >@@ -29,10 +29,35 @@ > #include <limits.h> > #include <stdint.h> > #include <unistd.h> >+#if defined(__FreeBSD__) >+# if __FreeBSD__ < 11 >+# include <machine/atomic.h> >+# endif >+#include <errno.h> >+#include <sys/umtx.h> >+#else > #include <linux/futex.h> > #include <sys/syscall.h> >+#endif > #include <sys/time.h> > >+#if defined(__FreeBSD__) >+static inline int futex_wake(uint32_t *addr, int count) >+{ >+ return _umtx_op(addr, UMTX_OP_WAKE, (uint32_t)count, NULL, NULL) == -1 ? errno : 0; >+} >+ >+static inline int futex_wait(uint32_t *addr, int32_t value, struct timespec *timeout) >+{ >+ void *uaddr = NULL, *uaddr2 = NULL; >+ if (timeout != NULL) { >+ const struct _umtx_time tmo = { ._clockid = CLOCK_MONOTONIC, ._flags = UMTX_ABSTIME, ._timeout = *timeout }; >+ uaddr = (void *)&tmo; >+ uaddr2 = (void *)(uintptr_t)sizeof(tmo); >+ } >+ return _umtx_op(addr, UMTX_OP_WAIT_UINT, (uint32_t)value, uaddr, uaddr2) == -1 ? errno : 0; >+} >+#else > static inline long sys_futex(void *addr1, int op, int val1, const struct timespec *timeout, void *addr2, int val3) > { > return syscall(SYS_futex, addr1, op, val1, timeout, addr2, val3); >@@ -50,6 +75,7 @@ static inline int futex_wait(uint32_t *addr, int32_t v > return sys_futex(addr, FUTEX_WAIT_BITSET, value, timeout, NULL, > FUTEX_BITSET_MATCH_ANY); > } >+#endif > > #endif >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 225415
:
190018
|
190045
|
190047
|
190061
|
190062
|
190063
|
190064
|
190159
|
190459
|
190681
|
191041
|
191335
|
191719
|
191881
|
191890