From ae7d8a6766fccee29a66440a8ca004f0993a2bac Mon Sep 17 00:00:00 2001 From: David Xu Date: Fri, 6 Oct 2006 08:22:08 +0000 Subject: [PATCH] Implement 32bit umtx_lock and umtx_unlock system calls, these two system calls are not used by libthr in RELENG_6 and HEAD, it is only used by the libthr in RELENG-5, the _umtx_op system call can do more incremental dirty works than these two system calls without having to introduce new system calls or throw away old system calls when things are going on. --- sys/compat/freebsd32/syscalls.master | 4 ++-- sys/kern/kern_umtx.c | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/sys/compat/freebsd32/syscalls.master b/sys/compat/freebsd32/syscalls.master index 5cfd0c83073..2a421ddbf00 100644 --- a/sys/compat/freebsd32/syscalls.master +++ b/sys/compat/freebsd32/syscalls.master @@ -721,8 +721,8 @@ 431 AUE_NULL NOPROTO { void thr_exit(long *state); } 432 AUE_NULL NOPROTO { int thr_self(long *id); } 433 AUE_NULL NOPROTO { int thr_kill(long id, int sig); } -434 AUE_NULL NOPROTO { int _umtx_lock(struct umtx *umtx); } -435 AUE_NULL NOPROTO { int _umtx_unlock(struct umtx *umtx); } +434 AUE_NULL STD { int freebsd32_umtx_lock(struct umtx *umtx); } +435 AUE_NULL STD { int freebsd32_umtx_unlock(struct umtx *umtx); } 436 AUE_NULL NOPROTO { int jail_attach(int jid); } 437 AUE_EXTATTR_LIST_FD UNIMPL extattr_list_fd 438 AUE_EXTATTR_LIST_FILE UNIMPL extattr_list_file diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index 0cff693fffd..4c7f9d7bc38 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -2303,6 +2303,20 @@ _umtx_op(struct thread *td, struct _umtx_op_args *uap) #ifdef COMPAT_IA32 +int +freebsd32_umtx_lock(struct thread *td, struct freebsd32_umtx_lock_args *uap) + /* struct umtx *umtx */ +{ + return (do_lock_umtx32(td, (uint32_t *)uap->umtx, td->td_tid, NULL)); +} + +int +freebsd32_umtx_unlock(struct thread *td, struct freebsd32_umtx_unlock_args *uap) + /* struct umtx *umtx */ +{ + return (do_unlock_umtx32(td, (uint32_t *)uap->umtx, td->td_tid)); +} + struct timespec32 { u_int32_t tv_sec; u_int32_t tv_nsec;