svn commit: r203107 - projects/ppc64/sys/powerpc/powerpc
Nathan Whitehorn
nwhitehorn at FreeBSD.org
Thu Jan 28 05:28:49 UTC 2010
Author: nwhitehorn
Date: Thu Jan 28 05:28:48 2010
New Revision: 203107
URL: http://svn.freebsd.org/changeset/base/203107
Log:
Fix passing argc to user space. MI code uses suword, which copies a 64-bit
quantity, but arginfo.ps_nargvstr is an unsigned int. Thus, it ended up
being always zero when read back with copyin() on big-endian 64-bit
systems. This fixes argument passing to 64-bit executables.
Modified:
projects/ppc64/sys/powerpc/powerpc/exec_machdep.c
Modified: projects/ppc64/sys/powerpc/powerpc/exec_machdep.c
==============================================================================
--- projects/ppc64/sys/powerpc/powerpc/exec_machdep.c Thu Jan 28 04:50:09 2010 (r203106)
+++ projects/ppc64/sys/powerpc/powerpc/exec_machdep.c Thu Jan 28 05:28:48 2010 (r203107)
@@ -526,7 +526,7 @@ exec_setregs(struct thread *td, u_long e
*/
td->td_retval[0] = arginfo.ps_nargvstr;
td->td_retval[1] = (register_t)arginfo.ps_argvstr;
- tf->fixreg[3] = arginfo.ps_nargvstr;
+ tf->fixreg[3] = *((register_t *)(&arginfo.ps_nargvstr));
tf->fixreg[4] = (register_t)arginfo.ps_argvstr;
tf->fixreg[5] = (register_t)arginfo.ps_envstr;
tf->fixreg[6] = 0; /* auxillary vector */
More information about the svn-src-projects
mailing list