kasan.h 708 B

123456789101112131415161718192021222324252627282930313233
  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 <[email protected]>
  7. *
  8. */
  9. #ifndef __ASM_KASAN_H
  10. #define __ASM_KASAN_H
  11. #ifdef CONFIG_KASAN
  12. #include <asm/kasan_def.h>
  13. #define KASAN_SHADOW_SCALE_SHIFT 3
  14. /*
  15. * The compiler uses a shadow offset assuming that addresses start
  16. * from 0. Kernel addresses don't start from 0, so shadow
  17. * for kernel really starts from 'compiler's shadow offset' +
  18. * ('kernel address space start' >> KASAN_SHADOW_SCALE_SHIFT)
  19. */
  20. asmlinkage void kasan_early_init(void);
  21. extern void kasan_init(void);
  22. #else
  23. static inline void kasan_init(void) { }
  24. #endif
  25. #endif