Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102593983
D31248.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
8 KB
Referenced Files
None
Subscribers
None
D31248.diff
View Options
diff --git a/sys/compat/cloudabi/cloudabi_futex.c b/sys/compat/cloudabi/cloudabi_futex.c
--- a/sys/compat/cloudabi/cloudabi_futex.c
+++ b/sys/compat/cloudabi/cloudabi_futex.c
@@ -35,7 +35,7 @@
#include <sys/proc.h>
#include <sys/sx.h>
#include <sys/systm.h>
-#include <sys/umtx.h>
+#include <sys/umtxvar.h>
#include <contrib/cloudabi/cloudabi_types_common.h>
diff --git a/sys/compat/linux/linux_futex.c b/sys/compat/linux/linux_futex.c
--- a/sys/compat/linux/linux_futex.c
+++ b/sys/compat/linux/linux_futex.c
@@ -57,7 +57,7 @@
#include <sys/queue.h>
#include <sys/sched.h>
#include <sys/sdt.h>
-#include <sys/umtx.h>
+#include <sys/umtxvar.h>
#include <vm/vm_extern.h>
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -70,7 +70,7 @@
#include <sys/sysent.h>
#include <sys/sysproto.h>
#include <sys/timers.h>
-#include <sys/umtx.h>
+#include <sys/umtxvar.h>
#include <sys/vnode.h>
#include <sys/wait.h>
#ifdef KTRACE
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -76,7 +76,7 @@
#include <sys/sem.h>
#include <sys/sysent.h>
#include <sys/timers.h>
-#include <sys/umtx.h>
+#include <sys/umtxvar.h>
#ifdef KTRACE
#include <sys/ktrace.h>
#endif
diff --git a/sys/kern/kern_kthread.c b/sys/kern/kern_kthread.c
--- a/sys/kern/kern_kthread.c
+++ b/sys/kern/kern_kthread.c
@@ -41,7 +41,7 @@
#include <sys/signalvar.h>
#include <sys/sysent.h>
#include <sys/sx.h>
-#include <sys/umtx.h>
+#include <sys/umtxvar.h>
#include <sys/unistd.h>
#include <sys/wait.h>
#include <sys/sched.h>
diff --git a/sys/kern/kern_racct.c b/sys/kern/kern_racct.c
--- a/sys/kern/kern_racct.c
+++ b/sys/kern/kern_racct.c
@@ -57,7 +57,7 @@
#include <sys/sysctl.h>
#include <sys/sysent.h>
#include <sys/sysproto.h>
-#include <sys/umtx.h>
+#include <sys/umtxvar.h>
#include <machine/smp.h>
#ifdef RCTL
diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c
--- a/sys/kern/kern_resource.c
+++ b/sys/kern/kern_resource.c
@@ -59,7 +59,7 @@
#include <sys/sysctl.h>
#include <sys/sysent.h>
#include <sys/time.h>
-#include <sys/umtx.h>
+#include <sys/umtxvar.h>
#include <vm/vm.h>
#include <vm/vm_param.h>
diff --git a/sys/kern/kern_thr.c b/sys/kern/kern_thr.c
--- a/sys/kern/kern_thr.c
+++ b/sys/kern/kern_thr.c
@@ -54,7 +54,7 @@
#include <sys/ucontext.h>
#include <sys/thr.h>
#include <sys/rtprio.h>
-#include <sys/umtx.h>
+#include <sys/umtxvar.h>
#include <sys/limits.h>
#ifdef HWPMC_HOOKS
#include <sys/pmckern.h>
diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c
--- a/sys/kern/kern_thread.c
+++ b/sys/kern/kern_thread.c
@@ -56,7 +56,7 @@
#include <sys/taskqueue.h>
#include <sys/ktr.h>
#include <sys/rwlock.h>
-#include <sys/umtx.h>
+#include <sys/umtxvar.h>
#include <sys/vmmeter.h>
#include <sys/cpuset.h>
#ifdef HWPMC_HOOKS
diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c
--- a/sys/kern/kern_umtx.c
+++ b/sys/kern/kern_umtx.c
@@ -63,6 +63,7 @@
#include <sys/time.h>
#include <sys/eventhandler.h>
#include <sys/umtx.h>
+#include <sys/umtxvar.h>
#include <security/mac/mac_framework.h>
diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c
--- a/sys/kern/sched_4bsd.c
+++ b/sys/kern/sched_4bsd.c
@@ -56,7 +56,7 @@
#include <sys/sysctl.h>
#include <sys/sx.h>
#include <sys/turnstile.h>
-#include <sys/umtx.h>
+#include <sys/umtxvar.h>
#include <machine/pcb.h>
#include <machine/smp.h>
diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c
--- a/sys/kern/sched_ule.c
+++ b/sys/kern/sched_ule.c
@@ -61,7 +61,7 @@
#include <sys/sysctl.h>
#include <sys/sysproto.h>
#include <sys/turnstile.h>
-#include <sys/umtx.h>
+#include <sys/umtxvar.h>
#include <sys/vmmeter.h>
#include <sys/cpuset.h>
#include <sys/sbuf.h>
diff --git a/sys/sys/umtx.h b/sys/sys/umtx.h
--- a/sys/sys/umtx.h
+++ b/sys/sys/umtx.h
@@ -132,83 +132,10 @@
uintptr_t robust_inact_offset;
};
-#ifndef _KERNEL
-
__BEGIN_DECLS
int _umtx_op(void *obj, int op, u_long val, void *uaddr, void *uaddr2);
__END_DECLS
-#else
-
-/*
- * The umtx_key structure is used by both the Linux futex code and the
- * umtx implementation to map userland addresses to unique keys.
- */
-
-enum {
- TYPE_SIMPLE_WAIT,
- TYPE_CV,
- TYPE_SEM,
- TYPE_SIMPLE_LOCK,
- TYPE_NORMAL_UMUTEX,
- TYPE_PI_UMUTEX,
- TYPE_PP_UMUTEX,
- TYPE_RWLOCK,
- TYPE_FUTEX,
- TYPE_SHM,
- TYPE_PI_ROBUST_UMUTEX,
- TYPE_PP_ROBUST_UMUTEX,
-};
-
-/* Key to represent a unique userland synchronous object */
-struct umtx_key {
- int hash;
- int type;
- int shared;
- union {
- struct {
- struct vm_object *object;
- uintptr_t offset;
- } shared;
- struct {
- struct vmspace *vs;
- uintptr_t addr;
- } private;
- struct {
- void *a;
- uintptr_t b;
- } both;
- } info;
-};
-
-#define THREAD_SHARE 0
-#define PROCESS_SHARE 1
-#define AUTO_SHARE 2
-
-struct thread;
-
-static inline int
-umtx_key_match(const struct umtx_key *k1, const struct umtx_key *k2)
-{
- return (k1->type == k2->type &&
- k1->info.both.a == k2->info.both.a &&
- k1->info.both.b == k2->info.both.b);
-}
-
-int umtx_copyin_timeout(const void *, struct timespec *);
-void umtx_exec(struct proc *p);
-int umtx_key_get(const void *, int, int, struct umtx_key *);
-void umtx_key_release(struct umtx_key *);
-struct umtx_q *umtxq_alloc(void);
-void umtxq_free(struct umtx_q *);
-int kern_umtx_wake(struct thread *, void *, int, int);
-void umtx_pi_adjust(struct thread *, u_char);
-void umtx_thread_init(struct thread *);
-void umtx_thread_fini(struct thread *);
-void umtx_thread_alloc(struct thread *);
-void umtx_thread_exit(struct thread *);
-
-#endif /* !_KERNEL */
#endif /* !_SYS_UMTX_H_ */
diff --git a/sys/sys/umtxvar.h b/sys/sys/umtxvar.h
new file mode 100644
--- /dev/null
+++ b/sys/sys/umtxvar.h
@@ -0,0 +1,106 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (c) 2002, Jeffrey Roberson <jeff@freebsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice unmodified, this list of conditions, and the following
+ * disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ *
+ */
+
+#ifndef _SYS_UMTXVAR_H_
+#define _SYS_UMTXVAR_H_
+
+#ifdef _KERNEL
+
+/*
+ * The umtx_key structure is used by both the Linux futex code and the
+ * umtx implementation to map userland addresses to unique keys.
+ */
+enum {
+ TYPE_SIMPLE_WAIT,
+ TYPE_CV,
+ TYPE_SEM,
+ TYPE_SIMPLE_LOCK,
+ TYPE_NORMAL_UMUTEX,
+ TYPE_PI_UMUTEX,
+ TYPE_PP_UMUTEX,
+ TYPE_RWLOCK,
+ TYPE_FUTEX,
+ TYPE_SHM,
+ TYPE_PI_ROBUST_UMUTEX,
+ TYPE_PP_ROBUST_UMUTEX,
+};
+
+/* Key to represent a unique userland synchronous object */
+struct umtx_key {
+ int hash;
+ int type;
+ int shared;
+ union {
+ struct {
+ struct vm_object *object;
+ uintptr_t offset;
+ } shared;
+ struct {
+ struct vmspace *vs;
+ uintptr_t addr;
+ } private;
+ struct {
+ void *a;
+ uintptr_t b;
+ } both;
+ } info;
+};
+
+#define THREAD_SHARE 0
+#define PROCESS_SHARE 1
+#define AUTO_SHARE 2
+
+struct thread;
+
+static inline int
+umtx_key_match(const struct umtx_key *k1, const struct umtx_key *k2)
+{
+
+ return (k1->type == k2->type &&
+ k1->info.both.a == k2->info.both.a &&
+ k1->info.both.b == k2->info.both.b);
+}
+
+int umtx_copyin_timeout(const void *, struct timespec *);
+void umtx_exec(struct proc *p);
+int umtx_key_get(const void *, int, int, struct umtx_key *);
+void umtx_key_release(struct umtx_key *);
+struct umtx_q *umtxq_alloc(void);
+void umtxq_free(struct umtx_q *);
+int kern_umtx_wake(struct thread *, void *, int, int);
+void umtx_pi_adjust(struct thread *, u_char);
+void umtx_thread_init(struct thread *);
+void umtx_thread_fini(struct thread *);
+void umtx_thread_alloc(struct thread *);
+void umtx_thread_exit(struct thread *);
+
+#endif /* _KERNEL */
+#endif /* !_SYS_UMTXVAR_H_ */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 15, 1:14 PM (16 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14642619
Default Alt Text
D31248.diff (8 KB)
Attached To
Mode
D31248: umtx: Split umtx.h on two counterparts.
Attached
Detach File
Event Timeline
Log In to Comment