Module Name: src
Committed By: matt
Date: Sat Feb 15 10:14:35 UTC 2014
Modified Files:
src/sys/sys [matt-nb5-mips64]: syscallvar.h
Log Message:
Add sy_invoke inline from HEAD
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.8.1 src/sys/sys/syscallvar.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/sys/syscallvar.h
diff -u src/sys/sys/syscallvar.h:1.2 src/sys/sys/syscallvar.h:1.2.8.1
--- src/sys/sys/syscallvar.h:1.2 Tue Oct 21 12:22:00 2008
+++ src/sys/sys/syscallvar.h Sat Feb 15 10:14:35 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: syscallvar.h,v 1.2 2008/10/21 12:22:00 ad Exp $ */
+/* $NetBSD: syscallvar.h,v 1.2.8.1 2014/02/15 10:14:35 matt Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -52,4 +52,31 @@ sy_call(const struct sysent *sy, struct
return error;
}
+static inline int
+sy_invoke(const struct sysent *sy, struct lwp *l, const void *uap,
+ register_t *rval, int code)
+{
+ const bool do_trace = l->l_proc->p_trace_enabled &&
+ (sy->sy_flags & SYCALL_INDIRECT) == 0;
+ int error;
+
+ if (__predict_true(!do_trace) || (error = trace_enter(code, uap,
+ sy->sy_narg)) == 0) {
+ rval[0] = 0;
+#if !defined(__mips__)
+ /*
+ * Due to the mips userland code for SYS_break needing v1 to be
+ * preserved, we can't clear this on mips.
+ */
+ rval[1] = 0;
+#endif
+ error = sy_call(sy, l, uap, rval);
+ }
+
+ if (__predict_false(do_trace)) {
+ trace_exit(code, rval, error);
+ }
+ return error;
+}
+
#endif /* _SYS_SYSCALLVAR_H_ */