linux: provide just one instance of futex_list

Move futex_list definition to linux.c which is included once
in linux.ko (i386) and in linux_common.ko (amd64 and aarch64)
allowing 32/64 bit linux programs to access the same futexes
in the latter case.

PR:		240989
Reviewed by:	dchagin
Differential Revision:	https://reviews.freebsd.org/D22073
This commit is contained in:
yuripv 2019-10-18 10:28:08 +00:00
parent c404e5b4f1
commit fb90dea0cc
4 changed files with 4 additions and 3 deletions

View File

@ -51,6 +51,8 @@ __FBSDID("$FreeBSD$");
#include <compat/linux/linux_common.h>
#include <compat/linux/linux_util.h>
struct futex_list futex_list;
CTASSERT(LINUX_IFNAMSIZ == IFNAMSIZ);
static int bsd_to_linux_sigtbl[LINUX_SIGTBLSZ] = {

View File

@ -140,4 +140,6 @@ void bsd_to_linux_sigset(sigset_t *, l_sigset_t *);
int linux_to_bsd_signal(int sig);
int bsd_to_linux_signal(int sig);
extern LIST_HEAD(futex_list, futex) futex_list;
#endif /* _LINUX_MI_H_ */

View File

@ -207,8 +207,6 @@ struct futex {
TAILQ_HEAD(lf_waiting_proc, waiting_proc) f_waiting_proc;
};
struct futex_list futex_list;
#define FUTEX_LOCK(f) mtx_lock(&(f)->f_lck)
#define FUTEX_LOCKED(f) mtx_owned(&(f)->f_lck)
#define FUTEX_UNLOCK(f) mtx_unlock(&(f)->f_lck)

View File

@ -38,7 +38,6 @@
#ifndef _LINUX_FUTEX_H
#define _LINUX_FUTEX_H
extern LIST_HEAD(futex_list, futex) futex_list;
extern struct mtx futex_mtx;
#define LINUX_FUTEX_WAIT 0