svn commit: r199504 - projects/ppc64/sys/compat/freebsd32
Nathan Whitehorn
nwhitehorn at FreeBSD.org
Thu Nov 19 03:37:07 UTC 2009
Author: nwhitehorn
Date: Thu Nov 19 03:37:06 2009
New Revision: 199504
URL: http://svn.freebsd.org/changeset/base/199504
Log:
Remove a few #ifdefs by defining RETVAL_HI/LO to describe the correct
retval entry for the high/low 32-bits of a 64-bit return.
Suggested by: kib
Modified:
projects/ppc64/sys/compat/freebsd32/freebsd32_misc.c
Modified: projects/ppc64/sys/compat/freebsd32/freebsd32_misc.c
==============================================================================
--- projects/ppc64/sys/compat/freebsd32/freebsd32_misc.c Thu Nov 19 01:29:10 2009 (r199503)
+++ projects/ppc64/sys/compat/freebsd32/freebsd32_misc.c Thu Nov 19 03:37:06 2009 (r199504)
@@ -121,8 +121,12 @@ static int freebsd32_kevent_copyin(void
#if BYTE_ORDER == BIG_ENDIAN
#define PAIR32TO64(type, name) ((name ## 2) | ((type)(name ## 1) << 32))
+#define RETVAL_HI 0
+#define RETVAL_LO 1
#else
#define PAIR32TO64(type, name) ((name ## 1) | ((type)(name ## 2) << 32))
+#define RETVAL_HI 1
+#define RETVAL_LO 0
#endif
int
@@ -2018,13 +2022,8 @@ freebsd32_lseek(struct thread *td, struc
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
+ td->td_retval[RETVAL_LO] = pos & 0xffffffff; /* %eax */
+ td->td_retval[RETVAL_HI] = pos >> 32; /* %edx */
return error;
}
@@ -2105,13 +2104,8 @@ 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
+ td->td_retval[RETVAL_LO] = pos & 0xffffffff; /* %eax */
+ td->td_retval[RETVAL_HI] = pos >> 32; /* %edx */
return error;
}
More information about the svn-src-projects
mailing list