| 4596 | } |
| 4597 | |
| 4598 | static int |
| 4599 | umtx_handle_rb(struct thread *td, uintptr_t rbp, uintptr_t *rb_list, bool inact, |
| 4600 | bool compat32) |
| 4601 | { |
| 4602 | struct umutex m; |
| 4603 | int error; |
| 4604 | |
| 4605 | KASSERT(td->td_proc == curproc, ("need current vmspace")); |
| 4606 | error = copyin((void *)rbp, &m, sizeof(m)); |
| 4607 | if (error != 0) |
| 4608 | return (error); |
| 4609 | if (rb_list != NULL) |
| 4610 | umtx_read_rb_list(td, &m, rb_list, compat32); |
| 4611 | if ((m.m_flags & UMUTEX_ROBUST) == 0) |
| 4612 | return (EINVAL); |
| 4613 | if ((m.m_owner & ~UMUTEX_CONTESTED) != td->td_tid) |
| 4614 | /* inact is cleared after unlock, allow the inconsistency */ |
| 4615 | return (inact ? 0 : EINVAL); |
| 4616 | return (do_unlock_umutex(td, (struct umutex *)rbp, true)); |
| 4617 | } |
| 4618 | |
| 4619 | static void |
| 4620 | umtx_cleanup_rb_list(struct thread *td, uintptr_t rb_list, uintptr_t *rb_inact, |
no test coverage detected