From 945ff78a7046f910f1eca4ae741b42040184bffd Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Fri, 26 Sep 2014 16:50:04 +0200 Subject: polish make_send_right.patch --- debian/patches/make_send_right.patch | 48 ++++++++++++++++++++++++++++++++---- 1 file changed, 43 insertions(+), 5 deletions(-) diff --git a/debian/patches/make_send_right.patch b/debian/patches/make_send_right.patch index 084342e..b4d950d 100644 --- a/debian/patches/make_send_right.patch +++ b/debian/patches/make_send_right.patch @@ -1,21 +1,29 @@ diff --git a/kern/bootstrap.c b/kern/bootstrap.c -index d919e90..5f82d19 100644 +index d919e90..6ea5b67 100644 --- a/kern/bootstrap.c +++ b/kern/bootstrap.c -@@ -96,9 +96,11 @@ task_insert_send_right( +@@ -90,15 +90,18 @@ static void get_compat_strings(char *flags_str, char *root_str); /* forward */ + static mach_port_t + task_insert_send_right( + task_t task, +- ipc_port_t port) ++ ipc_port_t port, ++ boolean_t make_send) + { + mach_port_t name; for (name = 1;; name++) { kern_return_t kr; -+ mach_port_t sright; ++ ipc_port_t sright; -+ sright = ipc_port_make_send(port); ++ sright = make_send? ipc_port_make_send(port): port; kr = mach_port_insert_right(task->itk_space, name, - port, MACH_MSG_TYPE_PORT_SEND); + sright, MACH_MSG_TYPE_PORT_SEND); if (kr == KERN_SUCCESS) break; assert(kr == KERN_NAME_EXISTS); -@@ -155,13 +157,13 @@ void bootstrap_create(void) +@@ -155,13 +158,13 @@ void bootstrap_create(void) /* Initialize boot script variables. We leak these send rights. */ losers = boot_script_set_variable ("host-port", VAL_PORT, @@ -31,3 +39,33 @@ index d919e90..5f82d19 100644 if (losers) panic ("cannot set boot-script variable device-port: %s", boot_script_error_string (losers)); +@@ -287,11 +290,11 @@ bootstrap_exec_compat(void *e) + + boot_host_port = + task_insert_send_right(bootstrap_task, +- ipc_port_make_send(realhost.host_priv_self)); ++ realhost.host_priv_self, TRUE); + + boot_device_port = + task_insert_send_right(bootstrap_task, +- ipc_port_make_send(master_device_port)); ++ master_device_port, TRUE); + + /* + * Start the bootstrap thread. +@@ -838,13 +841,13 @@ 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_t)port, TRUE); + return 0; + } + + int + boot_script_insert_task_port (struct cmd *cmd, task_t task, mach_port_t *name) + { +- *name = task_insert_send_right (cmd->task, task->itk_sself); ++ *name = task_insert_send_right (cmd->task, task->itk_sself, FALSE); + return 0; + } -- cgit v1.2.3