Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/aarch64/aarch64 linux syscall should not break x1 r...



details:   https://anonhg.NetBSD.org/src/rev/ac8e4a361433
branches:  trunk
changeset: 1023842:ac8e4a361433
user:      ryo <ryo%NetBSD.org@localhost>
date:      Mon Sep 27 17:40:39 2021 +0000

description:
linux syscall should not break x1 register

diffstat:

 sys/arch/aarch64/aarch64/linux_syscall.c |  6 ++++--
 sys/arch/aarch64/aarch64/syscall.c       |  6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diffs (54 lines):

diff -r 6e336b9d4623 -r ac8e4a361433 sys/arch/aarch64/aarch64/linux_syscall.c
--- a/sys/arch/aarch64/aarch64/linux_syscall.c  Mon Sep 27 17:37:59 2021 +0000
+++ b/sys/arch/aarch64/aarch64/linux_syscall.c  Mon Sep 27 17:40:39 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_syscall.c,v 1.1 2021/09/23 06:56:26 ryo Exp $    */
+/*     $NetBSD: linux_syscall.c,v 1.2 2021/09/27 17:40:39 ryo Exp $    */
 
 /*
  * Copyright (c) 2021 Ryo Shimizu <ryo%nerv.org@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.1 2021/09/23 06:56:26 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.2 2021/09/27 17:40:39 ryo Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_linux.h"
@@ -54,5 +54,7 @@
 /* used when __HAVE_MINIMAL_EMUL is not defined */
 #define SYSCALL_EMUL_ERRNO(x)  native_to_linux_errno[x]
 
+/* don't update x1 register with rval[1] */
+#define SYSCALL_NO_RVAL1
 
 #include "syscall.c"
diff -r 6e336b9d4623 -r ac8e4a361433 sys/arch/aarch64/aarch64/syscall.c
--- a/sys/arch/aarch64/aarch64/syscall.c        Mon Sep 27 17:37:59 2021 +0000
+++ b/sys/arch/aarch64/aarch64/syscall.c        Mon Sep 27 17:40:39 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: syscall.c,v 1.9 2021/09/27 17:37:59 ryo Exp $  */
+/*     $NetBSD: syscall.c,v 1.10 2021/09/27 17:40:39 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
 #define EMULNAME(x)    (x)
 #define EMULNAMEU(x)   (x)
 
-__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.9 2021/09/27 17:37:59 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.10 2021/09/27 17:40:39 ryo Exp $");
 
 void
 cpu_spawn_return(struct lwp *l)
@@ -208,7 +208,9 @@
 #endif
                } else {
                        tf->tf_reg[0] = rval[0];
+#ifndef SYSCALL_NO_RVAL1
                        tf->tf_reg[1] = rval[1];
+#endif
                }
                tf->tf_spsr &= ~NZCV_C;
        } else {



Home | Main Index | Thread Index | Old Index