diff --git a/strace-6.6-sw.patch b/strace-6.6-sw.patch new file mode 100644 index 0000000000000000000000000000000000000000..78e76299ba575f782764ac6fbfb898d2d77c9262 --- /dev/null +++ b/strace-6.6-sw.patch @@ -0,0 +1,3424 @@ +diff --git a/build-aux/config.guess b/build-aux/config.guess +index 69188da..0feb8b3 100755 +--- a/build-aux/config.guess ++++ b/build-aux/config.guess +@@ -982,6 +982,14 @@ EOF + UNAME_MACHINE=aarch64_be + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; ++ sw_64:Linux:*:*) ++ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in ++ sw) UNAME_MACHINE=sw_64 ;; ++ esac ++ objdump --private-headers /bin/sh | grep -q ld.so.1 ++ if test "$?" = 0 ; then LIBC=gnulibc1 ; fi ++ GUESS=$UNAME_MACHINE-sunway-linux-$LIBC ++ ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in + EV5) UNAME_MACHINE=alphaev5 ;; +diff --git a/build-aux/config.sub b/build-aux/config.sub +index de4259e..13d3d05 100755 +--- a/build-aux/config.sub ++++ b/build-aux/config.sub +@@ -1182,6 +1182,7 @@ case $cpu-$vendor in + | a29k \ + | aarch64 | aarch64_be \ + | abacus \ ++ | sw_64 \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \ + | alphapca5[67] | alpha64pca5[67] \ +diff --git a/bundled/Makefile.am b/bundled/Makefile.am +index df975cf..15d1afb 100644 +--- a/bundled/Makefile.am ++++ b/bundled/Makefile.am +@@ -10,6 +10,7 @@ EXTRA_DIST = \ + linux/GPL-2.0 \ + linux/Linux-syscall-note \ + linux/arch/alpha/include/uapi/asm/fcntl.h \ ++ linux/arch/sw_64/include/uapi/asm/fcntl.h \ + linux/arch/arm/include/uapi/asm/fcntl.h \ + linux/arch/arm64/include/uapi/asm/fcntl.h \ + linux/arch/ia64/include/uapi/asm/fcntl.h \ +diff --git a/bundled/Makefile.in b/bundled/Makefile.in +index bf2c9e0..07a9551 100644 +--- a/bundled/Makefile.in ++++ b/bundled/Makefile.in +@@ -330,6 +330,7 @@ EXTRA_DIST = \ + linux/GPL-2.0 \ + linux/Linux-syscall-note \ + linux/arch/alpha/include/uapi/asm/fcntl.h \ ++ linux/arch/sw_64/include/uapi/asm/fcntl.h \ + linux/arch/arm/include/uapi/asm/fcntl.h \ + linux/arch/arm64/include/uapi/asm/fcntl.h \ + linux/arch/ia64/include/uapi/asm/fcntl.h \ +diff --git a/bundled/linux/arch/sw_64/include/uapi/asm/fcntl.h b/bundled/linux/arch/sw_64/include/uapi/asm/fcntl.h +new file mode 100644 +index 0000000..2e12e99 +--- /dev/null ++++ b/bundled/linux/arch/sw_64/include/uapi/asm/fcntl.h +@@ -0,0 +1,58 @@ ++/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ ++#ifndef _SW_64_FCNTL_H ++#define _SW_64_FCNTL_H ++ ++#define O_CREAT 01000 /* not fcntl */ ++#define O_TRUNC 02000 /* not fcntl */ ++#define O_EXCL 04000 /* not fcntl */ ++#define O_NOCTTY 010000 /* not fcntl */ ++ ++#define O_NONBLOCK 00004 ++#define O_APPEND 00010 ++#define O_DSYNC 040000 /* used to be O_SYNC, see below */ ++#define O_DIRECTORY 0100000 /* must be a directory */ ++#define O_NOFOLLOW 0200000 /* don't follow links */ ++#define O_LARGEFILE 0400000 /* will be set by the kernel on every open */ ++#define O_DIRECT 02000000 /* direct disk access - should check with OSF/1 */ ++#define O_NOATIME 04000000 ++#define O_CLOEXEC 010000000 /* set close_on_exec */ ++/* ++ * Before Linux 2.6.33 only O_DSYNC semantics were implemented, but using ++ * the O_SYNC flag. We continue to use the existing numerical value ++ * for O_DSYNC semantics now, but using the correct symbolic name for it. ++ * This new value is used to request true Posix O_SYNC semantics. It is ++ * defined in this strange way to make sure applications compiled against ++ * new headers get at least O_DSYNC semantics on older kernels. ++ * ++ * This has the nice side-effect that we can simply test for O_DSYNC ++ * wherever we do not care if O_DSYNC or O_SYNC is used. ++ * ++ * Note: __O_SYNC must never be used directly. ++ */ ++#define __O_SYNC 020000000 ++#define O_SYNC (__O_SYNC|O_DSYNC) ++ ++#define O_PATH 040000000 ++#define __O_TMPFILE 0100000000 ++ ++#define F_GETLK 7 ++#define F_SETLK 8 ++#define F_SETLKW 9 ++ ++#define F_SETOWN 5 /* for sockets. */ ++#define F_GETOWN 6 /* for sockets. */ ++#define F_SETSIG 10 /* for sockets. */ ++#define F_GETSIG 11 /* for sockets. */ ++ ++/* for posix fcntl() and lockf() */ ++#define F_RDLCK 1 ++#define F_WRLCK 2 ++#define F_UNLCK 8 ++ ++/* for old implementation of bsd flock () */ ++#define F_EXLCK 16 /* or 3 */ ++#define F_SHLCK 32 /* or 4 */ ++ ++#include ++ ++#endif +diff --git a/configure b/configure +index c5ae7ff..037aac4 100755 +--- a/configure ++++ b/configure +@@ -6240,6 +6240,13 @@ aarch64*) + + printf "%s\n" "#define AARCH64 1" >>confdefs.h + ++ ;; ++sw_64*) ++ arch=sw_64 ++ arch_enable_Werror=no ++ ++$as_echo "#define SW_64 1" >>confdefs.h ++ + ;; + alpha*) + arch=alpha +diff --git a/configure.ac b/configure.ac +index 21c7265..f2c5315 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -74,6 +74,11 @@ aarch64*) + cc_flags_m32= + AC_DEFINE([AARCH64], 1, [Define for the AArch64 architecture.]) + ;; ++sw_64*) ++ arch=sw_64 ++ arch_enable_Werror=no ++ AC_DEFINE([SW_64], 1, [Define for the Sw_64 architecture.]) ++ ;; + alpha*) + arch=alpha + arch_enable_Werror=no +diff --git a/src/Makefile.am b/src/Makefile.am +index 44398cc..602a4e7 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -58,6 +58,7 @@ libstrace_a_SOURCES = \ + affinity.c \ + aio.c \ + alpha.c \ ++ sw_64.c \ + arch_defs.h \ + basic_filters.c \ + bind.c \ +@@ -602,6 +603,23 @@ EXTRA_DIST = \ + linux/generic/userent.h \ + linux/generic/userent0.h \ + linux/hppa/arch_defs_.h \ ++ linux/sw_64/arch_defs_.h \ ++ linux/sw_64/arch_getrval2.c \ ++ linux/sw_64/arch_regs.c \ ++ linux/sw_64/arch_sigreturn.c \ ++ linux/sw_64/errnoent.h \ ++ linux/sw_64/get_error.c \ ++ linux/sw_64/get_scno.c \ ++ linux/sw_64/get_syscall_args.c \ ++ linux/sw_64/get_syscall_result.c \ ++ linux/sw_64/ioctls_arch0.h \ ++ linux/sw_64/ioctls_inc0.h \ ++ linux/sw_64/raw_syscall.h \ ++ linux/sw_64/set_error.c \ ++ linux/sw_64/set_scno.c \ ++ linux/sw_64/signalent.h \ ++ linux/sw_64/syscallent.h \ ++ linux/sw_64/userent.h \ + linux/hppa/arch_regs.c \ + linux/hppa/arch_rt_sigframe.c \ + linux/hppa/errnoent.h \ +diff --git a/src/Makefile.in b/src/Makefile.in +index bc24a49..9151245 100644 +--- a/src/Makefile.in ++++ b/src/Makefile.in +@@ -295,7 +295,7 @@ am__objects_2 = libmpers_mx32_a-block.$(OBJEXT) \ + libmpers_mx32_a_OBJECTS = $(am_libmpers_mx32_a_OBJECTS) + libstrace_a_AR = $(AR) $(ARFLAGS) + libstrace_a_LIBADD = +-am__libstrace_a_SOURCES_DIST = access.c affinity.c aio.c alpha.c \ ++am__libstrace_a_SOURCES_DIST = access.c affinity.c aio.c alpha.c sw_64.c \ + arch_defs.h basic_filters.c bind.c bjm.c block.c bpf.c \ + bpf_attr.h bpf_filter.c bpf_filter.h bpf_fprog.h \ + bpf_seccomp_filter.c bpf_sock_filter.c btrfs.c cacheflush.c \ +@@ -386,6 +386,7 @@ am__objects_3 = libstrace_a-bpf_attr_check.$(OBJEXT) + am_libstrace_a_OBJECTS = libstrace_a-access.$(OBJEXT) \ + libstrace_a-affinity.$(OBJEXT) libstrace_a-aio.$(OBJEXT) \ + libstrace_a-alpha.$(OBJEXT) \ ++ libstrace_a-sw_64.$(OBJEXT) \ + libstrace_a-basic_filters.$(OBJEXT) libstrace_a-bind.$(OBJEXT) \ + libstrace_a-bjm.$(OBJEXT) libstrace_a-block.$(OBJEXT) \ + libstrace_a-bpf.$(OBJEXT) libstrace_a-bpf_filter.$(OBJEXT) \ +@@ -740,6 +741,7 @@ am__depfiles_remade = ./$(DEPDIR)/disable_ptrace_get_syscall_info.Po \ + ./$(DEPDIR)/libstrace_a-affinity.Po \ + ./$(DEPDIR)/libstrace_a-aio.Po \ + ./$(DEPDIR)/libstrace_a-alpha.Po \ ++ ./$(DEPDIR)/libstrace_a-sw_64.Po \ + ./$(DEPDIR)/libstrace_a-basic_filters.Po \ + ./$(DEPDIR)/libstrace_a-bind.Po ./$(DEPDIR)/libstrace_a-bjm.Po \ + ./$(DEPDIR)/libstrace_a-block.Po \ +@@ -1988,7 +1990,7 @@ disable_ptrace_getregset_LDADD = $(strace_LDADD) + noinst_LIBRARIES = libstrace.a $(am__append_20) $(am__append_24) + libstrace_a_CPPFLAGS = $(strace_CPPFLAGS) + libstrace_a_CFLAGS = $(strace_CFLAGS) +-libstrace_a_SOURCES = access.c affinity.c aio.c alpha.c arch_defs.h \ ++libstrace_a_SOURCES = access.c affinity.c aio.c alpha.c sw_64.c arch_defs.h \ + basic_filters.c bind.c bjm.c block.c bpf.c bpf_attr.h \ + bpf_filter.c bpf_filter.h bpf_fprog.h bpf_seccomp_filter.c \ + bpf_sock_filter.c btrfs.c cacheflush.c cachestat.c cachestat.h \ +@@ -2111,6 +2113,23 @@ EXTRA_DIST = \ + linux/aarch64/shuffle_scno.c \ + linux/aarch64/syscallent.h \ + linux/aarch64/syscallent1.h \ ++ linux/sw_64/arch_defs_.h \ ++ linux/sw_64/arch_getrval2.c \ ++ linux/sw_64/arch_regs.c \ ++ linux/sw_64/arch_sigreturn.c \ ++ linux/sw_64/errnoent.h \ ++ linux/sw_64/get_error.c \ ++ linux/sw_64/get_scno.c \ ++ linux/sw_64/get_syscall_args.c \ ++ linux/sw_64/get_syscall_result.c \ ++ linux/sw_64/ioctls_arch0.h \ ++ linux/sw_64/ioctls_inc0.h \ ++ linux/sw_64/raw_syscall.h \ ++ linux/sw_64/set_error.c \ ++ linux/sw_64/set_scno.c \ ++ linux/sw_64/signalent.h \ ++ linux/sw_64/syscallent.h \ ++ linux/sw_64/userent.h \ + linux/alpha/arch_defs_.h \ + linux/alpha/arch_getrval2.c \ + linux/alpha/arch_regs.c \ +@@ -3007,6 +3026,7 @@ distclean-compile: + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-affinity.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-aio.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-alpha.Po@am__quote@ # am--include-marker ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-sw_64.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-basic_filters.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-bind.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-bjm.Po@am__quote@ # am--include-marker +@@ -4581,6 +4601,20 @@ libstrace_a-aio.obj: aio.c + @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -c -o libstrace_a-aio.obj `if test -f 'aio.c'; then $(CYGPATH_W) 'aio.c'; else $(CYGPATH_W) '$(srcdir)/aio.c'; fi` + ++libstrace_a-sw_64.o: sw_64.c ++@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-sw_64.o -MD -MP -MF $(DEPDIR)/libstrace_a-sw_64.Tpo -c -o libstrace_a-sw_64.o `test -f 'sw_64.c' || echo '$(srcdir)/'`sw_64.c ++@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-sw_64.Tpo $(DEPDIR)/libstrace_a-sw_64.Po ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sw_64.c' object='libstrace_a-sw_64.o' libtool=no @AMDEPBACKSLASH@ ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ++@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -c -o libstrace_a-sw_64.o `test -f 'sw_64.c' || echo '$(srcdir)/'`sw_64.c ++ ++libstrace_a-sw_64.obj: sw_64.c ++@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-sw_64.obj -MD -MP -MF $(DEPDIR)/libstrace_a-sw_64.Tpo -c -o libstrace_a-sw_64.obj `if test -f 'sw_64.c'; then $(CYGPATH_W) 'sw_64.c'; else $(CYGPATH_W) '$(srcdir)/sw_64.c'; fi` ++@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-sw_64.Tpo $(DEPDIR)/libstrace_a-sw_64.Po ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source=sw_64.c' object='libstrace_a-sw_64.obj' libtool=no @AMDEPBACKSLASH@ ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ++@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -c -o libstrace_a-sw_64.obj `if test -f 'sw_64.c'; then $(CYGPATH_W) 'sw_64.c'; else $(CYGPATH_W) '$(srcdir)/sw_64.c'; fi` ++ + libstrace_a-alpha.o: alpha.c + @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-alpha.o -MD -MP -MF $(DEPDIR)/libstrace_a-alpha.Tpo -c -o libstrace_a-alpha.o `test -f 'alpha.c' || echo '$(srcdir)/'`alpha.c + @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-alpha.Tpo $(DEPDIR)/libstrace_a-alpha.Po +@@ -8727,6 +8761,7 @@ distclean: distclean-am + -rm -f ./$(DEPDIR)/libstrace_a-affinity.Po + -rm -f ./$(DEPDIR)/libstrace_a-aio.Po + -rm -f ./$(DEPDIR)/libstrace_a-alpha.Po ++ -rm -f ./$(DEPDIR)/libstrace_a-sw_64.Po + -rm -f ./$(DEPDIR)/libstrace_a-basic_filters.Po + -rm -f ./$(DEPDIR)/libstrace_a-bind.Po + -rm -f ./$(DEPDIR)/libstrace_a-bjm.Po +@@ -9143,6 +9178,7 @@ maintainer-clean: maintainer-clean-am + -rm -f ./$(DEPDIR)/libstrace_a-affinity.Po + -rm -f ./$(DEPDIR)/libstrace_a-aio.Po + -rm -f ./$(DEPDIR)/libstrace_a-alpha.Po ++ -rm -f ./$(DEPDIR)/libstrace_a-sw_64.Po + -rm -f ./$(DEPDIR)/libstrace_a-basic_filters.Po + -rm -f ./$(DEPDIR)/libstrace_a-bind.Po + -rm -f ./$(DEPDIR)/libstrace_a-bjm.Po +diff --git a/src/clone.c b/src/clone.c +index 8d384ab..e213d25 100644 +--- a/src/clone.c ++++ b/src/clone.c +@@ -39,7 +39,7 @@ + # define ARG_PTID 2 + # define ARG_CTID ((current_personality != 1) ? 3 : 4) + # define ARG_TLS ((current_personality != 1) ? 4 : 3) +-#elif defined ALPHA || defined TILE || defined OR1K || defined CSKY ++#elif defined ALPHA || defined SW_64 || defined TILE || defined OR1K || defined CSKY + # define ARG_FLAGS 0 + # define ARG_STACK 1 + # define ARG_PTID 2 +diff --git a/src/config.h.in b/src/config.h.in +index 2b809d9..d910015 100644 +--- a/src/config.h.in ++++ b/src/config.h.in +@@ -6,6 +6,9 @@ + /* Define if building universal (internal helper macro) */ + #undef AC_APPLE_UNIVERSAL_BUILD + ++/* Define for the Sw_64 architecture. */ ++#undef SW_64 ++ + /* Define for the Alpha architecture. */ + #undef ALPHA + +diff --git a/src/defs.h b/src/defs.h +index 6632a21..56c2d43 100644 +--- a/src/defs.h ++++ b/src/defs.h +@@ -1674,7 +1674,7 @@ extern int print_timex64(struct tcb *, kernel_ulong_t); + extern int print_sparc64_timex(struct tcb *, kernel_ulong_t); + # endif + +-# ifdef ALPHA ++# if defined ALPHA || defined SW_64 + typedef struct { + int tv_sec, tv_usec; + } timeval32_t; +diff --git a/src/desc.c b/src/desc.c +index 6c286a2..a5f57ea 100644 +--- a/src/desc.c ++++ b/src/desc.c +@@ -160,7 +160,7 @@ SYS_FUNC(oldselect) + } + #endif /* HAVE_ARCH_OLD_SELECT */ + +-#ifdef ALPHA ++#if defined ALPHA || defined SW_64 + SYS_FUNC(osf_select) + { + return decode_select(tcp, tcp->u_arg, print_timeval32, sprint_timeval32); +diff --git a/src/hostname.c b/src/hostname.c +index 681f6fa..648f960 100644 +--- a/src/hostname.c ++++ b/src/hostname.c +@@ -26,7 +26,7 @@ SYS_FUNC(sethostname) + return RVAL_DECODED; + } + +-#if defined(ALPHA) ++#if defined(ALPHA) || defined(SW_64) + SYS_FUNC(gethostname) + { + if (exiting(tcp)) { +diff --git a/src/ioctl.c b/src/ioctl.c +index fc6cef9..55c999d 100644 +--- a/src/ioctl.c ++++ b/src/ioctl.c +@@ -305,7 +305,7 @@ static int + f_ioctl(struct tcb *tcp, const unsigned int code, const kernel_ulong_t arg) + { + int rc = fs_f_ioctl(tcp, code, arg); +-#if defined ALPHA ++#if defined ALPHA || defined SW_64 + if (rc == RVAL_DECODED) + rc = sock_ioctl(tcp, code, arg); + if (rc == RVAL_DECODED) +@@ -403,12 +403,12 @@ ioctl_decode(struct tcb *tcp, const struct finfo *finfo) + return ubi_ioctl(tcp, code, arg); + case 'p': + return rtc_ioctl(tcp, code, arg); +-#if defined ALPHA || defined MIPS || defined SH || defined XTENSA ++#if defined ALPHA || defined SW_64 || defined MIPS || defined SH || defined XTENSA + case 's': + return sock_ioctl(tcp, code, arg); + #endif + #if defined(ALPHA) || defined(MIPS) || defined(POWERPC) \ +- || defined(SPARC) || defined(SPARC64) ++ || defined(SPARC) || defined SW_64 || defined(SPARC64) + case 't': + return term_ioctl(tcp, code, arg); + #endif +diff --git a/src/kernel_types.h b/src/kernel_types.h +index 0889201..4bb5a34 100644 +--- a/src/kernel_types.h ++++ b/src/kernel_types.h +@@ -56,7 +56,7 @@ typedef kernel_ulong_t __kernel_ulong_t; + */ + # if SIZEOF_LONG == 4 + # define PRI__64 "ll" +-# elif defined ALPHA || defined IA64 || defined __powerpc64__ \ ++# elif defined ALPHA || defined SW_64 || defined IA64 || defined __powerpc64__ \ + || (defined MIPS && !defined __ANDROID__) + # define PRI__64 "l" + # else +diff --git a/src/linux/sw_64/arch_defs_.h b/src/linux/sw_64/arch_defs_.h +new file mode 100644 +index 0000000..cff0619 +--- /dev/null ++++ b/src/linux/sw_64/arch_defs_.h +@@ -0,0 +1,11 @@ ++/* ++ * Copyright (c) 2018-2021 The strace developers. ++ * All rights reserved. ++ * ++ * SPDX-License-Identifier: LGPL-2.1-or-later ++ */ ++ ++#define HAVE_ARCH_GETRVAL2 1 ++#define HAVE_ARCH_DEDICATED_ERR_REG 1 ++#define HAVE_ARCH_TIME32_SYSCALLS 1 ++#define PERSONALITY0_AUDIT_ARCH { AUDIT_ARCH_SW_64, 0 } +diff --git a/src/linux/sw_64/arch_getrval2.c b/src/linux/sw_64/arch_getrval2.c +new file mode 100644 +index 0000000..e49cafc +--- /dev/null ++++ b/src/linux/sw_64/arch_getrval2.c +@@ -0,0 +1,15 @@ ++/* ++ * Copyright (c) 2015-2021 The strace developers. ++ * All rights reserved. ++ * ++ * SPDX-License-Identifier: LGPL-2.1-or-later ++ */ ++ ++long ++getrval2(struct tcb *tcp) ++{ ++ unsigned long r20; ++ if (upeek(tcp, 20, &r20) < 0) ++ return -1; ++ return r20; ++} +diff --git a/src/linux/sw_64/arch_regs.c b/src/linux/sw_64/arch_regs.c +new file mode 100644 +index 0000000..1c1e155 +--- /dev/null ++++ b/src/linux/sw_64/arch_regs.c +@@ -0,0 +1,18 @@ ++/* ++ * Copyright (c) 2015-2021 The strace developers. ++ * All rights reserved. ++ * ++ * SPDX-License-Identifier: LGPL-2.1-or-later ++ */ ++ ++static unsigned long alpha_r0; ++static unsigned long alpha_a3; ++ ++#define REG_R0 0 ++#define REG_A0 16 ++#define REG_A3 19 ++#define REG_SP 30 ++#define REG_PC 64 ++ ++#define ARCH_PC_PEEK_ADDR REG_PC ++#define ARCH_SP_PEEK_ADDR REG_SP +diff --git a/src/linux/sw_64/arch_sigreturn.c b/src/linux/sw_64/arch_sigreturn.c +new file mode 100644 +index 0000000..158d95c +--- /dev/null ++++ b/src/linux/sw_64/arch_sigreturn.c +@@ -0,0 +1,18 @@ ++/* ++ * Copyright (c) 2015-2021 The strace developers. ++ * All rights reserved. ++ * ++ * SPDX-License-Identifier: LGPL-2.1-or-later ++ */ ++ ++static void ++arch_sigreturn(struct tcb *tcp) ++{ ++ unsigned long addr; ++ ++ if (!get_stack_pointer(tcp, &addr)) ++ return; ++ addr += offsetof(struct sigcontext, sc_mask); ++ ++ print_sigset_addr(tcp, addr); ++} +diff --git a/src/linux/sw_64/errnoent.h b/src/linux/sw_64/errnoent.h +new file mode 100644 +index 0000000..df79f5f +--- /dev/null ++++ b/src/linux/sw_64/errnoent.h +@@ -0,0 +1,156 @@ ++/* ++ * Copyright (c) 1999-2021 The strace developers. ++ * All rights reserved. ++ * ++ * SPDX-License-Identifier: LGPL-2.1-or-later ++ */ ++ ++[ 1] = "EPERM", ++[ 2] = "ENOENT", ++[ 3] = "ESRCH", ++[ 4] = "EINTR", ++[ 5] = "EIO", ++[ 6] = "ENXIO", ++[ 7] = "E2BIG", ++[ 8] = "ENOEXEC", ++[ 9] = "EBADF", ++[ 10] = "ECHILD", ++[ 11] = "EDEADLK", ++[ 12] = "ENOMEM", ++[ 13] = "EACCES", ++[ 14] = "EFAULT", ++[ 15] = "ENOTBLK", ++[ 16] = "EBUSY", ++[ 17] = "EEXIST", ++[ 18] = "EXDEV", ++[ 19] = "ENODEV", ++[ 20] = "ENOTDIR", ++[ 21] = "EISDIR", ++[ 22] = "EINVAL", ++[ 23] = "ENFILE", ++[ 24] = "EMFILE", ++[ 25] = "ENOTTY", ++[ 26] = "ETXTBSY", ++[ 27] = "EFBIG", ++[ 28] = "ENOSPC", ++[ 29] = "ESPIPE", ++[ 30] = "EROFS", ++[ 31] = "EMLINK", ++[ 32] = "EPIPE", ++[ 33] = "EDOM", ++[ 34] = "ERANGE", ++[ 35] = "EAGAIN", ++[ 36] = "EINPROGRESS", ++[ 37] = "EALREADY", ++[ 38] = "ENOTSOCK", ++[ 39] = "EDESTADDRREQ", ++[ 40] = "EMSGSIZE", ++[ 41] = "EPROTOTYPE", ++[ 42] = "ENOPROTOOPT", ++[ 43] = "EPROTONOSUPPORT", ++[ 44] = "ESOCKTNOSUPPORT", ++[ 45] = "EOPNOTSUPP", ++[ 46] = "EPFNOSUPPORT", ++[ 47] = "EAFNOSUPPORT", ++[ 48] = "EADDRINUSE", ++[ 49] = "EADDRNOTAVAIL", ++[ 50] = "ENETDOWN", ++[ 51] = "ENETUNREACH", ++[ 52] = "ENETRESET", ++[ 53] = "ECONNABORTED", ++[ 54] = "ECONNRESET", ++[ 55] = "ENOBUFS", ++[ 56] = "EISCONN", ++[ 57] = "ENOTCONN", ++[ 58] = "ESHUTDOWN", ++[ 59] = "ETOOMANYREFS", ++[ 60] = "ETIMEDOUT", ++[ 61] = "ECONNREFUSED", ++[ 62] = "ELOOP", ++[ 63] = "ENAMETOOLONG", ++[ 64] = "EHOSTDOWN", ++[ 65] = "EHOSTUNREACH", ++[ 66] = "ENOTEMPTY", ++[ 68] = "EUSERS", ++[ 69] = "EDQUOT", ++[ 70] = "ESTALE", ++[ 71] = "EREMOTE", ++[ 77] = "ENOLCK", ++[ 78] = "ENOSYS", ++[ 80] = "ENOMSG", ++[ 81] = "EIDRM", ++[ 82] = "ENOSR", ++[ 83] = "ETIME", ++[ 84] = "EBADMSG", ++[ 85] = "EPROTO", ++[ 86] = "ENODATA", ++[ 87] = "ENOSTR", ++[ 88] = "ECHRNG", ++[ 89] = "EL2NSYNC", ++[ 90] = "EL3HLT", ++[ 91] = "EL3RST", ++[ 92] = "ENOPKG", ++[ 93] = "ELNRNG", ++[ 94] = "EUNATCH", ++[ 95] = "ENOCSI", ++[ 96] = "EL2HLT", ++[ 97] = "EBADE", ++[ 98] = "EBADR", ++[ 99] = "EXFULL", ++[100] = "ENOANO", ++[101] = "EBADRQC", ++[102] = "EBADSLT", ++[103] = "EDEADLOCK", ++[104] = "EBFONT", ++[105] = "ENONET", ++[106] = "ENOLINK", ++[107] = "EADV", ++[108] = "ESRMNT", ++[109] = "ECOMM", ++[110] = "EMULTIHOP", ++[111] = "EDOTDOT", ++[112] = "EOVERFLOW", ++[113] = "ENOTUNIQ", ++[114] = "EBADFD", ++[115] = "EREMCHG", ++[116] = "EILSEQ", ++[117] = "EUCLEAN", ++[118] = "ENOTNAM", ++[119] = "ENAVAIL", ++[120] = "EISNAM", ++[121] = "EREMOTEIO", ++[122] = "ELIBACC", ++[123] = "ELIBBAD", ++[124] = "ELIBSCN", ++[125] = "ELIBMAX", ++[126] = "ELIBEXEC", ++[127] = "ERESTART", ++[128] = "ESTRPIPE", ++[129] = "ENOMEDIUM", ++[130] = "EMEDIUMTYPE", ++[131] = "ECANCELED", ++[132] = "ENOKEY", ++[133] = "EKEYEXPIRED", ++[134] = "EKEYREVOKED", ++[135] = "EKEYREJECTED", ++[136] = "EOWNERDEAD", ++[137] = "ENOTRECOVERABLE", ++[138] = "ERFKILL", ++[139] = "EHWPOISON", ++[512] = "ERESTARTSYS", ++[513] = "ERESTARTNOINTR", ++[514] = "ERESTARTNOHAND", ++[515] = "ENOIOCTLCMD", ++[516] = "ERESTART_RESTARTBLOCK", ++[517] = "EPROBE_DEFER", ++[518] = "EOPENSTALE", ++[521] = "EBADHANDLE", ++[522] = "ENOTSYNC", ++[523] = "EBADCOOKIE", ++[524] = "ENOTSUPP", ++[525] = "ETOOSMALL", ++[526] = "ESERVERFAULT", ++[527] = "EBADTYPE", ++[528] = "EJUKEBOX", ++[529] = "EIOCBQUEUED", ++[530] = "ERECALLCONFLICT", +diff --git a/src/linux/sw_64/get_error.c b/src/linux/sw_64/get_error.c +new file mode 100644 +index 0000000..1c0099c +--- /dev/null ++++ b/src/linux/sw_64/get_error.c +@@ -0,0 +1,17 @@ ++/* ++ * Copyright (c) 2015-2021 The strace developers. ++ * All rights reserved. ++ * ++ * SPDX-License-Identifier: LGPL-2.1-or-later ++ */ ++ ++static void ++arch_get_error(struct tcb *tcp, const bool check_errno) ++{ ++ if (alpha_a3) { ++ tcp->u_rval = -1; ++ tcp->u_error = alpha_r0; ++ } else { ++ tcp->u_rval = alpha_r0; ++ } ++} +diff --git a/src/linux/sw_64/get_scno.c b/src/linux/sw_64/get_scno.c +new file mode 100644 +index 0000000..9e95644 +--- /dev/null ++++ b/src/linux/sw_64/get_scno.c +@@ -0,0 +1,32 @@ ++/* ++ * Copyright (c) 2015-2021 The strace developers. ++ * All rights reserved. ++ * ++ * SPDX-License-Identifier: LGPL-2.1-or-later ++ */ ++ ++/* Return codes: 1 - ok, 0 - ignore, other - error. */ ++static int ++arch_get_scno(struct tcb *tcp) ++{ ++ kernel_ulong_t scno = 0; ++ ++ if (upeek(tcp, REG_A3, &alpha_a3) < 0) ++ return -1; ++ if (upeek(tcp, REG_R0, &scno) < 0) ++ return -1; ++ ++ /* ++ * Do some sanity checks to figure out if it's ++ * really a syscall entry ++ */ ++ if (!scno_in_range(scno)) { ++ if (alpha_a3 == 0 || alpha_a3 == -1UL) { ++ debug_msg("stray syscall exit: r0 = %lu", scno); ++ return 0; ++ } ++ } ++ ++ tcp->scno = scno; ++ return 1; ++} +diff --git a/src/linux/sw_64/get_syscall_args.c b/src/linux/sw_64/get_syscall_args.c +new file mode 100644 +index 0000000..9343ab1 +--- /dev/null ++++ b/src/linux/sw_64/get_syscall_args.c +@@ -0,0 +1,18 @@ ++/* ++ * Copyright (c) 2015-2021 The strace developers. ++ * All rights reserved. ++ * ++ * SPDX-License-Identifier: LGPL-2.1-or-later ++ */ ++ ++/* Return -1 on error or 1 on success (never 0!). */ ++static int ++arch_get_syscall_args(struct tcb *tcp) ++{ ++ unsigned int i; ++ ++ for (i = 0; i < n_args(tcp); ++i) ++ if (upeek(tcp, REG_A0+i, &tcp->u_arg[i]) < 0) ++ return -1; ++ return 1; ++} +diff --git a/src/linux/sw_64/get_syscall_result.c b/src/linux/sw_64/get_syscall_result.c +new file mode 100644 +index 0000000..73591fd +--- /dev/null ++++ b/src/linux/sw_64/get_syscall_result.c +@@ -0,0 +1,13 @@ ++/* ++ * Copyright (c) 2015-2021 The strace developers. ++ * All rights reserved. ++ * ++ * SPDX-License-Identifier: LGPL-2.1-or-later ++ */ ++ ++static int ++get_syscall_result_regs(struct tcb *tcp) ++{ ++ return (upeek(tcp, REG_A3, &alpha_a3) < 0 || ++ upeek(tcp, REG_R0, &alpha_r0) < 0) ? -1 : 0; ++} +diff --git a/src/linux/sw_64/ioctls_arch0.h b/src/linux/sw_64/ioctls_arch0.h +new file mode 100644 +index 0000000..39f87ce +--- /dev/null ++++ b/src/linux/sw_64/ioctls_arch0.h +@@ -0,0 +1,80 @@ ++/* Generated by ioctls_gen.sh from definitions found in $linux/arch/alpha/include/ tree. */ ++{ "asm/ioctls.h", "FIOASYNC", _IOC_WRITE, 0x667d, 0x04 }, ++{ "asm/ioctls.h", "FIOCLEX", _IOC_NONE, 0x6601, 0x00 }, ++{ "asm/ioctls.h", "FIONBIO", _IOC_WRITE, 0x667e, 0x04 }, ++{ "asm/ioctls.h", "FIONCLEX", _IOC_NONE, 0x6602, 0x00 }, ++{ "asm/ioctls.h", "FIONREAD", _IOC_READ, 0x667f, 0x04 }, ++{ "asm/ioctls.h", "FIOQSIZE", _IOC_READ, 0x6680, 0x08 }, ++{ "asm/ioctls.h", "TCFLSH", _IOC_NONE, 0x741f, 0x00 }, ++{ "asm/ioctls.h", "TCGETA", _IOC_READ, 0x7417, 0x12 }, ++{ "asm/ioctls.h", "TCGETS", _IOC_READ, 0x7413, 0x2c }, ++{ "asm/ioctls.h", "TCSBRK", _IOC_NONE, 0x741d, 0x00 }, ++{ "asm/ioctls.h", "TCSBRKP", 0, 0x5425, 0 }, ++{ "asm/ioctls.h", "TCSETA", _IOC_WRITE, 0x7418, 0x12 }, ++{ "asm/ioctls.h", "TCSETAF", _IOC_WRITE, 0x741c, 0x12 }, ++{ "asm/ioctls.h", "TCSETAW", _IOC_WRITE, 0x7419, 0x12 }, ++{ "asm/ioctls.h", "TCSETS", _IOC_WRITE, 0x7414, 0x2c }, ++{ "asm/ioctls.h", "TCSETSF", _IOC_WRITE, 0x7416, 0x2c }, ++{ "asm/ioctls.h", "TCSETSW", _IOC_WRITE, 0x7415, 0x2c }, ++{ "asm/ioctls.h", "TCXONC", _IOC_NONE, 0x741e, 0x00 }, ++{ "asm/ioctls.h", "TIOCCBRK", 0, 0x5428, 0 }, ++{ "asm/ioctls.h", "TIOCCONS", 0, 0x541D, 0 }, ++{ "asm/ioctls.h", "TIOCEXCL", 0, 0x540C, 0 }, ++{ "asm/ioctls.h", "TIOCGDEV", _IOC_READ, 0x5432, 0x04 }, ++{ "asm/ioctls.h", "TIOCGETC", _IOC_READ, 0x7412, 0x06 }, ++{ "asm/ioctls.h", "TIOCGETD", 0, 0x5424, 0 }, ++{ "asm/ioctls.h", "TIOCGETP", _IOC_READ, 0x7408, 0x06 }, ++{ "asm/ioctls.h", "TIOCGEXCL", _IOC_READ, 0x5440, 0x04 }, ++{ "asm/ioctls.h", "TIOCGICOUNT", 0, 0x545D, 0 }, ++{ "asm/ioctls.h", "TIOCGLCKTRMIOS", 0, 0x5456, 0 }, ++{ "asm/ioctls.h", "TIOCGLTC", _IOC_READ, 0x7474, 0x06 }, ++{ "asm/ioctls.h", "TIOCGPGRP", _IOC_READ, 0x7477, 0x04 }, ++{ "asm/ioctls.h", "TIOCGPKT", _IOC_READ, 0x5438, 0x04 }, ++{ "asm/ioctls.h", "TIOCGPTLCK", _IOC_READ, 0x5439, 0x04 }, ++{ "asm/ioctls.h", "TIOCGPTN", _IOC_READ, 0x5430, 0x04 }, ++{ "asm/ioctls.h", "TIOCGRS485", _IOC_READ, 0x542e, 0x20 }, ++{ "asm/ioctls.h", "TIOCGSERIAL", 0, 0x541E, 0 }, ++{ "asm/ioctls.h", "TIOCGSID", 0, 0x5429, 0 }, ++{ "asm/ioctls.h", "TIOCGSOFTCAR", 0, 0x5419, 0 }, ++{ "asm/ioctls.h", "TIOCGWINSZ", _IOC_READ, 0x7468, 0x08 }, ++{ "asm/ioctls.h", "TIOCLINUX", 0, 0x541C, 0 }, ++{ "asm/ioctls.h", "TIOCMBIC", 0, 0x5417, 0 }, ++{ "asm/ioctls.h", "TIOCMBIS", 0, 0x5416, 0 }, ++{ "asm/ioctls.h", "TIOCMGET", 0, 0x5415, 0 }, ++{ "asm/ioctls.h", "TIOCMIWAIT", 0, 0x545C, 0 }, ++{ "asm/ioctls.h", "TIOCMSET", 0, 0x5418, 0 }, ++{ "asm/ioctls.h", "TIOCNOTTY", 0, 0x5422, 0 }, ++{ "asm/ioctls.h", "TIOCNXCL", 0, 0x540D, 0 }, ++{ "asm/ioctls.h", "TIOCOUTQ", _IOC_READ, 0x7473, 0x04 }, ++{ "asm/ioctls.h", "TIOCPKT", 0, 0x5420, 0 }, ++{ "asm/ioctls.h", "TIOCSBRK", 0, 0x5427, 0 }, ++{ "asm/ioctls.h", "TIOCSCTTY", 0, 0x540E, 0 }, ++{ "asm/ioctls.h", "TIOCSERCONFIG", 0, 0x5453, 0 }, ++{ "asm/ioctls.h", "TIOCSERGETLSR", 0, 0x5459, 0 }, ++{ "asm/ioctls.h", "TIOCSERGETMULTI", 0, 0x545A, 0 }, ++{ "asm/ioctls.h", "TIOCSERGSTRUCT", 0, 0x5458, 0 }, ++{ "asm/ioctls.h", "TIOCSERGWILD", 0, 0x5454, 0 }, ++{ "asm/ioctls.h", "TIOCSERSETMULTI", 0, 0x545B, 0 }, ++{ "asm/ioctls.h", "TIOCSERSWILD", 0, 0x5455, 0 }, ++{ "asm/ioctls.h", "TIOCSETC", _IOC_WRITE, 0x7411, 0x06 }, ++{ "asm/ioctls.h", "TIOCSETD", 0, 0x5423, 0 }, ++{ "asm/ioctls.h", "TIOCSETN", _IOC_WRITE, 0x740a, 0x06 }, ++{ "asm/ioctls.h", "TIOCSETP", _IOC_WRITE, 0x7409, 0x06 }, ++{ "asm/ioctls.h", "TIOCSIG", _IOC_WRITE, 0x5436, 0x04 }, ++{ "asm/ioctls.h", "TIOCSLCKTRMIOS", 0, 0x5457, 0 }, ++{ "asm/ioctls.h", "TIOCSLTC", _IOC_WRITE, 0x7475, 0x06 }, ++{ "asm/ioctls.h", "TIOCSPGRP", _IOC_WRITE, 0x7476, 0x04 }, ++{ "asm/ioctls.h", "TIOCSPTLCK", _IOC_WRITE, 0x5431, 0x04 }, ++{ "asm/ioctls.h", "TIOCSRS485", _IOC_READ|_IOC_WRITE, 0x542f, 0x20 }, ++{ "asm/ioctls.h", "TIOCSSERIAL", 0, 0x541F, 0 }, ++{ "asm/ioctls.h", "TIOCSSOFTCAR", 0, 0x541A, 0 }, ++{ "asm/ioctls.h", "TIOCSTART", _IOC_NONE, 0x746e, 0x00 }, ++{ "asm/ioctls.h", "TIOCSTI", 0, 0x5412, 0 }, ++{ "asm/ioctls.h", "TIOCSTOP", _IOC_NONE, 0x746f, 0x00 }, ++{ "asm/ioctls.h", "TIOCSWINSZ", _IOC_WRITE, 0x7467, 0x08 }, ++{ "asm/ioctls.h", "TIOCVHANGUP", 0, 0x5437, 0 }, ++{ "asm/sockios.h", "FIOGETOWN", _IOC_READ, 0x667b, 0x04 }, ++{ "asm/sockios.h", "FIOSETOWN", _IOC_WRITE, 0x667c, 0x04 }, ++{ "asm/sockios.h", "SIOCATMARK", _IOC_READ, 0x7307, 0x04 }, ++{ "asm/sockios.h", "SIOCGPGRP", _IOC_READ, 0x7309, 0x04 }, ++{ "asm/sockios.h", "SIOCSPGRP", _IOC_WRITE, 0x7308, 0x04 }, +diff --git a/src/linux/sw_64/ioctls_inc0.h b/src/linux/sw_64/ioctls_inc0.h +new file mode 100644 +index 0000000..6028afb +--- /dev/null ++++ b/src/linux/sw_64/ioctls_inc0.h +@@ -0,0 +1 @@ ++#include "../64/ioctls_inc.h" +diff --git a/src/linux/sw_64/raw_syscall.h b/src/linux/sw_64/raw_syscall.h +new file mode 100644 +index 0000000..c7acc72 +--- /dev/null ++++ b/src/linux/sw_64/raw_syscall.h +@@ -0,0 +1,31 @@ ++/* ++ * Raw syscalls. ++ * ++ * Copyright (c) 2018-2021 The strace developers. ++ * All rights reserved. ++ * ++ * SPDX-License-Identifier: LGPL-2.1-or-later ++ */ ++ ++#ifndef STRACE_RAW_SYSCALL_H ++# define STRACE_RAW_SYSCALL_H ++ ++# include "kernel_types.h" ++ ++static inline kernel_ulong_t ++raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err) ++{ ++ kernel_ulong_t sc_0 = nr; ++ register kernel_ulong_t sc_19 __asm__("$19"); ++ __asm__ __volatile__("callsys" ++ : "+v"(sc_0), "=r"(sc_19) ++ : ++ : "memory", "$1", "$2", "$3", "$4", "$5", "$6", ++ "$7", "$8", "$16", "$17", "$18", "$20", "$21", ++ "$22", "$23", "$24", "$25", "$27", "$28"); ++ *err = sc_19; ++ return sc_0; ++} ++# define raw_syscall_0 raw_syscall_0 ++ ++#endif /* !STRACE_RAW_SYSCALL_H */ +diff --git a/src/linux/sw_64/set_error.c b/src/linux/sw_64/set_error.c +new file mode 100644 +index 0000000..df545e8 +--- /dev/null ++++ b/src/linux/sw_64/set_error.c +@@ -0,0 +1,20 @@ ++/* ++ * Copyright (c) 2016-2021 The strace developers. ++ * All rights reserved. ++ * ++ * SPDX-License-Identifier: LGPL-2.1-or-later ++ */ ++ ++static int ++arch_set_error(struct tcb *tcp) ++{ ++ return upoke(tcp, REG_A3, (alpha_a3 = 1)) ++ || upoke(tcp, REG_R0, (alpha_r0 = tcp->u_error)); ++} ++ ++static int ++arch_set_success(struct tcb *tcp) ++{ ++ return upoke(tcp, REG_A3, (alpha_a3 = 0)) ++ || upoke(tcp, REG_R0, (alpha_r0 = tcp->u_rval)); ++} +diff --git a/src/linux/sw_64/set_scno.c b/src/linux/sw_64/set_scno.c +new file mode 100644 +index 0000000..e2732d6 +--- /dev/null ++++ b/src/linux/sw_64/set_scno.c +@@ -0,0 +1,12 @@ ++/* ++ * Copyright (c) 2016-2021 The strace developers. ++ * All rights reserved. ++ * ++ * SPDX-License-Identifier: LGPL-2.1-or-later ++ */ ++ ++static int ++arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) ++{ ++ return upoke(tcp, REG_R0, scno); ++} +diff --git a/src/linux/sw_64/signalent.h b/src/linux/sw_64/signalent.h +new file mode 100644 +index 0000000..e10af26 +--- /dev/null ++++ b/src/linux/sw_64/signalent.h +@@ -0,0 +1,40 @@ ++/* ++ * Copyright (c) 1999-2021 The strace developers. ++ * All rights reserved. ++ * ++ * SPDX-License-Identifier: LGPL-2.1-or-later ++ */ ++ ++ "0", /* 0 */ ++ "SIGHUP", /* 1 */ ++ "SIGINT", /* 2 */ ++ "SIGQUIT", /* 3 */ ++ "SIGILL", /* 4 */ ++ "SIGTRAP", /* 5 */ ++ "SIGABRT", /* 6 */ ++ "SIGEMT", /* 7 */ ++ "SIGFPE", /* 8 */ ++ "SIGKILL", /* 9 */ ++ "SIGBUS", /* 10 */ ++ "SIGSEGV", /* 11 */ ++ "SIGSYS", /* 12 */ ++ "SIGPIPE", /* 13 */ ++ "SIGALRM", /* 14 */ ++ "SIGTERM", /* 15 */ ++ "SIGURG", /* 16 */ ++ "SIGSTOP", /* 17 */ ++ "SIGTSTP", /* 18 */ ++ "SIGCONT", /* 19 */ ++ "SIGCHLD", /* 20 */ ++ "SIGTTIN", /* 21 */ ++ "SIGTTOU", /* 22 */ ++ "SIGIO", /* 23 */ ++ "SIGXCPU", /* 24 */ ++ "SIGXFSZ", /* 25 */ ++ "SIGVTALRM", /* 26 */ ++ "SIGPROF", /* 27 */ ++ "SIGWINCH", /* 28 */ ++ "SIGINFO", /* 29 */ ++ "SIGUSR1", /* 30 */ ++ "SIGUSR2", /* 31 */ ++ "SIGRTMIN", /* 32 */ +diff --git a/src/linux/sw_64/syscallent.h b/src/linux/sw_64/syscallent.h +new file mode 100644 +index 0000000..f9e971e +--- /dev/null ++++ b/src/linux/sw_64/syscallent.h +@@ -0,0 +1,483 @@ ++/* ++ * Copyright (c) 1993 Branko Lankester ++ * Copyright (c) 1993, 1994, 1995 Rick Sladkey ++ * Copyright (c) 1995-2021 The strace developers. ++ * All rights reserved. ++ * ++ * SPDX-License-Identifier: LGPL-2.1-or-later ++ */ ++ ++[ 0] = { 6, 0, SEN(printargs), "osf_syscall" }, /* not implemented */ ++[ 1] = { 1, TP|SE, SEN(exit), "exit" }, ++[ 2] = { 0, TP, SEN(fork), "fork" }, ++[ 3] = { 3, TD, SEN(read), "read" }, ++[ 4] = { 3, TD, SEN(write), "write" }, ++[ 5] = { 5, 0, SEN(printargs), "osf_old_open" }, /* not implemented */ ++[ 6] = { 1, TD, SEN(close), "close" }, ++[ 7] = { 4, TP, SEN(osf_wait4), "osf_wait4" }, ++[ 8] = { 5, 0, SEN(printargs), "osf_old_creat" }, /* not implemented */ ++[ 9] = { 2, TF, SEN(link), "link" }, ++[ 10] = { 1, TF, SEN(unlink), "unlink" }, ++[ 11] = { 5, 0, SEN(printargs), "osf_execve" }, /* not implemented */ ++[ 12] = { 1, TF, SEN(chdir), "chdir" }, ++[ 13] = { 1, TD, SEN(fchdir), "fchdir" }, ++[ 14] = { 3, TF, SEN(mknod), "mknod" }, ++[ 15] = { 2, TF, SEN(chmod), "chmod" }, ++[ 16] = { 3, TF, SEN(chown), "chown" }, ++[ 17] = { 1, TM|SI, SEN(brk), "brk" }, ++[ 18] = { 5, TSFA, SEN(printargs), "osf_getfsstat" }, /* not implemented */ ++[ 19] = { 3, TD, SEN(lseek), "lseek" }, ++[ 20] = { 0, PU|NF, SEN(getxpid), "getxpid" }, ++[ 21] = { 4, 0, SEN(printargs), "osf_mount" }, ++[ 22] = { 2, TF, SEN(umount2), "umount" }, ++[ 23] = { 1, TC, SEN(setuid), "setuid" }, ++[ 24] = { 0, TC|PU|NF, SEN(getxuid), "getxuid" }, ++[ 25] = { 5, 0, SEN(printargs), "exec_with_loader" }, /* not implemented */ ++[ 26] = { 4, 0, SEN(ptrace), "ptrace" }, ++[ 27] = { 5, 0, SEN(printargs), "osf_nrecvmsg" }, /* not implemented */ ++[ 28] = { 5, 0, SEN(printargs), "osf_nsendmsg" }, /* not implemented */ ++[ 29] = { 5, 0, SEN(printargs), "osf_nrecvfrom" }, /* not implemented */ ++[ 30] = { 5, 0, SEN(printargs), "osf_naccept" }, /* not implemented */ ++[ 31] = { 5, 0, SEN(printargs), "osf_ngetpeername" }, /* not implemented */ ++[ 32] = { 5, 0, SEN(printargs), "osf_ngetsockname" }, /* not implemented */ ++[ 33] = { 2, TF, SEN(access), "access" }, ++[ 34] = { 5, 0, SEN(printargs), "osf_chflags" }, /* not implemented */ ++[ 35] = { 5, 0, SEN(printargs), "osf_fchflags" }, /* not implemented */ ++[ 36] = { 0, 0, SEN(sync), "sync" }, ++[ 37] = { 2, TS|TP, SEN(kill), "kill" }, ++[ 38] = { 5, TF|TST|TSTA, SEN(printargs), "osf_old_stat" }, /* not implemented */ ++[ 39] = { 2, 0, SEN(setpgid), "setpgid" }, ++[ 40] = { 5, TF|TLST|TSTA, SEN(printargs), "osf_old_lstat" }, /* not implemented */ ++[ 41] = { 1, TD, SEN(dup), "dup" }, ++[ 42] = { 0, TD, SEN(pipe), "pipe" }, ++[ 43] = { 4, 0, SEN(printargs), "osf_set_program_attributes" }, ++[ 44] = { 5, 0, SEN(printargs), "osf_profil" }, /* not implemented */ ++[ 45] = { 3, TD|TF, SEN(open), "open" }, ++[ 46] = { 5, 0, SEN(printargs), "osf_old_sigaction" }, /* not implemented */ ++[ 47] = { 0, TC|PU|NF, SEN(getxgid), "getxgid" }, ++[ 48] = { 2, TS, SEN(osf_sigprocmask), "osf_sigprocmask" }, ++[ 49] = { 5, 0, SEN(printargs), "osf_getlogin" }, /* not implemented */ ++[ 50] = { 5, 0, SEN(printargs), "osf_setlogin" }, /* not implemented */ ++[ 51] = { 1, TF, SEN(acct), "acct" }, ++[ 52] = { 1, TS, SEN(sigpending), "sigpending" }, ++[ 53] = { }, ++[ 54] = { 3, TD, SEN(ioctl), "ioctl" }, ++[ 55] = { 5, 0, SEN(printargs), "osf_reboot" }, /* not implemented */ ++[ 56] = { 5, 0, SEN(printargs), "osf_revoke" }, /* not implemented */ ++[ 57] = { 2, TF, SEN(symlink), "symlink" }, ++[ 58] = { 3, TF, SEN(readlink), "readlink" }, ++[ 59] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" }, ++[ 60] = { 1, NF, SEN(umask), "umask" }, ++[ 61] = { 1, TF, SEN(chroot), "chroot" }, ++[ 62] = { 5, TD|TFST|TSTA, SEN(printargs), "osf_old_fstat" }, /* not implemented */ ++[ 63] = { 0, PU|NF, SEN(getpgrp), "getpgrp" }, ++[ 64] = { 0, PU|NF, SEN(getpagesize), "getpagesize" }, ++[ 65] = { 5, TM, SEN(printargs), "osf_mremap" }, /* not implemented */ ++[ 66] = { 0, TP, SEN(vfork), "vfork" }, ++[ 67] = { 2, TF|TST|TSTA, SEN(stat), "stat" }, ++[ 68] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" }, ++[ 69] = { 5, TM, SEN(printargs), "osf_sbrk" }, /* not implemented */ ++[ 70] = { 5, 0, SEN(printargs), "osf_sstk" }, /* not implemented */ ++[ 71] = { 6, TD|TM|SI, SEN(mmap), "mmap" }, ++[ 72] = { 5, 0, SEN(printargs), "osf_old_vadvise" }, /* not implemented */ ++[ 73] = { 2, TM|SI, SEN(munmap), "munmap" }, ++[ 74] = { 3, TM|SI, SEN(mprotect), "mprotect" }, ++[ 75] = { 3, TM, SEN(madvise), "madvise" }, ++[ 76] = { 0, 0, SEN(vhangup), "vhangup" }, ++[ 77] = { 5, 0, SEN(printargs), "osf_kmodcall" }, /* not implemented */ ++[ 78] = { 5, TM, SEN(printargs), "osf_mincore" }, /* not implemented */ ++[ 79] = { 2, TC, SEN(getgroups), "getgroups" }, ++[ 80] = { 2, TC, SEN(setgroups), "setgroups" }, ++[ 81] = { 5, 0, SEN(printargs), "osf_old_getpgrp" }, /* not implemented */ ++[ 82] = { 2, 0, SEN(setpgrp), "setpgrp" }, ++[ 83] = { 3, 0, SEN(osf_setitimer), "osf_setitimer" }, ++[ 84] = { 5, 0, SEN(printargs), "osf_old_wait" }, /* not implemented */ ++[ 85] = { 5, 0, SEN(printargs), "osf_table" }, /* not implemented */ ++[ 86] = { 2, 0, SEN(osf_getitimer), "osf_getitimer" }, ++[ 87] = { 2, 0, SEN(gethostname), "gethostname" }, ++[ 88] = { 2, 0, SEN(sethostname), "sethostname" }, ++[ 89] = { 0, PU|NF, SEN(getdtablesize), "getdtablesize" }, ++[ 90] = { 2, TD, SEN(dup2), "dup2" }, ++[ 91] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" }, ++[ 92] = { 3, TD, SEN(fcntl), "fcntl" }, ++[ 93] = { 5, TD, SEN(osf_select), "osf_select" }, ++[ 94] = { 3, TD, SEN(poll_time64), "poll" }, ++[ 95] = { 1, TD, SEN(fsync), "fsync" }, ++[ 96] = { 3, 0, SEN(setpriority), "setpriority" }, ++[ 97] = { 3, TN, SEN(socket), "socket" }, ++[ 98] = { 3, TN, SEN(connect), "connect" }, ++[ 99] = { 3, TN, SEN(accept), "accept" }, ++[100] = { 2, 0, SEN(getpriority), "getpriority" }, ++[101] = { 4, TN, SEN(send), "send" }, ++[102] = { 4, TN, SEN(recv), "recv" }, ++[103] = { 0, TS, SEN(sigreturn), "sigreturn" }, ++[104] = { 3, TN, SEN(bind), "bind" }, ++[105] = { 5, TN, SEN(setsockopt), "setsockopt" }, ++[106] = { 2, TN, SEN(listen), "listen" }, ++[107] = { 5, 0, SEN(printargs), "osf_plock" }, /* not implemented */ ++[108] = { 5, 0, SEN(printargs), "osf_old_sigvec" }, /* not implemented */ ++[109] = { 5, 0, SEN(printargs), "osf_old_sigblock" }, /* not implemented */ ++[110] = { 5, 0, SEN(printargs), "osf_old_sigsetmask" }, /* not implemented */ ++[111] = { 1, TS, SEN(sigsuspend), "sigsuspend" }, ++[112] = { 2, 0, SEN(printargs), "osf_sigstack" }, ++[113] = { 3, TN, SEN(recvmsg), "recvmsg" }, ++[114] = { 3, TN, SEN(sendmsg), "sendmsg" }, ++[115] = { 5, 0, SEN(printargs), "osf_old_vtrace" }, /* not implemented */ ++[116] = { 2, TCL, SEN(osf_gettimeofday), "osf_gettimeofday" }, ++[117] = { 2, 0, SEN(osf_getrusage), "osf_getrusage" }, ++[118] = { 5, TN, SEN(getsockopt), "getsockopt" }, ++[119] = { }, ++[120] = { 3, TD, SEN(readv), "readv" }, ++[121] = { 3, TD, SEN(writev), "writev" }, ++[122] = { 2, TCL, SEN(osf_settimeofday), "osf_settimeofday" }, ++[123] = { 3, TD, SEN(fchown), "fchown" }, ++[124] = { 2, TD, SEN(fchmod), "fchmod" }, ++[125] = { 6, TN, SEN(recvfrom), "recvfrom" }, ++[126] = { 2, TC, SEN(setreuid), "setreuid" }, ++[127] = { 2, TC, SEN(setregid), "setregid" }, ++[128] = { 2, TF, SEN(rename), "rename" }, ++[129] = { 2, TF, SEN(truncate), "truncate" }, ++[130] = { 2, TD, SEN(ftruncate), "ftruncate" }, ++[131] = { 2, TD, SEN(flock), "flock" }, ++[132] = { 1, TC, SEN(setgid), "setgid" }, ++[133] = { 6, TN, SEN(sendto), "sendto" }, ++[134] = { 2, TN, SEN(shutdown), "shutdown" }, ++[135] = { 4, TN, SEN(socketpair), "socketpair" }, ++[136] = { 2, TF, SEN(mkdir), "mkdir" }, ++[137] = { 1, TF, SEN(rmdir), "rmdir" }, ++[138] = { 2, TF, SEN(osf_utimes), "osf_utimes" }, ++[139] = { 5, 0, SEN(printargs), "osf_old_sigreturn" }, /* not implemented */ ++[140] = { 5, TCL, SEN(printargs), "osf_adjtime" }, /* not implemented */ ++[141] = { 3, TN, SEN(getpeername), "getpeername" }, ++[142] = { 5, 0, SEN(printargs), "osf_gethostid" }, /* not implemented */ ++[143] = { 5, 0, SEN(printargs), "osf_sethostid" }, /* not implemented */ ++[144] = { 2, 0, SEN(getrlimit), "getrlimit" }, ++[145] = { 2, 0, SEN(setrlimit), "setrlimit" }, ++[146] = { 5, TP, SEN(printargs), "osf_old_killpg" }, /* not implemented */ ++[147] = { 0, 0, SEN(setsid), "setsid" }, ++[148] = { 4, TF, SEN(quotactl), "quotactl" }, ++[149] = { 5, 0, SEN(printargs), "osf_oldquota" }, /* not implemented */ ++[150] = { 3, TN, SEN(getsockname), "getsockname" }, ++[151 ... 152] = { }, ++[153] = { 5, 0, SEN(printargs), "osf_pid_block" }, /* not implemented */ ++[154] = { 5, 0, SEN(printargs), "osf_pid_unblock" }, /* not implemented */ ++[155] = { }, ++[156] = { 3, TS, SEN(sigaction), "sigaction" }, ++[157] = { 5, 0, SEN(printargs), "osf_sigwaitprim" }, /* not implemented */ ++[158] = { 5, 0, SEN(printargs), "osf_nfssvc" }, /* not implemented */ ++[159] = { 4, 0, SEN(printargs), "osf_getdirentries" }, ++[160] = { 3, TF|TSF|TSFA, SEN(osf_statfs), "osf_statfs" }, ++[161] = { 3, TD|TFSF|TSFA, SEN(osf_fstatfs), "osf_fstatfs" }, ++[162] = { }, ++[163] = { 5, 0, SEN(printargs), "osf_asynch_daemon" }, /* not implemented */ ++[164] = { 5, 0, SEN(printargs), "osf_getfh" }, /* not implemented */ ++[165] = { 2, 0, SEN(printargs), "osf_getdomainname" }, ++[166] = { 2, 0, SEN(setdomainname), "setdomainname" }, ++[167 ... 168] = { }, ++[169] = { 5, 0, SEN(printargs), "osf_exportfs" }, /* not implemented */ ++[170 ... 180] = { }, ++[181] = { 5, 0, SEN(printargs), "osf_alt_plock" }, /* not implemented */ ++[182 ... 183] = { }, ++[184] = { 5, 0, SEN(printargs), "osf_getmnt" }, /* not implemented */ ++[185 ... 186] = { }, ++[187] = { 5, 0, SEN(printargs), "osf_alt_sigpending" }, /* not implemented */ ++[188] = { 5, 0, SEN(printargs), "osf_alt_setsid" }, /* not implemented */ ++[189 ... 198] = { }, ++[199] = { 4, 0, SEN(printargs), "osf_swapon" }, ++[200] = { 3, TI, SEN(msgctl), "msgctl" }, ++[201] = { 2, TI, SEN(msgget), "msgget" }, ++[202] = { 5, TI, SEN(msgrcv), "msgrcv" }, ++[203] = { 4, TI, SEN(msgsnd), "msgsnd" }, ++[204] = { 4, TI, SEN(semctl), "semctl" }, ++[205] = { 3, TI, SEN(semget), "semget" }, ++[206] = { 3, TI, SEN(semop), "semop" }, ++[207] = { 1, 0, SEN(printargs), "osf_utsname" }, ++[208] = { 3, TF, SEN(chown), "lchown" }, ++[209] = { 3, TI|TM|SI, SEN(shmat), "osf_shmat" }, ++[210] = { 3, TI, SEN(shmctl), "shmctl" }, ++[211] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" }, ++[212] = { 3, TI, SEN(shmget), "shmget" }, ++[213] = { 5, 0, SEN(printargs), "osf_mvalid" }, /* not implemented */ ++[214] = { 5, 0, SEN(printargs), "osf_getaddressconf" }, /* not implemented */ ++[215] = { 5, 0, SEN(printargs), "osf_msleep" }, /* not implemented */ ++[216] = { 5, 0, SEN(printargs), "osf_mwakeup" }, /* not implemented */ ++[217] = { 3, TM, SEN(msync), "msync" }, ++[218] = { 5, 0, SEN(printargs), "osf_signal" }, /* not implemented */ ++[219] = { 5, 0, SEN(printargs), "osf_utc_gettime" }, /* not implemented */ ++[220] = { 5, TCL, SEN(printargs), "osf_utc_adjtime" }, /* not implemented */ ++[221] = { }, ++[222] = { 5, 0, SEN(printargs), "osf_security" }, /* not implemented */ ++[223] = { 5, 0, SEN(printargs), "osf_kloadcall" }, /* not implemented */ ++[224] = { 2, TF|TST|TSTA, SEN(printargs), "osf_stat" }, ++[225] = { 2, TF|TLST|TSTA, SEN(printargs), "osf_lstat" }, ++[226] = { 2, TD|TFST|TSTA, SEN(printargs), "osf_fstat" }, ++[227] = { 3, TF|TSF|TSFA, SEN(osf_statfs), "osf_statfs64" }, ++[228] = { 3, TD|TFSF|TSFA, SEN(osf_fstatfs), "osf_fstatfs64" }, ++[229 ... 232] = { }, ++[233] = { 1, 0, SEN(getpgid), "getpgid" }, ++[234] = { 1, 0, SEN(getsid), "getsid" }, ++[235] = { 2, TS, SEN(sigaltstack), "sigaltstack" }, ++[236] = { 5, 0, SEN(printargs), "osf_waitid" }, /* not implemented */ ++[237] = { 5, 0, SEN(printargs), "osf_priocntlset" }, /* not implemented */ ++[238] = { 5, 0, SEN(printargs), "osf_sigsendset" }, /* not implemented */ ++[239] = { 5, 0, SEN(printargs), "osf_set_speculative" }, /* not implemented */ ++[240] = { 5, 0, SEN(printargs), "osf_msfs_syscall" }, /* not implemented */ ++[241] = { 3, 0, SEN(printargs), "osf_sysinfo" }, ++[242] = { 5, 0, SEN(printargs), "osf_uadmin" }, /* not implemented */ ++[243] = { 5, 0, SEN(printargs), "osf_fuser" }, /* not implemented */ ++[244] = { 2, 0, SEN(printargs), "osf_proplist_syscall" }, ++[245] = { 5, TCL, SEN(printargs), "osf_ntp_adjtime" }, /* not implemented */ ++[246] = { 5, 0, SEN(printargs), "osf_ntp_gettime" }, /* not implemented */ ++[247] = { 5, 0, SEN(printargs), "osf_pathconf" }, /* not implemented */ ++[248] = { 5, 0, SEN(printargs), "osf_fpathconf" }, /* not implemented */ ++[249] = { }, ++[250] = { 5, 0, SEN(printargs), "osf_uswitch" }, /* not implemented */ ++[251] = { 2, 0, SEN(printargs), "osf_usleep_thread" }, ++[252] = { 5, 0, SEN(printargs), "osf_audcntl" }, /* not implemented */ ++[253] = { 5, 0, SEN(printargs), "osf_audgen" }, /* not implemented */ ++[254] = { 3, 0, SEN(sysfs), "sysfs" }, ++[255] = { 5, 0, SEN(printargs), "osf_subsys_info" }, /* not implemented */ ++[256] = { 5, 0, SEN(printargs), "osf_getsysinfo" }, ++[257] = { 5, 0, SEN(printargs), "osf_setsysinfo" }, ++[258] = { 5, 0, SEN(printargs), "osf_afs_syscall" }, /* not implemented */ ++[259] = { 5, 0, SEN(printargs), "osf_swapctl" }, /* not implemented */ ++[260] = { 5, 0, SEN(printargs), "osf_memcntl" }, /* not implemented */ ++[261] = { 5, 0, SEN(printargs), "osf_fdatasync" }, /* not implemented */ ++[262 ... 299] = { }, ++[300] = { 2, 0, SEN(bdflush), "bdflush" }, ++[301] = { 1, 0, SEN(printargs), "sethae" }, ++[302] = { 5, TF, SEN(mount), "mount" }, ++[303] = { 1, TCL, SEN(adjtimex32), "old_adjtimex" }, ++[304] = { 1, TF, SEN(swapoff), "swapoff" }, ++[305] = { 3, TD, SEN(getdents), "getdents" }, ++[306] = { 2, 0, SEN(create_module), "create_module" }, /* not implemented */ ++[307] = { 3, 0, SEN(init_module), "init_module" }, ++[308] = { 2, 0, SEN(delete_module), "delete_module" }, ++[309] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" }, /* not implemented */ ++[310] = { 3, 0, SEN(syslog), "syslog" }, ++[311] = { 4, 0, SEN(reboot), "reboot" }, ++[312] = { 5, TP, SEN(clone), "clone" }, ++[313] = { 1, TF, SEN(uselib), "uselib" }, ++[314] = { 2, TM, SEN(mlock), "mlock" }, ++[315] = { 2, TM, SEN(munlock), "munlock" }, ++[316] = { 1, TM, SEN(mlockall), "mlockall" }, ++[317] = { 0, TM, SEN(munlockall), "munlockall" }, ++[318] = { 1, 0, SEN(sysinfo), "sysinfo" }, ++[319] = { 1, 0, SEN(sysctl), "_sysctl" }, ++[320] = { }, ++[321] = { 1, TF, SEN(umount), "oldumount" }, ++[322] = { 2, TF, SEN(swapon), "swapon" }, ++[323] = { 1, 0, SEN(times), "times" }, ++[324] = { 1, NF, SEN(personality), "personality" }, ++[325] = { 1, TC|NF, SEN(setfsuid), "setfsuid" }, ++[326] = { 1, TC|NF, SEN(setfsgid), "setfsgid" }, ++[327] = { 2, TSFA, SEN(ustat), "ustat" }, ++[328] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" }, ++[329] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" }, ++[330] = { 2, 0, SEN(sched_setparam), "sched_setparam" }, ++[331] = { 2, 0, SEN(sched_getparam), "sched_getparam" }, ++[332] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" }, ++[333] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" }, ++[334] = { 0, 0, SEN(sched_yield), "sched_yield" }, ++[335] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, ++[336] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, ++[337] = { 2, 0, SEN(sched_rr_get_interval_time64),"sched_rr_get_interval"}, ++[338] = { 5, 0, SEN(afs_syscall), "afs_syscall" }, /* not implemented */ ++[339] = { 1, 0, SEN(uname), "uname" }, ++[340] = { 2, 0, SEN(nanosleep_time64), "nanosleep" }, ++[341] = { 5, TM|SI, SEN(mremap), "mremap" }, ++[342] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, /* not implemented */ ++[343] = { 3, TC, SEN(setresuid), "setresuid" }, ++[344] = { 3, TC, SEN(getresuid), "getresuid" }, ++[345] = { 5, 0, SEN(printargs), "pciconfig_read" }, ++[346] = { 5, 0, SEN(printargs), "pciconfig_write" }, ++[347] = { 5, 0, SEN(query_module), "query_module" }, /* not implemented */ ++[348] = { 5, TC, SEN(prctl), "prctl" }, ++[349] = { 4, TD, SEN(pread), "pread64" }, ++[350] = { 4, TD, SEN(pwrite), "pwrite64" }, ++[351] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" }, ++[352] = { 5, TS, SEN(rt_sigaction), "rt_sigaction" }, ++[353] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, ++[354] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, ++[355] = { 4, TS, SEN(rt_sigtimedwait_time64), "rt_sigtimedwait" }, ++[356] = { 3, TS|TP, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, ++[357] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, ++[358] = { 5, TD, SEN(select), "select" }, ++[359] = { 2, TCL, SEN(gettimeofday), "gettimeofday" }, ++[360] = { 2, TCL, SEN(settimeofday), "settimeofday" }, ++[361] = { 2, 0, SEN(getitimer), "getitimer" }, ++[362] = { 3, 0, SEN(setitimer), "setitimer" }, ++[363] = { 2, TF, SEN(utimes), "utimes" }, ++[364] = { 2, 0, SEN(getrusage), "getrusage" }, ++[365] = { 4, TP, SEN(wait4), "wait4" }, ++[366] = { 1, TCL, SEN(adjtimex64), "adjtimex" }, ++[367] = { 2, TF, SEN(getcwd), "getcwd" }, ++[368] = { 2, TC, SEN(capget), "capget" }, ++[369] = { 2, TC, SEN(capset), "capset" }, ++[370] = { 4, TD|TN, SEN(sendfile), "sendfile" }, ++[371] = { 3, TC, SEN(setresgid), "setresgid" }, ++[372] = { 3, TC, SEN(getresgid), "getresgid" }, ++[373] = { 4, 0, SEN(printargs), "dipc" }, /* not implemented */ ++[374] = { 2, TF, SEN(pivotroot), "pivot_root" }, ++[375] = { 3, TM, SEN(mincore), "mincore" }, ++[376] = { 3, 0, SEN(printargs), "pciconfig_iobase" }, ++[377] = { 3, TD, SEN(getdents64), "getdents64" }, ++[378] = { 0, PU|NF, SEN(gettid), "gettid" }, ++[379] = { 3, TD, SEN(readahead), "readahead" }, ++[380] = { }, ++[381] = { 2, TS|TP, SEN(tkill), "tkill" }, ++[382] = { 5, TF, SEN(setxattr), "setxattr" }, ++[383] = { 5, TF, SEN(setxattr), "lsetxattr" }, ++[384] = { 5, TD, SEN(fsetxattr), "fsetxattr" }, ++[385] = { 4, TF, SEN(getxattr), "getxattr" }, ++[386] = { 4, TF, SEN(getxattr), "lgetxattr" }, ++[387] = { 4, TD, SEN(fgetxattr), "fgetxattr" }, ++[388] = { 3, TF, SEN(listxattr), "listxattr" }, ++[389] = { 3, TF, SEN(listxattr), "llistxattr" }, ++[390] = { 3, TD, SEN(flistxattr), "flistxattr" }, ++[391] = { 2, TF, SEN(removexattr), "removexattr" }, ++[392] = { 2, TF, SEN(removexattr), "lremovexattr" }, ++[393] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, ++[394] = { 6, 0, SEN(futex_time64), "futex" }, ++[395] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, ++[396] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, ++[397] = { 5, 0, SEN(tuxcall), "tuxcall" }, /* not implemented */ ++[398] = { 2, TM, SEN(io_setup), "io_setup" }, ++[399] = { 1, TM, SEN(io_destroy), "io_destroy" }, ++[400] = { 5, 0, SEN(io_getevents_time64), "io_getevents" }, ++[401] = { 3, 0, SEN(io_submit), "io_submit" }, ++[402] = { 3, 0, SEN(io_cancel), "io_cancel" }, ++[403 ... 404] = { }, ++[405] = { 1, TP|SE, SEN(exit), "exit_group" }, ++[406] = { 3, 0, SEN(lookup_dcookie), "lookup_dcookie" }, ++[407] = { 1, TD, SEN(epoll_create), "epoll_create" }, ++[408] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" }, ++[409] = { 4, TD, SEN(epoll_wait), "epoll_wait" }, ++[410] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, ++[411] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, ++[412] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, ++[413] = { 4, TD, SEN(fadvise64), "fadvise64" }, ++[414] = { 3, 0, SEN(timer_create), "timer_create" }, ++[415] = { 4, 0, SEN(timer_settime64), "timer_settime" }, ++[416] = { 2, 0, SEN(timer_gettime64), "timer_gettime" }, ++[417] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, ++[418] = { 1, 0, SEN(timer_delete), "timer_delete" }, ++[419] = { 2, TCL, SEN(clock_settime64), "clock_settime" }, ++[420] = { 2, TCL, SEN(clock_gettime64), "clock_gettime" }, ++[421] = { 2, TCL, SEN(clock_getres_time64), "clock_getres" }, ++[422] = { 4, 0, SEN(clock_nanosleep_time64), "clock_nanosleep" }, ++[423] = { 4, TI, SEN(semtimedop_time64), "semtimedop" }, ++[424] = { 3, TS|TP, SEN(tgkill), "tgkill" }, ++[425] = { 2, TF|TST|TSTA, SEN(stat64), "stat64" }, ++[426] = { 2, TF|TLST|TSTA, SEN(lstat64), "lstat64" }, ++[427] = { 2, TD|TFST|TSTA, SEN(fstat64), "fstat64" }, ++[428] = { 5, 0, SEN(vserver), "vserver" }, /* not implemented */ ++[429] = { 6, TM, SEN(mbind), "mbind" }, /* not implemented */ ++[430] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, /* not implemented */ ++[431] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, /* not implemented */ ++[432] = { 4, TD, SEN(mq_open), "mq_open" }, ++[433] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, ++[434] = { 5, TD, SEN(mq_timedsend_time64), "mq_timedsend" }, ++[435] = { 5, TD, SEN(mq_timedreceive_time64), "mq_timedreceive" }, ++[436] = { 2, TD, SEN(mq_notify), "mq_notify" }, ++[437] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" }, ++[438] = { 5, TP, SEN(waitid), "waitid" }, ++[439] = { 5, 0, SEN(add_key), "add_key" }, ++[440] = { 4, 0, SEN(request_key), "request_key" }, ++[441] = { 5, 0, SEN(keyctl), "keyctl" }, ++[442] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, ++[443] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, ++[444] = { 0, TD, SEN(inotify_init), "inotify_init" }, ++[445] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" }, ++[446] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, ++[447] = { 1, TD, SEN(fdatasync), "fdatasync" }, ++[448] = { 4, 0, SEN(kexec_load), "kexec_load" }, ++[449] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, ++[450] = { 4, TD|TF, SEN(openat), "openat" }, ++[451] = { 3, TD|TF, SEN(mkdirat), "mkdirat" }, ++[452] = { 4, TD|TF, SEN(mknodat), "mknodat" }, ++[453] = { 5, TD|TF, SEN(fchownat), "fchownat" }, ++[454] = { 3, TD|TF, SEN(futimesat), "futimesat" }, ++[455] = { 4, TD|TF|TFST|TSTA,SEN(fstatat64), "fstatat64" }, ++[456] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, ++[457] = { 4, TD|TF, SEN(renameat), "renameat" }, ++[458] = { 5, TD|TF, SEN(linkat), "linkat" }, ++[459] = { 3, TD|TF, SEN(symlinkat), "symlinkat" }, ++[460] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, ++[461] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, ++[462] = { 3, TD|TF, SEN(faccessat), "faccessat" }, ++[463] = { 6, TD, SEN(pselect6_time64), "pselect6" }, ++[464] = { 5, TD, SEN(ppoll_time64), "ppoll" }, ++[465] = { 1, 0, SEN(unshare), "unshare" }, ++[466] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, ++[467] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, ++[468] = { 6, TD, SEN(splice), "splice" }, ++[469] = { 4, TD, SEN(sync_file_range), "sync_file_range" }, ++[470] = { 4, TD, SEN(tee), "tee" }, ++[471] = { 4, TD, SEN(vmsplice), "vmsplice" }, ++[472] = { 6, TM, SEN(move_pages), "move_pages" }, ++[473] = { 3, 0, SEN(getcpu), "getcpu" }, ++[474] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, ++[475] = { 4, TD|TF, SEN(utimensat_time64), "utimensat" }, ++[476] = { 3, TD|TS, SEN(signalfd), "signalfd" }, ++[477] = { 4, TD, SEN(timerfd), "timerfd" }, /* not implemented */ ++[478] = { 1, TD, SEN(eventfd), "eventfd" }, ++[479] = { 5, TN, SEN(recvmmsg_time64), "recvmmsg" }, ++[480] = { 4, TD, SEN(fallocate), "fallocate" }, ++[481] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, ++[482] = { 4, TD, SEN(timerfd_settime64), "timerfd_settime" }, ++[483] = { 2, TD, SEN(timerfd_gettime64), "timerfd_gettime" }, ++[484] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, ++[485] = { 2, TD, SEN(eventfd2), "eventfd2" }, ++[486] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, ++[487] = { 3, TD, SEN(dup3), "dup3" }, ++[488] = { 2, TD, SEN(pipe2), "pipe2" }, ++[489] = { 1, TD, SEN(inotify_init1), "inotify_init1" }, ++[490] = { 4, TD, SEN(preadv), "preadv" }, ++[491] = { 4, TD, SEN(pwritev), "pwritev" }, ++[492] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, ++[493] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, ++[494] = { 2, TD, SEN(fanotify_init), "fanotify_init" }, ++[495] = { 5, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, ++[496] = { 4, 0, SEN(prlimit64), "prlimit64" }, ++[497] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, ++[498] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, ++[499] = { 2, TCL, SEN(clock_adjtime64), "clock_adjtime" }, ++[500] = { 1, TD, SEN(syncfs), "syncfs" }, ++[501] = { 2, TD, SEN(setns), "setns" }, ++[502] = { 4, TN, SEN(accept4), "accept4" }, ++[503] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, ++[504] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" }, ++[505] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" }, ++[506] = { 5, 0, SEN(kcmp), "kcmp" }, ++[507] = { 3, TD, SEN(finit_module), "finit_module" }, ++[508] = { 3, 0, SEN(sched_setattr), "sched_setattr" }, ++[509] = { 4, 0, SEN(sched_getattr), "sched_getattr" }, ++[510] = { 5, TD|TF, SEN(renameat2), "renameat2" }, ++[511] = { 3, 0, SEN(getrandom), "getrandom" }, ++[512] = { 2, TD, SEN(memfd_create), "memfd_create" }, ++[513] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" }, ++[514] = { 3, 0, SEN(seccomp), "seccomp" }, ++[515] = { 3, TD, SEN(bpf), "bpf" }, ++[516] = { 1, TD, SEN(userfaultfd), "userfaultfd" }, ++[517] = { 3, 0, SEN(membarrier), "membarrier" }, ++[518] = { 3, TM, SEN(mlock2), "mlock2" }, ++[519] = { 6, TD, SEN(copy_file_range), "copy_file_range" }, ++[520] = { 6, TD, SEN(preadv2), "preadv2" }, ++[521] = { 6, TD, SEN(pwritev2), "pwritev2" }, ++[522] = { 5, TD|TF|TFST|TSTA,SEN(statx), "statx" }, ++[523] = { 6, 0, SEN(io_pgetevents_time64), "io_pgetevents" }, ++[524] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" }, ++[525] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" }, ++[526] = { 1, 0, SEN(pkey_free), "pkey_free" }, ++[527] = { 4, 0, SEN(rseq), "rseq" }, ++[528] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" }, ++[529] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" }, ++[530] = { 0, TC|PU|NF, SEN(getegid), "getegid" }, ++[531] = { 0, TC|PU|NF, SEN(geteuid), "geteuid" }, ++[532] = { 0, PU|NF, SEN(getppid), "getppid" }, ++/* all other architectures have common numbers for new syscalls, alpha is the exception */ ++/* 534 - 424 == 110 */ ++#define BASE_NR 110 ++#include "syscallent-common.h" ++#undef BASE_NR +diff --git a/src/linux/sw_64/userent.h b/src/linux/sw_64/userent.h +new file mode 100644 +index 0000000..f5f5e50 +--- /dev/null ++++ b/src/linux/sw_64/userent.h +@@ -0,0 +1,74 @@ ++/* ++ * Copyright (c) 2014-2021 The strace developers. ++ * All rights reserved. ++ * ++ * SPDX-License-Identifier: LGPL-2.1-or-later ++ */ ++ ++{ 0, "r0" }, ++{ 1, "r1" }, ++{ 2, "r2" }, ++{ 3, "r3" }, ++{ 4, "r4" }, ++{ 5, "r5" }, ++{ 6, "r6" }, ++{ 7, "r7" }, ++{ 8, "r8" }, ++{ 9, "r9" }, ++{ 10, "r10" }, ++{ 11, "r11" }, ++{ 12, "r12" }, ++{ 13, "r13" }, ++{ 14, "r14" }, ++{ 15, "r15" }, ++{ 16, "r16" }, ++{ 17, "r17" }, ++{ 18, "r18" }, ++{ 19, "r19" }, ++{ 20, "r20" }, ++{ 21, "r21" }, ++{ 22, "r22" }, ++{ 23, "r23" }, ++{ 24, "r24" }, ++{ 25, "r25" }, ++{ 26, "r26" }, ++{ 27, "r27" }, ++{ 28, "r28" }, ++{ 29, "gp" }, ++{ 30, "fp" }, ++{ 31, "zero" }, ++{ 32, "fp0" }, ++{ 33, "fp" }, ++{ 34, "fp2" }, ++{ 35, "fp3" }, ++{ 36, "fp4" }, ++{ 37, "fp5" }, ++{ 38, "fp6" }, ++{ 39, "fp7" }, ++{ 40, "fp8" }, ++{ 41, "fp9" }, ++{ 42, "fp10" }, ++{ 43, "fp11" }, ++{ 44, "fp12" }, ++{ 45, "fp13" }, ++{ 46, "fp14" }, ++{ 47, "fp15" }, ++{ 48, "fp16" }, ++{ 49, "fp17" }, ++{ 50, "fp18" }, ++{ 51, "fp19" }, ++{ 52, "fp20" }, ++{ 53, "fp21" }, ++{ 54, "fp22" }, ++{ 55, "fp23" }, ++{ 56, "fp24" }, ++{ 57, "fp25" }, ++{ 58, "fp26" }, ++{ 59, "fp27" }, ++{ 60, "fp28" }, ++{ 61, "fp29" }, ++{ 62, "fp30" }, ++{ 63, "fp31" }, ++{ 64, "pc" }, ++/* Other fields in "struct user" */ ++#include "userent0.h" +diff --git a/src/print_timeval.c b/src/print_timeval.c +index 3bba62a..c59d7ac 100644 +--- a/src/print_timeval.c ++++ b/src/print_timeval.c +@@ -118,7 +118,7 @@ MPERS_PRINTER_DECL(int, print_itimerval, + return 0; + } + +-#ifdef ALPHA ++#if defined ALPHA || defined SW_64 + + void + print_timeval32_t(const timeval32_t *t) +diff --git a/src/printrusage.c b/src/printrusage.c +index f83fe10..ab8f164 100644 +--- a/src/printrusage.c ++++ b/src/printrusage.c +@@ -69,7 +69,7 @@ MPERS_PRINTER_DECL(void, printrusage, + tprint_struct_end(); + } + +-#ifdef ALPHA ++#if defined ALPHA || defined SW_64 + void + printrusage32(struct tcb *const tcp, const kernel_ulong_t addr) + { +diff --git a/src/resource.c b/src/resource.c +index 090b6a0..79bfa2d 100644 +--- a/src/resource.c ++++ b/src/resource.c +@@ -180,7 +180,7 @@ SYS_FUNC(getrusage) + return 0; + } + +-#ifdef ALPHA ++#if defined ALPHA || defined SW_64 + SYS_FUNC(osf_getrusage) + { + if (entering(tcp)) { +diff --git a/src/signal.c b/src/signal.c +index 98f84d5..ad28327 100644 +--- a/src/signal.c ++++ b/src/signal.c +@@ -297,7 +297,7 @@ struct old_sigaction { + unsigned int sa_flags; + unsigned long sa_handler__; + unsigned long sa_mask; +-#elif defined ALPHA ++#elif defined ALPHA || defined SW_64 + unsigned long sa_handler__; + unsigned long sa_mask; + unsigned int sa_flags; +@@ -308,7 +308,7 @@ struct old_sigaction { + unsigned long sa_restorer; + #endif + } +-#ifdef ALPHA ++#if defined ALPHA || defined SW_64 + ATTRIBUTE_PACKED + #endif + ; +@@ -347,7 +347,7 @@ decode_old_sigaction(struct tcb *const tcp, const kernel_ulong_t addr) + PRINT_FIELD_OBJ_VAL(sa, sa_mask, tprint_old_sigmask_val); + tprint_struct_next(); + PRINT_FIELD_FLAGS(sa, sa_flags, sigact_flags, "SA_???"); +-#if !(defined ALPHA || defined MIPS) ++#if !(defined ALPHA || defined SW_64 || defined MIPS) + if (sa.sa_flags & 0x04000000U) { + tprint_struct_next(); + PRINT_FIELD_OBJ_VAL(sa, sa_restorer, printaddr); +@@ -419,7 +419,7 @@ SYS_FUNC(sigsuspend) + return RVAL_DECODED; + } + +-#ifdef ALPHA ++#if defined ALPHA || defined SW_64 + /* + * The OSF/1 sigprocmask is different: it doesn't pass in two pointers, + * but rather passes in the new bitmask as an argument and then returns +@@ -643,7 +643,7 @@ SYS_FUNC(rt_sigaction) + + /* sigsetsize */ + PRINT_VAL_U(tcp->u_arg[4]); +-#elif defined(ALPHA) ++#elif defined(ALPHA) || defined(SW_64) + /* sigsetsize */ + PRINT_VAL_U(tcp->u_arg[3]); + tprint_arg_next(); +diff --git a/src/sw_64.c b/src/sw_64.c +new file mode 100644 +index 0000000..5498702 +--- /dev/null ++++ b/src/sw_64.c +@@ -0,0 +1,78 @@ ++/* ++ * Copyright (c) 2016 Dmitry V. Levin ++ * Copyright (c) 2016-2021 The strace developers. ++ * All rights reserved. ++ * ++ * SPDX-License-Identifier: LGPL-2.1-or-later ++ */ ++ ++#include "defs.h" ++ ++#ifdef SW_64 ++ ++# include "xstring.h" ++ ++static int ++decode_getxxid(struct tcb *tcp, const char *what) ++{ ++ if (entering(tcp)) ++ return 0; ++ ++ long rval = getrval2(tcp); ++ if (rval == -1) ++ return 0; ++ static const char const fmt[] = "%s %ld"; ++ static char outstr[sizeof(fmt) + 3 * sizeof(rval)]; ++ xsprintf(outstr, fmt, what, rval); ++ tcp->auxstr = outstr; ++ return RVAL_STR; ++} ++ ++SYS_FUNC(getxpid) ++{ ++ return decode_getxxid(tcp, "ppid"); ++} ++ ++SYS_FUNC(getxuid) ++{ ++ return decode_getxxid(tcp, "euid"); ++} ++ ++SYS_FUNC(getxgid) ++{ ++ return decode_getxxid(tcp, "egid"); ++} ++ ++SYS_FUNC(osf_statfs) ++{ ++ /* pathname */ ++ printpath(tcp, tcp->u_arg[0]); ++ tprint_arg_next(); ++ ++ /* buf */ ++ printaddr(tcp->u_arg[1]); ++ tprint_arg_next(); ++ ++ /* size */ ++ PRINT_VAL_U(tcp->u_arg[2]); ++ ++ return RVAL_DECODED; ++} ++ ++SYS_FUNC(osf_fstatfs) ++{ ++ /* fd */ ++ printfd(tcp, tcp->u_arg[0]); ++ tprint_arg_next(); ++ ++ /* buf */ ++ printaddr(tcp->u_arg[1]); ++ tprint_arg_next(); ++ ++ /* size */ ++ PRINT_VAL_U(tcp->u_arg[2]); ++ ++ return RVAL_DECODED; ++} ++ ++#endif /* SW_64 */ +diff --git a/src/syscall_dummy.h b/src/syscall_dummy.h +index 96e8d0f..a04b938 100644 +--- a/src/syscall_dummy.h ++++ b/src/syscall_dummy.h +@@ -33,7 +33,7 @@ + # define sys_get_thread_area printargs + # endif + +-# ifdef ALPHA ++# if defined ALPHA || defined SW_64 + # define sys_getdtablesize printargs + # endif + +diff --git a/src/time.c b/src/time.c +index 2b0ded5..223eb65 100644 +--- a/src/time.c ++++ b/src/time.c +@@ -55,7 +55,7 @@ SYS_FUNC(settimeofday) + } + #endif + +-#ifdef ALPHA ++#if defined ALPHA || defined SW_64 + SYS_FUNC(osf_gettimeofday) + { + if (exiting(tcp)) { +@@ -70,7 +70,7 @@ SYS_FUNC(osf_gettimeofday) + } + #endif + +-#ifdef ALPHA ++#if defined ALPHA || defined SW_64 + SYS_FUNC(osf_settimeofday) + { + /* tv */ +@@ -141,7 +141,7 @@ SYS_FUNC(getitimer) + return 0; + } + +-#ifdef ALPHA ++#if defined ALPHA || defined SW_64 + SYS_FUNC(osf_getitimer) + { + if (entering(tcp)) { +@@ -173,7 +173,7 @@ SYS_FUNC(setitimer) + return 0; + } + +-#ifdef ALPHA ++#if defined ALPHA || defined SW_64 + SYS_FUNC(osf_setitimer) + { + if (entering(tcp)) { +diff --git a/src/utimes.c b/src/utimes.c +index a14809d..397907f 100644 +--- a/src/utimes.c ++++ b/src/utimes.c +@@ -75,7 +75,7 @@ SYS_FUNC(utimensat_time64) + return do_utimensat(tcp, print_timespec64_utime_pair); + } + +-#ifdef ALPHA ++#if defined ALPHA || defined SW_64 + SYS_FUNC(osf_utimes) + { + /* pathname */ +diff --git a/src/wait.c b/src/wait.c +index 1f04e83..2e5cfc7 100644 +--- a/src/wait.c ++++ b/src/wait.c +@@ -130,7 +130,7 @@ SYS_FUNC(wait4) + } + #endif + +-#ifdef ALPHA ++#if defined ALPHA || defined SW_64 + SYS_FUNC(osf_wait4) + { + return printwaitn(tcp, printrusage32); +diff --git a/src/xlat/audit_arch.h b/src/xlat/audit_arch.h +index db085b8..ed00ec4 100644 +--- a/src/xlat/audit_arch.h ++++ b/src/xlat/audit_arch.h +@@ -19,6 +19,13 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else + # define AUDIT_ARCH_AARCH64 (EM_AARCH64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) + #endif ++#if defined(AUDIT_ARCH_SW_64) || (defined(HAVE_DECL_AUDIT_ARCH_SW_64) && HAVE_DECL_AUDIT_ARCH_SW_64) ++DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE ++static_assert((AUDIT_ARCH_SW_64) == ((EM_SW_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)), "AUDIT_ARCH_SW_64 != (EM_SW_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)"); ++DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE ++#else ++# define AUDIT_ARCH_SW_64 (EM_SW_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) ++#endif + #if defined(AUDIT_ARCH_ALPHA) || (defined(HAVE_DECL_AUDIT_ARCH_ALPHA) && HAVE_DECL_AUDIT_ARCH_ALPHA) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((AUDIT_ARCH_ALPHA) == ((EM_ALPHA|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)), "AUDIT_ARCH_ALPHA != (EM_ALPHA|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)"); +@@ -570,6 +577,9 @@ static const struct xlat_data audit_arch_xdata[] = { + XLAT(AUDIT_ARCH_XTENSA), + #define XLAT_VAL_53 ((unsigned) (AUDIT_ARCH_XTENSA)) + #define XLAT_STR_53 STRINGIFY(AUDIT_ARCH_XTENSA) ++ XLAT(AUDIT_ARCH_SW_64), ++ #define XLAT_VAL_54 ((unsigned) (AUDIT_ARCH_SW_64)) ++ #define XLAT_STR_54 STRINGIFY(AUDIT_ARCH_SW_64) + }; + const struct xlat audit_arch[1] = { { + .data = audit_arch_xdata, +diff --git a/src/xlat/audit_arch.in b/src/xlat/audit_arch.in +index 0760eb7..b3ce391 100644 +--- a/src/xlat/audit_arch.in ++++ b/src/xlat/audit_arch.in +@@ -10,6 +10,7 @@ + + AUDIT_ARCH_AARCH64 (EM_AARCH64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) + AUDIT_ARCH_ALPHA (EM_ALPHA|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) ++AUDIT_ARCH_SW_64 (EM_SW_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) + AUDIT_ARCH_ARCOMPACT (EM_ARCOMPACT|__AUDIT_ARCH_LE) + AUDIT_ARCH_ARCOMPACTBE (EM_ARCOMPACT) + AUDIT_ARCH_ARCV2 (EM_ARCV2|__AUDIT_ARCH_LE) +diff --git a/src/xlat/elf_em.h b/src/xlat/elf_em.h +index 764c123..db1310a 100644 +--- a/src/xlat/elf_em.h ++++ b/src/xlat/elf_em.h +@@ -3080,6 +3080,13 @@ static_assert((unsigned long long) (EM_OR32) + #undef XLAT_PREV_VAL + #define XLAT_PREV_VAL (EM_OR32) + #endif ++#if defined(EM_SW_64) || (defined(HAVE_DECL_EM_SW_64) && HAVE_DECL_EM_SW_64) ++DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE ++static_assert((EM_SW_64) == (0x9916), "EM_SW_64 != 0x9916"); ++DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE ++#else ++# define EM_SW_64 0x9916 ++#endif + #if defined(EM_ALPHA) || (defined(HAVE_DECL_EM_ALPHA) && HAVE_DECL_EM_ALPHA) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((EM_ALPHA) == (0x9026), "EM_ALPHA != 0x9026"); +@@ -3768,6 +3775,9 @@ static const struct xlat_data elf_em_xdata[] = { + XLAT(EM_OR32), + #define XLAT_VAL_180 ((unsigned) (EM_OR32)) + #define XLAT_STR_180 STRINGIFY(EM_OR32) ++ XLAT(EM_SW_64), ++ #define XLAT_VAL_180 ((unsigned) (EM_SW_64)) ++ #define XLAT_STR_180 STRINGIFY(EM_SW_64) + XLAT(EM_ALPHA), + #define XLAT_VAL_181 ((unsigned) (EM_ALPHA)) + #define XLAT_STR_181 STRINGIFY(EM_ALPHA) +diff --git a/src/xlat/elf_em.in b/src/xlat/elf_em.in +index 6d9bf80..fb8bc49 100644 +--- a/src/xlat/elf_em.in ++++ b/src/xlat/elf_em.in +@@ -31,6 +31,7 @@ EM_RH32 38 /* TRW RH-32 */ + EM_RCE 39 /* Motorola RCE */ + EM_ARM 40 /* ARM 32-bit architecture */ + /* EM_ALPHA 41 - Digital Alpha */ ++/* EM_SW_64 41 - Digital Sw_64 */ + EM_SH 42 /* Hitachi SH */ + EM_SPARCV9 43 /* SPARC Version 9 */ + EM_TRICORE 44 /* Siemens TriCore embedded processor */ +@@ -195,6 +196,7 @@ EM_AVR32 0x18ad /* Atmel AVR32, removed in v4.12-rc1~159^2~5 */ + EM_FRV 0x5441 /* Fujitsu FR-V */ + EM_OR32 0x8472 /* arch/openrisc/include/uapi/asm/elf.h */ + EM_ALPHA 0x9026 /* "This is an interim value that we will use until the committee comes up with a final number."; see also 41 */ ++EM_SW_64 0x9916 /* "This is an interim value that we will use until the committee comes up with a final number."; see also 41 */ + EM_CYGNUS_M32R 0x9041 /* Bogus old m32r magic number, used by old tools. */ + EM_CYGNUS_V850 0x9080 /* Bogus old v850 magic number, used by old tools, removed in v4.6-rc1~95^2~36 */ + EM_S390_OLD 0xa390 /* This is the old interim value for S/390 architecture */ +diff --git a/src/xlat/madvise_cmds.h b/src/xlat/madvise_cmds.h +index ec2be99..f036292 100644 +--- a/src/xlat/madvise_cmds.h ++++ b/src/xlat/madvise_cmds.h +@@ -71,7 +71,7 @@ static_assert((unsigned long long) (MADV_WILLNEED) + #undef XLAT_PREV_VAL + #define XLAT_PREV_VAL (MADV_WILLNEED) + #endif +-#if defined __alpha__ ++#if defined __alpha__ || defined __sw_64__ + #if defined(MADV_DONTNEED) || (defined(HAVE_DECL_MADV_DONTNEED) && HAVE_DECL_MADV_DONTNEED) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((MADV_DONTNEED) == (6), "MADV_DONTNEED != 6"); +@@ -320,7 +320,7 @@ static const struct xlat_data madvise_cmds_xdata[] = { + #define XLAT_VAL_3 ((unsigned) (MADV_WILLNEED)) + #define XLAT_STR_3 STRINGIFY(MADV_WILLNEED) + +-#if defined __alpha__ ++#if defined __alpha__ || defined __sw_64__ + XLAT(MADV_DONTNEED), + #define XLAT_VAL_4 ((unsigned) (MADV_DONTNEED)) + #define XLAT_STR_4 STRINGIFY(MADV_DONTNEED) +diff --git a/src/xlat/madvise_cmds.in b/src/xlat/madvise_cmds.in +index decae9b..2ef5082 100644 +--- a/src/xlat/madvise_cmds.in ++++ b/src/xlat/madvise_cmds.in +@@ -4,7 +4,7 @@ MADV_RANDOM 1 + MADV_SEQUENTIAL 2 + MADV_WILLNEED 3 + +-#if defined __alpha__ ++#if defined __alpha__ || defined __sw_64__ + MADV_DONTNEED 6 + #else + MADV_DONTNEED 4 +diff --git a/src/xlat/mlockall_flags.h b/src/xlat/mlockall_flags.h +index afad90e..ce12ff0 100644 +--- a/src/xlat/mlockall_flags.h ++++ b/src/xlat/mlockall_flags.h +@@ -3,7 +3,7 @@ + #include "gcc_compat.h" + #include "static_assert.h" + +-#if defined __alpha__ || defined __powerpc__ || defined __powerpc64__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __powerpc__ || defined __powerpc64__ || defined __sparc__ + #if defined(MCL_CURRENT) || (defined(HAVE_DECL_MCL_CURRENT) && HAVE_DECL_MCL_CURRENT) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((MCL_CURRENT) == (0x2000), "MCL_CURRENT != 0x2000"); +@@ -60,7 +60,7 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + + DIAG_PUSH_IGNORE_TAUTOLOGICAL_CONSTANT_COMPARE + static const struct xlat_data mlockall_flags_xdata[] = { +-#if defined __alpha__ || defined __powerpc__ || defined __powerpc64__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __powerpc__ || defined __powerpc64__ || defined __sparc__ + XLAT(MCL_CURRENT), + #define XLAT_VAL_0 ((unsigned) (MCL_CURRENT)) + #define XLAT_STR_0 STRINGIFY(MCL_CURRENT) +diff --git a/src/xlat/mlockall_flags.in b/src/xlat/mlockall_flags.in +index d9ad7af..9bdc21b 100644 +--- a/src/xlat/mlockall_flags.in ++++ b/src/xlat/mlockall_flags.in +@@ -1,4 +1,4 @@ +-#if defined __alpha__ || defined __powerpc__ || defined __powerpc64__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __powerpc__ || defined __powerpc64__ || defined __sparc__ + MCL_CURRENT 0x2000 + MCL_FUTURE 0x4000 + MCL_ONFAULT 0x8000 +diff --git a/src/xlat/mmap_flags.h b/src/xlat/mmap_flags.h +index 564d532..530da03 100644 +--- a/src/xlat/mmap_flags.h ++++ b/src/xlat/mmap_flags.h +@@ -32,7 +32,7 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else + # define MAP_FIXED 0x4 + #endif +-#elif defined __alpha__ ++#elif defined __alpha__ || defined __sw_64__ + #if defined(MAP_FIXED) || (defined(HAVE_DECL_MAP_FIXED) && HAVE_DECL_MAP_FIXED) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((MAP_FIXED) == (0x100), "MAP_FIXED != 0x100"); +@@ -49,7 +49,7 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + # define MAP_FIXED 0x10 + #endif + #endif +-#if defined __alpha__ || defined __hppa__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ + #if defined(MAP_ANONYMOUS) || (defined(HAVE_DECL_MAP_ANONYMOUS) && HAVE_DECL_MAP_ANONYMOUS) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((MAP_ANONYMOUS) == (0x10), "MAP_ANONYMOUS != 0x10"); +@@ -126,7 +126,7 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else + # define MAP_NORESERVE 0x400 + #endif +-#elif defined __alpha__ ++#elif defined __alpha__ || defined __sw_64__ + #if defined(MAP_NORESERVE) || (defined(HAVE_DECL_MAP_NORESERVE) && HAVE_DECL_MAP_NORESERVE) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((MAP_NORESERVE) == (0x10000), "MAP_NORESERVE != 0x10000"); +@@ -151,7 +151,7 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else + # define MAP_POPULATE 0x10000 + #endif +-#elif defined __alpha__ ++#elif defined __alpha__ || defined __sw_64__ + #if defined(MAP_POPULATE) || (defined(HAVE_DECL_MAP_POPULATE) && HAVE_DECL_MAP_POPULATE) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((MAP_POPULATE) == (0x20000), "MAP_POPULATE != 0x20000"); +@@ -176,7 +176,7 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else + # define MAP_NONBLOCK 0x20000 + #endif +-#elif defined __alpha__ ++#elif defined __alpha__ || defined __sw_64__ + #if defined(MAP_NONBLOCK) || (defined(HAVE_DECL_MAP_NONBLOCK) && HAVE_DECL_MAP_NONBLOCK) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((MAP_NONBLOCK) == (0x40000), "MAP_NONBLOCK != 0x40000"); +@@ -211,7 +211,7 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else + # define MAP_GROWSDOWN 0x200 + #endif +-#elif defined __alpha__ || defined __mips__ || defined __xtensa__ ++#elif defined __alpha__ || defined __sw_64__ || defined __mips__ || defined __xtensa__ + #if defined(MAP_GROWSDOWN) || (defined(HAVE_DECL_MAP_GROWSDOWN) && HAVE_DECL_MAP_GROWSDOWN) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((MAP_GROWSDOWN) == (0x1000), "MAP_GROWSDOWN != 0x1000"); +@@ -246,7 +246,7 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #endif + #else + #endif +-#if defined __alpha__ || defined __mips__ || defined __xtensa__ ++#if defined __alpha__ || defined __sw_64__ || defined __mips__ || defined __xtensa__ + #if defined(MAP_DENYWRITE) || (defined(HAVE_DECL_MAP_DENYWRITE) && HAVE_DECL_MAP_DENYWRITE) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((MAP_DENYWRITE) == (0x2000), "MAP_DENYWRITE != 0x2000"); +@@ -263,7 +263,7 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + # define MAP_DENYWRITE 0x800 + #endif + #endif +-#if defined __alpha__ || defined __mips__ || defined __xtensa__ ++#if defined __alpha__ || defined __sw_64__ || defined __mips__ || defined __xtensa__ + #if defined(MAP_EXECUTABLE) || (defined(HAVE_DECL_MAP_EXECUTABLE) && HAVE_DECL_MAP_EXECUTABLE) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((MAP_EXECUTABLE) == (0x4000), "MAP_EXECUTABLE != 0x4000"); +@@ -290,7 +290,7 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #endif + #else + #endif +-#if defined __alpha__ ++#if defined __alpha__ || defined __sw_64__ + #if defined(_MAP_INHERIT) || (defined(HAVE_DECL__MAP_INHERIT) && HAVE_DECL__MAP_INHERIT) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((_MAP_INHERIT) == (0x400), "_MAP_INHERIT != 0x400"); +@@ -323,7 +323,7 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else + # define MAP_LOCKED 0x100 + #endif +-#elif defined __alpha__ || defined __mips__ || defined __xtensa__ ++#elif defined __alpha__ || defined __sw_64__ || defined __mips__ || defined __xtensa__ + #if defined(MAP_LOCKED) || (defined(HAVE_DECL_MAP_LOCKED) && HAVE_DECL_MAP_LOCKED) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((MAP_LOCKED) == (0x8000), "MAP_LOCKED != 0x8000"); +@@ -340,7 +340,7 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + # define MAP_LOCKED 0x2000 + #endif + #endif +-#if defined __alpha__ ++#if defined __alpha__ || defined __sw_64__ + #if defined(_MAP_HASSEMAPHORE) || (defined(HAVE_DECL__MAP_HASSEMAPHORE) && HAVE_DECL__MAP_HASSEMAPHORE) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((_MAP_HASSEMAPHORE) == (0x200), "_MAP_HASSEMAPHORE != 0x200"); +@@ -358,7 +358,7 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else + # define MAP_STACK 0x40000 + #endif +-#elif defined __alpha__ ++#elif defined __alpha__ || defined __sw_64__ + #if defined(MAP_STACK) || (defined(HAVE_DECL_MAP_STACK) && HAVE_DECL_MAP_STACK) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((MAP_STACK) == (0x80000), "MAP_STACK != 0x80000"); +@@ -383,7 +383,7 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else + # define MAP_HUGETLB 0x80000 + #endif +-#elif defined __alpha__ ++#elif defined __alpha__ || defined __sw_64__ + #if defined(MAP_HUGETLB) || (defined(HAVE_DECL_MAP_HUGETLB) && HAVE_DECL_MAP_HUGETLB) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((MAP_HUGETLB) == (0x100000), "MAP_HUGETLB != 0x100000"); +@@ -420,7 +420,7 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else + # define MAP_UNINITIALIZED 0x4000000 + #endif +-#if defined __alpha__ ++#if defined __alpha__ || defined __sw_64__ + #if defined(MAP_FIXED_NOREPLACE) || (defined(HAVE_DECL_MAP_FIXED_NOREPLACE) && HAVE_DECL_MAP_FIXED_NOREPLACE) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((MAP_FIXED_NOREPLACE) == (0x200000), "MAP_FIXED_NOREPLACE != 0x200000"); +@@ -467,7 +467,7 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #endif + #else + #endif +-#if defined __alpha__ ++#if defined __alpha__ || defined __sw_64__ + #if defined(_MAP_UNALIGNED) || (defined(HAVE_DECL__MAP_UNALIGNED) && HAVE_DECL__MAP_UNALIGNED) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((_MAP_UNALIGNED) == (0x800), "_MAP_UNALIGNED != 0x800"); +@@ -507,7 +507,7 @@ static const struct xlat_data mmap_flags_xdata[] = { + XLAT(MAP_FIXED), + #define XLAT_VAL_3 ((unsigned) (MAP_FIXED)) + #define XLAT_STR_3 STRINGIFY(MAP_FIXED) +-#elif defined __alpha__ ++#elif defined __alpha__ || defined __sw_64__ + XLAT(MAP_FIXED), + #define XLAT_VAL_4 ((unsigned) (MAP_FIXED)) + #define XLAT_STR_4 STRINGIFY(MAP_FIXED) +@@ -517,7 +517,7 @@ static const struct xlat_data mmap_flags_xdata[] = { + #define XLAT_STR_5 STRINGIFY(MAP_FIXED) + #endif + +-#if defined __alpha__ || defined __hppa__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ + XLAT(MAP_ANONYMOUS), + #define XLAT_VAL_6 ((unsigned) (MAP_ANONYMOUS)) + #define XLAT_STR_6 STRINGIFY(MAP_ANONYMOUS) +@@ -584,7 +584,7 @@ static const struct xlat_data mmap_flags_xdata[] = { + XLAT(MAP_NORESERVE), + #define XLAT_VAL_16 ((unsigned) (MAP_NORESERVE)) + #define XLAT_STR_16 STRINGIFY(MAP_NORESERVE) +-#elif defined __alpha__ ++#elif defined __alpha__ || defined __sw_64__ + XLAT(MAP_NORESERVE), + #define XLAT_VAL_17 ((unsigned) (MAP_NORESERVE)) + #define XLAT_STR_17 STRINGIFY(MAP_NORESERVE) +@@ -598,7 +598,7 @@ static const struct xlat_data mmap_flags_xdata[] = { + XLAT(MAP_POPULATE), + #define XLAT_VAL_19 ((unsigned) (MAP_POPULATE)) + #define XLAT_STR_19 STRINGIFY(MAP_POPULATE) +-#elif defined __alpha__ ++#elif defined __alpha__ || defined __sw_64__ + XLAT(MAP_POPULATE), + #define XLAT_VAL_20 ((unsigned) (MAP_POPULATE)) + #define XLAT_STR_20 STRINGIFY(MAP_POPULATE) +@@ -612,7 +612,7 @@ static const struct xlat_data mmap_flags_xdata[] = { + XLAT(MAP_NONBLOCK), + #define XLAT_VAL_22 ((unsigned) (MAP_NONBLOCK)) + #define XLAT_STR_22 STRINGIFY(MAP_NONBLOCK) +-#elif defined __alpha__ ++#elif defined __alpha__ || defined __sw_64__ + XLAT(MAP_NONBLOCK), + #define XLAT_VAL_23 ((unsigned) (MAP_NONBLOCK)) + #define XLAT_STR_23 STRINGIFY(MAP_NONBLOCK) +@@ -664,7 +664,7 @@ static const struct xlat_data mmap_flags_xdata[] = { + #endif + #endif + +-#if defined __alpha__ || defined __mips__ || defined __xtensa__ ++#if defined __alpha__ || defined __sw_64__ || defined __mips__ || defined __xtensa__ + XLAT(MAP_DENYWRITE), + #define XLAT_VAL_33 ((unsigned) (MAP_DENYWRITE)) + #define XLAT_STR_33 STRINGIFY(MAP_DENYWRITE) +@@ -674,7 +674,7 @@ static const struct xlat_data mmap_flags_xdata[] = { + #define XLAT_STR_34 STRINGIFY(MAP_DENYWRITE) + #endif + +-#if defined __alpha__ || defined __mips__ || defined __xtensa__ ++#if defined __alpha__ || defined __sw_64__ || defined __mips__ || defined __xtensa__ + XLAT(MAP_EXECUTABLE), + #define XLAT_VAL_35 ((unsigned) (MAP_EXECUTABLE)) + #define XLAT_STR_35 STRINGIFY(MAP_EXECUTABLE) +@@ -696,7 +696,7 @@ static const struct xlat_data mmap_flags_xdata[] = { + #endif + #endif + +-#if defined __alpha__ ++#if defined __alpha__ || defined __sw_64__ + XLAT(_MAP_INHERIT), + #define XLAT_VAL_39 ((unsigned) (_MAP_INHERIT)) + #define XLAT_STR_39 STRINGIFY(_MAP_INHERIT) +@@ -720,7 +720,7 @@ static const struct xlat_data mmap_flags_xdata[] = { + XLAT(MAP_LOCKED), + #define XLAT_VAL_43 ((unsigned) (MAP_LOCKED)) + #define XLAT_STR_43 STRINGIFY(MAP_LOCKED) +-#elif defined __alpha__ || defined __mips__ || defined __xtensa__ ++#elif defined __alpha__ || defined __sw_64__ || defined __mips__ || defined __xtensa__ + XLAT(MAP_LOCKED), + #define XLAT_VAL_44 ((unsigned) (MAP_LOCKED)) + #define XLAT_STR_44 STRINGIFY(MAP_LOCKED) +@@ -730,7 +730,7 @@ static const struct xlat_data mmap_flags_xdata[] = { + #define XLAT_STR_45 STRINGIFY(MAP_LOCKED) + #endif + +-#if defined __alpha__ ++#if defined __alpha__ || defined __sw_64__ + XLAT(_MAP_HASSEMAPHORE), + #define XLAT_VAL_46 ((unsigned) (_MAP_HASSEMAPHORE)) + #define XLAT_STR_46 STRINGIFY(_MAP_HASSEMAPHORE) +@@ -746,7 +746,7 @@ static const struct xlat_data mmap_flags_xdata[] = { + XLAT(MAP_STACK), + #define XLAT_VAL_48 ((unsigned) (MAP_STACK)) + #define XLAT_STR_48 STRINGIFY(MAP_STACK) +-#elif defined __alpha__ ++#elif defined __alpha__ || defined __sw_64__ + XLAT(MAP_STACK), + #define XLAT_VAL_49 ((unsigned) (MAP_STACK)) + #define XLAT_STR_49 STRINGIFY(MAP_STACK) +@@ -760,7 +760,7 @@ static const struct xlat_data mmap_flags_xdata[] = { + XLAT(MAP_HUGETLB), + #define XLAT_VAL_51 ((unsigned) (MAP_HUGETLB)) + #define XLAT_STR_51 STRINGIFY(MAP_HUGETLB) +-#elif defined __alpha__ ++#elif defined __alpha__ || defined __sw_64__ + XLAT(MAP_HUGETLB), + #define XLAT_VAL_52 ((unsigned) (MAP_HUGETLB)) + #define XLAT_STR_52 STRINGIFY(MAP_HUGETLB) +@@ -786,7 +786,7 @@ static const struct xlat_data mmap_flags_xdata[] = { + #define XLAT_VAL_55 ((unsigned) (MAP_UNINITIALIZED)) + #define XLAT_STR_55 STRINGIFY(MAP_UNINITIALIZED) + +-#if defined __alpha__ ++#if defined __alpha__ || defined __sw_64__ + XLAT(MAP_FIXED_NOREPLACE), + #define XLAT_VAL_56 ((unsigned) (MAP_FIXED_NOREPLACE)) + #define XLAT_STR_56 STRINGIFY(MAP_FIXED_NOREPLACE) +@@ -832,7 +832,7 @@ static const struct xlat_data mmap_flags_xdata[] = { + #endif + #endif + +-#if defined __alpha__ ++#if defined __alpha__ || defined __sw_64__ + XLAT(_MAP_UNALIGNED), + #define XLAT_VAL_64 ((unsigned) (_MAP_UNALIGNED)) + #define XLAT_STR_64 STRINGIFY(_MAP_UNALIGNED) +diff --git a/src/xlat/mmap_flags.in b/src/xlat/mmap_flags.in +index 201bf99..175cb67 100644 +--- a/src/xlat/mmap_flags.in ++++ b/src/xlat/mmap_flags.in +@@ -8,13 +8,13 @@ MAP_SHARED_VALIDATE 0x3 + + #if defined __hppa__ + MAP_FIXED 0x4 +-#elif defined __alpha__ ++#elif defined __alpha__ || defined __sw_64__ + MAP_FIXED 0x100 + #else + MAP_FIXED 0x10 + #endif + +-#if defined __alpha__ || defined __hppa__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ + MAP_ANONYMOUS 0x10 + #elif defined __mips__ || defined __xtensa__ + MAP_ANONYMOUS 0x800 +@@ -53,7 +53,7 @@ MAP_RENAME + MAP_NORESERVE 0x40 + #elif defined __mips__ || defined __xtensa__ + MAP_NORESERVE 0x400 +-#elif defined __alpha__ ++#elif defined __alpha__ || defined __sw_64__ + MAP_NORESERVE 0x10000 + #else + MAP_NORESERVE 0x4000 +@@ -61,7 +61,7 @@ MAP_NORESERVE 0x4000 + + #if defined __hppa__ || defined __mips__ || defined __xtensa__ + MAP_POPULATE 0x10000 +-#elif defined __alpha__ ++#elif defined __alpha__ || defined __sw_64__ + MAP_POPULATE 0x20000 + #else + MAP_POPULATE 0x8000 +@@ -69,7 +69,7 @@ MAP_POPULATE 0x8000 + + #if defined __hppa__ || defined __mips__ || defined __xtensa__ + MAP_NONBLOCK 0x20000 +-#elif defined __alpha__ ++#elif defined __alpha__ || defined __sw_64__ + MAP_NONBLOCK 0x40000 + #else + MAP_NONBLOCK 0x10000 +@@ -83,7 +83,7 @@ _MAP_NEW + + #if defined __sparc__ + MAP_GROWSDOWN 0x200 +-#elif defined __alpha__ || defined __mips__ || defined __xtensa__ ++#elif defined __alpha__ || defined __sw_64__ || defined __mips__ || defined __xtensa__ + MAP_GROWSDOWN 0x1000 + #elif defined __hppa__ + MAP_GROWSDOWN 0x8000 +@@ -97,13 +97,13 @@ MAP_GROWSUP 0x200 + MAP_GROWSUP + #endif + +-#if defined __alpha__ || defined __mips__ || defined __xtensa__ ++#if defined __alpha__ || defined __sw_64__ || defined __mips__ || defined __xtensa__ + MAP_DENYWRITE 0x2000 + #else + MAP_DENYWRITE 0x800 + #endif + +-#if defined __alpha__ || defined __mips__ || defined __xtensa__ ++#if defined __alpha__ || defined __sw_64__ || defined __mips__ || defined __xtensa__ + MAP_EXECUTABLE 0x4000 + #else + MAP_EXECUTABLE 0x1000 +@@ -115,7 +115,7 @@ MAP_INHERIT 0x80 + MAP_INHERIT + #endif + +-#if defined __alpha__ ++#if defined __alpha__ || defined __sw_64__ + _MAP_INHERIT 0x400 + #else + _MAP_INHERIT +@@ -127,13 +127,13 @@ MAP_FILE 0 + MAP_LOCKED 0x80 + #elif defined __sparc__ + MAP_LOCKED 0x100 +-#elif defined __alpha__ || defined __mips__ || defined __xtensa__ ++#elif defined __alpha__ || defined __sw_64__ || defined __mips__ || defined __xtensa__ + MAP_LOCKED 0x8000 + #else + MAP_LOCKED 0x2000 + #endif + +-#if defined __alpha__ ++#if defined __alpha__ || defined __sw_64__ + _MAP_HASSEMAPHORE 0x200 + #else + _MAP_HASSEMAPHORE +@@ -141,7 +141,7 @@ _MAP_HASSEMAPHORE + + #if defined __hppa__ || defined __mips__ || defined __xtensa__ + MAP_STACK 0x40000 +-#elif defined __alpha__ ++#elif defined __alpha__ || defined __sw_64__ + MAP_STACK 0x80000 + #else + MAP_STACK 0x20000 +@@ -149,7 +149,7 @@ MAP_STACK 0x20000 + + #if defined __hppa__ || defined __mips__ || defined __xtensa__ + MAP_HUGETLB 0x80000 +-#elif defined __alpha__ ++#elif defined __alpha__ || defined __sw_64__ + MAP_HUGETLB 0x100000 + #else + MAP_HUGETLB 0x40000 +@@ -167,7 +167,7 @@ MAP_SYNC 0x80000 + #endif /* MAP_UNINITIALIZED == 0 */ + MAP_UNINITIALIZED 0x4000000 + +-#if defined __alpha__ ++#if defined __alpha__ || defined __sw_64__ + MAP_FIXED_NOREPLACE 0x200000 + #else + MAP_FIXED_NOREPLACE 0x100000 +@@ -191,7 +191,7 @@ MAP_LOCAL 0x80 + MAP_LOCAL + #endif + +-#if defined __alpha__ ++#if defined __alpha__ || defined __sw_64__ + _MAP_UNALIGNED 0x800 + #else + _MAP_UNALIGNED +diff --git a/src/xlat/resources.h b/src/xlat/resources.h +index ef63723..c3e4d36 100644 +--- a/src/xlat/resources.h ++++ b/src/xlat/resources.h +@@ -38,7 +38,7 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else + # define RLIMIT_CORE 4 + #endif +-#if defined(__alpha__) ++#if defined(__alpha__) || defined(__sw_64__) + #if defined(RLIMIT_RSS) || (defined(HAVE_DECL_RLIMIT_RSS) && HAVE_DECL_RLIMIT_RSS) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((RLIMIT_RSS) == (5), "RLIMIT_RSS != 5"); +@@ -253,7 +253,7 @@ static const struct xlat_data resources_xdata[] = { + #define XLAT_VAL_4 ((unsigned) (RLIMIT_CORE)) + #define XLAT_STR_4 STRINGIFY(RLIMIT_CORE) + +-#if defined(__alpha__) ++#if defined(__alpha__) || defined(__sw_64__) + [RLIMIT_RSS] = XLAT(RLIMIT_RSS), + #define XLAT_VAL_5 ((unsigned) (RLIMIT_RSS)) + #define XLAT_STR_5 STRINGIFY(RLIMIT_RSS) +diff --git a/src/xlat/resources.in b/src/xlat/resources.in +index f12cb85..7cd024b 100644 +--- a/src/xlat/resources.in ++++ b/src/xlat/resources.in +@@ -5,7 +5,7 @@ RLIMIT_DATA 2 + RLIMIT_STACK 3 + RLIMIT_CORE 4 + +-#if defined(__alpha__) ++#if defined(__alpha__) || defined(__sw_64__) + RLIMIT_RSS 5 + RLIMIT_NOFILE 6 + RLIMIT_AS 7 +diff --git a/src/xlat/sock_options.h b/src/xlat/sock_options.h +index b2bd20f..f42efb0 100644 +--- a/src/xlat/sock_options.h ++++ b/src/xlat/sock_options.h +@@ -10,7 +10,7 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else + # define SO_DEBUG 1 + #endif +-#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __mips__ || defined __sparc__ + #if defined(SO_REUSEADDR) || (defined(HAVE_DECL_SO_REUSEADDR) && HAVE_DECL_SO_REUSEADDR) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((SO_REUSEADDR) == (4), "SO_REUSEADDR != 4"); +@@ -27,7 +27,7 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + # define SO_REUSEADDR 2 + #endif + #endif +-#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __mips__ || defined __sparc__ + #if defined(SO_TYPE) || (defined(HAVE_DECL_SO_TYPE) && HAVE_DECL_SO_TYPE) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((SO_TYPE) == (4104), "SO_TYPE != 4104"); +@@ -44,7 +44,7 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + # define SO_TYPE 3 + #endif + #endif +-#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __mips__ || defined __sparc__ + #if defined(SO_ERROR) || (defined(HAVE_DECL_SO_ERROR) && HAVE_DECL_SO_ERROR) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((SO_ERROR) == (4103), "SO_ERROR != 4103"); +@@ -61,7 +61,7 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + # define SO_ERROR 4 + #endif + #endif +-#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __mips__ || defined __sparc__ + #if defined(SO_DONTROUTE) || (defined(HAVE_DECL_SO_DONTROUTE) && HAVE_DECL_SO_DONTROUTE) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((SO_DONTROUTE) == (16), "SO_DONTROUTE != 16"); +@@ -78,7 +78,7 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + # define SO_DONTROUTE 5 + #endif + #endif +-#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __mips__ || defined __sparc__ + #if defined(SO_BROADCAST) || (defined(HAVE_DECL_SO_BROADCAST) && HAVE_DECL_SO_BROADCAST) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((SO_BROADCAST) == (32), "SO_BROADCAST != 32"); +@@ -95,7 +95,7 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + # define SO_BROADCAST 6 + #endif + #endif +-#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __mips__ || defined __sparc__ + #if defined(SO_SNDBUF) || (defined(HAVE_DECL_SO_SNDBUF) && HAVE_DECL_SO_SNDBUF) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((SO_SNDBUF) == (4097), "SO_SNDBUF != 4097"); +@@ -112,7 +112,7 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + # define SO_SNDBUF 7 + #endif + #endif +-#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __mips__ || defined __sparc__ + #if defined(SO_RCVBUF) || (defined(HAVE_DECL_SO_RCVBUF) && HAVE_DECL_SO_RCVBUF) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((SO_RCVBUF) == (4098), "SO_RCVBUF != 4098"); +@@ -129,7 +129,7 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + # define SO_RCVBUF 8 + #endif + #endif +-#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __mips__ || defined __sparc__ + #if defined(SO_KEEPALIVE) || (defined(HAVE_DECL_SO_KEEPALIVE) && HAVE_DECL_SO_KEEPALIVE) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((SO_KEEPALIVE) == (8), "SO_KEEPALIVE != 8"); +@@ -146,7 +146,7 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + # define SO_KEEPALIVE 9 + #endif + #endif +-#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __mips__ || defined __sparc__ + #if defined(SO_OOBINLINE) || (defined(HAVE_DECL_SO_OOBINLINE) && HAVE_DECL_SO_OOBINLINE) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((SO_OOBINLINE) == (256), "SO_OOBINLINE != 256"); +@@ -197,7 +197,7 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + # define SO_PRIORITY 12 + #endif + #endif +-#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __mips__ || defined __sparc__ + #if defined(SO_LINGER) || (defined(HAVE_DECL_SO_LINGER) && HAVE_DECL_SO_LINGER) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((SO_LINGER) == (128), "SO_LINGER != 128"); +@@ -239,7 +239,7 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + # define SO_BSDCOMPAT 14 + #endif + #endif +-#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __mips__ || defined __sparc__ + #if defined(SO_REUSEPORT) || (defined(HAVE_DECL_SO_REUSEPORT) && HAVE_DECL_SO_REUSEPORT) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((SO_REUSEPORT) == (512), "SO_REUSEPORT != 512"); +@@ -264,7 +264,7 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else + # define SO_PASSCRED 2 + #endif +-#elif defined __alpha__ || defined __mips__ ++#elif defined __alpha__ || defined __sw_64__ || defined __mips__ + #if defined(SO_PASSCRED) || (defined(HAVE_DECL_SO_PASSCRED) && HAVE_DECL_SO_PASSCRED) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((SO_PASSCRED) == (17), "SO_PASSCRED != 17"); +@@ -297,7 +297,7 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + # define SO_PASSCRED 16 + #endif + #endif +-#if defined __alpha__ || defined __mips__ ++#if defined __alpha__ || defined __sw_64__ || defined __mips__ + #if defined(SO_PEERCRED) || (defined(HAVE_DECL_SO_PEERCRED) && HAVE_DECL_SO_PEERCRED) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((SO_PEERCRED) == (18), "SO_PEERCRED != 18"); +@@ -362,7 +362,7 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else + # define SO_RCVLOWAT 4100 + #endif +-#elif defined __alpha__ ++#elif defined __alpha__ || defined __sw_64__ + #if defined(SO_RCVLOWAT) || (defined(HAVE_DECL_SO_RCVLOWAT) && HAVE_DECL_SO_RCVLOWAT) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((SO_RCVLOWAT) == (4112), "SO_RCVLOWAT != 4112"); +@@ -403,7 +403,7 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else + # define SO_SNDLOWAT 4099 + #endif +-#elif defined __alpha__ ++#elif defined __alpha__ || defined __sw_64__ + #if defined(SO_SNDLOWAT) || (defined(HAVE_DECL_SO_SNDLOWAT) && HAVE_DECL_SO_SNDLOWAT) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((SO_SNDLOWAT) == (4113), "SO_SNDLOWAT != 4113"); +@@ -436,7 +436,7 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else + # define SO_RCVTIMEO_OLD 4102 + #endif +-#elif defined __alpha__ ++#elif defined __alpha__ || defined __sw_64__ + #if defined(SO_RCVTIMEO_OLD) || (defined(HAVE_DECL_SO_RCVTIMEO_OLD) && HAVE_DECL_SO_RCVTIMEO_OLD) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((SO_RCVTIMEO_OLD) == (4114), "SO_RCVTIMEO_OLD != 4114"); +@@ -477,7 +477,7 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else + # define SO_SNDTIMEO_OLD 4101 + #endif +-#elif defined __alpha__ ++#elif defined __alpha__ || defined __sw_64__ + #if defined(SO_SNDTIMEO_OLD) || (defined(HAVE_DECL_SO_SNDTIMEO_OLD) && HAVE_DECL_SO_SNDTIMEO_OLD) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((SO_SNDTIMEO_OLD) == (4115), "SO_SNDTIMEO_OLD != 4115"); +@@ -502,7 +502,7 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + # define SO_SNDTIMEO_OLD 21 + #endif + #endif +-#if defined __alpha__ ++#if defined __alpha__ || defined __sw_64__ + #if defined(SO_SECURITY_AUTHENTICATION) || (defined(HAVE_DECL_SO_SECURITY_AUTHENTICATION) && HAVE_DECL_SO_SECURITY_AUTHENTICATION) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((SO_SECURITY_AUTHENTICATION) == (19), "SO_SECURITY_AUTHENTICATION != 19"); +@@ -535,7 +535,7 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + # define SO_SECURITY_AUTHENTICATION 22 + #endif + #endif +-#if defined __alpha__ ++#if defined __alpha__ || defined __sw_64__ + #if defined(SO_SECURITY_ENCRYPTION_TRANSPORT) || (defined(HAVE_DECL_SO_SECURITY_ENCRYPTION_TRANSPORT) && HAVE_DECL_SO_SECURITY_ENCRYPTION_TRANSPORT) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((SO_SECURITY_ENCRYPTION_TRANSPORT) == (20), "SO_SECURITY_ENCRYPTION_TRANSPORT != 20"); +@@ -568,7 +568,7 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + # define SO_SECURITY_ENCRYPTION_TRANSPORT 23 + #endif + #endif +-#if defined __alpha__ ++#if defined __alpha__ || defined __sw_64__ + #if defined(SO_SECURITY_ENCRYPTION_NETWORK) || (defined(HAVE_DECL_SO_SECURITY_ENCRYPTION_NETWORK) && HAVE_DECL_SO_SECURITY_ENCRYPTION_NETWORK) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((SO_SECURITY_ENCRYPTION_NETWORK) == (21), "SO_SECURITY_ENCRYPTION_NETWORK != 21"); +@@ -685,7 +685,7 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else + # define SO_ACCEPTCONN 4105 + #endif +-#elif defined __alpha__ ++#elif defined __alpha__ || defined __sw_64__ + #if defined(SO_ACCEPTCONN) || (defined(HAVE_DECL_SO_ACCEPTCONN) && HAVE_DECL_SO_ACCEPTCONN) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((SO_ACCEPTCONN) == (4116), "SO_ACCEPTCONN != 4116"); +@@ -718,7 +718,7 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + # define SO_ACCEPTCONN 30 + #endif + #endif +-#if defined __alpha__ || defined __mips__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __mips__ || defined __sparc__ + #if defined(SO_PEERSEC) || (defined(HAVE_DECL_SO_PEERSEC) && HAVE_DECL_SO_PEERSEC) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((SO_PEERSEC) == (30), "SO_PEERSEC != 30"); +@@ -751,7 +751,7 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + #else + # define SO_SNDBUFFORCE 31 + #endif +-#elif defined __alpha__ || defined __hppa__ || defined __sparc__ ++#elif defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __sparc__ + #if defined(SO_SNDBUFFORCE) || (defined(HAVE_DECL_SO_SNDBUFFORCE) && HAVE_DECL_SO_SNDBUFFORCE) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((SO_SNDBUFFORCE) == (4106), "SO_SNDBUFFORCE != 4106"); +@@ -768,7 +768,7 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + # define SO_SNDBUFFORCE 32 + #endif + #endif +-#if defined __alpha__ || defined __hppa__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __sparc__ + #if defined(SO_RCVBUFFORCE) || (defined(HAVE_DECL_SO_RCVBUFFORCE) && HAVE_DECL_SO_RCVBUFFORCE) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((SO_RCVBUFFORCE) == (4107), "SO_RCVBUFFORCE != 4107"); +@@ -885,7 +885,7 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + # define SO_TIMESTAMPING_OLD 37 + #endif + #endif +-#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __sparc__ || defined __mips__ + #if defined(SO_PROTOCOL) || (defined(HAVE_DECL_SO_PROTOCOL) && HAVE_DECL_SO_PROTOCOL) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((SO_PROTOCOL) == (4136), "SO_PROTOCOL != 4136"); +@@ -902,7 +902,7 @@ DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE + # define SO_PROTOCOL 38 + #endif + #endif +-#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __sparc__ || defined __mips__ + #if defined(SO_DOMAIN) || (defined(HAVE_DECL_SO_DOMAIN) && HAVE_DECL_SO_DOMAIN) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((SO_DOMAIN) == (4137), "SO_DOMAIN != 4137"); +@@ -1837,7 +1837,7 @@ static const struct xlat_data sock_options_xdata[] = { + #define XLAT_VAL_0 ((unsigned) (SO_DEBUG)) + #define XLAT_STR_0 STRINGIFY(SO_DEBUG) + +-#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __mips__ || defined __sparc__ + XLAT(SO_REUSEADDR), + #define XLAT_VAL_1 ((unsigned) (SO_REUSEADDR)) + #define XLAT_STR_1 STRINGIFY(SO_REUSEADDR) +@@ -1847,7 +1847,7 @@ static const struct xlat_data sock_options_xdata[] = { + #define XLAT_STR_2 STRINGIFY(SO_REUSEADDR) + #endif + +-#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __mips__ || defined __sparc__ + XLAT(SO_TYPE), + #define XLAT_VAL_3 ((unsigned) (SO_TYPE)) + #define XLAT_STR_3 STRINGIFY(SO_TYPE) +@@ -1857,7 +1857,7 @@ static const struct xlat_data sock_options_xdata[] = { + #define XLAT_STR_4 STRINGIFY(SO_TYPE) + #endif + +-#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __mips__ || defined __sparc__ + XLAT(SO_ERROR), + #define XLAT_VAL_5 ((unsigned) (SO_ERROR)) + #define XLAT_STR_5 STRINGIFY(SO_ERROR) +@@ -1867,7 +1867,7 @@ static const struct xlat_data sock_options_xdata[] = { + #define XLAT_STR_6 STRINGIFY(SO_ERROR) + #endif + +-#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __mips__ || defined __sparc__ + XLAT(SO_DONTROUTE), + #define XLAT_VAL_7 ((unsigned) (SO_DONTROUTE)) + #define XLAT_STR_7 STRINGIFY(SO_DONTROUTE) +@@ -1877,7 +1877,7 @@ static const struct xlat_data sock_options_xdata[] = { + #define XLAT_STR_8 STRINGIFY(SO_DONTROUTE) + #endif + +-#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __mips__ || defined __sparc__ + XLAT(SO_BROADCAST), + #define XLAT_VAL_9 ((unsigned) (SO_BROADCAST)) + #define XLAT_STR_9 STRINGIFY(SO_BROADCAST) +@@ -1887,7 +1887,7 @@ static const struct xlat_data sock_options_xdata[] = { + #define XLAT_STR_10 STRINGIFY(SO_BROADCAST) + #endif + +-#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __mips__ || defined __sparc__ + XLAT(SO_SNDBUF), + #define XLAT_VAL_11 ((unsigned) (SO_SNDBUF)) + #define XLAT_STR_11 STRINGIFY(SO_SNDBUF) +@@ -1897,7 +1897,7 @@ static const struct xlat_data sock_options_xdata[] = { + #define XLAT_STR_12 STRINGIFY(SO_SNDBUF) + #endif + +-#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __mips__ || defined __sparc__ + XLAT(SO_RCVBUF), + #define XLAT_VAL_13 ((unsigned) (SO_RCVBUF)) + #define XLAT_STR_13 STRINGIFY(SO_RCVBUF) +@@ -1907,7 +1907,7 @@ static const struct xlat_data sock_options_xdata[] = { + #define XLAT_STR_14 STRINGIFY(SO_RCVBUF) + #endif + +-#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __mips__ || defined __sparc__ + XLAT(SO_KEEPALIVE), + #define XLAT_VAL_15 ((unsigned) (SO_KEEPALIVE)) + #define XLAT_STR_15 STRINGIFY(SO_KEEPALIVE) +@@ -1917,7 +1917,7 @@ static const struct xlat_data sock_options_xdata[] = { + #define XLAT_STR_16 STRINGIFY(SO_KEEPALIVE) + #endif + +-#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __mips__ || defined __sparc__ + XLAT(SO_OOBINLINE), + #define XLAT_VAL_17 ((unsigned) (SO_OOBINLINE)) + #define XLAT_STR_17 STRINGIFY(SO_OOBINLINE) +@@ -1947,7 +1947,7 @@ static const struct xlat_data sock_options_xdata[] = { + #define XLAT_STR_22 STRINGIFY(SO_PRIORITY) + #endif + +-#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __mips__ || defined __sparc__ + XLAT(SO_LINGER), + #define XLAT_VAL_23 ((unsigned) (SO_LINGER)) + #define XLAT_STR_23 STRINGIFY(SO_LINGER) +@@ -1971,7 +1971,7 @@ static const struct xlat_data sock_options_xdata[] = { + #define XLAT_STR_27 STRINGIFY(SO_BSDCOMPAT) + #endif + +-#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __mips__ || defined __sparc__ + XLAT(SO_REUSEPORT), + #define XLAT_VAL_28 ((unsigned) (SO_REUSEPORT)) + #define XLAT_STR_28 STRINGIFY(SO_REUSEPORT) +@@ -1985,7 +1985,7 @@ static const struct xlat_data sock_options_xdata[] = { + XLAT(SO_PASSCRED), + #define XLAT_VAL_30 ((unsigned) (SO_PASSCRED)) + #define XLAT_STR_30 STRINGIFY(SO_PASSCRED) +-#elif defined __alpha__ || defined __mips__ ++#elif defined __alpha__ || defined __sw_64__ || defined __mips__ + XLAT(SO_PASSCRED), + #define XLAT_VAL_31 ((unsigned) (SO_PASSCRED)) + #define XLAT_STR_31 STRINGIFY(SO_PASSCRED) +@@ -2003,7 +2003,7 @@ static const struct xlat_data sock_options_xdata[] = { + #define XLAT_STR_34 STRINGIFY(SO_PASSCRED) + #endif + +-#if defined __alpha__ || defined __mips__ ++#if defined __alpha__ || defined __sw_64__ || defined __mips__ + XLAT(SO_PEERCRED), + #define XLAT_VAL_35 ((unsigned) (SO_PEERCRED)) + #define XLAT_STR_35 STRINGIFY(SO_PEERCRED) +@@ -2037,7 +2037,7 @@ static const struct xlat_data sock_options_xdata[] = { + XLAT(SO_RCVLOWAT), + #define XLAT_VAL_42 ((unsigned) (SO_RCVLOWAT)) + #define XLAT_STR_42 STRINGIFY(SO_RCVLOWAT) +-#elif defined __alpha__ ++#elif defined __alpha__ || defined __sw_64__ + XLAT(SO_RCVLOWAT), + #define XLAT_VAL_43 ((unsigned) (SO_RCVLOWAT)) + #define XLAT_STR_43 STRINGIFY(SO_RCVLOWAT) +@@ -2059,7 +2059,7 @@ static const struct xlat_data sock_options_xdata[] = { + XLAT(SO_SNDLOWAT), + #define XLAT_VAL_47 ((unsigned) (SO_SNDLOWAT)) + #define XLAT_STR_47 STRINGIFY(SO_SNDLOWAT) +-#elif defined __alpha__ ++#elif defined __alpha__ || defined __sw_64__ + XLAT(SO_SNDLOWAT), + #define XLAT_VAL_48 ((unsigned) (SO_SNDLOWAT)) + #define XLAT_STR_48 STRINGIFY(SO_SNDLOWAT) +@@ -2077,7 +2077,7 @@ static const struct xlat_data sock_options_xdata[] = { + XLAT(SO_RCVTIMEO_OLD), + #define XLAT_VAL_51 ((unsigned) (SO_RCVTIMEO_OLD)) + #define XLAT_STR_51 STRINGIFY(SO_RCVTIMEO_OLD) +-#elif defined __alpha__ ++#elif defined __alpha__ || defined __sw_64__ + XLAT(SO_RCVTIMEO_OLD), + #define XLAT_VAL_52 ((unsigned) (SO_RCVTIMEO_OLD)) + #define XLAT_STR_52 STRINGIFY(SO_RCVTIMEO_OLD) +@@ -2099,7 +2099,7 @@ static const struct xlat_data sock_options_xdata[] = { + XLAT(SO_SNDTIMEO_OLD), + #define XLAT_VAL_56 ((unsigned) (SO_SNDTIMEO_OLD)) + #define XLAT_STR_56 STRINGIFY(SO_SNDTIMEO_OLD) +-#elif defined __alpha__ ++#elif defined __alpha__ || defined __sw_64__ + XLAT(SO_SNDTIMEO_OLD), + #define XLAT_VAL_57 ((unsigned) (SO_SNDTIMEO_OLD)) + #define XLAT_STR_57 STRINGIFY(SO_SNDTIMEO_OLD) +@@ -2113,7 +2113,7 @@ static const struct xlat_data sock_options_xdata[] = { + #define XLAT_STR_59 STRINGIFY(SO_SNDTIMEO_OLD) + #endif + +-#if defined __alpha__ ++#if defined __alpha__ || defined __sw_64__ + XLAT(SO_SECURITY_AUTHENTICATION), + #define XLAT_VAL_60 ((unsigned) (SO_SECURITY_AUTHENTICATION)) + #define XLAT_STR_60 STRINGIFY(SO_SECURITY_AUTHENTICATION) +@@ -2131,7 +2131,7 @@ static const struct xlat_data sock_options_xdata[] = { + #define XLAT_STR_63 STRINGIFY(SO_SECURITY_AUTHENTICATION) + #endif + +-#if defined __alpha__ ++#if defined __alpha__ || defined __sw_64__ + XLAT(SO_SECURITY_ENCRYPTION_TRANSPORT), + #define XLAT_VAL_64 ((unsigned) (SO_SECURITY_ENCRYPTION_TRANSPORT)) + #define XLAT_STR_64 STRINGIFY(SO_SECURITY_ENCRYPTION_TRANSPORT) +@@ -2149,7 +2149,7 @@ static const struct xlat_data sock_options_xdata[] = { + #define XLAT_STR_67 STRINGIFY(SO_SECURITY_ENCRYPTION_TRANSPORT) + #endif + +-#if defined __alpha__ ++#if defined __alpha__ || defined __sw_64__ + XLAT(SO_SECURITY_ENCRYPTION_NETWORK), + #define XLAT_VAL_68 ((unsigned) (SO_SECURITY_ENCRYPTION_NETWORK)) + #define XLAT_STR_68 STRINGIFY(SO_SECURITY_ENCRYPTION_NETWORK) +@@ -2217,7 +2217,7 @@ static const struct xlat_data sock_options_xdata[] = { + XLAT(SO_ACCEPTCONN), + #define XLAT_VAL_81 ((unsigned) (SO_ACCEPTCONN)) + #define XLAT_STR_81 STRINGIFY(SO_ACCEPTCONN) +-#elif defined __alpha__ ++#elif defined __alpha__ || defined __sw_64__ + XLAT(SO_ACCEPTCONN), + #define XLAT_VAL_82 ((unsigned) (SO_ACCEPTCONN)) + #define XLAT_STR_82 STRINGIFY(SO_ACCEPTCONN) +@@ -2235,7 +2235,7 @@ static const struct xlat_data sock_options_xdata[] = { + #define XLAT_STR_85 STRINGIFY(SO_ACCEPTCONN) + #endif + +-#if defined __alpha__ || defined __mips__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __mips__ || defined __sparc__ + XLAT(SO_PEERSEC), + #define XLAT_VAL_86 ((unsigned) (SO_PEERSEC)) + #define XLAT_STR_86 STRINGIFY(SO_PEERSEC) +@@ -2253,7 +2253,7 @@ static const struct xlat_data sock_options_xdata[] = { + XLAT(SO_SNDBUFFORCE), + #define XLAT_VAL_89 ((unsigned) (SO_SNDBUFFORCE)) + #define XLAT_STR_89 STRINGIFY(SO_SNDBUFFORCE) +-#elif defined __alpha__ || defined __hppa__ || defined __sparc__ ++#elif defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __sparc__ + XLAT(SO_SNDBUFFORCE), + #define XLAT_VAL_90 ((unsigned) (SO_SNDBUFFORCE)) + #define XLAT_STR_90 STRINGIFY(SO_SNDBUFFORCE) +@@ -2263,7 +2263,7 @@ static const struct xlat_data sock_options_xdata[] = { + #define XLAT_STR_91 STRINGIFY(SO_SNDBUFFORCE) + #endif + +-#if defined __alpha__ || defined __hppa__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __sparc__ + XLAT(SO_RCVBUFFORCE), + #define XLAT_VAL_92 ((unsigned) (SO_RCVBUFFORCE)) + #define XLAT_STR_92 STRINGIFY(SO_RCVBUFFORCE) +@@ -2329,7 +2329,7 @@ static const struct xlat_data sock_options_xdata[] = { + #define XLAT_STR_105 STRINGIFY(SO_TIMESTAMPING_OLD) + #endif + +-#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __sparc__ + XLAT(SO_PROTOCOL), + #define XLAT_VAL_106 ((unsigned) (SO_PROTOCOL)) + #define XLAT_STR_106 STRINGIFY(SO_PROTOCOL) +@@ -2339,7 +2339,7 @@ static const struct xlat_data sock_options_xdata[] = { + #define XLAT_STR_107 STRINGIFY(SO_PROTOCOL) + #endif + +-#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __sparc__ + XLAT(SO_DOMAIN), + #define XLAT_VAL_108 ((unsigned) (SO_DOMAIN)) + #define XLAT_STR_108 STRINGIFY(SO_DOMAIN) +diff --git a/src/xlat/sock_options.in b/src/xlat/sock_options.in +index b50e3d9..4551b55 100755 +--- a/src/xlat/sock_options.in ++++ b/src/xlat/sock_options.in +@@ -2,55 +2,55 @@ + + SO_DEBUG 1 + +-#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __mips__ || defined __sparc__ + SO_REUSEADDR 4 + #else + SO_REUSEADDR 2 + #endif + +-#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __mips__ || defined __sparc__ + SO_TYPE 4104 + #else + SO_TYPE 3 + #endif + +-#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __mips__ || defined __sparc__ + SO_ERROR 4103 + #else + SO_ERROR 4 + #endif + +-#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __mips__ || defined __sparc__ + SO_DONTROUTE 16 + #else + SO_DONTROUTE 5 + #endif + +-#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __mips__ || defined __sparc__ + SO_BROADCAST 32 + #else + SO_BROADCAST 6 + #endif + +-#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __mips__ || defined __sparc__ + SO_SNDBUF 4097 + #else + SO_SNDBUF 7 + #endif + +-#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __mips__ || defined __sparc__ + SO_RCVBUF 4098 + #else + SO_RCVBUF 8 + #endif + +-#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __mips__ || defined __sparc__ + SO_KEEPALIVE 8 + #else + SO_KEEPALIVE 9 + #endif + +-#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __mips__ || defined __sparc__ + SO_OOBINLINE 256 + #else + SO_OOBINLINE 10 +@@ -68,7 +68,7 @@ SO_PRIORITY 16396 + SO_PRIORITY 12 + #endif + +-#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ ++# define __alpha__ || defined __sw_64__ || defined __hppa__ || defined __mips__ || defined __sparc__ + SO_LINGER 128 + #else + SO_LINGER 13 +@@ -82,7 +82,7 @@ SO_BSDCOMPAT 16398 + SO_BSDCOMPAT 14 + #endif + +-#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __mips__ || defined __sparc__ + SO_REUSEPORT 512 + #else + SO_REUSEPORT 15 +@@ -90,7 +90,7 @@ SO_REUSEPORT 15 + + #if defined __sparc__ + SO_PASSCRED 2 +-#elif defined __alpha__ || defined __mips__ ++#elif defined __alpha__ || defined __sw_64__ || defined __mips__ + SO_PASSCRED 17 + #elif defined __powerpc__ + SO_PASSCRED 20 +@@ -100,7 +100,7 @@ SO_PASSCRED 16400 + SO_PASSCRED 16 + #endif + +-#if defined __alpha__ || defined __mips__ ++#if defined __alpha__ || defined __sw_64__ || defined __mips__ + SO_PEERCRED 18 + #elif defined __powerpc__ + SO_PEERCRED 21 +@@ -118,7 +118,7 @@ SO_RCVLOWAT 16 + SO_RCVLOWAT 2048 + #elif defined __hppa__ || defined __mips__ + SO_RCVLOWAT 4100 +-#elif defined __alpha__ ++#elif defined __alpha__ || defined __sw_64__ + SO_RCVLOWAT 4112 + #else + SO_RCVLOWAT 18 +@@ -130,7 +130,7 @@ SO_SNDLOWAT 17 + SO_SNDLOWAT 4096 + #elif defined __hppa__ || defined __mips__ + SO_SNDLOWAT 4099 +-#elif defined __alpha__ ++#elif defined __alpha__ || defined __sw_64__ + SO_SNDLOWAT 4113 + #else + SO_SNDLOWAT 19 +@@ -140,7 +140,7 @@ SO_SNDLOWAT 19 + SO_RCVTIMEO_OLD 18 + #elif defined __hppa__ || defined __mips__ + SO_RCVTIMEO_OLD 4102 +-#elif defined __alpha__ ++#elif defined __alpha__ || defined __sw_64__ + SO_RCVTIMEO_OLD 4114 + #elif defined __sparc__ + SO_RCVTIMEO_OLD 8192 +@@ -152,7 +152,7 @@ SO_RCVTIMEO_OLD 20 + SO_SNDTIMEO_OLD 19 + #elif defined __hppa__ || defined __mips__ + SO_SNDTIMEO_OLD 4101 +-#elif defined __alpha__ ++#elif defined __alpha__ || defined __sw_64__ + SO_SNDTIMEO_OLD 4115 + #elif defined __sparc__ + SO_SNDTIMEO_OLD 16384 +@@ -160,7 +160,7 @@ SO_SNDTIMEO_OLD 16384 + SO_SNDTIMEO_OLD 21 + #endif + +-#if defined __alpha__ ++#if defined __alpha__ || defined __sw_64__ + SO_SECURITY_AUTHENTICATION 19 + #elif defined __hppa__ + SO_SECURITY_AUTHENTICATION 16406 +@@ -170,7 +170,7 @@ SO_SECURITY_AUTHENTICATION 20481 + SO_SECURITY_AUTHENTICATION 22 + #endif + +-#if defined __alpha__ ++#if defined __alpha__ || defined __sw_64__ + SO_SECURITY_ENCRYPTION_TRANSPORT 20 + #elif defined __hppa__ + SO_SECURITY_ENCRYPTION_TRANSPORT 16407 +@@ -180,7 +180,7 @@ SO_SECURITY_ENCRYPTION_TRANSPORT 20482 + SO_SECURITY_ENCRYPTION_TRANSPORT 23 + #endif + +-#if defined __alpha__ ++#if defined __alpha__ || defined __sw_64__ + SO_SECURITY_ENCRYPTION_NETWORK 21 + #elif defined __hppa__ + SO_SECURITY_ENCRYPTION_NETWORK 16408 +@@ -220,7 +220,7 @@ SO_TIMESTAMP_OLD 29 + + #if defined __mips__ + SO_ACCEPTCONN 4105 +-#elif defined __alpha__ ++#elif defined __alpha__ || defined __sw_64__ + SO_ACCEPTCONN 4116 + #elif defined __hppa__ + SO_ACCEPTCONN 16412 +@@ -230,7 +230,7 @@ SO_ACCEPTCONN 32768 + SO_ACCEPTCONN 30 + #endif + +-#if defined __alpha__ || defined __mips__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __mips__ || defined __sparc__ + SO_PEERSEC 30 + #elif defined __hppa__ + SO_PEERSEC 16413 +@@ -240,13 +240,13 @@ SO_PEERSEC 31 + + #if defined __mips__ + SO_SNDBUFFORCE 31 +-#elif defined __alpha__ || defined __hppa__ || defined __sparc__ ++#elif defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __sparc__ + SO_SNDBUFFORCE 4106 + #else + SO_SNDBUFFORCE 32 + #endif + +-#if defined __alpha__ || defined __hppa__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __sparc__ + SO_RCVBUFFORCE 4107 + #else + SO_RCVBUFFORCE 33 +@@ -284,13 +284,13 @@ SO_TIMESTAMPING_OLD 16416 + SO_TIMESTAMPING_OLD 37 + #endif + +-#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __mips__ || defined __sparc__ + SO_PROTOCOL 4136 + #else + SO_PROTOCOL 38 + #endif + +-#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __mips__ || defined __sparc__ + SO_DOMAIN 4137 + #else + SO_DOMAIN 39 +diff --git a/src/xlat/socketlayers.h b/src/xlat/socketlayers.h +index 9b9d441..6af736d 100644 +--- a/src/xlat/socketlayers.h ++++ b/src/xlat/socketlayers.h +@@ -20,7 +20,7 @@ static_assert((unsigned long long) (SOL_IP) + #undef XLAT_PREV_VAL + #define XLAT_PREV_VAL (SOL_IP) + #endif +-#if !(defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__) ++#if !(defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __mips__ || defined __sparc__) + #if defined(SOL_SOCKET) || (defined(HAVE_DECL_SOL_SOCKET) && HAVE_DECL_SOL_SOCKET) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((SOL_SOCKET) == (1), "SOL_SOCKET != 1"); +@@ -685,7 +685,7 @@ static_assert((unsigned long long) (SOL_XDP) + #undef XLAT_PREV_VAL + #define XLAT_PREV_VAL (SOL_XDP) + #endif +-#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __mips__ || defined __sparc__ + #if defined(SOL_SOCKET) || (defined(HAVE_DECL_SOL_SOCKET) && HAVE_DECL_SOL_SOCKET) + DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE + static_assert((SOL_SOCKET) == (0xffff), "SOL_SOCKET != 0xffff"); +@@ -715,7 +715,7 @@ static const struct xlat_data socketlayers_xdata[] = { + XLAT(SOL_IP), + #define XLAT_VAL_0 ((unsigned) (SOL_IP)) + #define XLAT_STR_0 STRINGIFY(SOL_IP) +-#if !(defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__) ++#if !(defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __mips__ || defined __sparc__) + XLAT(SOL_SOCKET), + #define XLAT_VAL_1 ((unsigned) (SOL_SOCKET)) + #define XLAT_STR_1 STRINGIFY(SOL_SOCKET) +@@ -834,7 +834,7 @@ static const struct xlat_data socketlayers_xdata[] = { + XLAT(SOL_XDP), + #define XLAT_VAL_39 ((unsigned) (SOL_XDP)) + #define XLAT_STR_39 STRINGIFY(SOL_XDP) +-#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __mips__ || defined __sparc__ + XLAT(SOL_SOCKET), + #define XLAT_VAL_40 ((unsigned) (SOL_SOCKET)) + #define XLAT_STR_40 STRINGIFY(SOL_SOCKET) +diff --git a/src/xlat/socketlayers.in b/src/xlat/socketlayers.in +index fe32a60..2f8b114 100644 +--- a/src/xlat/socketlayers.in ++++ b/src/xlat/socketlayers.in +@@ -1,6 +1,6 @@ + #sorted sort -k2,2n + SOL_IP 0 +-#if !(defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__) ++#if !(defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __mips__ || defined __sparc__) + SOL_SOCKET 1 + #endif + SOL_TCP 6 +@@ -41,6 +41,6 @@ SOL_NFC 280 + SOL_KCM 281 + SOL_TLS 282 + SOL_XDP 283 +-#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ ++#if defined __alpha__ || defined __sw_64__ || defined __hppa__ || defined __mips__ || defined __sparc__ + SOL_SOCKET 0xffff + #endif +diff --git a/tests-m32/create_tmpfile.c b/tests-m32/create_tmpfile.c +index 1a24a6c..3252af0 100644 +--- a/tests-m32/create_tmpfile.c ++++ b/tests-m32/create_tmpfile.c +@@ -14,7 +14,7 @@ + #ifndef O_TMPFILE + # if defined __hppa__ + # define O_TMPFILE 040000000 +-# elif defined __alpha__ ++# elif defined __alpha__ || defined __sw_64__ + # define O_TMPFILE 0100000000 + # elif defined __sparc__ + # define O_TMPFILE 0200000000 +diff --git a/tests-m32/shmxt.c b/tests-m32/shmxt.c +index 708023c..4dc3b19 100644 +--- a/tests-m32/shmxt.c ++++ b/tests-m32/shmxt.c +@@ -19,7 +19,7 @@ cleanup(void) + id = -1; + } + +-#ifdef __alpha__ ++#if defined __alpha__ || defined __sw_64__ + # define SHMAT "osf_shmat" + #else + # define SHMAT "shmat" +diff --git a/tests-m32/sigaction.c b/tests-m32/sigaction.c +index c9f2c97..8814363 100644 +--- a/tests-m32/sigaction.c ++++ b/tests-m32/sigaction.c +@@ -24,7 +24,7 @@ struct set_sa { + unsigned int flags; + unsigned long handler; + unsigned long mask[1]; +-# elif defined ALPHA ++# elif defined ALPHA || defined SW_64 + unsigned long handler; + unsigned long mask[1]; + unsigned int flags; +@@ -35,7 +35,7 @@ struct set_sa { + unsigned long restorer; + # endif + } +-# ifdef ALPHA ++# if defined ALPHA || defined SW_64 + ATTRIBUTE_PACKED + # endif + ; +@@ -157,7 +157,7 @@ main(void) + sigdelset(mask.libc, SIGHUP); + + memcpy(new_act->mask, mask.old, sizeof(mask.old)); +-# if defined SA_RESTORER && !(defined ALPHA || defined MIPS) ++# if defined SA_RESTORER && !(defined ALPHA || defined SW_64 || defined MIPS) + new_act->flags = SA_RESTORER; + new_act->restorer = (unsigned long) 0xdeadfacecafef00dULL; + # define SA_RESTORER_FMT ", sa_flags=SA_RESTORER, sa_restorer=%#lx" +diff --git a/tests-m32/signal2name.c b/tests-m32/signal2name.c +index 1d8e7c5..2339237 100644 +--- a/tests-m32/signal2name.c ++++ b/tests-m32/signal2name.c +@@ -40,7 +40,7 @@ signal2name(int sig) + CASE(SIGWINCH); + CASE(SIGXCPU); + CASE(SIGXFSZ); +-#if defined ALPHA ++#if defined ALPHA || defined SW_64 + CASE(SIGABRT); + CASE(SIGEMT); + CASE(SIGINFO); +diff --git a/tests-m32/umount.test b/tests-m32/umount.test +index e98ad9f..e2d3992 100755 +--- a/tests-m32/umount.test ++++ b/tests-m32/umount.test +@@ -10,7 +10,7 @@ + . "${srcdir=.}/init.sh" + + case "$STRACE_ARCH" in +- alpha) syscall=oldumount ;; ++ alpha | sw_64) syscall=oldumount ;; + *) syscall=umount ;; + esac + run_strace_match_diff -a24 -s6 -e trace=$syscall +diff --git a/tests-m32/umount2.test b/tests-m32/umount2.test +index 33b466d..f318846 100755 +--- a/tests-m32/umount2.test ++++ b/tests-m32/umount2.test +@@ -10,7 +10,7 @@ + . "${srcdir=.}/init.sh" + + case "$STRACE_ARCH" in +- alpha|ia64) syscall=umount ;; ++ alpha|ia64|sw_64) syscall=umount ;; + *) syscall=umount2 ;; + esac + run_strace_match_diff -s7 -e trace=$syscall +diff --git a/tests-mx32/create_tmpfile.c b/tests-mx32/create_tmpfile.c +index 1a24a6c..3252af0 100644 +--- a/tests-mx32/create_tmpfile.c ++++ b/tests-mx32/create_tmpfile.c +@@ -14,7 +14,7 @@ + #ifndef O_TMPFILE + # if defined __hppa__ + # define O_TMPFILE 040000000 +-# elif defined __alpha__ ++# elif defined __alpha__ || defined __sw_64__ + # define O_TMPFILE 0100000000 + # elif defined __sparc__ + # define O_TMPFILE 0200000000 +diff --git a/tests-mx32/shmxt.c b/tests-mx32/shmxt.c +index 708023c..4dc3b19 100644 +--- a/tests-mx32/shmxt.c ++++ b/tests-mx32/shmxt.c +@@ -19,7 +19,7 @@ cleanup(void) + id = -1; + } + +-#ifdef __alpha__ ++#if defined __alpha__ || defined __sw_64__ + # define SHMAT "osf_shmat" + #else + # define SHMAT "shmat" +diff --git a/tests-mx32/sigaction.c b/tests-mx32/sigaction.c +index c9f2c97..8814363 100644 +--- a/tests-mx32/sigaction.c ++++ b/tests-mx32/sigaction.c +@@ -24,7 +24,7 @@ struct set_sa { + unsigned int flags; + unsigned long handler; + unsigned long mask[1]; +-# elif defined ALPHA ++# elif defined ALPHA || defined SW_64 + unsigned long handler; + unsigned long mask[1]; + unsigned int flags; +@@ -35,7 +35,7 @@ struct set_sa { + unsigned long restorer; + # endif + } +-# ifdef ALPHA ++# if defined ALPHA || defined SW_64 + ATTRIBUTE_PACKED + # endif + ; +@@ -157,7 +157,7 @@ main(void) + sigdelset(mask.libc, SIGHUP); + + memcpy(new_act->mask, mask.old, sizeof(mask.old)); +-# if defined SA_RESTORER && !(defined ALPHA || defined MIPS) ++# if defined SA_RESTORER && !(defined ALPHA || defined SW_64 || defined MIPS) + new_act->flags = SA_RESTORER; + new_act->restorer = (unsigned long) 0xdeadfacecafef00dULL; + # define SA_RESTORER_FMT ", sa_flags=SA_RESTORER, sa_restorer=%#lx" +diff --git a/tests-mx32/signal2name.c b/tests-mx32/signal2name.c +index 1d8e7c5..2339237 100644 +--- a/tests-mx32/signal2name.c ++++ b/tests-mx32/signal2name.c +@@ -40,7 +40,7 @@ signal2name(int sig) + CASE(SIGWINCH); + CASE(SIGXCPU); + CASE(SIGXFSZ); +-#if defined ALPHA ++#if defined ALPHA || defined SW_64 + CASE(SIGABRT); + CASE(SIGEMT); + CASE(SIGINFO); +diff --git a/tests-mx32/umount.test b/tests-mx32/umount.test +index e98ad9f..e6eaaa7 100755 +--- a/tests-mx32/umount.test ++++ b/tests-mx32/umount.test +@@ -10,7 +10,7 @@ + . "${srcdir=.}/init.sh" + + case "$STRACE_ARCH" in +- alpha) syscall=oldumount ;; ++ alpha|sw_64) syscall=oldumount ;; + *) syscall=umount ;; + esac + run_strace_match_diff -a24 -s6 -e trace=$syscall +diff --git a/tests-mx32/umount2.test b/tests-mx32/umount2.test +index 33b466d..f318846 100755 +--- a/tests-mx32/umount2.test ++++ b/tests-mx32/umount2.test +@@ -10,7 +10,7 @@ + . "${srcdir=.}/init.sh" + + case "$STRACE_ARCH" in +- alpha|ia64) syscall=umount ;; ++ alpha|ia64|sw_64) syscall=umount ;; + *) syscall=umount2 ;; + esac + run_strace_match_diff -s7 -e trace=$syscall +diff --git a/tests/create_tmpfile.c b/tests/create_tmpfile.c +index 1a24a6c..3252af0 100644 +--- a/tests/create_tmpfile.c ++++ b/tests/create_tmpfile.c +@@ -14,7 +14,7 @@ + #ifndef O_TMPFILE + # if defined __hppa__ + # define O_TMPFILE 040000000 +-# elif defined __alpha__ ++# elif defined __alpha__ || defined __sw_64__ + # define O_TMPFILE 0100000000 + # elif defined __sparc__ + # define O_TMPFILE 0200000000 +diff --git a/tests/shmxt.c b/tests/shmxt.c +index 708023c..4dc3b19 100644 +--- a/tests/shmxt.c ++++ b/tests/shmxt.c +@@ -19,7 +19,7 @@ cleanup(void) + id = -1; + } + +-#ifdef __alpha__ ++#if defined __alpha__ || defined __sw_64__ + # define SHMAT "osf_shmat" + #else + # define SHMAT "shmat" +diff --git a/tests/sigaction.c b/tests/sigaction.c +index c9f2c97..8814363 100644 +--- a/tests/sigaction.c ++++ b/tests/sigaction.c +@@ -24,7 +24,7 @@ struct set_sa { + unsigned int flags; + unsigned long handler; + unsigned long mask[1]; +-# elif defined ALPHA ++# elif defined ALPHA || defined SW_64 + unsigned long handler; + unsigned long mask[1]; + unsigned int flags; +@@ -35,7 +35,7 @@ struct set_sa { + unsigned long restorer; + # endif + } +-# ifdef ALPHA ++# if defined ALPHA || defined SW_64 + ATTRIBUTE_PACKED + # endif + ; +@@ -157,7 +157,7 @@ main(void) + sigdelset(mask.libc, SIGHUP); + + memcpy(new_act->mask, mask.old, sizeof(mask.old)); +-# if defined SA_RESTORER && !(defined ALPHA || defined MIPS) ++# if defined SA_RESTORER && !(defined ALPHA || defined SW_64 || defined MIPS) + new_act->flags = SA_RESTORER; + new_act->restorer = (unsigned long) 0xdeadfacecafef00dULL; + # define SA_RESTORER_FMT ", sa_flags=SA_RESTORER, sa_restorer=%#lx" +diff --git a/tests/signal2name.c b/tests/signal2name.c +index 1d8e7c5..2339237 100644 +--- a/tests/signal2name.c ++++ b/tests/signal2name.c +@@ -40,7 +40,7 @@ signal2name(int sig) + CASE(SIGWINCH); + CASE(SIGXCPU); + CASE(SIGXFSZ); +-#if defined ALPHA ++#if defined ALPHA || defined SW_64 + CASE(SIGABRT); + CASE(SIGEMT); + CASE(SIGINFO); +diff --git a/tests/umount.test b/tests/umount.test +index e98ad9f..e6eaaa7 100755 +--- a/tests/umount.test ++++ b/tests/umount.test +@@ -10,7 +10,7 @@ + . "${srcdir=.}/init.sh" + + case "$STRACE_ARCH" in +- alpha) syscall=oldumount ;; ++ alpha|sw_64) syscall=oldumount ;; + *) syscall=umount ;; + esac + run_strace_match_diff -a24 -s6 -e trace=$syscall +diff --git a/tests/umount2.test b/tests/umount2.test +index 33b466d..f318846 100755 +--- a/tests/umount2.test ++++ b/tests/umount2.test +@@ -10,7 +10,7 @@ + . "${srcdir=.}/init.sh" + + case "$STRACE_ARCH" in +- alpha|ia64) syscall=umount ;; ++ alpha|ia64|sw_64) syscall=umount ;; + *) syscall=umount2 ;; + esac + run_strace_match_diff -s7 -e trace=$syscall +-- +2.31.1 + diff --git a/strace.spec b/strace.spec index 558be3fbda84dbabeaecfcc2bf8654057cc38b90..59ab1e411098f20fac72b206a9108a6a49d945f9 100644 --- a/strace.spec +++ b/strace.spec @@ -1,7 +1,7 @@ Summary: Tracks and displays system calls associated with a running process Name: strace Version: 6.6 -Release: 3 +Release: 4 # The test suite is GPLv2+, all the rest is LGPLv2.1+. License: LGPL-2.1+ and GPL-2.0+ # Some distros require Group tag to be present, @@ -26,6 +26,7 @@ Patch0003: backport-0003-Factor-out-droptcb_verbose-from-detach.patch Patch0004: backport-0004-Factor-out-interrupt_or_stop-from-detach.patch Patch0005: backport-0005-Factor-out-detach_interrupted_or_stopped-from-detach.patch Patch0006: backport-0006-strace-fix-potential-deadlock-during-cleanup.patch +Patch0007: strace-6.6-sw.patch # OBS compatibility %{?!buildroot:BuildRoot: %_tmppath/buildroot-%name-%version-%release} @@ -107,6 +108,9 @@ wait %{_mandir}/man1/* %changelog +* Mon Mar 03 2025 zhangshaoning - 6.6-4 +- Add sw_64 support + * Fri Dec 27 2024 wangxiao - 6.6-3 - strace: fix potential deadlock during cleanup