summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/amd64/linux32/linux32_sysvec.c4
-rw-r--r--sys/compat/linux/linux_emul.c4
-rw-r--r--sys/compat/linux/linux_emul.h24
-rw-r--r--sys/i386/linux/linux_sysvec.c4
4 files changed, 18 insertions, 18 deletions
diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_sysvec.c
index f77d0b9..d3c4f2e 100644
--- a/sys/amd64/linux32/linux32_sysvec.c
+++ b/sys/amd64/linux32/linux32_sysvec.c
@@ -1081,7 +1081,7 @@ linux_elf_modevent(module_t mod, int type, void *data)
linux_ioctl_register_handler(*lihp);
SET_FOREACH(ldhp, linux_device_handler_set)
linux_device_register_handler(*ldhp);
- sx_init(&emul_lock, "emuldata lock");
+ mtx_init(&emul_lock, "emuldata lock", NULL, MTX_DEF);
sx_init(&emul_shared_lock, "emuldata->shared lock");
LIST_INIT(&futex_list);
sx_init(&futex_sx, "futex protection lock");
@@ -1112,7 +1112,7 @@ linux_elf_modevent(module_t mod, int type, void *data)
linux_ioctl_unregister_handler(*lihp);
SET_FOREACH(ldhp, linux_device_handler_set)
linux_device_unregister_handler(*ldhp);
- sx_destroy(&emul_lock);
+ mtx_destroy(&emul_lock);
sx_destroy(&emul_shared_lock);
sx_destroy(&futex_sx);
EVENTHANDLER_DEREGISTER(process_exit, linux_exit_tag);
diff --git a/sys/compat/linux/linux_emul.c b/sys/compat/linux/linux_emul.c
index a0221b9..1a0d5a3 100644
--- a/sys/compat/linux/linux_emul.c
+++ b/sys/compat/linux/linux_emul.c
@@ -55,8 +55,8 @@ __FBSDID("$FreeBSD$");
#include <machine/../linux/linux_proto.h>
#endif
-struct sx emul_shared_lock;
-struct sx emul_lock;
+struct sx emul_shared_lock;
+struct mtx emul_lock;
/* this returns locked reference to the emuldata entry (if found) */
struct linux_emuldata *
diff --git a/sys/compat/linux/linux_emul.h b/sys/compat/linux/linux_emul.h
index d1e82eb..0b9dd88 100644
--- a/sys/compat/linux/linux_emul.h
+++ b/sys/compat/linux/linux_emul.h
@@ -29,7 +29,7 @@
*/
#ifndef _LINUX_EMUL_H_
-#define _LINUX_EMUL_H_
+#define _LINUX_EMUL_H_
struct linux_emuldata_shared {
int refs;
@@ -55,26 +55,26 @@ struct linux_emuldata {
LIST_ENTRY(linux_emuldata) threads; /* list of linux threads */
};
-struct linux_emuldata *em_find(struct proc *, int locked);
+struct linux_emuldata *em_find(struct proc *, int locked);
-#define EMUL_LOCK(l) sx_xlock(l)
-#define EMUL_UNLOCK(l) sx_xunlock(l)
+#define EMUL_LOCK(l) mtx_lock(l)
+#define EMUL_UNLOCK(l) mtx_unlock(l)
-#define EMUL_SHARED_RLOCK(l) sx_slock(l)
-#define EMUL_SHARED_RUNLOCK(l) sx_sunlock(l)
-#define EMUL_SHARED_WLOCK(l) sx_xlock(l)
-#define EMUL_SHARED_WUNLOCK(l) sx_xunlock(l)
+#define EMUL_SHARED_RLOCK(l) sx_slock(l)
+#define EMUL_SHARED_RUNLOCK(l) sx_sunlock(l)
+#define EMUL_SHARED_WLOCK(l) sx_xlock(l)
+#define EMUL_SHARED_WUNLOCK(l) sx_xunlock(l)
/* for em_find use */
-#define EMUL_DOLOCK 1
-#define EMUL_DONTLOCK 0
+#define EMUL_DOLOCK 1
+#define EMUL_DONTLOCK 0
int linux_proc_init(struct thread *, pid_t, int);
void linux_proc_exit(void *, struct proc *);
void linux_schedtail(void *, struct proc *);
void linux_proc_exec(void *, struct proc *, struct image_params *);
-extern struct sx emul_shared_lock;
-extern struct sx emul_lock;
+extern struct sx emul_shared_lock;
+extern struct mtx emul_lock;
#endif /* !_LINUX_EMUL_H_ */
diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c
index 9dc804d..c6547e9 100644
--- a/sys/i386/linux/linux_sysvec.c
+++ b/sys/i386/linux/linux_sysvec.c
@@ -917,7 +917,7 @@ linux_elf_modevent(module_t mod, int type, void *data)
linux_ioctl_register_handler(*lihp);
SET_FOREACH(ldhp, linux_device_handler_set)
linux_device_register_handler(*ldhp);
- sx_init(&emul_lock, "emuldata lock");
+ mtx_init(&emul_lock, "emuldata lock", NULL, MTX_DEF);
sx_init(&emul_shared_lock, "emuldata->shared lock");
LIST_INIT(&futex_list);
sx_init(&futex_sx, "futex protection lock");
@@ -948,7 +948,7 @@ linux_elf_modevent(module_t mod, int type, void *data)
linux_ioctl_unregister_handler(*lihp);
SET_FOREACH(ldhp, linux_device_handler_set)
linux_device_unregister_handler(*ldhp);
- sx_destroy(&emul_lock);
+ mtx_destroy(&emul_lock);
sx_destroy(&emul_shared_lock);
sx_destroy(&futex_sx);
EVENTHANDLER_DEREGISTER(process_exit, linux_exit_tag);
OpenPOWER on IntegriCloud