--- Gnu-Mach/kern/boot_script.c 2020/09/02 04:42:49 1.1.1.1 +++ Gnu-Mach/kern/boot_script.c 2020/09/02 04:45:20 1.1.1.2 @@ -3,9 +3,7 @@ /* Written by Shantanu Goel (goel@cs.columbia.edu). */ #include -#if !KERNEL || OSKIT_MACH #include -#endif #include "boot_script.h" @@ -19,7 +17,7 @@ struct sym int type; /* Symbol value. */ - int val; + long val; /* For function symbols; type of value returned by function. */ int ret_type; @@ -46,7 +44,7 @@ struct arg int type; /* Argument value. */ - int val; + long val; }; /* List of commands. */ @@ -69,23 +67,23 @@ static int symtab_index = 0; /* Create a task and suspend it. */ static int -create_task (struct cmd *cmd, int *val) +create_task (struct cmd *cmd, long *val) { int err = boot_script_task_create (cmd); - *val = (int) cmd->task; + *val = (long) cmd->task; return err; } /* Resume a task. */ static int -resume_task (struct cmd *cmd, int *val) +resume_task (struct cmd *cmd, long *val) { return boot_script_task_resume (cmd); } /* Resume a task when the user hits return. */ static int -prompt_resume_task (struct cmd *cmd, int *val) +prompt_resume_task (struct cmd *cmd, long *val) { return boot_script_prompt_task_resume (cmd); } @@ -93,9 +91,9 @@ prompt_resume_task (struct cmd *cmd, int /* List of builtin symbols. */ static struct sym builtin_symbols[] = { - { "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 }, + { "task-create", VAL_FUNC, (long) create_task, VAL_TASK, 0 }, + { "task-resume", VAL_FUNC, (long) resume_task, VAL_NONE, 1 }, + { "prompt-task-resume", VAL_FUNC, (long) prompt_resume_task, VAL_NONE, 1 }, }; #define NUM_BUILTIN (sizeof (builtin_symbols) / sizeof (builtin_symbols[0])) @@ -296,7 +294,8 @@ boot_script_parse_line (void *hook, char for (p += 2;;) { char c; - int i, val, type; + int i, type; + long val; struct sym *s; /* Parse symbol name. */ @@ -351,7 +350,7 @@ boot_script_parse_line (void *hook, char if (! s->run_on_exec) { (error - = ((*((int (*) (struct cmd *, int *)) s->val)) + = ((*((int (*) (struct cmd *, long *)) s->val)) (cmd, &val))); if (error) goto bad; @@ -373,7 +372,7 @@ boot_script_parse_line (void *hook, char else if (s->type == VAL_NONE) { type = VAL_SYM; - val = (int) s; + val = (long) s; } else { @@ -660,7 +659,7 @@ boot_script_exec () /* Create an entry for the variable NAME with TYPE and value VAL, in the symbol table. */ int -boot_script_set_variable (const char *name, int type, int val) +boot_script_set_variable (const char *name, int type, long val) { struct sym *sym = sym_enter (name); @@ -683,7 +682,7 @@ boot_script_define_function (const char if (sym) { sym->type = VAL_FUNC; - sym->val = (int) func; + sym->val = (long) func; sym->ret_type = ret_type; sym->run_on_exec = ret_type == VAL_NONE; }