summaryrefslogtreecommitdiff
path: root/kern/boot_script.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2013-02-04 10:27:44 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2013-02-04 10:27:44 +0100
commitba1b3afd50913473f3036a63b4a82d7ba5c42009 (patch)
tree9dff0ddec4bf8b927a025b4bf9882cb1731170f3 /kern/boot_script.c
parentbfdb3be16e5a20eebc97b3ca613d9a4da4465533 (diff)
parent51e87d005139a435cd846ac5c224eed5042c4fa0 (diff)
Merge branch 'master' into master-gdb_stubs
Diffstat (limited to 'kern/boot_script.c')
-rw-r--r--kern/boot_script.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/kern/boot_script.c b/kern/boot_script.c
index 93491267..b2e9393b 100644
--- a/kern/boot_script.c
+++ b/kern/boot_script.c
@@ -17,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;
@@ -44,7 +44,7 @@ struct arg
int type;
/* Argument value. */
- int val;
+ long val;
};
/* List of commands. */
@@ -67,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);
}
@@ -91,9 +91,9 @@ 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_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]))
@@ -294,7 +294,8 @@ boot_script_parse_line (void *hook, char *cmdline)
for (p += 2;;)
{
char c;
- int i, val, type;
+ int i, type;
+ long val;
struct sym *s;
/* Parse symbol name. */
@@ -349,7 +350,7 @@ boot_script_parse_line (void *hook, char *cmdline)
if (! s->run_on_exec)
{
(error
- = ((*((int (*) (struct cmd *, int *)) s->val))
+ = ((*((int (*) (struct cmd *, long *)) s->val))
(cmd, &val)));
if (error)
goto bad;
@@ -371,7 +372,7 @@ boot_script_parse_line (void *hook, char *cmdline)
else if (s->type == VAL_NONE)
{
type = VAL_SYM;
- val = (int) s;
+ val = (long) s;
}
else
{
@@ -658,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);
@@ -681,7 +682,7 @@ boot_script_define_function (const char *name, int ret_type,
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;
}