linux/powerpc64/syscallent1.h \
linux/powerpc64/userent.h \
linux/ptp_clock.h \
+ linux/riscv/arch_regs.c \
+ linux/riscv/errnoent1.h \
+ linux/riscv/get_error.c \
+ linux/riscv/get_scno.c \
+ linux/riscv/get_syscall_args.c \
+ linux/riscv/ioctls_arch0.h \
+ linux/riscv/ioctls_arch1.h \
+ linux/riscv/ioctls_inc0.h \
+ linux/riscv/ioctls_inc1.h \
+ linux/riscv/signalent1.h \
+ linux/riscv/stat32.h \
+ linux/riscv/syscallent.h \
+ linux/riscv/syscallent1.h \
linux/s390/arch_regs.c \
linux/s390/arch_regs.h \
linux/s390/arch_sigreturn.c \
# 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
+#elif defined ALPHA || defined TILE || defined OR1K || defined RISCV
# define ARG_FLAGS 0
# define ARG_STACK 1
# define ARG_PTID 2
AC_DEFINE([XTENSA], 1, [Define for the Xtensa architecture])
;;
+riscv*)
+ arch=riscv
+ AC_DEFINE([RISCV], 1, [Define for the RISC-V architecture])
+ ;;
+
*)
AC_MSG_RESULT([NO!])
AC_MSG_ERROR([architecture $host_cpu is not supported by strace])
# define PERSONALITY2_WORDSIZE 4
#elif defined AARCH64 \
|| defined POWERPC64 \
+ || defined RISCV \
|| defined SPARC64 \
|| defined TILE \
|| defined X32
|| defined(BFIN) \
|| defined(M68K) \
|| defined(MICROBLAZE) \
+ || defined(RISCV) \
|| defined(S390) \
|| defined(SH) || defined(SH64) \
|| defined(SPARC) || defined(SPARC64) \
--- /dev/null
+static struct user_regs_struct riscv_regs;
+#define ARCH_REGS_FOR_GETREGSET riscv_regs
+#define ARCH_PC_REG riscv_regs.pc
--- /dev/null
+/* RISC-V rv32 and rv64 */
+#include "../errnoent.h"
--- /dev/null
+static void
+get_error(struct tcb *tcp, const bool check_errno)
+{
+ if (check_errno && is_negated_errno(riscv_regs.a0)) {
+ tcp->u_rval = -1;
+ tcp->u_error = -riscv_regs.a0;
+ } else {
+ tcp->u_rval = riscv_regs.a0;
+ }
+}
--- /dev/null
+/* Return codes: 1 - ok, 0 - ignore, other - error. */
+static int
+arch_get_scno(struct tcb *tcp)
+{
+ tcp->scno = riscv_regs.a7;
+ return 1;
+}
--- /dev/null
+/* Return -1 on error or 1 on success (never 0!). */
+static int
+get_syscall_args(struct tcb *tcp)
+{
+ tcp->u_arg[0] = riscv_regs.a0;
+ tcp->u_arg[1] = riscv_regs.a1;
+ tcp->u_arg[2] = riscv_regs.a2;
+ tcp->u_arg[3] = riscv_regs.a3;
+ tcp->u_arg[4] = riscv_regs.a4;
+ tcp->u_arg[5] = riscv_regs.a5;
+ return 1;
+}
--- /dev/null
+/* Generated by ioctls_gen.sh from definitions found in $linux/arch/riscv/include/ tree. */
--- /dev/null
+#include "ioctls_arch0.h"
--- /dev/null
+#include "64/ioctls_inc.h"
--- /dev/null
+#include "32/ioctls_inc.h"
--- /dev/null
+/* RISC-V rv32 and rv64 */
+#include "../signalent.h"
--- /dev/null
+/* no 32-bit stat */
--- /dev/null
+#include "64/syscallent.h"
--- /dev/null
+#include "32/syscallent.h"