Both affect access checks, and should therefore be in kcsan-checks.h. This is in preparation to use these in compiler.h.
Showing the changes to include/linux (2 of 2 files). Show all
Unified · Split
| @@ -36,6 +36,20 @@ · 35 unmodified lines | |||
| 36 | */ | 36 | */ |
| 37 | void __kcsan_check_access(const volatile void *ptr, size_t size, int type); | 37 | void __kcsan_check_access(const volatile void *ptr, size_t size, int type); |
| 38 | 38 | ||
| 39 | /** | ||
| 40 | * kcsan_disable_current - disable KCSAN for the current context | ||
| 41 | * | ||
| 42 | * Supports nesting. | ||
| 43 | */ | ||
| 44 | void kcsan_disable_current(void); | ||
| 45 | |||
| 46 | /** | ||
| 47 | * kcsan_enable_current - re-enable KCSAN for the current context | ||
| 48 | * | ||
| 49 | * Supports nesting. | ||
| 50 | */ | ||
| 51 | void kcsan_enable_current(void); | ||
| 52 | |||
| 39 | /** | 53 | /** |
| 40 | * kcsan_nestable_atomic_begin - begin nestable atomic region | 54 | * kcsan_nestable_atomic_begin - begin nestable atomic region |
| 41 | * | 55 | * |
| @@ -133,6 +147,8 @@ void kcsan_end_scoped_access(struct kcsan_scoped_access *sa); · 91 unmodified lines | |||
| 133 | static inline void __kcsan_check_access(const volatile void *ptr, size_t size, | 147 | static inline void __kcsan_check_access(const volatile void *ptr, size_t size, |
| 134 | int type) { } | 148 | int type) { } |
| 135 | 149 | ||
| 150 | static inline void kcsan_disable_current(void) { } | ||
| 151 | static inline void kcsan_enable_current(void) { } | ||
| 136 | static inline void kcsan_nestable_atomic_begin(void) { } | 152 | static inline void kcsan_nestable_atomic_begin(void) { } |
| 137 | static inline void kcsan_nestable_atomic_end(void) { } | 153 | static inline void kcsan_nestable_atomic_end(void) { } |
| 138 | static inline void kcsan_flat_atomic_begin(void) { } | 154 | static inline void kcsan_flat_atomic_begin(void) { } |
| @@ -50,25 +50,9 @@ struct kcsan_ctx { · 49 unmodified lines | |||
| 50 | */ | 50 | */ |
| 51 | void kcsan_init(void); | 51 | void kcsan_init(void); |
| 52 | 52 | ||
| 53 | /** | ||
| 54 | * kcsan_disable_current - disable KCSAN for the current context | ||
| 55 | * | ||
| 56 | * Supports nesting. | ||
| 57 | */ | ||
| 58 | void kcsan_disable_current(void); | ||
| 59 | |||
| 60 | /** | ||
| 61 | * kcsan_enable_current - re-enable KCSAN for the current context | ||
| 62 | * | ||
| 63 | * Supports nesting. | ||
| 64 | */ | ||
| 65 | void kcsan_enable_current(void); | ||
| 66 | |||
| 67 | #else /* CONFIG_KCSAN */ | 53 | #else /* CONFIG_KCSAN */ |
| 68 | 54 | ||
| 69 | static inline void kcsan_init(void) { } | 55 | static inline void kcsan_init(void) { } |
| 70 | static inline void kcsan_disable_current(void) { } | ||
| 71 | static inline void kcsan_enable_current(void) { } | ||
| 72 | 56 | ||
| 73 | #endif /* CONFIG_KCSAN */ | 57 | #endif /* CONFIG_KCSAN */ |
| 74 | 58 | ||