Source-Changes-HG archive

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

[src/trunk]: src/sys/rump/librump On the one thousand and ninth day rump's ma...



details:   https://anonhg.NetBSD.org/src/rev/9d57e0979364
branches:  trunk
changeset: 451284:9d57e0979364
user:      bad <bad%NetBSD.org@localhost>
date:      Mon May 13 17:49:05 2019 +0000

description:
On the one thousand and ninth day rump's mainbus was moved from
rumpdev to rumpkern, liberating all rumpnet users from the need to
-lrumpdev -lrumpvfs just because a loopback interface is mandatory.

Rename rumpdev/autoconf.c to rumpkern/rump_autoconf.c to avoid
accidentally picking up e.g. sys/arch/amd64/amd64/autoconf.c through
make's .PATH.
Move rumpdev/MAINBUS.ioconf to rumpkern.

diffstat:

 sys/rump/librump/rumpdev/MAINBUS.ioconf     |    6 -
 sys/rump/librump/rumpdev/Makefile.rumpdev   |    9 +-
 sys/rump/librump/rumpdev/autoconf.c         |  140 ----------------------------
 sys/rump/librump/rumpkern/MAINBUS.ioconf    |    6 +
 sys/rump/librump/rumpkern/Makefile.rumpkern |   13 +-
 sys/rump/librump/rumpkern/rump_autoconf.c   |  140 ++++++++++++++++++++++++++++
 6 files changed, 157 insertions(+), 157 deletions(-)

diffs (truncated from 376 to 300 lines):

diff -r 8b62f9add40b -r 9d57e0979364 sys/rump/librump/rumpdev/MAINBUS.ioconf
--- a/sys/rump/librump/rumpdev/MAINBUS.ioconf   Mon May 13 16:55:17 2019 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-ioconf mainbus
-
-include "conf/files"
-include "rump/dev/files.rump"
-
-mainbus0 at root
diff -r 8b62f9add40b -r 9d57e0979364 sys/rump/librump/rumpdev/Makefile.rumpdev
--- a/sys/rump/librump/rumpdev/Makefile.rumpdev Mon May 13 16:55:17 2019 +0000
+++ b/sys/rump/librump/rumpdev/Makefile.rumpdev Mon May 13 17:49:05 2019 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.rumpdev,v 1.12 2015/10/19 16:16:38 pooka Exp $
+#      $NetBSD: Makefile.rumpdev,v 1.13 2019/05/13 17:49:05 bad Exp $
 #
 
 LIB=   rumpdev
@@ -8,13 +8,10 @@
        ${RUMPTOP}/../kern                                      \
        ${RUMPTOP}/../dev
 
-IOCONFDIR:=    ${.PARSEDIR}
-IOCONF=                MAINBUS.ioconf
-
-SRCS=  rump_dev.c autoconf.c
+SRCS=  rump_dev.c
 
 # sys/kern
-SRCS+= kern_pmf.c subr_autoconf.c
+SRCS+= kern_pmf.c
 
 # sys/dev
 SRCS+= dev_verbose.c
diff -r 8b62f9add40b -r 9d57e0979364 sys/rump/librump/rumpdev/autoconf.c
--- a/sys/rump/librump/rumpdev/autoconf.c       Mon May 13 16:55:17 2019 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,140 +0,0 @@
-/*     $NetBSD: autoconf.c,v 1.9 2016/01/26 23:12:17 pooka Exp $       */
-
-/*
- * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.9 2016/01/26 23:12:17 pooka Exp $");
-
-#include <sys/param.h>
-#include <sys/device.h>
-#include <sys/kernel.h>
-
-static int     mainbus_match(device_t, cfdata_t, void *);
-static void    mainbus_attach(device_t, device_t, void *);
-static int     mainbus_search(device_t, cfdata_t, const int *, void *);
-
-struct mainbus_softc {
-       int mb_nada;
-};
-
-/*
- * Initial lists as required by autoconf(9).  The data from ioconf.c
- * is patched in by rump_mainbus_init().
- */
-const struct cfattachinit cfattachinit[] = {
-       { NULL, NULL },
-};
-struct cfdata cfdata[] = {
-       { NULL, NULL, 0, FSTATE_NOTFOUND, NULL, 0, NULL}, /* replaced by init */
-       { NULL, NULL, 0, FSTATE_NOTFOUND, NULL, 0, NULL},
-};
-struct cfdriver * const cfdriver_list_initial[] = {
-       NULL,
-};
-
-#include "ioconf.c"
-
-CFATTACH_DECL_NEW(mainbus, sizeof(struct mainbus_softc),
-       mainbus_match, mainbus_attach, NULL, NULL);
-
-const short cfroots[] = {
-       0, /* mainbus */
-       -1
-};
-
-/* actually used */
-#define MAXPDEVS 256
-struct pdevinit pdevinit[MAXPDEVS] = {{NULL,0}, }; /* XXX: static limit */
-static int pdev_total = 0;
-
-#include <rump-sys/dev.h>
-
-void
-rump_pdev_add(void (*pdev_attach)(int), int pdev_count)
-{
-       struct pdevinit *pdev_new;
-
-       KASSERT(cold);
-
-       pdev_new = &pdevinit[pdev_total];
-       pdev_new->pdev_attach = pdev_attach;
-       pdev_new->pdev_count = pdev_count;
-
-       pdev_total++;
-       KASSERT(pdev_total < MAXPDEVS);
-}
-
-void
-rump_pdev_finalize()
-{
-
-       rump_pdev_add(NULL, 0);
-}
-
-static int
-mainbus_match(device_t parent, cfdata_t match, void *aux)
-{
-
-       return 1;
-}
-
-static void
-mainbus_attach(device_t parent, device_t self, void *aux)
-{
-
-       aprint_normal("\n");
-       config_search_ia(mainbus_search, self, "mainbus", NULL);
-}
-
-static int
-mainbus_search(device_t parent, cfdata_t cf, const int *ldesc, void *aux)
-{
-       struct mainbus_attach_args maa;
-
-       maa.maa_unit = cf->cf_unit;
-       if (config_match(parent, cf, &maa) > 0)
-               config_attach(parent, cf, &maa, NULL);
-
-       return 0;
-}
-
-void
-rump_mainbus_init(void)
-{
-
-       /* replace cfdata[0] to a state expected by autoconf(9) */
-       memcpy(&cfdata[0], &cfdata_ioconf_mainbus[0], sizeof(cfdata[0]));
-}
-
-void
-rump_mainbus_attach(void)
-{
-       const struct cfattachinit *cfai = &cfattach_ioconf_mainbus[0];
-
-       config_cfdata_attach(cfdata, 0);
-       config_cfdriver_attach(cfdriver_ioconf_mainbus[0]);
-       config_cfattach_attach(cfai->cfai_name, cfai->cfai_list[0]);
-}
diff -r 8b62f9add40b -r 9d57e0979364 sys/rump/librump/rumpkern/MAINBUS.ioconf
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/librump/rumpkern/MAINBUS.ioconf  Mon May 13 17:49:05 2019 +0000
@@ -0,0 +1,6 @@
+ioconf mainbus
+
+include "conf/files"
+include "rump/dev/files.rump"
+
+mainbus0 at root
diff -r 8b62f9add40b -r 9d57e0979364 sys/rump/librump/rumpkern/Makefile.rumpkern
--- a/sys/rump/librump/rumpkern/Makefile.rumpkern       Mon May 13 16:55:17 2019 +0000
+++ b/sys/rump/librump/rumpkern/Makefile.rumpkern       Mon May 13 17:49:05 2019 +0000
@@ -1,9 +1,8 @@
-#      $NetBSD: Makefile.rumpkern,v 1.174 2019/01/27 02:08:49 pgoyette Exp $
+#      $NetBSD: Makefile.rumpkern,v 1.175 2019/05/13 17:49:05 bad Exp $
 #
 
-.include "${RUMPTOP}/Makefile.rump"
-
-.include <bsd.own.mk>
+IOCONFDIR:=    ${.PARSEDIR}
+IOCONF=                MAINBUS.ioconf
 
 LIB=           rump
 COMMENT=       Rump kernel base
@@ -31,7 +30,7 @@
        signals.c sleepq.c threads.c vm.c hyperentropy.c        \
        accessors.c
 
-SRCS+= rumpkern_syscalls.c
+SRCS+= rump_autoconf.c rumpkern_syscalls.c
 
 # autogenerated into the correct namespace
 RUMPOBJ_NORENAME= rump_syscalls.o rump_syscalls.pico rump_syscalls.po
@@ -99,6 +98,7 @@
        kern_timeout.c          \
        kern_uidinfo.c          \
        param.c                 \
+       subr_autoconf.c         \
        subr_callback.c         \
        subr_copy.c             \
        subr_cprng.c            \
@@ -160,6 +160,9 @@
 SRCS+= rijndael.c
 SRCS+= cprng_fast.c
 
+.include "${RUMPTOP}/Makefile.rump"
+.include <bsd.own.mk>
+
 # compat
 .if !empty(RUMP_NBCOMPAT:M50)
 SRCS+= kern_select_50.c
diff -r 8b62f9add40b -r 9d57e0979364 sys/rump/librump/rumpkern/rump_autoconf.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/librump/rumpkern/rump_autoconf.c Mon May 13 17:49:05 2019 +0000
@@ -0,0 +1,140 @@
+/*     $NetBSD: rump_autoconf.c,v 1.1 2019/05/13 17:49:05 bad Exp $    */
+
+/*
+ * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: rump_autoconf.c,v 1.1 2019/05/13 17:49:05 bad Exp $");
+
+#include <sys/param.h>
+#include <sys/device.h>
+#include <sys/kernel.h>
+
+static int     mainbus_match(device_t, cfdata_t, void *);
+static void    mainbus_attach(device_t, device_t, void *);
+static int     mainbus_search(device_t, cfdata_t, const int *, void *);
+
+struct mainbus_softc {
+       int mb_nada;
+};
+
+/*
+ * Initial lists as required by autoconf(9).  The data from ioconf.c
+ * is patched in by rump_mainbus_init().
+ */
+const struct cfattachinit cfattachinit[] = {
+       { NULL, NULL },
+};
+struct cfdata cfdata[] = {
+       { NULL, NULL, 0, FSTATE_NOTFOUND, NULL, 0, NULL}, /* replaced by init */
+       { NULL, NULL, 0, FSTATE_NOTFOUND, NULL, 0, NULL},
+};
+struct cfdriver * const cfdriver_list_initial[] = {
+       NULL,
+};
+
+#include "ioconf.c"
+
+CFATTACH_DECL_NEW(mainbus, sizeof(struct mainbus_softc),
+       mainbus_match, mainbus_attach, NULL, NULL);
+
+const short cfroots[] = {
+       0, /* mainbus */



Home | Main Index | Thread Index | Old Index