1*ef9871c6SBrooks Davis /*-
2*ef9871c6SBrooks Davis * SPDX-License-Identifier: BSD-2-Clause
3*ef9871c6SBrooks Davis *
4*ef9871c6SBrooks Davis * Copyright (c) 2005 David Xu <davidxu@freebsd.org>
5*ef9871c6SBrooks Davis * All rights reserved.
6*ef9871c6SBrooks Davis *
7*ef9871c6SBrooks Davis * Redistribution and use in source and binary forms, with or without
8*ef9871c6SBrooks Davis * modification, are permitted provided that the following conditions
9*ef9871c6SBrooks Davis * are met:
10*ef9871c6SBrooks Davis * 1. Redistributions of source code must retain the above copyright
11*ef9871c6SBrooks Davis * notice unmodified, this list of conditions, and the following
12*ef9871c6SBrooks Davis * disclaimer.
13*ef9871c6SBrooks Davis * 2. Redistributions in binary form must reproduce the above copyright
14*ef9871c6SBrooks Davis * notice, this list of conditions and the following disclaimer in the
15*ef9871c6SBrooks Davis * documentation and/or other materials provided with the distribution.
16*ef9871c6SBrooks Davis *
17*ef9871c6SBrooks Davis * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18*ef9871c6SBrooks Davis * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19*ef9871c6SBrooks Davis * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20*ef9871c6SBrooks Davis * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21*ef9871c6SBrooks Davis * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22*ef9871c6SBrooks Davis * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23*ef9871c6SBrooks Davis * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24*ef9871c6SBrooks Davis * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25*ef9871c6SBrooks Davis * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26*ef9871c6SBrooks Davis * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27*ef9871c6SBrooks Davis */
28*ef9871c6SBrooks Davis
29*ef9871c6SBrooks Davis #include <sys/types.h>
30*ef9871c6SBrooks Davis #include <sys/errno.h>
31*ef9871c6SBrooks Davis #include <sys/umtx.h>
32*ef9871c6SBrooks Davis
33*ef9871c6SBrooks Davis int
_umtx_op_err(void * obj,int op,u_long val,void * uaddr,void * uaddr2)34*ef9871c6SBrooks Davis _umtx_op_err(void *obj, int op, u_long val, void *uaddr, void *uaddr2)
35*ef9871c6SBrooks Davis {
36*ef9871c6SBrooks Davis if (_umtx_op(obj, op, val, uaddr, uaddr2) == -1)
37*ef9871c6SBrooks Davis return (errno);
38*ef9871c6SBrooks Davis return (0);
39*ef9871c6SBrooks Davis }
40