CVSROOT:        /cvs
Module name:    src
Changes by:     guent...@cvs.openbsd.org        2022/10/30 11:43:40

Modified files:
        sys/arch/alpha/alpha: machdep.c 
        sys/arch/amd64/amd64: machdep.c 
        sys/arch/arm/arm: arm_machdep.c 
        sys/arch/arm64/arm64: machdep.c 
        sys/arch/hppa/hppa: machdep.c 
        sys/arch/i386/i386: machdep.c 
        sys/arch/m88k/m88k: m88k_machdep.c 
        sys/arch/macppc/macppc: machdep.c 
        sys/arch/mips64/mips64: mips64_machdep.c 
        sys/arch/powerpc64/powerpc64: machdep.c 
        sys/arch/riscv64/riscv64: machdep.c 
        sys/arch/sh/sh : sh_machdep.c 
        sys/arch/sparc64/sparc64: machdep.c 
        sys/kern       : init_main.c kern_exec.c 
        sys/sys        : exec.h 

Log message:
Simplfity setregs() by passing it the ps_strings and switching
sys_execve() to return EJUSTRETURN.

setregs() is the MD routine used by sys_execve() to set up the
thread's trapframe and PCB such that, on 'return' to userspace, it
has the register values defined by the ABI and otherwise zero.  It
had to set the syscall retval[] values previously because the normal
syscall return path overwrites a couple registers with the retval[]
values.  By instead returning EJUSTRETURN that and some complexity
with program-counter handling on m88k and sparc64 goes away.

Also, give setregs() add a 'struct ps_strings *arginfo' argument
so powerpc, powerpc64, and sh can directly get argc/argv/envp
values for registers instead of copyin()ing the one in userspace.

Improvements from miod@ and millert@
Testing assistance miod@, kettenis@, and aoyama@
ok miod@ kettenis@

Reply via email to