diff options
-rw-r--r-- | sys/kern/syscalls.master | 2 | ||||
-rw-r--r-- | sys/sys/sysproto.h | 2 | ||||
-rw-r--r-- | sys/sys/umtx.h | 16 |
3 files changed, 12 insertions, 8 deletions
diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master index fbe2aa8..c29cd2e 100644 --- a/sys/kern/syscalls.master +++ b/sys/kern/syscalls.master @@ -795,7 +795,7 @@ u_int length); } 453 AUE_AUDITCTL MSTD { int auditctl(char *path); } 454 AUE_NULL MSTD { int _umtx_op(struct umtx *umtx, int op, \ - long id, void *uaddr, const void *uaddr2); } + long id, void *uaddr, void *uaddr2); } 455 AUE_NULL MSTD { int thr_new(struct thr_param *param, \ int param_size); } 456 AUE_NULL MSTD { int sigqueue(pid_t pid, int signum, void *value); } diff --git a/sys/sys/sysproto.h b/sys/sys/sysproto.h index 41a4a97..e145167 100644 --- a/sys/sys/sysproto.h +++ b/sys/sys/sysproto.h @@ -1391,7 +1391,7 @@ struct _umtx_op_args { char op_l_[PADL_(int)]; int op; char op_r_[PADR_(int)]; char id_l_[PADL_(long)]; long id; char id_r_[PADR_(long)]; char uaddr_l_[PADL_(void *)]; void * uaddr; char uaddr_r_[PADR_(void *)]; - char uaddr2_l_[PADL_(void *)]; const void * uaddr2; char uaddr2_r_[PADR_(void *)]; + char uaddr2_l_[PADL_(void *)]; void * uaddr2; char uaddr2_r_[PADR_(void *)]; }; struct thr_new_args { char param_l_[PADL_(struct thr_param *)]; struct thr_param * param; char param_r_[PADR_(struct thr_param *)]; diff --git a/sys/sys/umtx.h b/sys/sys/umtx.h index 04f0238..75ec0d4 100644 --- a/sys/sys/umtx.h +++ b/sys/sys/umtx.h @@ -52,13 +52,15 @@ struct umtx { #ifndef _KERNEL /* - * System calls for acquiring and releasing contested mutexes. + * System call for userland mutex operations. + */ +int _umtx_op(struct umtx *umtx, int op, long id, void *uaddr, void *uaddr2); + +/* + * Old (deprecated) userland mutex system calls. */ -/* deprecated becaues it can only use thread id */ int _umtx_lock(struct umtx *mtx); -/* deprecated becaues it can only use thread id */ int _umtx_unlock(struct umtx *mtx); -int _umtx_op(struct umtx *umtx, int op, long id, void *uaddr, const void *uaddr2); /* * Standard api. Try uncontested acquire/release and asks the @@ -100,7 +102,8 @@ umtx_timedlock(struct umtx *umtx, long id, const struct timespec *timeout) { if (atomic_cmpset_acq_ptr(&umtx->u_owner, (void *)UMTX_UNOWNED, (void *)id) == 0) - if (_umtx_op(umtx, UMTX_OP_LOCK, id, 0, timeout) == -1) + if (_umtx_op(umtx, UMTX_OP_LOCK, id, 0, + __DECONST(void *, timeout)) == -1) return (errno); return (0); } @@ -118,7 +121,8 @@ umtx_unlock(struct umtx *umtx, long id) static __inline int umtx_wait(struct umtx *umtx, long id, const struct timespec *timeout) { - if (_umtx_op(umtx, UMTX_OP_WAIT, id, 0, timeout) == -1) + if (_umtx_op(umtx, UMTX_OP_WAIT, id, 0, + __DECONST(void *, timeout)) == -1) return (errno); return (0); } |