Source-Changes-HG archive

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

[src/trunk]: src/sys/rump/librump/rumpkern Also create hw.pagesize, makes sys...



details:   https://anonhg.NetBSD.org/src/rev/c58f6e7d07ac
branches:  trunk
changeset: 789714:c58f6e7d07ac
user:      pooka <pooka%NetBSD.org@localhost>
date:      Wed Sep 04 17:56:08 2013 +0000

description:
Also create hw.pagesize, makes sysconf(_SC_PAGESIZE) return a more
sensible result.

diffstat:

 sys/rump/librump/rumpkern/rump.c |  24 +++++++++++++++++++-----
 1 files changed, 19 insertions(+), 5 deletions(-)

diffs (59 lines):

diff -r 7763209660c4 -r c58f6e7d07ac sys/rump/librump/rumpkern/rump.c
--- a/sys/rump/librump/rumpkern/rump.c  Wed Sep 04 17:45:40 2013 +0000
+++ b/sys/rump/librump/rumpkern/rump.c  Wed Sep 04 17:56:08 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rump.c,v 1.272 2013/09/03 19:55:13 pooka Exp $ */
+/*     $NetBSD: rump.c,v 1.273 2013/09/04 17:56:08 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.272 2013/09/03 19:55:13 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.273 2013/09/04 17:56:08 pooka Exp $");
 
 #include <sys/systm.h>
 #define ELFSIZE ARCH_ELFSIZE
@@ -158,23 +158,37 @@
 static void add_linkedin_modules(const struct modinfo *const *, size_t);
 
 /*
- * Create kern.hostname.  why only this you ask.  well, init_sysctl
+ * Create some sysctl nodes.  why only this you ask.  well, init_sysctl
  * is a kitchen sink in need of some gardening.  but i want to use
- * kern.hostname today.
+ * others today.  Furthermore, creating a whole kitchen sink full of
+ * sysctl nodes is a waste of cycles for rump kernel bootstrap.
  */
 static void
 mksysctls(void)
 {
 
+       /* kern.hostname */
        sysctl_createv(NULL, 0, NULL, NULL,
            CTLFLAG_PERMANENT, CTLTYPE_NODE, "kern", NULL,
            NULL, 0, NULL, 0, CTL_KERN, CTL_EOL);
-
        /* XXX: setting hostnamelen is missing */
        sysctl_createv(NULL, 0, NULL, NULL,
            CTLFLAG_PERMANENT|CTLFLAG_READWRITE, CTLTYPE_STRING, "hostname",
            SYSCTL_DESCR("System hostname"), NULL, 0,
            hostname, MAXHOSTNAMELEN, CTL_KERN, KERN_HOSTNAME, CTL_EOL);
+
+       /* hw.pagesize */
+       sysctl_createv(NULL, 0, NULL, NULL,
+           CTLFLAG_PERMANENT,
+           CTLTYPE_NODE, "hw", NULL,
+           NULL, 0, NULL, 0,
+           CTL_HW, CTL_EOL);
+       sysctl_createv(NULL, 0, NULL, NULL,
+           CTLFLAG_PERMANENT|CTLFLAG_IMMEDIATE,
+           CTLTYPE_INT, "pagesize",
+           SYSCTL_DESCR("Software page size"),
+           NULL, PAGE_SIZE, NULL, 0,
+           CTL_HW, HW_PAGESIZE, CTL_EOL);
 }
 
 /* there's no convenient kernel entry point for this, so just craft out own */



Home | Main Index | Thread Index | Old Index