kasan.h 953 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __ASM_KASAN_H
  3. #define __ASM_KASAN_H
  4. #ifndef __ASSEMBLY__
  5. #ifdef CONFIG_KASAN
  6. #include <linux/kernel.h>
  7. #include <linux/sizes.h>
  8. #include <asm/kmem_layout.h>
  9. #define KASAN_SHADOW_SCALE_SHIFT 3
  10. /* Start of area covered by KASAN */
  11. #define KASAN_START_VADDR __XTENSA_UL_CONST(0x90000000)
  12. /* Start of the shadow map */
  13. #define KASAN_SHADOW_START (XCHAL_PAGE_TABLE_VADDR + XCHAL_PAGE_TABLE_SIZE)
  14. /* Size of the shadow map */
  15. #define KASAN_SHADOW_SIZE (-KASAN_START_VADDR >> KASAN_SHADOW_SCALE_SHIFT)
  16. /* End of the shadow map */
  17. #define KASAN_SHADOW_END (KASAN_SHADOW_START + KASAN_SHADOW_SIZE)
  18. /* Offset for mem to shadow address transformation */
  19. #define KASAN_SHADOW_OFFSET __XTENSA_UL_CONST(CONFIG_KASAN_SHADOW_OFFSET)
  20. void __init kasan_early_init(void);
  21. void __init kasan_init(void);
  22. #else
  23. static inline void kasan_early_init(void)
  24. {
  25. }
  26. static inline void kasan_init(void)
  27. {
  28. }
  29. #endif
  30. #endif
  31. #endif