diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2023-01-16 05:32:06 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2023-01-16 05:32:06 +0000 |
commit | 9d064db0a2a6e9cebcb374ca76fb50f4c069a39b (patch) | |
tree | 9d84891dd44eec95d345453bdae1169e120fe866 /sys/arch/arm | |
parent | ff34d857fd6e85016c617d586e47c6d77f44d0b5 (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/arm')
-rw-r--r-- | sys/arch/arm/arm/syscall.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/arch/arm/arm/syscall.c b/sys/arch/arm/arm/syscall.c index d8f97b18104..eabf879dead 100644 --- a/sys/arch/arm/arm/syscall.c +++ b/sys/arch/arm/arm/syscall.c @@ -1,4 +1,4 @@ -/* $OpenBSD: syscall.c,v 1.24 2021/12/09 00:26:11 guenther Exp $ */ +/* $OpenBSD: syscall.c,v 1.25 2023/01/16 05:32:04 deraadt Exp $ */ /* $NetBSD: syscall.c,v 1.24 2003/11/14 19:03:17 scw Exp $ */ /*- @@ -94,7 +94,7 @@ swi_handler(trapframe_t *frame) { struct proc *p = curproc; const struct sysent *callp; - int code, error; + int code, error, indirect = -1; u_int nap = 4, nargs; register_t *ap, *args, copyargs[MAXARGS], rval[2]; @@ -118,10 +118,12 @@ swi_handler(trapframe_t *frame) switch (code) { case SYS_syscall: + indirect = code; code = *ap++; nap--; break; case SYS___syscall: + indirect = code; code = ap[_QUAD_LOWWORD]; ap += 2; nap -= 2; @@ -149,7 +151,7 @@ swi_handler(trapframe_t *frame) rval[0] = 0; rval[1] = frame->tf_r1; - error = mi_syscall(p, code, callp, args, rval); + error = mi_syscall(p, code, indirect, callp, args, rval); switch (error) { case 0: |