blob: 5b98a83076932fe913226f9b8372511a3670b748 [file] [log] [blame]
Mark Rutland0cf264b2019-02-11 13:20:35 +00001#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0
3#
4# Generate atomic headers
5
6ATOMICDIR=$(dirname $0)
7ATOMICTBL=${ATOMICDIR}/atomics.tbl
8LINUXDIR=${ATOMICDIR}/../..
9
10cat <<EOF |
Mark Rutlande3d18ce2021-07-13 11:52:51 +010011gen-atomic-instrumented.sh linux/atomic/atomic-instrumented.h
12gen-atomic-long.sh linux/atomic/atomic-long.h
13gen-atomic-fallback.sh linux/atomic/atomic-arch-fallback.h
Mark Rutland0cf264b2019-02-11 13:20:35 +000014EOF
Peter Zijlstra37f81732020-01-24 22:13:03 +010015while read script header args; do
16 /bin/sh ${ATOMICDIR}/${script} ${ATOMICTBL} ${args} > ${LINUXDIR}/include/${header}
Mark Rutland0cf264b2019-02-11 13:20:35 +000017 HASH="$(sha1sum ${LINUXDIR}/include/${header})"
18 HASH="${HASH%% *}"
19 printf "// %s\n" "${HASH}" >> ${LINUXDIR}/include/${header}
20done