linux/bfin/set_error.c \
linux/bfin/set_scno.c \
linux/bfin/syscallent.h \
+ linux/csky/arch_regs.c \
+ linux/csky/get_error.c \
+ linux/csky/get_scno.c \
+ linux/csky/get_syscall_args.c \
+ linux/csky/ioctls_arch0.h \
+ linux/csky/ioctls_inc0.h \
+ linux/csky/raw_syscall.h \
+ linux/csky/set_error.c \
+ linux/csky/set_scno.c \
+ linux/csky/syscallent.h \
linux/bfin/userent.h \
linux/check_scno.c \
linux/dummy.h \
* Bug fixes
* Fixed decoding of last two arguments of clone syscall on riscv.
+* Improvements
+ * Added C-SKY architecture support.
+
Noteworthy changes in release 5.0 (2019-03-19)
==============================================
}
#endif /* M68K */
-#ifdef BFIN
+#if defined(BFIN) || defined(CSKY)
static const struct xlat cacheflush_flags[] = {
XLAT(ICACHE),
XLAT(DCACHE),
return RVAL_DECODED;
}
-#endif /* BFIN */
+#endif /* BFIN || CSKY */
#ifdef SH
static const struct xlat cacheflush_flags[] = {
# 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 CSKY
# define ARG_FLAGS 0
# define ARG_STACK 1
# define ARG_PTID 2
arch=bfin
AC_DEFINE([BFIN], 1, [Define for the Blackfin architecture.])
;;
+csky*)
+ arch=csky
+ AC_DEFINE([CSKY], 1, [Define for the C-SKY architecture])
+ ;;
hppa*|parisc*)
arch=hppa
AC_DEFINE([HPPA], 1, [Define for the HPPA architecture.])
--- /dev/null
+/*
+ * Copyright (c) 2015-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static struct pt_regs csky_regs;
+
+#define ARCH_REGS_FOR_GETREGSET csky_regs
+#define ARCH_PC_REG csky_regs.pc
+#define ARCH_SP_REG csky_regs.usp
--- /dev/null
+/*
+ * Copyright (c) 2015-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+#include "negated_errno.h"
+
+static void
+arch_get_error(struct tcb *tcp, const bool check_errno)
+{
+ if (check_errno && is_negated_errno(csky_regs.a0)) {
+ tcp->u_rval = -1;
+ tcp->u_error = -csky_regs.a0;
+ } else {
+ tcp->u_rval = csky_regs.a0;
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2015-2019 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)
+{
+#if defined(__CSKYABIV2__)
+ tcp->scno = csky_regs.regs[3];
+#else
+ tcp->scno = csky_regs.r1;
+#endif
+ return 1;
+}
--- /dev/null
+/*
+ * Copyright (c) 2015-2019 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)
+{
+ tcp->u_arg[0] = csky_regs.orig_a0;
+ tcp->u_arg[1] = csky_regs.a1;
+ tcp->u_arg[2] = csky_regs.a2;
+ tcp->u_arg[3] = csky_regs.a3;
+ tcp->u_arg[4] = csky_regs.regs[0];
+ tcp->u_arg[5] = csky_regs.regs[1];
+ return 1;
+}
--- /dev/null
+/* Generated by ioctls_gen.sh from definitions found in $linux/arch/csky/include/ tree. */
--- /dev/null
+#include "32/ioctls_inc.h"
--- /dev/null
+/*
+ * Copyright (c) 2018-2019 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)
+{
+#if defined(__CSKYABIV2__)
+ register kernel_ulong_t scno __asm__("r7") = nr;
+#else
+ register kernel_ulong_t scno __asm__("r1") = nr;
+#endif
+ register kernel_ulong_t a0 __asm__("a0");
+ asm volatile("trap 0"
+ : "+r"(scno), "=r"(a0)
+ :
+ : "memory");
+
+ *err = 0;
+ return a0;
+}
+# define raw_syscall_0 raw_syscall_0
+
+#endif /* !STRACE_RAW_SYSCALL_H */
--- /dev/null
+/*
+ * Copyright (c) 2016-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+arch_set_error(struct tcb *tcp)
+{
+ csky_regs.a0 = -tcp->u_error;
+ return set_regs(tcp->pid);
+}
+
+static int
+arch_set_success(struct tcb *tcp)
+{
+ csky_regs.a0 = tcp->u_rval;
+ return set_regs(tcp->pid);
+}
--- /dev/null
+/*
+ * Copyright (c) 2016-2019 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)
+{
+#if defined(__CSKYABIV2__)
+ csky_regs.regs[3] = scno;
+#else
+ csky_regs.r1 = scno;
+#endif
+ return set_regs(tcp->pid);
+}
--- /dev/null
+#include "32/syscallent.h"
+/* [244 ... 259] are arch specific */
+[244] = {1, 0, SEN(set_thread_area), "set_thread_area"},
+[245] = {3, 0, SEN(cacheflush), "cacheflush"},