xref: /openbmc/linux/arch/powerpc/include/asm/kasan.h (revision 3dc4b6fb)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __ASM_KASAN_H
3 #define __ASM_KASAN_H
4 
5 #ifdef CONFIG_KASAN
6 #define _GLOBAL_KASAN(fn)	_GLOBAL(__##fn)
7 #define _GLOBAL_TOC_KASAN(fn)	_GLOBAL_TOC(__##fn)
8 #define EXPORT_SYMBOL_KASAN(fn)	EXPORT_SYMBOL(__##fn)
9 #else
10 #define _GLOBAL_KASAN(fn)	_GLOBAL(fn)
11 #define _GLOBAL_TOC_KASAN(fn)	_GLOBAL_TOC(fn)
12 #define EXPORT_SYMBOL_KASAN(fn)
13 #endif
14 
15 #ifndef __ASSEMBLY__
16 
17 #include <asm/page.h>
18 
19 #define KASAN_SHADOW_SCALE_SHIFT	3
20 
21 #define KASAN_SHADOW_START	(KASAN_SHADOW_OFFSET + \
22 				 (PAGE_OFFSET >> KASAN_SHADOW_SCALE_SHIFT))
23 
24 #define KASAN_SHADOW_OFFSET	ASM_CONST(CONFIG_KASAN_SHADOW_OFFSET)
25 
26 #define KASAN_SHADOW_END	0UL
27 
28 #define KASAN_SHADOW_SIZE	(KASAN_SHADOW_END - KASAN_SHADOW_START)
29 
30 #ifdef CONFIG_KASAN
31 void kasan_early_init(void);
32 void kasan_mmu_init(void);
33 void kasan_init(void);
34 #else
35 static inline void kasan_init(void) { }
36 static inline void kasan_mmu_init(void) { }
37 #endif
38 
39 #endif /* __ASSEMBLY */
40 #endif
41