[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] machdev: Pass argv through to _hurd_init
From: |
Samuel Thibault |
Subject: |
Re: [PATCH] machdev: Pass argv through to _hurd_init |
Date: |
Sun, 4 Apr 2021 16:25:34 +0200 |
User-agent: |
NeoMutt/20170609 (1.8.3) |
Applied, thanks!
Damien Zammit, le dim. 04 avril 2021 13:37:50 +1000, a ecrit:
> ---
> libmachdev/machdev.h | 2 +-
> libmachdev/trivfs_server.c | 11 +++++++----
> pci-arbiter/main.c | 2 +-
> rumpdisk/main.c | 2 +-
> 4 files changed, 10 insertions(+), 7 deletions(-)
>
> diff --git a/libmachdev/machdev.h b/libmachdev/machdev.h
> index 8f613b35..5d0eed02 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(int argc, char **argv, mach_port_t
> bootstrap_resume_task, const char *name, const char *path, mach_port_t
> *bootstrap);
> 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..1c5d53ad 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 ();
> @@ -434,8 +436,8 @@ 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)
> +machdev_trivfs_init(int argc, char **argv, mach_port_t bootstrap_resume_task,
> + const char *name, const char *path, mach_port_t
> *bootstrap)
> {
> 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..050f1aac 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 (argc, argv, disk_server_task, "pci",
> "/servers/bus/pci", &bootstrap);
> 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..7f503b51 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 (argc, argv, bootstrap_resume_task, "rumpdisk",
> "/dev/rumpdisk", &bootstrap);
> machdev_device_init ();
> err = pthread_create (&t, NULL, machdev_server, NULL);
> if (err)
> --
> 2.30.1
>
>
--
Samuel
* x remarque qu'avec un peu de volonté, on peut faire du code de porc
dans d'importe quel langage Turing-complet
-+- x sur #ens-mim - codons porc -+-