Module Name:    src
Committed By:   pooka
Date:           Tue Sep  3 19:55:13 UTC 2013

Modified Files:
        src/sys/kern: makesyscalls.sh
        src/sys/rump/librump/rumpkern: rump.c rump_private.h

Log Message:
Don't autogenerate the wrapper that is called from the rump kernel
local syscall entry points.  The wrapper is now so big that it doesn't
get inlined (original intent for having it close to the entry points),
and autogenerating a regular function just loses in flexibility.


To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.130 src/sys/kern/makesyscalls.sh
cvs rdiff -u -r1.271 -r1.272 src/sys/rump/librump/rumpkern/rump.c
cvs rdiff -u -r1.74 -r1.75 src/sys/rump/librump/rumpkern/rump_private.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/kern/makesyscalls.sh
diff -u src/sys/kern/makesyscalls.sh:1.129 src/sys/kern/makesyscalls.sh:1.130
--- src/sys/kern/makesyscalls.sh:1.129	Thu Aug 15 21:16:13 2013
+++ src/sys/kern/makesyscalls.sh	Tue Sep  3 19:55:13 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: makesyscalls.sh,v 1.129 2013/08/15 21:16:13 pooka Exp $
+#	$NetBSD: makesyscalls.sh,v 1.130 2013/09/03 19:55:13 pooka Exp $
 #
 # Copyright (c) 1994, 1996, 2000 Christopher G. Demetriou
 # All rights reserved.
@@ -245,21 +245,8 @@ NR == 1 {
 	printf "#include <sys/syscallvar.h>\n\n" > rumpcalls
 	printf "#include <rump/rumpuser.h>\n" > rumpcalls
 	printf "#include \"rump_private.h\"\n\n" > rumpcalls
-	printf "static int\nrsys_syscall" > rumpcalls
-	printf "(int num, void *data, size_t dlen, register_t *retval)" > rumpcalls
-	printf "\n{\n\tstruct proc *p;\n" > rumpcalls
-	printf "\tstruct emul *e;\n" > rumpcalls
-	printf "\tstruct sysent *callp;\n" > rumpcalls
-	printf "\tint rv;\n\n" > rumpcalls
-	printf "\trump_schedule();\n" > rumpcalls
-	printf "\tp = curproc;\n" > rumpcalls
-	printf "\te = p->p_emul;\n" > rumpcalls
-	printf "#ifndef __HAVE_MINIMAL_EMUL\n" > rumpcalls
-	printf "\tKASSERT(num > 0 && num < e->e_nsysent);\n" > rumpcalls
-	printf "#endif\n" > rumpcalls
-	printf "\tcallp = e->e_sysent + num;\n\n" > rumpcalls
-	printf "\trv = sy_call(callp, curlwp, data, retval);\n" > rumpcalls
-	printf "\trump_unschedule();\n\n\treturn rv;\n}\n\n" > rumpcalls
+	printf "#define rsys_syscall(num, data, dlen, retval)\t\\\n" > rumpcalls
+	printf "    rump_syscall(num, data, dlen, retval)\n\n" > rumpcalls
 	printf "#define rsys_seterrno(error) rumpuser_seterrno(error)\n" > rumpcalls
 	printf "#define rsys_alias(a,b) __weak_alias(a,b);\n#endif\n\n" > rumpcalls
 

Index: src/sys/rump/librump/rumpkern/rump.c
diff -u src/sys/rump/librump/rumpkern/rump.c:1.271 src/sys/rump/librump/rumpkern/rump.c:1.272
--- src/sys/rump/librump/rumpkern/rump.c:1.271	Wed Jul  3 17:10:28 2013
+++ src/sys/rump/librump/rumpkern/rump.c	Tue Sep  3 19:55:13 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump.c,v 1.271 2013/07/03 17:10:28 njoly Exp $	*/
+/*	$NetBSD: rump.c,v 1.272 2013/09/03 19:55:13 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007-2011 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.271 2013/07/03 17:10:28 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.272 2013/09/03 19:55:13 pooka Exp $");
 
 #include <sys/systm.h>
 #define ELFSIZE ARCH_ELFSIZE
@@ -982,3 +982,25 @@ rump_xc_highpri(struct cpu_info *ci)
 	else
 		xc_broadcast(0, ipiemu, NULL, NULL);
 }
+
+int
+rump_syscall(int num, void *data, size_t dlen, register_t *retval)
+{
+	struct proc *p;
+	struct emul *e;
+	struct sysent *callp;
+	int rv;
+
+	rump_schedule();
+	p = curproc;
+	e = p->p_emul;
+#ifndef __HAVE_MINIMAL_EMUL
+	KASSERT(num > 0 && num < e->e_nsysent);
+#endif
+	callp = e->e_sysent + num;
+
+	rv = sy_call(callp, curlwp, data, retval);
+	rump_unschedule();
+
+	return rv;
+}

Index: src/sys/rump/librump/rumpkern/rump_private.h
diff -u src/sys/rump/librump/rumpkern/rump_private.h:1.74 src/sys/rump/librump/rumpkern/rump_private.h:1.75
--- src/sys/rump/librump/rumpkern/rump_private.h:1.74	Sun Mar 10 16:51:31 2013
+++ src/sys/rump/librump/rumpkern/rump_private.h	Tue Sep  3 19:55:13 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump_private.h,v 1.74 2013/03/10 16:51:31 pooka Exp $	*/
+/*	$NetBSD: rump_private.h,v 1.75 2013/09/03 19:55:13 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007-2011 Antti Kantee.  All Rights Reserved.
@@ -118,6 +118,7 @@ void 	rump_schedule_cpu_interlock(struct
 void	rump_unschedule_cpu(struct lwp *);
 void	rump_unschedule_cpu_interlock(struct lwp *, void *);
 void	rump_unschedule_cpu1(struct lwp *, void *);
+int	rump_syscall(int, void *, size_t, register_t *);
 
 void	rump_schedlock_cv_wait(struct rumpuser_cv *);
 int	rump_schedlock_cv_timedwait(struct rumpuser_cv *,

Reply via email to