sys/kern/kern_umtx.c
int
sys_umtx_wakeup(struct umtx_wakeup_args *uap)
{
    vm_page_t m;
    int offset;
    int error;
    void *waddr;

    cpu_mfence();
    if ((vm_offset_t)uap->ptr & (sizeof(int) - 1))
	return (EFAULT);
    m = vm_fault_page_quick((vm_offset_t)uap->ptr, VM_PROT_READ, &error);
    if (m == NULL) {
	error = EFAULT;
	goto done;
    }
    offset = (vm_offset_t)uap->ptr & PAGE_MASK;
    waddr = (void *)((intptr_t)VM_PAGE_TO_PHYS(m) + offset);

    if (uap->count == 1) {
	wakeup_domain_one(waddr, PDOMAIN_UMTX);
    } else {
	/* XXX wakes them all up for now */
	wakeup_domain(waddr, PDOMAIN_UMTX);
    }
    vm_page_unhold(m);
    error = 0;
done:
    return(error);
}
/*
 * umtx_wakeup { const int *ptr, int count }
 *
 * Wakeup the specified number of processes held in umtx_sleep() on the
 * specified user address.  A count of 0 wakes up all waiting processes.
 *
 * XXX assumes that the physical address space does not exceed the virtual
 * address space.
 */
umtx_wakeup { const int *ptr, int count }
Wakeup the specified number of processes held in umtx_sleep() on the
specified user address.  A count of 0 wakes up all waiting processes.

XXX assumes that the physical address space does not exceed the virtual
address space.
umtx_wakeup { const int * ptr int count } Wakeup the specified number of processes held in umtx_sleep () on the specified user address . A count of 0 wakes up all waiting processes . XXX assumes that the physical address space does not exceed the virtual address space .
int
sys_umtx_wakeup(struct umtx_wakeup_args *uap)
{
    vm_page_t m;
    int offset;
    int error;
    void *waddr;
    cpu_mfence();
    if ((vm_offset_t)uap->ptr & (sizeof(int) - 1))
	return (EFAULT);
    m = vm_fault_page_quick((vm_offset_t)uap->ptr, VM_PROT_READ, &error);
    if (m == NULL) {
	error = EFAULT;
	goto done;
    }
    offset = (vm_offset_t)uap->ptr & PAGE_MASK;
    waddr = (void *)((intptr_t)VM_PAGE_TO_PHYS(m) + offset);
    if (uap->count == 1) {
	wakeup_domain_one(waddr, PDOMAIN_UMTX);
    } else {
	wakeup_domain(waddr, PDOMAIN_UMTX);
    }
    vm_page_unhold(m);
    error = 0;
done:
    return(error);
}
int sys_umtx_wakeup ( struct umtx_wakeup_args * uap ) { vm_page_t m ; int offset ; int error ; void * waddr ; cpu_mfence ( ) ; if ( ( vm_offset_t ) uap -> ptr & ( sizeof ( int ) - 1 ) ) return ( EFAULT ) ; m = vm_fault_page_quick ( ( vm_offset_t ) uap -> ptr , VM_PROT_READ , & error ) ; if ( m == NULL ) { error = EFAULT ; goto done ; } offset = ( vm_offset_t ) uap -> ptr & PAGE_MASK ; waddr = ( void * ) ( ( intptr_t ) VM_PAGE_TO_PHYS ( m ) + offset ) ; if ( uap -> count == 1 ) { wakeup_domain_one ( waddr , PDOMAIN_UMTX ) ; } else { wakeup_domain ( waddr , PDOMAIN_UMTX ) ; } vm_page_unhold ( m ) ; error = 0 ; done : return ( error ) ; }
umtx_wakeup { const int *ptr, int count }
 Wakeup the specified number of processes held in umtx_sleep() on the
 specified user address.
umtx_wakeup { const int * ptr int count } Wakeup the specified number of processes held in umtx_sleep () on the specified user address .
/* XXX wakes them all up for now */