From 1fa4593b8c243a45ff70b7704568c683ed832eb0 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Fri, 17 Aug 2001 04:47:55 +0000 Subject: 2001-08-16 Roland McGrath * 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. --- boot/boot.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'boot') 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; -- cgit v1.2.3