Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Feb 2023 07:56:39 GMT
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: e00cdc17345e - stable/13 - linux(4): Deduplicate MI futex structures.
Message-ID:  <202302090756.3197udV3092820@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by dchagin:

URL: https://cgit.FreeBSD.org/src/commit/?id=e00cdc17345e131c94a77cfe6c633b8b2e71ef95

commit e00cdc17345e131c94a77cfe6c633b8b2e71ef95
Author:     Dmitry Chagin <dchagin@FreeBSD.org>
AuthorDate: 2023-02-01 18:57:04 +0000
Commit:     Dmitry Chagin <dchagin@FreeBSD.org>
CommitDate: 2023-02-09 07:54:16 +0000

    linux(4): Deduplicate MI futex structures.
    
    MFC after:      1 week
    
    (cherry picked from commit 575e48f1c4eb05fe8df6aaeb5f55e17c63a02639)
---
 sys/amd64/linux/linux.h        | 11 -----------
 sys/amd64/linux32/linux.h      | 11 -----------
 sys/arm64/linux/linux.h        | 11 -----------
 sys/compat/linux/linux_futex.h | 11 +++++++++++
 sys/i386/linux/linux.h         | 11 -----------
 sys/i386/linux/linux_copyout.c |  1 +
 6 files changed, 12 insertions(+), 44 deletions(-)

diff --git a/sys/amd64/linux/linux.h b/sys/amd64/linux/linux.h
index c9e28f20ef94..b31b520cb573 100644
--- a/sys/amd64/linux/linux.h
+++ b/sys/amd64/linux/linux.h
@@ -277,17 +277,6 @@ struct l_ifconf {
 
 #define	linux_copyout_rusage(r, u)	copyout(r, u, sizeof(*r))
 
-/* robust futexes */
-struct linux_robust_list {
-	l_uintptr_t			next;
-};
-
-struct linux_robust_list_head {
-	struct linux_robust_list	list;
-	l_long				futex_offset;
-	l_uintptr_t			pending_list;
-};
-
 /* This corresponds to 'struct user_regs_struct' in Linux. */
 struct linux_pt_regset {
 	l_ulong	r15;
diff --git a/sys/amd64/linux32/linux.h b/sys/amd64/linux32/linux.h
index 7909c9c2081b..c77897344506 100644
--- a/sys/amd64/linux32/linux.h
+++ b/sys/amd64/linux32/linux.h
@@ -442,17 +442,6 @@ int linux32_copyinuio(struct l_iovec32 *iovp, l_ulong iovcnt,
 int linux_copyout_rusage(struct rusage *ru, void *uaddr);
 #endif /* _KERNEL */
 
-/* robust futexes */
-struct linux_robust_list {
-	l_uintptr_t			next;
-};
-
-struct linux_robust_list_head {
-	struct linux_robust_list	list;
-	l_long				futex_offset;
-	l_uintptr_t			pending_list;
-};
-
 /* This corresponds to 'struct user_regs_struct32' in Linux. */
 struct linux_pt_regset32 {
 	l_uint ebx;
diff --git a/sys/arm64/linux/linux.h b/sys/arm64/linux/linux.h
index fe9c9b23e552..8ecadff2e220 100644
--- a/sys/arm64/linux/linux.h
+++ b/sys/arm64/linux/linux.h
@@ -217,17 +217,6 @@ struct l_ifreq {
 
 #define	linux_copyout_rusage(r, u)	copyout(r, u, sizeof(*r))
 
-/* robust futexes */
-struct linux_robust_list {
-	l_uintptr_t			next;
-};
-
-struct linux_robust_list_head {
-	struct linux_robust_list	list;
-	l_long				futex_offset;
-	l_uintptr_t			pending_list;
-};
-
 struct linux_pt_regset {
 	l_ulong x[31];
 	l_ulong sp;
diff --git a/sys/compat/linux/linux_futex.h b/sys/compat/linux/linux_futex.h
index 189db4e17c4f..53fe1bfd0955 100644
--- a/sys/compat/linux/linux_futex.h
+++ b/sys/compat/linux/linux_futex.h
@@ -79,6 +79,17 @@
 #define	FUTEX_TID_MASK		0x3fffffff
 #define	FUTEX_BITSET_MATCH_ANY	0xffffffff
 
+/* robust futexes */
+struct linux_robust_list {
+	l_uintptr_t			next;
+};
+
+struct linux_robust_list_head {
+	struct linux_robust_list	list;
+	l_long				futex_offset;
+	l_uintptr_t			pending_list;
+};
+
 int futex_xchgl(int oparg, uint32_t *uaddr, int *oldval);
 int futex_addl(int oparg, uint32_t *uaddr, int *oldval);
 int futex_orl(int oparg, uint32_t *uaddr, int *oldval);
diff --git a/sys/i386/linux/linux.h b/sys/i386/linux/linux.h
index 86fca2976f83..c651da6b5857 100644
--- a/sys/i386/linux/linux.h
+++ b/sys/i386/linux/linux.h
@@ -395,15 +395,4 @@ struct l_desc_struct {
 
 #define	linux_copyout_rusage(r, u)	copyout(r, u, sizeof(*r))
 
-/* robust futexes */
-struct linux_robust_list {
-	struct linux_robust_list	*next;
-};
-
-struct linux_robust_list_head {
-	struct linux_robust_list	list;
-	l_long				futex_offset;
-	struct linux_robust_list	*pending_list;
-};
-
 #endif /* !_I386_LINUX_H_ */
diff --git a/sys/i386/linux/linux_copyout.c b/sys/i386/linux/linux_copyout.c
index 6dc98bc8bf5d..5672787d5df7 100644
--- a/sys/i386/linux/linux_copyout.c
+++ b/sys/i386/linux/linux_copyout.c
@@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$");
 #include <machine/atomic.h>
 #include <machine/md_var.h>
 
+#include <i386/linux/linux.h>
 #include <compat/linux/linux_emul.h>
 #include <compat/linux/linux_futex.h>
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202302090756.3197udV3092820>