aboutsummaryrefslogtreecommitdiff
path: root/bsd-user/main.c
diff options
context:
space:
mode:
authorWarner Losh <imp@bsdimp.com>2021-04-29 18:45:13 -0600
committerWarner Losh <imp@bsdimp.com>2021-09-10 14:13:06 -0600
commitd37853f92f71688cb440e5d18121b97b7ed1c353 (patch)
tree4b4b99ab9896c8b2e1d1dc0663f3a98ced4fa118 /bsd-user/main.c
parent66ef252fab33d2113fd6cf399a1fd5e19ed26676 (diff)
bsd-user: pass the bsd_param into loader_exec
Pass the bsd_param into loader_exec, and adjust. We use it to track the inital stack allocation and to set stack, open files, and other state shared between bsdload.c and elfload.c Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Diffstat (limited to 'bsd-user/main.c')
-rw-r--r--bsd-user/main.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/bsd-user/main.c b/bsd-user/main.c
index 39c4a0f33c..1388c7a13d 100644
--- a/bsd-user/main.c
+++ b/bsd-user/main.c
@@ -343,6 +343,7 @@ int main(int argc, char **argv)
const char *log_mask = NULL;
struct target_pt_regs regs1, *regs = &regs1;
struct image_info info1, *info = &info1;
+ struct bsd_binprm bprm;
TaskState ts1, *ts = &ts1;
CPUArchState *env;
CPUState *cpu;
@@ -499,6 +500,9 @@ int main(int argc, char **argv)
/* Zero out regs */
memset(regs, 0, sizeof(struct target_pt_regs));
+ /* Zero bsd params */
+ memset(&bprm, 0, sizeof(bprm));
+
/* Zero out image_info */
memset(info, 0, sizeof(struct image_info));
@@ -566,7 +570,8 @@ int main(int argc, char **argv)
}
}
- if (loader_exec(filename, argv + optind, target_environ, regs, info) != 0) {
+ if (loader_exec(filename, argv + optind, target_environ, regs, info,
+ &bprm) != 0) {
printf("Error loading %s\n", filename);
_exit(1);
}