summaryrefslogtreecommitdiff
path: root/boot/boot_script.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2001-08-17 10:28:22 +0000
committerRoland McGrath <roland@gnu.org>2001-08-17 10:28:22 +0000
commitafc455ff671ddb540ebe14b6c6a3b96e569496c4 (patch)
treec037abd9f1522156be20a0faa65ae2fe3e4362e0 /boot/boot_script.c
parent16f26b53445c06f8ce9f3d1100b92cce4653563e (diff)
2001-08-17 Roland McGrath <roland@frob.com>
* 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.
Diffstat (limited to 'boot/boot_script.c')
-rw-r--r--boot/boot_script.c25
1 files changed, 18 insertions, 7 deletions
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 <mach/mach_types.h>
+#if !KERNEL || OSKIT_MACH
+#include <string.h>
+#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