xref: /netbsd-src/sys/sys/csan.h (revision b5ed0ef9ee75fbccaf5536eaa59d10bc27e5ab70)
1*b5ed0ef9Smaxv /*	$NetBSD: csan.h,v 1.2 2020/09/10 14:04:45 maxv Exp $	*/
2b7edd3d1Smaxv 
3b7edd3d1Smaxv /*
4*b5ed0ef9Smaxv  * Copyright (c) 2019-2020 Maxime Villard, m00nbsd.net
5b7edd3d1Smaxv  * All rights reserved.
6b7edd3d1Smaxv  *
7*b5ed0ef9Smaxv  * This code is part of the KCSAN subsystem of the NetBSD kernel.
8b7edd3d1Smaxv  *
9b7edd3d1Smaxv  * Redistribution and use in source and binary forms, with or without
10b7edd3d1Smaxv  * modification, are permitted provided that the following conditions
11b7edd3d1Smaxv  * are met:
12b7edd3d1Smaxv  * 1. Redistributions of source code must retain the above copyright
13b7edd3d1Smaxv  *    notice, this list of conditions and the following disclaimer.
14b7edd3d1Smaxv  * 2. Redistributions in binary form must reproduce the above copyright
15b7edd3d1Smaxv  *    notice, this list of conditions and the following disclaimer in the
16b7edd3d1Smaxv  *    documentation and/or other materials provided with the distribution.
17b7edd3d1Smaxv  *
18*b5ed0ef9Smaxv  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19*b5ed0ef9Smaxv  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20*b5ed0ef9Smaxv  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21*b5ed0ef9Smaxv  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22*b5ed0ef9Smaxv  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23*b5ed0ef9Smaxv  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24*b5ed0ef9Smaxv  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
25*b5ed0ef9Smaxv  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26*b5ed0ef9Smaxv  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27*b5ed0ef9Smaxv  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28*b5ed0ef9Smaxv  * SUCH DAMAGE.
29b7edd3d1Smaxv  */
30b7edd3d1Smaxv 
31b7edd3d1Smaxv #ifndef _SYS_CSAN_H_
32b7edd3d1Smaxv #define _SYS_CSAN_H_
33b7edd3d1Smaxv 
34b7edd3d1Smaxv #ifdef _KERNEL_OPT
35b7edd3d1Smaxv #include "opt_kcsan.h"
36b7edd3d1Smaxv #endif
37b7edd3d1Smaxv 
38b7edd3d1Smaxv #include <sys/types.h>
39b7edd3d1Smaxv 
40b7edd3d1Smaxv #ifdef KCSAN
41b7edd3d1Smaxv void kcsan_init(void);
42b7edd3d1Smaxv void kcsan_cpu_init(struct cpu_info *);
43b7edd3d1Smaxv #else
44b7edd3d1Smaxv #define kcsan_init()		__nothing
45b7edd3d1Smaxv #define kcsan_cpu_init(ci)	__nothing
46b7edd3d1Smaxv #endif
47b7edd3d1Smaxv 
48b7edd3d1Smaxv #endif /* !_SYS_CSAN_H_ */
49