History

asm-generic, atomic-instrumented: Use generic instrumented.h

This switches atomic-instrumented.h to use the generic instrumentation wrappers provided by instrumented.h. No functional change intended.

Marco Elver committed 6 years ago

Commit ed8af2e1 parent 36e4d4d2 files · +194 −220Browse files

Showing the changes to scripts (1 of 2 files). Show all

Unified · Split

scripts/atomic/gen-atomic-instrumented.sh+3−16
@@ -20,7 +20,7 @@ gen_param_check() · 19 unmodified lines
2020 # We don't write to constant parameters
2121 [ ${type#c} != ${type} ] && rw="read"
2222
23− printf "\t__atomic_check_${rw}(${name}, sizeof(*${name}));\n"
23+ printf "\tinstrument_atomic_${rw}(${name}, sizeof(*${name}));\n"
2424 }
2525
2626 #gen_param_check(arg...)
@@ -107,7 +107,7 @@ cat <<EOF · 80 unmodified lines
107107 #define ${xchg}(ptr, ...) \\
108108 ({ \\
109109 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)); \\
111111 arch_${xchg}(__ai_ptr, __VA_ARGS__); \\
112112 })
113113 EOF
@@ -148,20 +148,7 @@ cat << EOF · 34 unmodified lines
148148
149149 #include <linux/build_bug.h>
150150 #include <linux/compiler.h>
151−#include <linux/kasan-checks.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−}
151+#include <linux/instrumented.h>
165152
166153 EOF
167154