]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/ia64/sn/kernel/bte.c
[IA64] bte_unaligned_copy() transfers one extra cache line.
[linux-2.6-omap-h63xx.git] / arch / ia64 / sn / kernel / bte.c
index 7f73ad4408aaee3ad8977ad1ef2d1a89302cfbe5..ff1c55601178b2c2ff7071b26f03bf64f5638865 100644 (file)
@@ -381,14 +381,13 @@ bte_result_t bte_unaligned_copy(u64 src, u64 dest, u64 len, u64 mode)
                 * bcopy to the destination.
                 */
 
-               /* Add the leader from source */
-               headBteLen = len + (src & L1_CACHE_MASK);
-               /* Add the trailing bytes from footer. */
-               headBteLen += L1_CACHE_BYTES - (headBteLen & L1_CACHE_MASK);
-               headBteSource = src & ~L1_CACHE_MASK;
                headBcopySrcOffset = src & L1_CACHE_MASK;
                headBcopyDest = dest;
                headBcopyLen = len;
+
+               headBteSource = src - headBcopySrcOffset;
+               /* Add the leading and trailing bytes from source */
+               headBteLen = L1_CACHE_ALIGN(len + headBcopySrcOffset);
        }
 
        if (headBcopyLen > 0) {