From 8b42139220552ff00df529bb47a2ecf2ccb1c7e3 Mon Sep 17 00:00:00 2001 From: matt Date: Wed, 26 Jun 2013 06:31:53 +0000 Subject: [PATCH] Use sy_invoke --- sys/arch/arm/arm/syscall.c | 16 +++------------- sys/arch/powerpc/powerpc/syscall.c | 17 +++-------------- sys/arch/vax/vax/syscall.c | 14 +++----------- 3 files changed, 9 insertions(+), 38 deletions(-) diff --git a/sys/arch/arm/arm/syscall.c b/sys/arch/arm/arm/syscall.c index d107c6940b87..36c56bf927de 100644 --- a/sys/arch/arm/arm/syscall.c +++ b/sys/arch/arm/arm/syscall.c @@ -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 -__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 #include @@ -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: diff --git a/sys/arch/powerpc/powerpc/syscall.c b/sys/arch/powerpc/powerpc/syscall.c index cc762c4e0aa7..b0470bb1260e 100644 --- a/sys/arch/powerpc/powerpc/syscall.c +++ b/sys/arch/powerpc/powerpc/syscall.c @@ -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]; diff --git a/sys/arch/vax/vax/syscall.c b/sys/arch/vax/vax/syscall.c index 2b0d846c2ae3..9b5c2fcf5669 100644 --- a/sys/arch/vax/vax/syscall.c +++ b/sys/arch/vax/vax/syscall.c @@ -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 -__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); }