aboutsummaryrefslogtreecommitdiff
path: root/libdiskfs/opts-std-startup.c
diff options
context:
space:
mode:
authorJustus Winter <justus@gnupg.org>2017-03-12 17:16:40 +0100
committerJustus Winter <justus@gnupg.org>2017-03-12 17:41:04 +0100
commit4089f37cdd776e046d51604041c3fe62a2bc1435 (patch)
tree22a6f3203934672fd2d02b934023c8afd241fbf5 /libdiskfs/opts-std-startup.c
parentef729f8642cc96ddfd3f5b5db4d6aac057b1d397 (diff)
downloadhurd-4089f37cdd776e046d51604041c3fe62a2bc1435.tar.gz
hurd-4089f37cdd776e046d51604041c3fe62a2bc1435.tar.bz2
hurd-4089f37cdd776e046d51604041c3fe62a2bc1435.zip
Pass the kernel's task port to proc.
Previously, the early server bootstrap relied upon a specific task layout to determine the kernels task port. Explicitly pass it from the kernel instead. * boot/boot.c (default_boot_script): Add '--kernel-task' parameter to ext2fs. (main): New bootscript variable 'kernel-task'. * libdiskfs/boot-start.c (diskfs_kernel_task): Declaration variable. (diskfs_start_bootstrap): If '--kernel-task' was given to us, pass it along to startup. * libdiskfs/opts-std-startup.c (diskfs_kernel_task): New variable. (startup_options): Add '--kernel-task' option. (parse_startup_opt): Handle option. * proc/main.c (kernel_task): New variable. (OPT_KERNEL_TASK): New macro. (options): New variable. (parse_opt): New function. (main): Parse options. Use 'kernel_task' if provided. * release/servers.boot: Add '--kernel-task' parameter to ext2fs. * startup/startup.c (OPT_KERNEL_TASK): New macro. (options): Add '--kernel-task' option. (kernel_task): New variable. (insert_ports_fnc_t): New declaration. (run): Add argument for a function that inserts rights into the newly created task and adds arguments to the argument vector. (argz_task_insert_right): New function. (proc_insert_ports): Likewise. (parse_opt): New function. (main): Pass the kernel's task port to proc. (frob_kernel_process): Use the kernel's task port.
Diffstat (limited to 'libdiskfs/opts-std-startup.c')
-rw-r--r--libdiskfs/opts-std-startup.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libdiskfs/opts-std-startup.c b/libdiskfs/opts-std-startup.c
index ed25a18d..a38db99a 100644
--- a/libdiskfs/opts-std-startup.c
+++ b/libdiskfs/opts-std-startup.c
@@ -35,6 +35,7 @@ int _diskfs_boot_pause;
extern char **diskfs_argv;
mach_port_t diskfs_exec_server_task = MACH_PORT_NULL;
+mach_port_t diskfs_kernel_task = MACH_PORT_NULL;
/* ---------------------------------------------------------------- */
@@ -45,6 +46,7 @@ mach_port_t diskfs_exec_server_task = MACH_PORT_NULL;
#define OPT_BOOT_COMMAND (-5)
#define OPT_BOOT_INIT_PROGRAM (-6)
#define OPT_BOOT_PAUSE (-7)
+#define OPT_KERNEL_TASK (-8)
static const struct argp_option
startup_options[] =
@@ -68,6 +70,7 @@ startup_options[] =
{"host-priv-port", OPT_HOST_PRIV_PORT, "PORT"},
{"device-master-port", OPT_DEVICE_MASTER_PORT, "PORT"},
{"exec-server-task", OPT_EXEC_SERVER_TASK, "PORT"},
+ {"kernel-task", OPT_KERNEL_TASK, "PORT"},
{0}
};
@@ -106,6 +109,8 @@ parse_startup_opt (int opt, char *arg, struct argp_state *state)
_hurd_host_priv = atoi (arg); break;
case OPT_EXEC_SERVER_TASK:
diskfs_exec_server_task = atoi (arg); break;
+ case OPT_KERNEL_TASK:
+ diskfs_kernel_task = atoi (arg); break;
case OPT_BOOT_CMDLINE:
diskfs_boot_command_line = arg; break;
case OPT_BOOT_INIT_PROGRAM: