18c2ecf20Sopenharmony_ci#!/bin/sh 28c2ecf20Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0 38c2ecf20Sopenharmony_ci# 48c2ecf20Sopenharmony_ci# Generate atomic headers 58c2ecf20Sopenharmony_ci 68c2ecf20Sopenharmony_ciATOMICDIR=$(dirname $0) 78c2ecf20Sopenharmony_ciATOMICTBL=${ATOMICDIR}/atomics.tbl 88c2ecf20Sopenharmony_ciLINUXDIR=${ATOMICDIR}/../.. 98c2ecf20Sopenharmony_ci 108c2ecf20Sopenharmony_cicat <<EOF | 118c2ecf20Sopenharmony_cigen-atomic-instrumented.sh asm-generic/atomic-instrumented.h 128c2ecf20Sopenharmony_cigen-atomic-long.sh asm-generic/atomic-long.h 138c2ecf20Sopenharmony_cigen-atomic-fallback.sh linux/atomic-arch-fallback.h arch_ 148c2ecf20Sopenharmony_cigen-atomic-fallback.sh linux/atomic-fallback.h 158c2ecf20Sopenharmony_ciEOF 168c2ecf20Sopenharmony_ciwhile read script header args; do 178c2ecf20Sopenharmony_ci /bin/sh ${ATOMICDIR}/${script} ${ATOMICTBL} ${args} > ${LINUXDIR}/include/${header} 188c2ecf20Sopenharmony_ci HASH="$(sha1sum ${LINUXDIR}/include/${header})" 198c2ecf20Sopenharmony_ci HASH="${HASH%% *}" 208c2ecf20Sopenharmony_ci printf "// %s\n" "${HASH}" >> ${LINUXDIR}/include/${header} 218c2ecf20Sopenharmony_cidone 22