1/*	$OpenBSD: futex.h,v 1.2 2018/06/03 15:09:26 kettenis Exp $ */
2
3/*
4 * Copyright (c) 2016 Martin Pieuchot
5 *
6 * Permission to use, copy, modify, and distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18
19#ifndef	_SYS_FUTEX_H_
20#define	_SYS_FUTEX_H_
21
22#ifndef _KERNEL
23#include <sys/cdefs.h>
24
25__BEGIN_DECLS
26int futex(volatile uint32_t *, int, int, const struct timespec *,
27    volatile uint32_t *);
28__END_DECLS
29#endif /* ! _KERNEL */
30
31#define	FUTEX_WAIT		1
32#define	FUTEX_WAKE		2
33#define	FUTEX_REQUEUE		3
34
35#define	FUTEX_PRIVATE_FLAG	128
36
37#define	FUTEX_WAIT_PRIVATE	(FUTEX_WAIT | FUTEX_PRIVATE_FLAG)
38#define	FUTEX_WAKE_PRIVATE	(FUTEX_WAKE | FUTEX_PRIVATE_FLAG)
39#define	FUTEX_REQUEUE_PRIVATE	(FUTEX_REQUEUE | FUTEX_PRIVATE_FLAG)
40
41#endif	/* _SYS_FUTEX_H_ */
42