Date: Fri, 19 Jul 2002 22:26:14 +1000 From: Peter Grehan <peterg@ptree32.com.au> To: freebsd-ppc@freebsd.org Subject: updated setregs() patch Message-ID: <3D380566.42D617DA@ptree32.com.au>
next in thread | raw e-mail | index | archive | help
Oops, r3/r4 still need to be set: the one case where execve doesn't return through syscall() is for init's fork trampoline. In this case, the registers are passed through unchanged and aren't overwritten. Params can now be passed to init correctly :-) --- machdep.c Fri Jul 19 22:15:11 2002 *************** *** 875,882 **** --- 875,892 ---- * XXX We have to set both regs and retval here due to different * XXX calling convention in trap.c and init_main.c. */ + + /* + * XXX PG: these get overwritten in the syscall return code. + * execve() should return EJUSTRETURN, like it does on NetBSD. + * Emulate by setting the syscall return value cells. The + * registers still have to be set for init's fork trampoline. + */ tf->fixreg[3] = arginfo.ps_nargvstr; tf->fixreg[4] = (register_t)arginfo.ps_argvstr; + td->td_retval[0] = arginfo.ps_nargvstr; + td->td_retval[1] = (register_t)arginfo.ps_argvstr; + tf->fixreg[5] = (register_t)arginfo.ps_envstr; tf->fixreg[6] = 0; /* auxillary vector */ tf->fixreg[7] = 0; /* termination vector */ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ppc" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3D380566.42D617DA>