kern_umtx.c (270345) | kern_umtx.c (273604) |
---|---|
1/*- 2 * Copyright (c) 2004, David Xu <davidxu@freebsd.org> 3 * Copyright (c) 2002, Jeffrey Roberson <jeff@freebsd.org> 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 12 unchanged lines hidden (view full) --- 21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 */ 27 28#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2004, David Xu <davidxu@freebsd.org> 3 * Copyright (c) 2002, Jeffrey Roberson <jeff@freebsd.org> 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 12 unchanged lines hidden (view full) --- 21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 */ 27 28#include <sys/cdefs.h> |
29__FBSDID("$FreeBSD: head/sys/kern/kern_umtx.c 270345 2014-08-22 18:42:14Z kib $"); | 29__FBSDID("$FreeBSD: head/sys/kern/kern_umtx.c 273604 2014-10-24 20:02:44Z jhb $"); |
30 31#include "opt_compat.h" 32#include "opt_umtx_profiling.h" 33 34#include <sys/param.h> 35#include <sys/kernel.h> 36#include <sys/limits.h> 37#include <sys/lock.h> --- 2667 unchanged lines hidden (view full) --- 2705 umtxq_unbusy(&uq->uq_key); 2706 umtxq_unlock(&uq->uq_key); 2707 } 2708out: 2709 umtx_key_release(&uq->uq_key); 2710 return (error); 2711} 2712 | 30 31#include "opt_compat.h" 32#include "opt_umtx_profiling.h" 33 34#include <sys/param.h> 35#include <sys/kernel.h> 36#include <sys/limits.h> 37#include <sys/lock.h> --- 2667 unchanged lines hidden (view full) --- 2705 umtxq_unbusy(&uq->uq_key); 2706 umtxq_unlock(&uq->uq_key); 2707 } 2708out: 2709 umtx_key_release(&uq->uq_key); 2710 return (error); 2711} 2712 |
2713#if defined(COMPAT_FREEBSD9) || defined(COMPAT_FREEBSD10) |
|
2713static int 2714do_sem_wait(struct thread *td, struct _usem *sem, struct _umtx_time *timeout) 2715{ 2716 struct abs_timeout timo; 2717 struct umtx_q *uq; 2718 uint32_t flags, count; 2719 int error; 2720 --- 5 unchanged lines hidden (view full) --- 2726 2727 if (timeout != NULL) 2728 abs_timeout_init2(&timo, timeout); 2729 2730 umtxq_lock(&uq->uq_key); 2731 umtxq_busy(&uq->uq_key); 2732 umtxq_insert(uq); 2733 umtxq_unlock(&uq->uq_key); | 2714static int 2715do_sem_wait(struct thread *td, struct _usem *sem, struct _umtx_time *timeout) 2716{ 2717 struct abs_timeout timo; 2718 struct umtx_q *uq; 2719 uint32_t flags, count; 2720 int error; 2721 --- 5 unchanged lines hidden (view full) --- 2727 2728 if (timeout != NULL) 2729 abs_timeout_init2(&timo, timeout); 2730 2731 umtxq_lock(&uq->uq_key); 2732 umtxq_busy(&uq->uq_key); 2733 umtxq_insert(uq); 2734 umtxq_unlock(&uq->uq_key); |
2734 casuword32(__DEVOLATILE(uint32_t *, &sem->_has_waiters), 0, 1); | 2735 casuword32(&sem->_has_waiters, 0, 1); |
2735 count = fuword32(__DEVOLATILE(uint32_t *, &sem->_count)); 2736 if (count != 0) { 2737 umtxq_lock(&uq->uq_key); 2738 umtxq_unbusy(&uq->uq_key); 2739 umtxq_remove(uq); 2740 umtxq_unlock(&uq->uq_key); 2741 umtx_key_release(&uq->uq_key); 2742 return (0); --- 13 unchanged lines hidden (view full) --- 2756 error = EINTR; 2757 } 2758 umtxq_unlock(&uq->uq_key); 2759 umtx_key_release(&uq->uq_key); 2760 return (error); 2761} 2762 2763/* | 2736 count = fuword32(__DEVOLATILE(uint32_t *, &sem->_count)); 2737 if (count != 0) { 2738 umtxq_lock(&uq->uq_key); 2739 umtxq_unbusy(&uq->uq_key); 2740 umtxq_remove(uq); 2741 umtxq_unlock(&uq->uq_key); 2742 umtx_key_release(&uq->uq_key); 2743 return (0); --- 13 unchanged lines hidden (view full) --- 2757 error = EINTR; 2758 } 2759 umtxq_unlock(&uq->uq_key); 2760 umtx_key_release(&uq->uq_key); 2761 return (error); 2762} 2763 2764/* |
2764 * Signal a userland condition variable. | 2765 * Signal a userland semaphore. |
2765 */ 2766static int 2767do_sem_wake(struct thread *td, struct _usem *sem) 2768{ 2769 struct umtx_key key; 2770 int error, cnt; 2771 uint32_t flags; 2772 --- 17 unchanged lines hidden (view full) --- 2790 umtxq_lock(&key); 2791 } 2792 } 2793 umtxq_unbusy(&key); 2794 umtxq_unlock(&key); 2795 umtx_key_release(&key); 2796 return (error); 2797} | 2766 */ 2767static int 2768do_sem_wake(struct thread *td, struct _usem *sem) 2769{ 2770 struct umtx_key key; 2771 int error, cnt; 2772 uint32_t flags; 2773 --- 17 unchanged lines hidden (view full) --- 2791 umtxq_lock(&key); 2792 } 2793 } 2794 umtxq_unbusy(&key); 2795 umtxq_unlock(&key); 2796 umtx_key_release(&key); 2797 return (error); 2798} |
2799#endif |
|
2798 | 2800 |
2801static int 2802do_sem2_wait(struct thread *td, struct _usem2 *sem, struct _umtx_time *timeout) 2803{ 2804 struct abs_timeout timo; 2805 struct umtx_q *uq; 2806 uint32_t count, flags; 2807 int error; 2808 2809 uq = td->td_umtxq; 2810 flags = fuword32(&sem->_flags); 2811 error = umtx_key_get(sem, TYPE_SEM, GET_SHARE(flags), &uq->uq_key); 2812 if (error != 0) 2813 return (error); 2814 2815 if (timeout != NULL) 2816 abs_timeout_init2(&timo, timeout); 2817 2818 umtxq_lock(&uq->uq_key); 2819 umtxq_busy(&uq->uq_key); 2820 umtxq_insert(uq); 2821 umtxq_unlock(&uq->uq_key); 2822 count = fuword32(__DEVOLATILE(uint32_t *, &sem->_count)); 2823 if (count == -1) { 2824 umtxq_lock(&uq->uq_key); 2825 umtxq_unbusy(&uq->uq_key); 2826 umtxq_remove(uq); 2827 umtxq_unlock(&uq->uq_key); 2828 umtx_key_release(&uq->uq_key); 2829 return (EFAULT); 2830 } 2831 for (;;) { 2832 if (USEM_COUNT(count) != 0) { 2833 umtxq_lock(&uq->uq_key); 2834 umtxq_unbusy(&uq->uq_key); 2835 umtxq_remove(uq); 2836 umtxq_unlock(&uq->uq_key); 2837 umtx_key_release(&uq->uq_key); 2838 return (0); 2839 } 2840 if (count == USEM_HAS_WAITERS) 2841 break; 2842 count = casuword32(&sem->_count, 0, USEM_HAS_WAITERS); 2843 if (count == -1) { 2844 umtxq_lock(&uq->uq_key); 2845 umtxq_unbusy(&uq->uq_key); 2846 umtxq_remove(uq); 2847 umtxq_unlock(&uq->uq_key); 2848 umtx_key_release(&uq->uq_key); 2849 return (EFAULT); 2850 } 2851 if (count == 0) 2852 break; 2853 } 2854 umtxq_lock(&uq->uq_key); 2855 umtxq_unbusy(&uq->uq_key); 2856 2857 error = umtxq_sleep(uq, "usem", timeout == NULL ? NULL : &timo); 2858 2859 if ((uq->uq_flags & UQF_UMTXQ) == 0) 2860 error = 0; 2861 else { 2862 umtxq_remove(uq); 2863 /* A relative timeout cannot be restarted. */ 2864 if (error == ERESTART && timeout != NULL && 2865 (timeout->_flags & UMTX_ABSTIME) == 0) 2866 error = EINTR; 2867 } 2868 umtxq_unlock(&uq->uq_key); 2869 umtx_key_release(&uq->uq_key); 2870 return (error); 2871} 2872 2873/* 2874 * Signal a userland semaphore. 2875 */ 2876static int 2877do_sem2_wake(struct thread *td, struct _usem2 *sem) 2878{ 2879 struct umtx_key key; 2880 int error, cnt; 2881 uint32_t count, flags; 2882 2883 flags = fuword32(&sem->_flags); 2884 if ((error = umtx_key_get(sem, TYPE_SEM, GET_SHARE(flags), &key)) != 0) 2885 return (error); 2886 umtxq_lock(&key); 2887 umtxq_busy(&key); 2888 cnt = umtxq_count(&key); 2889 if (cnt > 0) { 2890 umtxq_signal(&key, 1); 2891 2892 /* 2893 * If this was the last sleeping thread, clear the waiters 2894 * flag in _count. 2895 */ 2896 if (cnt == 1) { 2897 umtxq_unlock(&key); 2898 count = fuword32(&sem->_count); 2899 while (count != -1 && count & USEM_HAS_WAITERS) 2900 count = casuword32(&sem->_count, count, 2901 count & ~USEM_HAS_WAITERS); 2902 if (count == -1) 2903 error = EFAULT; 2904 umtxq_lock(&key); 2905 } 2906 } 2907 umtxq_unbusy(&key); 2908 umtxq_unlock(&key); 2909 umtx_key_release(&key); 2910 return (error); 2911} 2912 |
|
2799inline int 2800umtx_copyin_timeout(const void *addr, struct timespec *tsp) 2801{ 2802 int error; 2803 2804 error = copyin(addr, tsp, sizeof(struct timespec)); 2805 if (error == 0) { 2806 if (tsp->tv_sec < 0 || --- 254 unchanged lines hidden (view full) --- 3061} 3062 3063static int 3064__umtx_op_rw_unlock(struct thread *td, struct _umtx_op_args *uap) 3065{ 3066 return do_rw_unlock(td, uap->obj); 3067} 3068 | 2913inline int 2914umtx_copyin_timeout(const void *addr, struct timespec *tsp) 2915{ 2916 int error; 2917 2918 error = copyin(addr, tsp, sizeof(struct timespec)); 2919 if (error == 0) { 2920 if (tsp->tv_sec < 0 || --- 254 unchanged lines hidden (view full) --- 3175} 3176 3177static int 3178__umtx_op_rw_unlock(struct thread *td, struct _umtx_op_args *uap) 3179{ 3180 return do_rw_unlock(td, uap->obj); 3181} 3182 |
3183#if defined(COMPAT_FREEBSD9) || defined(COMPAT_FREEBSD10) |
|
3069static int 3070__umtx_op_sem_wait(struct thread *td, struct _umtx_op_args *uap) 3071{ 3072 struct _umtx_time *tm_p, timeout; 3073 int error; 3074 3075 /* Allow a null timespec (wait forever). */ 3076 if (uap->uaddr2 == NULL) --- 8 unchanged lines hidden (view full) --- 3085 return (do_sem_wait(td, uap->obj, tm_p)); 3086} 3087 3088static int 3089__umtx_op_sem_wake(struct thread *td, struct _umtx_op_args *uap) 3090{ 3091 return do_sem_wake(td, uap->obj); 3092} | 3184static int 3185__umtx_op_sem_wait(struct thread *td, struct _umtx_op_args *uap) 3186{ 3187 struct _umtx_time *tm_p, timeout; 3188 int error; 3189 3190 /* Allow a null timespec (wait forever). */ 3191 if (uap->uaddr2 == NULL) --- 8 unchanged lines hidden (view full) --- 3200 return (do_sem_wait(td, uap->obj, tm_p)); 3201} 3202 3203static int 3204__umtx_op_sem_wake(struct thread *td, struct _umtx_op_args *uap) 3205{ 3206 return do_sem_wake(td, uap->obj); 3207} |
3208#endif |
|
3093 3094static int 3095__umtx_op_wake2_umutex(struct thread *td, struct _umtx_op_args *uap) 3096{ 3097 return do_wake2_umutex(td, uap->obj, uap->val); 3098} 3099 | 3209 3210static int 3211__umtx_op_wake2_umutex(struct thread *td, struct _umtx_op_args *uap) 3212{ 3213 return do_wake2_umutex(td, uap->obj, uap->val); 3214} 3215 |
3216static int 3217__umtx_op_sem2_wait(struct thread *td, struct _umtx_op_args *uap) 3218{ 3219 struct _umtx_time *tm_p, timeout; 3220 int error; 3221 3222 /* Allow a null timespec (wait forever). */ 3223 if (uap->uaddr2 == NULL) 3224 tm_p = NULL; 3225 else { 3226 error = umtx_copyin_umtx_time( 3227 uap->uaddr2, (size_t)uap->uaddr1, &timeout); 3228 if (error != 0) 3229 return (error); 3230 tm_p = &timeout; 3231 } 3232 return (do_sem2_wait(td, uap->obj, tm_p)); 3233} 3234 3235static int 3236__umtx_op_sem2_wake(struct thread *td, struct _umtx_op_args *uap) 3237{ 3238 return do_sem2_wake(td, uap->obj); 3239} 3240 |
|
3100typedef int (*_umtx_op_func)(struct thread *td, struct _umtx_op_args *uap); 3101 3102static _umtx_op_func op_table[] = { 3103 __umtx_op_unimpl, /* UMTX_OP_RESERVED0 */ 3104 __umtx_op_unimpl, /* UMTX_OP_RESERVED1 */ 3105 __umtx_op_wait, /* UMTX_OP_WAIT */ 3106 __umtx_op_wake, /* UMTX_OP_WAKE */ 3107 __umtx_op_trylock_umutex, /* UMTX_OP_MUTEX_TRYLOCK */ --- 6 unchanged lines hidden (view full) --- 3114 __umtx_op_wait_uint, /* UMTX_OP_WAIT_UINT */ 3115 __umtx_op_rw_rdlock, /* UMTX_OP_RW_RDLOCK */ 3116 __umtx_op_rw_wrlock, /* UMTX_OP_RW_WRLOCK */ 3117 __umtx_op_rw_unlock, /* UMTX_OP_RW_UNLOCK */ 3118 __umtx_op_wait_uint_private, /* UMTX_OP_WAIT_UINT_PRIVATE */ 3119 __umtx_op_wake_private, /* UMTX_OP_WAKE_PRIVATE */ 3120 __umtx_op_wait_umutex, /* UMTX_OP_MUTEX_WAIT */ 3121 __umtx_op_wake_umutex, /* UMTX_OP_MUTEX_WAKE */ | 3241typedef int (*_umtx_op_func)(struct thread *td, struct _umtx_op_args *uap); 3242 3243static _umtx_op_func op_table[] = { 3244 __umtx_op_unimpl, /* UMTX_OP_RESERVED0 */ 3245 __umtx_op_unimpl, /* UMTX_OP_RESERVED1 */ 3246 __umtx_op_wait, /* UMTX_OP_WAIT */ 3247 __umtx_op_wake, /* UMTX_OP_WAKE */ 3248 __umtx_op_trylock_umutex, /* UMTX_OP_MUTEX_TRYLOCK */ --- 6 unchanged lines hidden (view full) --- 3255 __umtx_op_wait_uint, /* UMTX_OP_WAIT_UINT */ 3256 __umtx_op_rw_rdlock, /* UMTX_OP_RW_RDLOCK */ 3257 __umtx_op_rw_wrlock, /* UMTX_OP_RW_WRLOCK */ 3258 __umtx_op_rw_unlock, /* UMTX_OP_RW_UNLOCK */ 3259 __umtx_op_wait_uint_private, /* UMTX_OP_WAIT_UINT_PRIVATE */ 3260 __umtx_op_wake_private, /* UMTX_OP_WAKE_PRIVATE */ 3261 __umtx_op_wait_umutex, /* UMTX_OP_MUTEX_WAIT */ 3262 __umtx_op_wake_umutex, /* UMTX_OP_MUTEX_WAKE */ |
3263#if defined(COMPAT_FREEBSD9) || defined(COMPAT_FREEBSD10) |
|
3122 __umtx_op_sem_wait, /* UMTX_OP_SEM_WAIT */ 3123 __umtx_op_sem_wake, /* UMTX_OP_SEM_WAKE */ | 3264 __umtx_op_sem_wait, /* UMTX_OP_SEM_WAIT */ 3265 __umtx_op_sem_wake, /* UMTX_OP_SEM_WAKE */ |
3266#else 3267 __umtx_op_unimpl, /* UMTX_OP_SEM_WAIT */ 3268 __umtx_op_unimpl, /* UMTX_OP_SEM_WAKE */ 3269#endif |
|
3124 __umtx_op_nwake_private, /* UMTX_OP_NWAKE_PRIVATE */ | 3270 __umtx_op_nwake_private, /* UMTX_OP_NWAKE_PRIVATE */ |
3125 __umtx_op_wake2_umutex /* UMTX_OP_MUTEX_WAKE2 */ | 3271 __umtx_op_wake2_umutex, /* UMTX_OP_MUTEX_WAKE2 */ 3272 __umtx_op_sem2_wait, /* UMTX_OP_SEM2_WAIT */ 3273 __umtx_op_sem2_wake, /* UMTX_OP_SEM2_WAKE */ |
3126}; 3127 3128int 3129sys__umtx_op(struct thread *td, struct _umtx_op_args *uap) 3130{ 3131 if ((unsigned)uap->op < UMTX_OP_MAX) 3132 return (*op_table[uap->op])(td, uap); 3133 return (EINVAL); --- 181 unchanged lines hidden (view full) --- 3315 uap->uaddr2, (size_t)uap->uaddr1,&timeout); 3316 if (error != 0) 3317 return (error); 3318 tm_p = &timeout; 3319 } 3320 return do_wait(td, uap->obj, uap->val, tm_p, 1, 1); 3321} 3322 | 3274}; 3275 3276int 3277sys__umtx_op(struct thread *td, struct _umtx_op_args *uap) 3278{ 3279 if ((unsigned)uap->op < UMTX_OP_MAX) 3280 return (*op_table[uap->op])(td, uap); 3281 return (EINVAL); --- 181 unchanged lines hidden (view full) --- 3463 uap->uaddr2, (size_t)uap->uaddr1,&timeout); 3464 if (error != 0) 3465 return (error); 3466 tm_p = &timeout; 3467 } 3468 return do_wait(td, uap->obj, uap->val, tm_p, 1, 1); 3469} 3470 |
3471#if defined(COMPAT_FREEBSD9) || defined(COMPAT_FREEBSD10) |
|
3323static int 3324__umtx_op_sem_wait_compat32(struct thread *td, struct _umtx_op_args *uap) 3325{ 3326 struct _umtx_time *tm_p, timeout; 3327 int error; 3328 3329 /* Allow a null timespec (wait forever). */ 3330 if (uap->uaddr2 == NULL) 3331 tm_p = NULL; 3332 else { 3333 error = umtx_copyin_umtx_time32(uap->uaddr2, 3334 (size_t)uap->uaddr1, &timeout); 3335 if (error != 0) 3336 return (error); 3337 tm_p = &timeout; 3338 } 3339 return (do_sem_wait(td, uap->obj, tm_p)); 3340} | 3472static int 3473__umtx_op_sem_wait_compat32(struct thread *td, struct _umtx_op_args *uap) 3474{ 3475 struct _umtx_time *tm_p, timeout; 3476 int error; 3477 3478 /* Allow a null timespec (wait forever). */ 3479 if (uap->uaddr2 == NULL) 3480 tm_p = NULL; 3481 else { 3482 error = umtx_copyin_umtx_time32(uap->uaddr2, 3483 (size_t)uap->uaddr1, &timeout); 3484 if (error != 0) 3485 return (error); 3486 tm_p = &timeout; 3487 } 3488 return (do_sem_wait(td, uap->obj, tm_p)); 3489} |
3490#endif |
|
3341 3342static int | 3491 3492static int |
3493__umtx_op_sem2_wait_compat32(struct thread *td, struct _umtx_op_args *uap) 3494{ 3495 struct _umtx_time *tm_p, timeout; 3496 int error; 3497 3498 /* Allow a null timespec (wait forever). */ 3499 if (uap->uaddr2 == NULL) 3500 tm_p = NULL; 3501 else { 3502 error = umtx_copyin_umtx_time32(uap->uaddr2, 3503 (size_t)uap->uaddr1, &timeout); 3504 if (error != 0) 3505 return (error); 3506 tm_p = &timeout; 3507 } 3508 return (do_sem2_wait(td, uap->obj, tm_p)); 3509} 3510 3511static int |
|
3343__umtx_op_nwake_private32(struct thread *td, struct _umtx_op_args *uap) 3344{ 3345 int count = uap->val; 3346 uint32_t uaddrs[BATCH_SIZE]; 3347 uint32_t **upp = (uint32_t **)uap->obj; 3348 int tocopy; 3349 int error = 0; 3350 int i, pos = 0; --- 29 unchanged lines hidden (view full) --- 3380 __umtx_op_wait_compat32, /* UMTX_OP_WAIT_UINT */ 3381 __umtx_op_rw_rdlock_compat32, /* UMTX_OP_RW_RDLOCK */ 3382 __umtx_op_rw_wrlock_compat32, /* UMTX_OP_RW_WRLOCK */ 3383 __umtx_op_rw_unlock, /* UMTX_OP_RW_UNLOCK */ 3384 __umtx_op_wait_uint_private_compat32, /* UMTX_OP_WAIT_UINT_PRIVATE */ 3385 __umtx_op_wake_private, /* UMTX_OP_WAKE_PRIVATE */ 3386 __umtx_op_wait_umutex_compat32, /* UMTX_OP_MUTEX_WAIT */ 3387 __umtx_op_wake_umutex, /* UMTX_OP_MUTEX_WAKE */ | 3512__umtx_op_nwake_private32(struct thread *td, struct _umtx_op_args *uap) 3513{ 3514 int count = uap->val; 3515 uint32_t uaddrs[BATCH_SIZE]; 3516 uint32_t **upp = (uint32_t **)uap->obj; 3517 int tocopy; 3518 int error = 0; 3519 int i, pos = 0; --- 29 unchanged lines hidden (view full) --- 3549 __umtx_op_wait_compat32, /* UMTX_OP_WAIT_UINT */ 3550 __umtx_op_rw_rdlock_compat32, /* UMTX_OP_RW_RDLOCK */ 3551 __umtx_op_rw_wrlock_compat32, /* UMTX_OP_RW_WRLOCK */ 3552 __umtx_op_rw_unlock, /* UMTX_OP_RW_UNLOCK */ 3553 __umtx_op_wait_uint_private_compat32, /* UMTX_OP_WAIT_UINT_PRIVATE */ 3554 __umtx_op_wake_private, /* UMTX_OP_WAKE_PRIVATE */ 3555 __umtx_op_wait_umutex_compat32, /* UMTX_OP_MUTEX_WAIT */ 3556 __umtx_op_wake_umutex, /* UMTX_OP_MUTEX_WAKE */ |
3557#if defined(COMPAT_FREEBSD9) || defined(COMPAT_FREEBSD10) |
|
3388 __umtx_op_sem_wait_compat32, /* UMTX_OP_SEM_WAIT */ 3389 __umtx_op_sem_wake, /* UMTX_OP_SEM_WAKE */ | 3558 __umtx_op_sem_wait_compat32, /* UMTX_OP_SEM_WAIT */ 3559 __umtx_op_sem_wake, /* UMTX_OP_SEM_WAKE */ |
3560#else 3561 __umtx_op_unimpl, /* UMTX_OP_SEM_WAIT */ 3562 __umtx_op_unimpl, /* UMTX_OP_SEM_WAKE */ 3563#endif |
|
3390 __umtx_op_nwake_private32, /* UMTX_OP_NWAKE_PRIVATE */ | 3564 __umtx_op_nwake_private32, /* UMTX_OP_NWAKE_PRIVATE */ |
3391 __umtx_op_wake2_umutex /* UMTX_OP_MUTEX_WAKE2 */ | 3565 __umtx_op_wake2_umutex, /* UMTX_OP_MUTEX_WAKE2 */ 3566 __umtx_op_sem2_wait_compat32, /* UMTX_OP_SEM2_WAIT */ 3567 __umtx_op_sem2_wake, /* UMTX_OP_SEM2_WAKE */ |
3392}; 3393 3394int 3395freebsd32_umtx_op(struct thread *td, struct freebsd32_umtx_op_args *uap) 3396{ 3397 if ((unsigned)uap->op < UMTX_OP_MAX) 3398 return (*op_table_compat32[uap->op])(td, 3399 (struct _umtx_op_args *)uap); --- 76 unchanged lines hidden --- | 3568}; 3569 3570int 3571freebsd32_umtx_op(struct thread *td, struct freebsd32_umtx_op_args *uap) 3572{ 3573 if ((unsigned)uap->op < UMTX_OP_MAX) 3574 return (*op_table_compat32[uap->op])(td, 3575 (struct _umtx_op_args *)uap); --- 76 unchanged lines hidden --- |