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/boot_script.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'boot/boot_script.c') diff --git a/boot/boot_script.c b/boot/boot_script.c index fb5b8d6c..d0317520 100644 --- a/boot/boot_script.c +++ b/boot/boot_script.c @@ -3,6 +3,9 @@ /* Written by Shantanu Goel (goel@cs.columbia.edu). */ #include +#if !KERNEL || OSKIT_MACH +#include +#endif #include "boot_script.h" @@ -30,8 +33,8 @@ struct sym /* Additional values symbols can take. These are only used internally. */ -#define VAL_SYM 3 /* symbol table entry */ -#define VAL_FUNC 4 /* function pointer */ +#define VAL_SYM 10 /* symbol table entry */ +#define VAL_FUNC 11 /* function pointer */ /* This structure describes an argument. */ struct arg @@ -90,7 +93,7 @@ prompt_resume_task (struct cmd *cmd, int *val) /* List of builtin symbols. */ static struct sym builtin_symbols[] = { - { "task-create", VAL_FUNC, (int) create_task, VAL_PORT, 0 }, + { "task-create", VAL_FUNC, (int) create_task, VAL_TASK, 0 }, { "task-resume", VAL_FUNC, (int) resume_task, VAL_NONE, 1 }, { "prompt-task-resume", VAL_FUNC, (int) prompt_resume_task, VAL_NONE, 1 }, }; @@ -543,6 +546,7 @@ boot_script_exec () { char *p, buf[50]; int len; + mach_port_t name; if (arg->type == VAL_SYM) { @@ -568,14 +572,21 @@ boot_script_exec () len = strlen (p); break; + case VAL_TASK: case VAL_PORT: - /* Insert send right. */ - error = boot_script_insert_right (cmd, - (mach_port_t) arg->val); + if (arg->type == VAL_TASK) + /* Insert send right to task port. */ + error = boot_script_insert_task_port + (cmd, (task_t) arg->val, &name); + else + /* Insert send right. */ + error = boot_script_insert_right (cmd, + (mach_port_t) arg->val, + &name); if (error) goto done; - i = arg->val; + i = name; p = buf + sizeof (buf); len = 0; do -- cgit v1.2.3