This switches atomic-instrumented.h to use the generic instrumentation wrappers provided by instrumented.h. No functional change intended.
Showing the changes to scripts (1 of 2 files). Show all
Unified · Split
| @@ -20,7 +20,7 @@ gen_param_check() · 19 unmodified lines | |||
| 20 | # We don't write to constant parameters | 20 | # We don't write to constant parameters |
| 21 | [ ${type#c} != ${type} ] && rw="read" | 21 | [ ${type#c} != ${type} ] && rw="read" |
| 22 | 22 | ||
| 23 | printf "\t__atomic_check_${rw}(${name}, sizeof(*${name}));\n" | 23 | printf "\tinstrument_atomic_${rw}(${name}, sizeof(*${name}));\n" |
| 24 | } | 24 | } |
| 25 | 25 | ||
| 26 | #gen_param_check(arg...) | 26 | #gen_param_check(arg...) |
| @@ -107,7 +107,7 @@ cat <<EOF · 80 unmodified lines | |||
| 107 | #define ${xchg}(ptr, ...) \\ | 107 | #define ${xchg}(ptr, ...) \\ |
| 108 | ({ \\ | 108 | ({ \\ |
| 109 | typeof(ptr) __ai_ptr = (ptr); \\ | 109 | typeof(ptr) __ai_ptr = (ptr); \\ |
| 110 | __atomic_check_write(__ai_ptr, ${mult}sizeof(*__ai_ptr)); \\ | 110 | instrument_atomic_write(__ai_ptr, ${mult}sizeof(*__ai_ptr)); \\ |
| 111 | arch_${xchg}(__ai_ptr, __VA_ARGS__); \\ | 111 | arch_${xchg}(__ai_ptr, __VA_ARGS__); \\ |
| 112 | }) | 112 | }) |
| 113 | EOF | 113 | EOF |
| @@ -148,20 +148,7 @@ cat << EOF · 34 unmodified lines | |||
| 148 | 148 | ||
| 149 | #include <linux/build_bug.h> | 149 | #include <linux/build_bug.h> |
| 150 | #include <linux/compiler.h> | 150 | #include <linux/compiler.h> |
| 151 | #include <linux/kasan-checks.h> | 151 | #include <linux/instrumented.h> |
| 152 | #include <linux/kcsan-checks.h> | ||
| 153 | |||
| 154 | static __always_inline void __atomic_check_read(const volatile void *v, size_t size) | ||
| 155 | { | ||
| 156 | kasan_check_read(v, size); | ||
| 157 | kcsan_check_atomic_read(v, size); | ||
| 158 | } | ||
| 159 | |||
| 160 | static __always_inline void __atomic_check_write(const volatile void *v, size_t size) | ||
| 161 | { | ||
| 162 | kasan_check_write(v, size); | ||
| 163 | kcsan_check_atomic_write(v, size); | ||
| 164 | } | ||
| 165 | 152 | ||
| 166 | EOF | 153 | EOF |
| 167 | 154 | ||