aboutsummaryrefslogtreecommitdiff
path: root/sys/sys
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2021-07-19 15:40:38 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2021-07-28 10:21:12 +0000
commit9b6b793bd79521edc082a89b264a30881cb65e22 (patch)
treeb77041bba3f982018fd9256ce23bce17de2281bf /sys/sys
parentc007408c245b7aff0f203b021e70f263e57d5173 (diff)
downloadsrc-9b6b793bd79521edc082a89b264a30881cb65e22.tar.gz
src-9b6b793bd79521edc082a89b264a30881cb65e22.zip
Revert most of ce42e793100b460f597e4c85ec0da12e274f9394
to restore ABI compatibility for pre-10.x binaries. It restores _umtx_lock() and _umtx_unlock() syscalls, and UMTX_OP_LOCK/ UMTX_OP_UNLOCK umtx_op(2) operations. UMUTEX_ERROR_CHECK flag is left out for now, I do not think it makes a difference. PR: 218571 Reviewed by: brooks (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31220
Diffstat (limited to 'sys/sys')
-rw-r--r--sys/sys/_umtx.h4
-rw-r--r--sys/sys/umtx.h7
2 files changed, 9 insertions, 2 deletions
diff --git a/sys/sys/_umtx.h b/sys/sys/_umtx.h
index b9d10b756a0c..d280c7d3db19 100644
--- a/sys/sys/_umtx.h
+++ b/sys/sys/_umtx.h
@@ -35,6 +35,10 @@
#include <sys/_types.h>
#include <sys/_timespec.h>
+struct umtx {
+ volatile unsigned long u_owner; /* Owner of the mutex. */
+};
+
struct umutex {
volatile __lwpid_t m_owner; /* Owner of the mutex */
__uint32_t m_flags; /* Flags of the mutex */
diff --git a/sys/sys/umtx.h b/sys/sys/umtx.h
index 6753a6217688..60e9dccdad91 100644
--- a/sys/sys/umtx.h
+++ b/sys/sys/umtx.h
@@ -34,6 +34,9 @@
#include <sys/_umtx.h>
+#define UMTX_UNOWNED 0x0
+#define UMTX_CONTESTED LONG_MIN
+
/* Common lock flags */
#define USYNC_PROCESS_SHARED 0x0001 /* Process shared sync objs */
@@ -73,8 +76,8 @@
#define USEM_COUNT(c) ((c) & USEM_MAX_COUNT)
/* op code for _umtx_op */
-#define UMTX_OP_RESERVED0 0
-#define UMTX_OP_RESERVED1 1
+#define UMTX_OP_LOCK 0 /* COMPAT10 */
+#define UMTX_OP_UNLOCK 1 /* COMPAT10 */
#define UMTX_OP_WAIT 2
#define UMTX_OP_WAKE 3
#define UMTX_OP_MUTEX_TRYLOCK 4