diff options
author | Brooks Davis <brooks@FreeBSD.org> | 2020-04-15 20:23:55 +0000 |
---|---|---|
committer | Brooks Davis <brooks@FreeBSD.org> | 2020-04-15 20:23:55 +0000 |
commit | 9df1c38bbc816bbac7b85701971478bf976c68c4 (patch) | |
tree | 5b9466f71b6ce508704a4d8284aee31c8f7d69e3 /sys/compat/freebsd32 | |
parent | 397df744f90e2b6e5edb0b1c1d42076821efecef (diff) |
Export argc, argv, envc, envv, and ps_strings in auxargs.
This simplifies discovery of these values, potentially with reducing the
number of syscalls we need to make at runtime. Longer term, we wish to
convert the startup process to pass an auxargs pointer to _start() and
use that rather than walking off the end of envv. This is cleaner,
more C-friendly, and for systems with strong bounds (e.g. CHERI)
necessary.
Reviewed by: kib
Obtained from: CheriBSD
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D24407
Notes
Notes:
svn path=/head/; revision=359988
Diffstat (limited to 'sys/compat/freebsd32')
-rw-r--r-- | sys/compat/freebsd32/freebsd32_misc.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c index 9480d437bd9a..89088a2aba42 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -3237,6 +3237,7 @@ freebsd32_copyout_strings(struct image_params *imgp, uintptr_t *stack_base) /* * Fill in "ps_strings" struct for ps, w, etc. */ + imgp->argv = vectp; if (suword32(&arginfo->ps_argvstr, (u_int32_t)(intptr_t)vectp) != 0 || suword32(&arginfo->ps_nargvstr, argc) != 0) return (EFAULT); @@ -3256,6 +3257,7 @@ freebsd32_copyout_strings(struct image_params *imgp, uintptr_t *stack_base) if (suword32(vectp++, 0) != 0) return (EFAULT); + imgp->envv = vectp; if (suword32(&arginfo->ps_envstr, (u_int32_t)(intptr_t)vectp) != 0 || suword32(&arginfo->ps_nenvstr, envc) != 0) return (EFAULT); |