diff --git a/include/lapi/syscalls/regen.sh b/include/lapi/syscalls/regen.sh index 663ce4458bb..e067464836e 100755 --- a/include/lapi/syscalls/regen.sh +++ b/include/lapi/syscalls/regen.sh @@ -14,7 +14,7 @@ err() { exit 1 } -cat << EOF > "${output_pid}" +cat <"${output_pid}" /************************************************ * GENERATED FILE: DO NOT EDIT/PATCH THIS FILE * * change your arch specific .in file instead * @@ -65,40 +65,40 @@ inline static void dummy_cleanup(void) {} EOF jobs=0 -for arch in $(cat "${srcdir}/order") ; do +for arch in $(cat "${srcdir}/supported-arch.txt"); do ( - echo "Generating data for arch $arch ... " - - ( - echo - case ${arch} in - sparc64) echo "#if defined(__sparc__) && defined(__arch64__)" ;; - sparc) echo "#if defined(__sparc__) && !defined(__arch64__)" ;; - s390) echo "#if defined(__s390__) && !defined(__s390x__)" ;; - mips_n32) echo "#if defined(__mips__) && defined(_ABIN32)" ;; - mips_n64) echo "#if defined(__mips__) && defined(_ABI64)" ;; - mips_o32) echo "#if defined(__mips__) && defined(_ABIO32) && _MIPS_SZLONG == 32" ;; - *) echo "#ifdef __${arch}__" ;; - esac - while read line ; do - set -- ${line} - nr="__NR_$1" - shift - if [ $# -eq 0 ] ; then - err "invalid line found: $line" - fi - echo "# ifndef ${nr}" - echo "# define ${nr} $*" - echo "# endif" - done < "${srcdir}/${arch}.in" - echo "#endif" - echo - ) >> "${output_pid}.${arch}" + echo "Generating data for arch $arch ... " + + ( + echo + case ${arch} in + sparc64) echo "#if defined(__sparc__) && defined(__arch64__)" ;; + sparc) echo "#if defined(__sparc__) && !defined(__arch64__)" ;; + s390) echo "#if defined(__s390__) && !defined(__s390x__)" ;; + mips_n32) echo "#if defined(__mips__) && defined(_ABIN32)" ;; + mips_n64) echo "#if defined(__mips__) && defined(_ABI64)" ;; + mips_o32) echo "#if defined(__mips__) && defined(_ABIO32) && _MIPS_SZLONG == 32" ;; + *) echo "#ifdef __${arch}__" ;; + esac + while read line; do + set -- ${line} + nr="__NR_$1" + shift + if [ $# -eq 0 ]; then + err "invalid line found: $line" + fi + echo "# ifndef ${nr}" + echo "# define ${nr} $*" + echo "# endif" + done <"${srcdir}/${arch}.in" + echo "#endif" + echo + ) >>"${output_pid}.${arch}" ) & - jobs=$(( jobs + 1 )) - if [ ${jobs} -ge ${max_jobs} ] ; then + jobs=$((jobs + 1)) + if [ ${jobs} -ge ${max_jobs} ]; then wait || exit 1 jobs=0 fi @@ -106,24 +106,24 @@ done echo "Generating stub list ... " ( -echo -echo "/* Common stubs */" -echo "#define __LTP__NR_INVALID_SYSCALL -1" >> "${output_pid}" -for nr in $(awk '{print $1}' "${srcdir}/"*.in | sort -u) ; do - nr="__NR_${nr}" - echo "# ifndef ${nr}" - echo "# define ${nr} __LTP__NR_INVALID_SYSCALL" - echo "# endif" -done -echo "#endif" -) >> "${output_pid}._footer" + echo + echo "/* Common stubs */" + echo "#define __LTP__NR_INVALID_SYSCALL -1" >>"${output_pid}" + for nr in $(awk '{print $1}' "${srcdir}/"*.in | sort -u); do + nr="__NR_${nr}" + echo "# ifndef ${nr}" + echo "# define ${nr} __LTP__NR_INVALID_SYSCALL" + echo "# endif" + done + echo "#endif" +) >>"${output_pid}._footer" wait || exit 1 printf "Combining them all ... " -for arch in $(cat "${srcdir}/order") _footer ; do +for arch in $(cat "${srcdir}/supported-arch.txt") _footer; do cat "${output_pid}.${arch}" -done >> "${output_pid}" +done >>"${output_pid}" mv "${output_pid}" "../${output}" rm -f "${output_pid}"* echo "OK!" diff --git a/include/lapi/syscalls/order b/include/lapi/syscalls/supported-arch.txt similarity index 91% rename from include/lapi/syscalls/order rename to include/lapi/syscalls/supported-arch.txt index c18aa38cf45..de88957edb5 100644 --- a/include/lapi/syscalls/order +++ b/include/lapi/syscalls/supported-arch.txt @@ -8,7 +8,6 @@ loongarch mips_n32 mips_n64 mips_o32 -powerpc64 powerpc s390x s390