diff options
Diffstat (limited to 'c/src/lib/libbsp/powerpc/shared/src/memcpy.c')
-rw-r--r-- | c/src/lib/libbsp/powerpc/shared/src/memcpy.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/c/src/lib/libbsp/powerpc/shared/src/memcpy.c b/c/src/lib/libbsp/powerpc/shared/src/memcpy.c index 6265f64d03..bd72d37b91 100644 --- a/c/src/lib/libbsp/powerpc/shared/src/memcpy.c +++ b/c/src/lib/libbsp/powerpc/shared/src/memcpy.c @@ -25,7 +25,7 @@ #include <libcpu/powerpc-utility.h> -#define CACHE_LINE_SIZE 32 +#define PPC_CACHE_ALIGNMENT 32 #define WORD_SIZE 4 @@ -47,8 +47,8 @@ void *memcpy(void *dst_ptr, const void *src_ptr, size_t n) uint32_t *word_dst = (uint32_t *) dst - 1; const uint32_t *word_src = (const uint32_t *) src - 1; - if (n >= 2 * CACHE_LINE_SIZE - WORD_SIZE) { - while ((uintptr_t) (word_dst + 1) % CACHE_LINE_SIZE != 0) { + if (n >= 2 * PPC_CACHE_ALIGNMENT - WORD_SIZE) { + while ((uintptr_t) (word_dst + 1) % PPC_CACHE_ALIGNMENT != 0) { uint32_t tmp; __asm__ volatile ( "lwzu %[tmp], 0x4(%[src])\n" @@ -60,7 +60,7 @@ void *memcpy(void *dst_ptr, const void *src_ptr, size_t n) n -= WORD_SIZE; } - while (n >= CACHE_LINE_SIZE) { + while (n >= PPC_CACHE_ALIGNMENT) { uint32_t dst_offset = 4; uint32_t src_offset = 32 + 4; uint32_t tmp0; @@ -95,7 +95,7 @@ void *memcpy(void *dst_ptr, const void *src_ptr, size_t n) : [src_offset] "r" (src_offset), [dst_offset] "r" (dst_offset) ); - n -= CACHE_LINE_SIZE; + n -= PPC_CACHE_ALIGNMENT; } } |