Commit 5faafd56 authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Paul E. McKenney

locking/atomics: Provide the arch_atomic_ interface to generic code

Architectures with instrumented (KASAN/KCSAN) atomic operations
natively provide arch_atomic_ variants that are not instrumented.

It turns out that some generic code also requires arch_atomic_ in
order to avoid instrumentation, so provide the arch_atomic_ interface
as a direct map into the regular atomic_ interface for
non-instrumented architectures.
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
parent b3a9e3b9
This diff is collapsed.
...@@ -58,6 +58,21 @@ cat << EOF ...@@ -58,6 +58,21 @@ cat << EOF
EOF EOF
} }
gen_proto_order_variant()
{
local meta="$1"; shift
local pfx="$1"; shift
local name="$1"; shift
local sfx="$1"; shift
local order="$1"; shift
local arch="$1"
local atomic="$2"
local basename="${arch}${atomic}_${pfx}${name}${sfx}"
printf "#define arch_${basename}${order} ${basename}${order}\n"
}
#gen_proto_order_variants(meta, pfx, name, sfx, arch, atomic, int, args...) #gen_proto_order_variants(meta, pfx, name, sfx, arch, atomic, int, args...)
gen_proto_order_variants() gen_proto_order_variants()
{ {
...@@ -72,6 +87,22 @@ gen_proto_order_variants() ...@@ -72,6 +87,22 @@ gen_proto_order_variants()
local template="$(find_fallback_template "${pfx}" "${name}" "${sfx}" "${order}")" local template="$(find_fallback_template "${pfx}" "${name}" "${sfx}" "${order}")"
if [ -z "$arch" ]; then
gen_proto_order_variant "${meta}" "${pfx}" "${name}" "${sfx}" "" "$@"
if meta_has_acquire "${meta}"; then
gen_proto_order_variant "${meta}" "${pfx}" "${name}" "${sfx}" "_acquire" "$@"
fi
if meta_has_release "${meta}"; then
gen_proto_order_variant "${meta}" "${pfx}" "${name}" "${sfx}" "_release" "$@"
fi
if meta_has_relaxed "${meta}"; then
gen_proto_order_variant "${meta}" "${pfx}" "${name}" "${sfx}" "_relaxed" "$@"
fi
echo ""
fi
# If we don't have relaxed atomics, then we don't bother with ordering fallbacks # If we don't have relaxed atomics, then we don't bother with ordering fallbacks
# read_acquire and set_release need to be templated, though # read_acquire and set_release need to be templated, though
if ! meta_has_relaxed "${meta}"; then if ! meta_has_relaxed "${meta}"; then
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment