bug-hurd
[Top][All Lists]
Advanced

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

[PATCH 2/2] machdev: Pass argv through to _hurd_init


From: Damien Zammit
Subject: [PATCH 2/2] machdev: Pass argv through to _hurd_init
Date: Fri, 19 Mar 2021 13:15:12 +1100

---
 libmachdev/machdev.h       | 2 +-
 libmachdev/trivfs_server.c | 9 ++++++---
 pci-arbiter/main.c         | 2 +-
 rumpdisk/main.c            | 2 +-
 4 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/libmachdev/machdev.h b/libmachdev/machdev.h
index 8f613b35..9884c70d 100644
--- a/libmachdev/machdev.h
+++ b/libmachdev/machdev.h
@@ -33,7 +33,7 @@ void machdev_device_init(void);
 void machdev_device_shutdown(mach_port_t dosync_handle);
 void * machdev_server(void *);
 error_t machdev_create_device_port (size_t size, void *result);
-int machdev_trivfs_init(mach_port_t bootstrap_resume_task, const char *name, 
const char *path, mach_port_t *bootstrap);
+int machdev_trivfs_init(mach_port_t bootstrap_resume_task, const char *name, 
const char *path, mach_port_t *bootstrap, char **argv);
 void machdev_trivfs_server(mach_port_t bootstrap);
 boolean_t machdev_is_master_device (mach_port_t port);
 
diff --git a/libmachdev/trivfs_server.c b/libmachdev/trivfs_server.c
index 60711348..1f2276d4 100644
--- a/libmachdev/trivfs_server.c
+++ b/libmachdev/trivfs_server.c
@@ -76,12 +76,14 @@ static char *devnode;
 
 /* Startup and shutdown notifications management */
 struct port_class *machdev_shutdown_notify_class;
-
 static void arrange_shutdown_notification (void);
 
 /* Our parent's task, if applicable */
 static task_t parent_task;
 
+/* Our argument vector */
+static char **machdev_argv;
+
 static void
 install_as_translator (mach_port_t bootport)
 {
@@ -315,7 +317,7 @@ trivfs_S_fsys_init (struct trivfs_control *fsys,
   portarray[INIT_PORT_AUTH] = authhandle;
   portarray[INIT_PORT_CRDIR] = root;
   portarray[INIT_PORT_CWDIR] = root;
-  _hurd_init (0, NULL, portarray, INIT_PORT_MAX, NULL, 0);
+  _hurd_init (0, machdev_argv, portarray, INIT_PORT_MAX, NULL, 0);
 
   /* Mark us as important.  */
   proc = getproc ();
@@ -435,7 +437,7 @@ resume_bootstrap_server(mach_port_t server_task, const char 
*server_name)
 
 int
 machdev_trivfs_init(mach_port_t bootstrap_resume_task, const char *name, const 
char *path,
-                    mach_port_t *bootstrap)
+                    mach_port_t *bootstrap, char **argv)
 {
   mach_port_t mybootstrap = MACH_PORT_NULL;
   port_bucket = ports_create_bucket ();
@@ -445,6 +447,7 @@ machdev_trivfs_init(mach_port_t bootstrap_resume_task, 
const char *name, const c
                          trivfs_protid_class, 0, &control);
 
   *bootstrap = MACH_PORT_NULL;
+  machdev_argv = argv;
 
   task_get_bootstrap_port (mach_task_self (), &mybootstrap);
   if (mybootstrap)
diff --git a/pci-arbiter/main.c b/pci-arbiter/main.c
index 1815994a..8783c693 100644
--- a/pci-arbiter/main.c
+++ b/pci-arbiter/main.c
@@ -214,7 +214,7 @@ main (int argc, char **argv)
   if (disk_server_task != MACH_PORT_NULL)
     {
       machdev_register (&pci_arbiter_emulation_ops);
-      machdev_trivfs_init (disk_server_task, "pci", "/servers/bus/pci", 
&bootstrap);
+      machdev_trivfs_init (disk_server_task, "pci", "/servers/bus/pci", 
&bootstrap, argv);
       machdev_device_init ();
       err = pthread_create (&t, NULL, machdev_server, NULL);
       if (err)
diff --git a/rumpdisk/main.c b/rumpdisk/main.c
index 87bc5573..b2a57fe8 100644
--- a/rumpdisk/main.c
+++ b/rumpdisk/main.c
@@ -112,7 +112,7 @@ main (int argc, char **argv)
     }
 
   rump_register_block ();
-  machdev_trivfs_init (bootstrap_resume_task, "rumpdisk", "/dev/rumpdisk", 
&bootstrap);
+  machdev_trivfs_init (bootstrap_resume_task, "rumpdisk", "/dev/rumpdisk", 
&bootstrap, argv);
   machdev_device_init ();
   err = pthread_create (&t, NULL, machdev_server, NULL);
   if (err)
-- 
2.30.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]