Use sy_invoke
This commit is contained in:
parent
7b9edbe958
commit
8b42139220
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: syscall.c,v 1.56 2012/08/16 17:35:01 matt Exp $ */
|
||||
/* $NetBSD: syscall.c,v 1.57 2013/06/26 06:31:53 matt Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2000, 2003 The NetBSD Foundation, Inc.
|
||||
|
@ -71,7 +71,7 @@
|
|||
|
||||
#include <sys/param.h>
|
||||
|
||||
__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.56 2012/08/16 17:35:01 matt Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.57 2013/06/26 06:31:53 matt Exp $");
|
||||
|
||||
#include <sys/device.h>
|
||||
#include <sys/errno.h>
|
||||
|
@ -254,17 +254,7 @@ syscall(struct trapframe *tf, lwp_t *l, uint32_t insn)
|
|||
args = &tf->tf_r0;
|
||||
}
|
||||
|
||||
if (!__predict_false(p->p_trace_enabled)
|
||||
|| __predict_false(callp->sy_flags & SYCALL_INDIRECT)
|
||||
|| (error = trace_enter(code, args, nargs)) == 0) {
|
||||
rval[0] = 0;
|
||||
rval[1] = 0;
|
||||
error = (*callp->sy_call)(l, args, rval);
|
||||
}
|
||||
|
||||
if (__predict_false(p->p_trace_enabled)
|
||||
|| !__predict_false(callp->sy_flags & SYCALL_INDIRECT))
|
||||
trace_exit(code, rval, error);
|
||||
error = sy_invoke(callp, l, args, rval, code);
|
||||
|
||||
switch (error) {
|
||||
case 0:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: syscall.c,v 1.51 2012/07/20 14:21:20 matt Exp $ */
|
||||
/* $NetBSD: syscall.c,v 1.52 2013/06/26 06:31:53 matt Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 2002 Matt Thomas
|
||||
|
@ -61,7 +61,7 @@
|
|||
#define EMULNAME(x) (x)
|
||||
#define EMULNAMEU(x) (x)
|
||||
|
||||
__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.51 2012/07/20 14:21:20 matt Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.52 2013/06/26 06:31:53 matt Exp $");
|
||||
|
||||
void
|
||||
child_return(void *arg)
|
||||
|
@ -144,18 +144,7 @@ EMULNAME(syscall)(struct trapframe *tf)
|
|||
params = args;
|
||||
}
|
||||
|
||||
if (!__predict_false(p->p_trace_enabled)
|
||||
|| __predict_false(callp->sy_flags & SYCALL_INDIRECT)
|
||||
|| (error = trace_enter(realcode, params, callp->sy_narg)) == 0) {
|
||||
rval[0] = 0;
|
||||
rval[1] = 0;
|
||||
error = sy_call(callp, l, params, rval);
|
||||
}
|
||||
|
||||
if (__predict_false(p->p_trace_enabled)
|
||||
&& !__predict_false(callp->sy_flags & SYCALL_INDIRECT)) {
|
||||
trace_exit(code, rval, error);
|
||||
}
|
||||
error = sy_invoke(callp, l, params, rval, code);
|
||||
|
||||
if (__predict_true(error == 0)) {
|
||||
tf->tf_fixreg[FIRSTARG] = rval[0];
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: syscall.c,v 1.22 2013/01/15 10:18:38 martin Exp $ */
|
||||
/* $NetBSD: syscall.c,v 1.23 2013/06/26 06:31:53 matt Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
|
||||
|
@ -33,7 +33,7 @@
|
|||
/* All bugs are subject to removal without further notice */
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.22 2013/01/15 10:18:38 martin Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.23 2013/06/26 06:31:53 matt Exp $");
|
||||
|
||||
#include "opt_multiprocessor.h"
|
||||
|
||||
|
@ -103,11 +103,7 @@ syscall(struct trapframe *tf)
|
|||
* Only trace if tracing is enabled and the syscall isn't indirect
|
||||
* (SYS_syscall or SYS___syscall)
|
||||
*/
|
||||
if (__predict_true(!p->p_trace_enabled)
|
||||
|| __predict_false(callp->sy_flags & SYCALL_INDIRECT)
|
||||
|| (error = trace_enter(tf->tf_code, args, callp->sy_narg)) == 0) {
|
||||
error = sy_call(callp, curlwp, args, rval);
|
||||
}
|
||||
error = sy_invoke(callp, curlwp, args, rval, tf->tf_code);
|
||||
|
||||
TDB(("return %s pc %lx, psl %lx, sp %lx, pid %d, err %d r0 %d, r1 %d, "
|
||||
"tf %p\n", syscallnames[tf->tf_code], tf->tf_pc, tf->tf_psl,
|
||||
|
@ -134,10 +130,6 @@ bad:
|
|||
break;
|
||||
}
|
||||
|
||||
if (__predict_false(p->p_trace_enabled)
|
||||
&& __predict_true(!(callp->sy_flags & SYCALL_INDIRECT)))
|
||||
trace_exit(tf->tf_code, rval, error);
|
||||
|
||||
userret(l, tf, oticks);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue