[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230510181717.2200934-3-paulmck@kernel.org>
Date: Wed, 10 May 2023 11:17:01 -0700
From: "Paul E. McKenney" <paulmck@...nel.org>
To: linux-kernel@...r.kernel.org
Cc: x86@...nel.org, akiyks@...il.com, linux-doc@...r.kernel.org,
kernel-team@...a.com, "Paul E. McKenney" <paulmck@...nel.org>,
Will Deacon <will@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Boqun Feng <boqun.feng@...il.com>,
Mark Rutland <mark.rutland@....com>
Subject: [PATCH locking/atomic 03/19] locking/atomic: Add kernel-doc and docbook_oldnew variables for headers
The andnot, dec, inc, and try_cmpxchg files in the scripts/atomic/fallbacks
directory do not supply kernel-doc headers. One reason for this is that
there is currently no reasonably way to document either the ordering or
whether the old or the new value is returned.
Therefore, supply docbook_order and docbook_oldnew sh variables that contain
the needed information.
Signed-off-by: Paul E. McKenney <paulmck@...nel.org>
Cc: Will Deacon <will@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Boqun Feng <boqun.feng@...il.com>
Cc: Mark Rutland <mark.rutland@....com>
---
scripts/atomic/gen-atomic-fallback.sh | 17 +++++++++++++++++
scripts/atomic/gen-atomic-instrumented.sh | 17 +++++++++++++++++
2 files changed, 34 insertions(+)
diff --git a/scripts/atomic/gen-atomic-fallback.sh b/scripts/atomic/gen-atomic-fallback.sh
index 6e853f0dad8d..697da5f16f98 100755
--- a/scripts/atomic/gen-atomic-fallback.sh
+++ b/scripts/atomic/gen-atomic-fallback.sh
@@ -24,6 +24,23 @@ gen_template_fallback()
local params="$(gen_params "${int}" "${atomic}" "$@")"
local args="$(gen_args "$@")"
+ local docbook_order=full
+ if test "${order}" = "_relaxed"
+ then
+ local docbook_order=no
+ elif test -n "${order}"
+ then
+ docbook_order="`echo $order | sed -e 's/_//'`"
+ fi
+ local docbook_oldnew="new"
+ if test "${pfx}" = "fetch_"
+ then
+ docbook_oldnew="old"
+ elif test "${sfx}" != "_return"
+ then
+ docbook_oldnew="no"
+ fi
+
if [ ! -z "${template}" ]; then
printf "#ifndef ${atomicname}\n"
. ${template}
diff --git a/scripts/atomic/gen-atomic-instrumented.sh b/scripts/atomic/gen-atomic-instrumented.sh
index d9ffd74f73ca..99c72393d362 100755
--- a/scripts/atomic/gen-atomic-instrumented.sh
+++ b/scripts/atomic/gen-atomic-instrumented.sh
@@ -68,6 +68,23 @@ gen_proto_order_variant()
local args="$(gen_args "$@")"
local retstmt="$(gen_ret_stmt "${meta}")"
+ local docbook_order=full
+ if test "${order}" = "_relaxed"
+ then
+ local docbook_order=no
+ elif test -n "${order}"
+ then
+ docbook_order="`echo $order | sed -e 's/_//'`"
+ fi
+ local docbook_oldnew="new"
+ if test "${pfx}" = "fetch_"
+ then
+ docbook_oldnew="old"
+ elif test "${sfx}" != "_return"
+ then
+ docbook_oldnew="no"
+ fi
+
cat <<EOF
static __always_inline ${ret}
${atomicname}(${params})
--
2.40.1
Powered by blists - more mailing lists