]> xenbits.xensource.com Git - people/liuw/rumprun.git/commitdiff
Use rumprun_config() instead of a homegrown interface.
authorAntti Kantee <pooka@iki.fi>
Wed, 22 Apr 2015 10:51:09 +0000 (10:51 +0000)
committerAntti Kantee <pooka@iki.fi>
Wed, 22 Apr 2015 10:51:09 +0000 (10:51 +0000)
We still do hackish configuration, but at least we do something.

platform/baremetal/init.c
platform/baremetal/rumpconfig.c

index fd3ba6cf302afb67c04499d0c98336729a6e0770..bd92c6f9538320ecfd5cb34ca5f01eb6c2553afc 100644 (file)
 
 #include <stdio.h>
 
-#include <rump/rump.h>
-#include <rump/netconfig.h>
-
 #include <bmk/app.h>
 
 #include <rumprun-base/netbsd_initfini.h>
 
-int bmk_havenet;
-
-/*
- * boot and configure rump kernel
- */
-static void
-rumpkern_config(void)
-{
-       int rv = 1;
-
-       /* le hack */
-       if (rump_pub_netconfig_ifup("wm0") == 0)
-               rv = rump_pub_netconfig_dhcp_ipv4_oneshot("wm0");
-       else if (rump_pub_netconfig_ifup("pcn0") == 0)
-               rv = rump_pub_netconfig_dhcp_ipv4_oneshot("pcn0");
-       else if (rump_pub_netconfig_ifup("vioif0") == 0)
-               rv = rump_pub_netconfig_dhcp_ipv4_oneshot("vioif0");
-       bmk_havenet = rv == 0;
-}
-
 void
 bmk_mainthread(void *notused)
 {
@@ -61,7 +38,6 @@ bmk_mainthread(void *notused)
        int rv;
 
        _netbsd_init();
-       rumpkern_config();
 
        printf("=== calling main() ===\n\n");
         rv = main(1, argv);
index 6e32bac23f05f70c214c48081cbfef1c20efd675..4938cae3808043eb6a723d068dde4030053032de 100644 (file)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2014 Martin Lucina.  All Rights Reserved.
+ * Copyright (c) 2015 Antti Kantee.  All Rights Reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * SUCH DAMAGE.
  */
 
-/* placeholder/stubs (in case it was unguessable) */
+#include <bmk/types.h>
+
+#include <rump/rump.h>
+#include <rump/netconfig.h>
 
 #include <rumprun-base/config.h>
 
+/*
+ * Does not exactly implement the config interface fully, but
+ * at least we might get network configuration ...
+ */
+
 void
 _rumprun_config(void)
 {
 
+       /* le hack */
+       if (rump_pub_netconfig_ifup("wm0") == 0)
+               rump_pub_netconfig_dhcp_ipv4_oneshot("wm0");
+       else if (rump_pub_netconfig_ifup("pcn0") == 0)
+               rump_pub_netconfig_dhcp_ipv4_oneshot("pcn0");
+       else if (rump_pub_netconfig_ifup("vioif0") == 0)
+               rump_pub_netconfig_dhcp_ipv4_oneshot("vioif0");
 }
 
 void