svn commit: r209850 - head/sys/powerpc/powerpc
Nathan Whitehorn
nwhitehorn at FreeBSD.org
Fri Jul 9 14:01:19 UTC 2010
Author: nwhitehorn
Date: Fri Jul 9 14:01:18 2010
New Revision: 209850
URL: http://svn.freebsd.org/changeset/base/209850
Log:
MFppc64:
Use longs instead of ints as the native word type in bcopy(). This will
expand nicely on 64-bit systems.
Modified:
head/sys/powerpc/powerpc/bcopy.c
Modified: head/sys/powerpc/powerpc/bcopy.c
==============================================================================
--- head/sys/powerpc/powerpc/bcopy.c Fri Jul 9 14:00:22 2010 (r209849)
+++ head/sys/powerpc/powerpc/bcopy.c Fri Jul 9 14:01:18 2010 (r209850)
@@ -52,7 +52,7 @@ __FBSDID("$FreeBSD$");
* sizeof(word) MUST BE A POWER OF TWO
* SO THAT wmask BELOW IS ALL ONES
*/
-typedef int word; /* "word" used for optimal copy speed */
+typedef long word; /* "word" used for optimal copy speed */
#define wsize sizeof(word)
#define wmask (wsize - 1)
@@ -86,14 +86,14 @@ memcpy(void *dst0, const void *src0, siz
/*
* Copy forward.
*/
- t = (int)src; /* only need low bits */
+ t = (size_t)src; /* only need low bits */
- if ((t | (int)dst) & wmask) {
+ if ((t | (uintptr_t)dst) & wmask) {
/*
* Try to align operands. This cannot be done
* unless the low bits match.
*/
- if ((t ^ (int)dst) & wmask || length < wsize) {
+ if ((t ^ (uintptr_t)dst) & wmask || length < wsize) {
t = length;
} else {
t = wsize - (t & wmask);
@@ -118,10 +118,10 @@ memcpy(void *dst0, const void *src0, siz
*/
src += length;
dst += length;
- t = (int)src;
+ t = (uintptr_t)src;
- if ((t | (int)dst) & wmask) {
- if ((t ^ (int)dst) & wmask || length <= wsize) {
+ if ((t | (uintptr_t)dst) & wmask) {
+ if ((t ^ (uintptr_t)dst) & wmask || length <= wsize) {
t = length;
} else {
t &= wmask;
More information about the svn-src-head
mailing list