srcu.h revision 328653
1292538Shselasky/*-
2328653Shselasky * Copyright (c) 2015-2017 Mellanox Technologies, Ltd.
3292538Shselasky * All rights reserved.
4292538Shselasky *
5292538Shselasky * Redistribution and use in source and binary forms, with or without
6292538Shselasky * modification, are permitted provided that the following conditions
7292538Shselasky * are met:
8292538Shselasky * 1. Redistributions of source code must retain the above copyright
9292538Shselasky *    notice unmodified, this list of conditions, and the following
10292538Shselasky *    disclaimer.
11292538Shselasky * 2. Redistributions in binary form must reproduce the above copyright
12292538Shselasky *    notice, this list of conditions and the following disclaimer in the
13292538Shselasky *    documentation and/or other materials provided with the distribution.
14292538Shselasky *
15292538Shselasky * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16292538Shselasky * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17292538Shselasky * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18292538Shselasky * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19292538Shselasky * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20292538Shselasky * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21292538Shselasky * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22292538Shselasky * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23292538Shselasky * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24292538Shselasky * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25292538Shselasky *
26292538Shselasky * $FreeBSD: stable/11/sys/compat/linuxkpi/common/include/linux/srcu.h 328653 2018-02-01 13:01:44Z hselasky $
27292538Shselasky */
28328653Shselasky
29292538Shselasky#ifndef	_LINUX_SRCU_H_
30292538Shselasky#define	_LINUX_SRCU_H_
31292538Shselasky
32292538Shselaskystruct srcu_struct {
33292538Shselasky};
34292538Shselasky
35328653Shselasky#define	srcu_dereference(ptr,srcu)	((__typeof(*(ptr)) *)(ptr))
36292538Shselasky
37328653Shselasky/* prototypes */
38292538Shselasky
39328653Shselaskyextern int srcu_read_lock(struct srcu_struct *);
40328653Shselaskyextern void srcu_read_unlock(struct srcu_struct *, int index);
41328653Shselaskyextern void synchronize_srcu(struct srcu_struct *);
42328653Shselaskyextern void srcu_barrier(struct srcu_struct *);
43328653Shselaskyextern int init_srcu_struct(struct srcu_struct *);
44328653Shselaskyextern void cleanup_srcu_struct(struct srcu_struct *);
45292538Shselasky
46292538Shselasky#endif					/* _LINUX_SRCU_H_ */
47