summaryrefslogtreecommitdiff
path: root/sys/arch/sh
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2023-01-16 05:32:06 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2023-01-16 05:32:06 +0000
commit9d064db0a2a6e9cebcb374ca76fb50f4c069a39b (patch)
tree9d84891dd44eec95d345453bdae1169e120fe866 /sys/arch/sh
parentff34d857fd6e85016c617d586e47c6d77f44d0b5 (diff)
we spent far too long debugging a weird go library problem (incorrect
arguments to mmap) because it was using syscall(2) and that callpath is invisible in ktrace. make it visible, it will now show "(via syscall)" and such. ok guenther
Diffstat (limited to 'sys/arch/sh')
-rw-r--r--sys/arch/sh/sh/trap.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/arch/sh/sh/trap.c b/sys/arch/sh/sh/trap.c
index e623d4e62f4..491a239bd21 100644
--- a/sys/arch/sh/sh/trap.c
+++ b/sys/arch/sh/sh/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.52 2023/01/09 06:04:14 miod Exp $ */
+/* $OpenBSD: trap.c,v 1.53 2023/01/16 05:32:05 deraadt Exp $ */
/* $NetBSD: exception.c,v 1.32 2006/09/04 23:57:52 uwe Exp $ */
/* $NetBSD: syscall.c,v 1.6 2006/03/07 07:21:50 thorpej Exp $ */
@@ -516,7 +516,7 @@ syscall(struct proc *p, struct trapframe *tf)
{
caddr_t params;
const struct sysent *callp;
- int error, opc;
+ int error, opc, indirect = -1;
int argoff, argsize;
register_t code, args[8], rval[2];
@@ -532,6 +532,7 @@ syscall(struct proc *p, struct trapframe *tf)
/*
* Code is first argument, followed by actual args.
*/
+ indirect = code;
code = tf->tf_r4;
argoff = 1;
break;
@@ -540,6 +541,7 @@ syscall(struct proc *p, struct trapframe *tf)
* Like syscall, but code is a quad, so as to maintain
* quad alignment for the rest of the arguments.
*/
+ indirect = code;
#if _BYTE_ORDER == BIG_ENDIAN
code = tf->tf_r5;
#else
@@ -605,7 +607,7 @@ syscall(struct proc *p, struct trapframe *tf)
rval[0] = 0;
rval[1] = tf->tf_r1;
- error = mi_syscall(p, code, callp, args, rval);
+ error = mi_syscall(p, code, indirect, callp, args, rval);
switch (error) {
case 0: