svn commit: r199486 - projects/ppc64/sys/compat/freebsd32
Kostik Belousov
kostikbel at gmail.com
Wed Nov 18 17:02:53 UTC 2009
On Wed, Nov 18, 2009 at 04:45:27PM +0000, Nathan Whitehorn wrote:
> Author: nwhitehorn
> Date: Wed Nov 18 16:45:27 2009
> New Revision: 199486
> URL: http://svn.freebsd.org/changeset/base/199486
>
> Log:
> Make several more freebsd32 syscalls work on big-endian hardware.
> Statically linked 32-bit binaries now seem to work more or less perfectly
> on a 64-bit kernel, but dynamically linked ones die in rtld with
> EOVERFLOW.
>
> Modified:
> projects/ppc64/sys/compat/freebsd32/freebsd32_misc.c
> projects/ppc64/sys/compat/freebsd32/freebsd32_proto.h
>
> Modified: projects/ppc64/sys/compat/freebsd32/freebsd32_misc.c
> ==============================================================================
> --- projects/ppc64/sys/compat/freebsd32/freebsd32_misc.c Wed Nov 18 15:48:51 2009 (r199485)
> +++ projects/ppc64/sys/compat/freebsd32/freebsd32_misc.c Wed Nov 18 16:45:27 2009 (r199486)
> @@ -2100,8 +2100,13 @@ freebsd6_freebsd32_lseek(struct thread *
> error = lseek(td, &ap);
> /* Expand the quad return into two parts for eax and edx */
> pos = *(off_t *)(td->td_retval);
> + #if BYTE_ORDER == BIG_ENDIAN
> + td->td_retval[0] = pos >> 32;
> + td->td_retval[1] = pos & 0xffffffff;
> + #else
> td->td_retval[0] = pos & 0xffffffff; /* %eax */
> td->td_retval[1] = pos >> 32; /* %edx */
> + #endif
> return error;
> }
What about defining constants like TD_RETVAL_HI and TD_RETVAL_LO,
and then
td->td_retval[TD_RETVAL_HI] = hiword;
td->td_retval[TD_RETVAL_LO] = loword;
There are several places in syscall return path in MD code that
would also benefit from lesser amount of ifdef.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/svn-src-projects/attachments/20091118/b8bb4244/attachment.pgp
More information about the svn-src-projects
mailing list