From afc455ff671ddb540ebe14b6c6a3b96e569496c4 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Fri, 17 Aug 2001 10:28:22 +0000 Subject: 2001-08-17 Roland McGrath * userland-boot.c (boot_script_insert_right): Take new result parameter for send right name in target task. (boot_script_insert_task_port): New function. * boot_script.h: Update those two decls. (VAL_TASK): New macro. * boot_script.c (VAL_SYM, VAL_FUNC): Increase these constants. (builtin_symbols): Use VAL_TASK for "task-create". (boot_script_exec): Update caller of boot_script_insert_right. Treat VAL_TASK like VAL_PORT, but call boot_script_insert_task_port. --- boot/userland-boot.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'boot/userland-boot.c') diff --git a/boot/userland-boot.c b/boot/userland-boot.c index b6f38290..c053b2b8 100644 --- a/boot/userland-boot.c +++ b/boot/userland-boot.c @@ -25,13 +25,13 @@ #include "boot_script.h" void * -boot_script_malloc (size_t size) +boot_script_malloc (unsigned int size) { return malloc (size); } void -boot_script_free (void *ptr, size_t size) +boot_script_free (void *ptr, unsigned int size) { free (ptr); } @@ -82,7 +82,7 @@ boot_script_free_task (task_t task, int aborting) } int -boot_script_insert_right (struct cmd *cmd , mach_port_t port) +boot_script_insert_right (struct cmd *cmd, mach_port_t port, mach_port_t *name) { error_t err = mach_port_insert_right (cmd->task, port, port, MACH_MSG_TYPE_COPY_SEND); @@ -91,5 +91,12 @@ boot_script_insert_right (struct cmd *cmd , mach_port_t port) error (0, err, "%s: task_resume", cmd->path); return BOOT_SCRIPT_MACH_ERROR; } + *name = port; return 0; } + +int +boot_script_insert_task_port (struct cmd *cmd, task_t task, mach_port_t *name) +{ + return boot_script_insert_right (cmd, task, name); +} -- cgit v1.2.3