diff options
author | Roland McGrath <roland@gnu.org> | 2001-08-17 04:47:55 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 2001-08-17 04:47:55 +0000 |
commit | 1fa4593b8c243a45ff70b7704568c683ed832eb0 (patch) | |
tree | 666c566f6610112f41de0fecc2b16bd8d4672ea8 | |
parent | b9cccadc0ec3ff86b52b205e9dd2417e9d798009 (diff) |
2001-08-16 Roland McGrath <roland@frob.com>
* boot_script.h (boot_script_malloc, boot_script_free): Declare new
functions that callers must define.
* boot_script.c: All uses of malloc/free changed to use those instead.
* userland-boot.c: New file. Defines them using malloc/free.
* Makefile (SRCS, OBJS): Add it.
* boot.c (boot_script_malloc, boot_script_free): Old cruft functions
removed.
* boot_script.c (boot_script_parse_line): Take new first argument HOOK.
Store it in CMD->hook.
(main): Update caller.
(boot_script_exec): Pass CMD->hook as 1st arg to boot_script_exec_cmd.
(boot_script_exec_cmd): Take new first argument HOOK.
* boot.c (boot_script_exec_cmd): Likewise.
* boot_script.h (struct cmd): New member `void *hook'.
Update decls for HOOK arguments added.
-rw-r--r-- | boot/boot.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/boot/boot.c b/boot/boot.c index c3277816..bba51b0e 100644 --- a/boot/boot.c +++ b/boot/boot.c @@ -294,18 +294,6 @@ void msg_thread (); /* Callbacks for boot_script.c; see boot_script.h. */ -void * -boot_script_malloc (int size) -{ - return malloc (size); -} - -void -boot_script_free (void *ptr, int size) -{ - free (ptr); -} - mach_port_t boot_script_read_file (const char *filename) { @@ -347,7 +335,8 @@ boot_script_read_file (const char *filename) } int -boot_script_exec_cmd (mach_port_t task, char *path, int argc, +boot_script_exec_cmd (void *hook, + mach_port_t task, char *path, int argc, char **argv, char *strings, int stringlen) { char *args, *p; @@ -585,7 +574,7 @@ main (int argc, char **argv, char **envp) while (p < buf + amt && *p != '\n') p++; *p = '\0'; - err = boot_script_parse_line (line); + err = boot_script_parse_line (0, line); if (err) { char *str; |