xref: /openbmc/linux/arch/arm/include/asm/kasan.h (revision ee7da21a)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * arch/arm/include/asm/kasan.h
4  *
5  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
6  * Author: Andrey Ryabinin <ryabinin.a.a@gmail.com>
7  *
8  */
9 
10 #ifndef __ASM_KASAN_H
11 #define __ASM_KASAN_H
12 
13 #ifdef CONFIG_KASAN
14 
15 #include <asm/kasan_def.h>
16 
17 #define KASAN_SHADOW_SCALE_SHIFT 3
18 
19 /*
20  * The compiler uses a shadow offset assuming that addresses start
21  * from 0. Kernel addresses don't start from 0, so shadow
22  * for kernel really starts from 'compiler's shadow offset' +
23  * ('kernel address space start' >> KASAN_SHADOW_SCALE_SHIFT)
24  */
25 
26 asmlinkage void kasan_early_init(void);
27 extern void kasan_init(void);
28 
29 #else
30 static inline void kasan_init(void) { }
31 #endif
32 
33 #endif
34