summaryrefslogtreecommitdiffstats
path: root/sys/compat
diff options
context:
space:
mode:
Diffstat (limited to 'sys/compat')
-rw-r--r--sys/compat/linux/linux_emul.h1
-rw-r--r--sys/compat/linux/linux_futex.c68
2 files changed, 46 insertions, 23 deletions
diff --git a/sys/compat/linux/linux_emul.h b/sys/compat/linux/linux_emul.h
index 3558b0a..7262093 100644
--- a/sys/compat/linux/linux_emul.h
+++ b/sys/compat/linux/linux_emul.h
@@ -61,6 +61,7 @@ int linux_common_execve(struct thread *, struct image_args *);
#define LINUX_XDEPR_REQUEUEOP 0x00000001 /* uses deprecated
futex REQUEUE op*/
#define LINUX_XUNSUP_EPOLL 0x00000002 /* unsupported epoll events */
+#define LINUX_XUNSUP_FUTEXPIOP 0x00000004 /* uses unsupported pi futex */
struct linux_pemuldata {
uint32_t flags; /* process emuldata flags */
diff --git a/sys/compat/linux/linux_futex.c b/sys/compat/linux/linux_futex.c
index 51851d2..8e6ebad 100644
--- a/sys/compat/linux/linux_futex.c
+++ b/sys/compat/linux/linux_futex.c
@@ -937,29 +937,43 @@ linux_sys_futex(struct thread *td, struct linux_sys_futex_args *args)
case LINUX_FUTEX_LOCK_PI:
/* not yet implemented */
- linux_msg(td,
- "linux_sys_futex: "
- "op LINUX_FUTEX_LOCK_PI not implemented\n");
- LIN_SDT_PROBE0(futex, linux_sys_futex, unimplemented_lock_pi);
+ pem = pem_find(td->td_proc);
+ if ((pem->flags & LINUX_XUNSUP_FUTEXPIOP) == 0) {
+ linux_msg(td,
+ "linux_sys_futex: "
+ "unsupported futex_pi op\n");
+ pem->flags |= LINUX_XUNSUP_FUTEXPIOP;
+ LIN_SDT_PROBE0(futex, linux_sys_futex,
+ unimplemented_lock_pi);
+ }
LIN_SDT_PROBE1(futex, linux_sys_futex, return, ENOSYS);
return (ENOSYS);
case LINUX_FUTEX_UNLOCK_PI:
/* not yet implemented */
- linux_msg(td,
- "linux_sys_futex: "
- "op LINUX_FUTEX_UNLOCK_PI not implemented\n");
- LIN_SDT_PROBE0(futex, linux_sys_futex, unimplemented_unlock_pi);
+ pem = pem_find(td->td_proc);
+ if ((pem->flags & LINUX_XUNSUP_FUTEXPIOP) == 0) {
+ linux_msg(td,
+ "linux_sys_futex: "
+ "unsupported futex_pi op\n");
+ pem->flags |= LINUX_XUNSUP_FUTEXPIOP;
+ LIN_SDT_PROBE0(futex, linux_sys_futex,
+ unimplemented_unlock_pi);
+ }
LIN_SDT_PROBE1(futex, linux_sys_futex, return, ENOSYS);
return (ENOSYS);
case LINUX_FUTEX_TRYLOCK_PI:
/* not yet implemented */
- linux_msg(td,
- "linux_sys_futex: "
- "op LINUX_FUTEX_TRYLOCK_PI not implemented\n");
- LIN_SDT_PROBE0(futex, linux_sys_futex,
- unimplemented_trylock_pi);
+ pem = pem_find(td->td_proc);
+ if ((pem->flags & LINUX_XUNSUP_FUTEXPIOP) == 0) {
+ linux_msg(td,
+ "linux_sys_futex: "
+ "unsupported futex_pi op\n");
+ pem->flags |= LINUX_XUNSUP_FUTEXPIOP;
+ LIN_SDT_PROBE0(futex, linux_sys_futex,
+ unimplemented_trylock_pi);
+ }
LIN_SDT_PROBE1(futex, linux_sys_futex, return, ENOSYS);
return (ENOSYS);
@@ -986,21 +1000,29 @@ linux_sys_futex(struct thread *td, struct linux_sys_futex_args *args)
case LINUX_FUTEX_WAIT_REQUEUE_PI:
/* not yet implemented */
- linux_msg(td,
- "linux_sys_futex: "
- "op FUTEX_WAIT_REQUEUE_PI not implemented\n");
- LIN_SDT_PROBE0(futex, linux_sys_futex,
- unimplemented_wait_requeue_pi);
+ pem = pem_find(td->td_proc);
+ if ((pem->flags & LINUX_XUNSUP_FUTEXPIOP) == 0) {
+ linux_msg(td,
+ "linux_sys_futex: "
+ "unsupported futex_pi op\n");
+ pem->flags |= LINUX_XUNSUP_FUTEXPIOP;
+ LIN_SDT_PROBE0(futex, linux_sys_futex,
+ unimplemented_wait_requeue_pi);
+ }
LIN_SDT_PROBE1(futex, linux_sys_futex, return, ENOSYS);
return (ENOSYS);
case LINUX_FUTEX_CMP_REQUEUE_PI:
/* not yet implemented */
- linux_msg(td,
- "linux_sys_futex: "
- "op LINUX_FUTEX_CMP_REQUEUE_PI not implemented\n");
- LIN_SDT_PROBE0(futex, linux_sys_futex,
- unimplemented_cmp_requeue_pi);
+ pem = pem_find(td->td_proc);
+ if ((pem->flags & LINUX_XUNSUP_FUTEXPIOP) == 0) {
+ linux_msg(td,
+ "linux_sys_futex: "
+ "unsupported futex_pi op\n");
+ pem->flags |= LINUX_XUNSUP_FUTEXPIOP;
+ LIN_SDT_PROBE0(futex, linux_sys_futex,
+ unimplemented_cmp_requeue_pi);
+ }
LIN_SDT_PROBE1(futex, linux_sys_futex, return, ENOSYS);
return (ENOSYS);
OpenPOWER on IntegriCloud