summaryrefslogtreecommitdiff
path: root/kern
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2014-09-26 17:24:00 +0200
committerJustus Winter <4winter@informatik.uni-hamburg.de>2014-09-26 17:24:00 +0200
commitdd2b22a787420e4b9d74e2778961b14f59293c91 (patch)
tree7b7c4edbb0e18449234b17190db808898e033a35 /kern
parent1c9bbcccfabbb451234d5a07f872b13d3278276e (diff)
kern: create send rights as they are inserted at bootstrap time
Previously, it was impossible to hand e.g. the master device port to more than one bootstrap task. Fix this by creating the send right as it is inserted into the target task. * kern/bootstrap.c (bootstrap_create): Do not create the send rights here... (boot_script_insert_right): ... but here.
Diffstat (limited to 'kern')
-rw-r--r--kern/bootstrap.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/kern/bootstrap.c b/kern/bootstrap.c
index d919e905..4edae7bf 100644
--- a/kern/bootstrap.c
+++ b/kern/bootstrap.c
@@ -155,13 +155,13 @@ void bootstrap_create(void)
/* Initialize boot script variables. We leak these send rights. */
losers = boot_script_set_variable
("host-port", VAL_PORT,
- (long)ipc_port_make_send(realhost.host_priv_self));
+ (long) realhost.host_priv_self);
if (losers)
panic ("cannot set boot-script variable host-port: %s",
boot_script_error_string (losers));
losers = boot_script_set_variable
("device-port", VAL_PORT,
- (long) ipc_port_make_send(master_device_port));
+ (long) master_device_port);
if (losers)
panic ("cannot set boot-script variable device-port: %s",
boot_script_error_string (losers));
@@ -838,7 +838,8 @@ boot_script_free_task (task_t task, int aborting)
int
boot_script_insert_right (struct cmd *cmd, mach_port_t port, mach_port_t *name)
{
- *name = task_insert_send_right (cmd->task, (ipc_port_t)port);
+ *name = task_insert_send_right (cmd->task,
+ ipc_port_make_send((ipc_port_t) port));
return 0;
}