summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2002-05-29 02:44:20 +0000
committerThomas Schwinge <tschwinge@gnu.org>2009-06-17 23:50:15 +0200
commit7432f0ff819141edb3b7e8e8fb0e6921a909d306 (patch)
tree18a9daa34b3c8bddb87e70ee78343189a9b358eb
parent295ffb2754b8ad00ae06429d97e0054a10e5f6ad (diff)
2002-05-28 Roland McGrath <roland@frob.com>
* kern/boot_script.c, kern/boot_script.h: Files updated from versions in hurd/boot (64 bit fixes).
-rw-r--r--kern/boot_script.c27
-rw-r--r--kern/boot_script.h5
2 files changed, 18 insertions, 14 deletions
diff --git a/kern/boot_script.c b/kern/boot_script.c
index d0317520..cfc19c2b 100644
--- a/kern/boot_script.c
+++ b/kern/boot_script.c
@@ -19,7 +19,7 @@ struct sym
int type;
/* Symbol value. */
- int val;
+ integer_t val;
/* For function symbols; type of value returned by function. */
int ret_type;
@@ -46,7 +46,7 @@ struct arg
int type;
/* Argument value. */
- int val;
+ integer_t val;
};
/* List of commands. */
@@ -93,9 +93,10 @@ 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, (integer_t) create_task, VAL_TASK, 0 },
+ { "task-resume", VAL_FUNC, (integer_t) resume_task, VAL_NONE, 1 },
+ { "prompt-task-resume",
+ VAL_FUNC, (integer_t) prompt_resume_task, VAL_NONE, 1 },
};
#define NUM_BUILTIN (sizeof (builtin_symbols) / sizeof (builtin_symbols[0]))
@@ -296,7 +297,8 @@ boot_script_parse_line (void *hook, char *cmdline)
for (p += 2;;)
{
char c;
- int i, val, type;
+ int i, type;
+ integer_t val;
struct sym *s;
/* Parse symbol name. */
@@ -351,7 +353,7 @@ boot_script_parse_line (void *hook, char *cmdline)
if (! s->run_on_exec)
{
(error
- = ((*((int (*) (struct cmd *, int *)) s->val))
+ = ((*((int (*) (struct cmd *, integer_t *)) s->val))
(cmd, &val)));
if (error)
goto bad;
@@ -373,7 +375,7 @@ boot_script_parse_line (void *hook, char *cmdline)
else if (s->type == VAL_NONE)
{
type = VAL_SYM;
- val = (int) s;
+ val = (integer_t) s;
}
else
{
@@ -643,7 +645,7 @@ boot_script_exec ()
for (i = 0; i < cmd->exec_funcs_index; i++)
{
struct sym *sym = cmd->exec_funcs[i];
- int error = ((*((int (*) (struct cmd *, int *)) sym->val))
+ int error = ((*((int (*) (struct cmd *, integer_t *)) sym->val))
(cmd, 0));
if (error)
{
@@ -660,7 +662,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, integer_t val)
{
struct sym *sym = sym_enter (name);
@@ -676,14 +678,15 @@ boot_script_set_variable (const char *name, int type, int val)
/* Define the function NAME, which will return type RET_TYPE. */
int
boot_script_define_function (const char *name, int ret_type,
- int (*func) (const struct cmd *cmd, int *val))
+ int (*func) (const struct cmd *cmd,
+ integer_t *val))
{
struct sym *sym = sym_enter (name);
if (sym)
{
sym->type = VAL_FUNC;
- sym->val = (int) func;
+ sym->val = (integer_t) func;
sym->ret_type = ret_type;
sym->run_on_exec = ret_type == VAL_NONE;
}
diff --git a/kern/boot_script.h b/kern/boot_script.h
index c436ac21..62458693 100644
--- a/kern/boot_script.h
+++ b/kern/boot_script.h
@@ -102,11 +102,12 @@ int boot_script_exec (void);
/* Create an entry in the symbol table for variable NAME,
whose type is TYPE and value is VAL. Returns 0 on success,
non-zero otherwise. */
-int boot_script_set_variable (const char *name, int type, int val);
+int boot_script_set_variable (const char *name, int type, integer_t val);
/* Define the function NAME, which will return type RET_TYPE. */
int boot_script_define_function (const char *name, int ret_type,
- int (*func) (const struct cmd *cmd, int *val));
+ int (*func) (const struct cmd *cmd,
+ integer_t *val));
/* Returns a string describing the error ERR. */
char *boot_script_error_string (int err);