public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Andrea Cervesato <andrea.cervesato@suse.de>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 1/4] Rename syscalls order file to supported-arch.txt
Date: Tue, 24 Sep 2024 10:06:26 +0200	[thread overview]
Message-ID: <20240924-generate_syscalls-v1-1-941507a9cdac@suse.com> (raw)
In-Reply-To: <20240924-generate_syscalls-v1-0-941507a9cdac@suse.com>

From: Andrea Cervesato <andrea.cervesato@suse.com>

Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
---
 include/lapi/syscalls/regen.sh                     | 88 +++++++++++-----------
 .../lapi/syscalls/{order => supported-arch.txt}    |  1 -
 2 files changed, 44 insertions(+), 45 deletions(-)

diff --git a/include/lapi/syscalls/regen.sh b/include/lapi/syscalls/regen.sh
index 663ce4458..e06746483 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 <<EOF >"${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 c18aa38cf..de88957ed 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

-- 
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2024-09-24  8:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-24  8:06 [LTP] [PATCH 0/4] Automatically generate syscalls.h Andrea Cervesato
2024-09-24  8:06 ` Andrea Cervesato [this message]
2024-09-24  8:06 ` [LTP] [PATCH 2/4] Add script to " Andrea Cervesato
2024-09-24  8:06 ` [LTP] [PATCH 3/4] Deprecate old syscalls input files Andrea Cervesato
2024-09-24  8:06 ` [LTP] [PATCH 4/4] Save syscalls.h inside repo Andrea Cervesato
2024-09-24  8:46 ` [LTP] [PATCH 0/4] Automatically generate syscalls.h Andrea Cervesato via ltp
2024-09-24 13:16   ` Jan Stancek
2024-09-24 13:23     ` Andrea Cervesato via ltp
2024-09-25 20:01       ` Jan Stancek
2024-09-26  7:07         ` Andrea Cervesato via ltp
2024-09-26  7:47           ` Jan Stancek
2024-09-26  8:19             ` Andrea Cervesato via ltp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240924-generate_syscalls-v1-1-941507a9cdac@suse.com \
    --to=andrea.cervesato@suse.de \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox