Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys Don't autogenerate the wrapper that is called from the r...



details:   https://anonhg.NetBSD.org/src/rev/1ff6c70b8a64
branches:  trunk
changeset: 789698:1ff6c70b8a64
user:      pooka <pooka%NetBSD.org@localhost>
date:      Tue Sep 03 19:55:13 2013 +0000

description:
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.

diffstat:

 sys/kern/makesyscalls.sh                 |  19 +++----------------
 sys/rump/librump/rumpkern/rump.c         |  26 ++++++++++++++++++++++++--
 sys/rump/librump/rumpkern/rump_private.h |   3 ++-
 3 files changed, 29 insertions(+), 19 deletions(-)

diffs (94 lines):

diff -r 40d88179dbbf -r 1ff6c70b8a64 sys/kern/makesyscalls.sh
--- a/sys/kern/makesyscalls.sh  Tue Sep 03 18:02:26 2013 +0000
+++ b/sys/kern/makesyscalls.sh  Tue Sep 03 19:55:13 2013 +0000
@@ -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 @@
        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
 
diff -r 40d88179dbbf -r 1ff6c70b8a64 sys/rump/librump/rumpkern/rump.c
--- a/sys/rump/librump/rumpkern/rump.c  Tue Sep 03 18:02:26 2013 +0000
+++ b/sys/rump/librump/rumpkern/rump.c  Tue Sep 03 19:55:13 2013 +0000
@@ -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 @@
        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;
+}
diff -r 40d88179dbbf -r 1ff6c70b8a64 sys/rump/librump/rumpkern/rump_private.h
--- a/sys/rump/librump/rumpkern/rump_private.h  Tue Sep 03 18:02:26 2013 +0000
+++ b/sys/rump/librump/rumpkern/rump_private.h  Tue Sep 03 19:55:13 2013 +0000
@@ -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_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 *,



Home | Main Index | Thread Index | Old Index