summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2017-06-16 06:22:21 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-06-16 06:22:55 +0200
commitb361cb6c4db0e6f26729cf0a0dd136fad2d64897 (patch)
treecf7138049d3fb651d8fc3030751125d19b695f8d
parentshell: Display scheduler instead of current CPU (diff)
downloadrtems-b361cb6c4db0e6f26729cf0a0dd136fad2d64897.tar.bz2
bsps/powerpc: Fix warning
Close #3051.
-rw-r--r--c/src/lib/libbsp/powerpc/shared/src/memcpy.c10
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;
}
}