[LTP] [PATCH 1/4] linux syscall numbers: fixed the checkings for SPARC

Stanislav Kholmanskikh
2014-05-08T09:07:07Z

For sparc64 platforms cpp does not define '__sparc64__', but
defines '__sparc__' and '__arch64__'.

For sparc32 platforms cpp just defines '__sparc__'.

This may cause problems because sparc64 and sparc32 have not equal
sets of system calls.

Modified the ckeckings for SPARC in regen.sh and executed it.

Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
---
testcases/kernel/include/linux_syscall_numbers.h | 4 ++--
testcases/kernel/include/regen.sh | 6 +++++-
2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/testcases/kernel/include/linux_syscall_numbers.h b/testcases/kernel/include/linux_syscall_numbers.h
index 03664ce..a43f7ca 100644
--- a/testcases/kernel/include/linux_syscall_numbers.h
+++ b/testcases/kernel/include/linux_syscall_numbers.h
@@ -8880,7 +8880,7 @@
#endif

-#ifdef __sparc64__
+#if defined(__sparc__) && defined(__arch64__)
# ifndef __NR_restart_syscall
# define __NR_restart_syscall 0
# endif
@@ -9883,7 +9883,7 @@
#endif

-#ifdef __sparc__
+#if defined(__sparc__) && !defined(__arch64__)
# ifndef __NR_restart_syscall
# define __NR_restart_syscall 0
# endif
diff --git a/testcases/kernel/include/regen.sh b/testcases/kernel/include/regen.sh
index 3e9f0e7..3f7f4aa 100755
--- a/testcases/kernel/include/regen.sh
+++ b/testcases/kernel/include/regen.sh
@@ -59,7 +59,11 @@ for arch in $(cat "${srcdir}/order") ; do

(
echo
- echo "#ifdef __${arch}__"
+ case ${arch} in
+ sparc64) echo "#if defined(__sparc__) && defined(__arch64__)" ;;
+ sparc) echo "#if defined(__sparc__) && !defined(__arch64__)" ;;
+ *) echo "#ifdef __${arch}__"
+ esac
while read line ; do
set -- ${line}
nr="__NR_$1"
--
1.7.1

------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
&#149; 3 signs your SCM is hindering your productivity
&#149; Requirements for releasing software faster
&#149; Expert tips and advice for migrating your SCM now