diff options
author | Joerg Sonnenberger <joerg@bec.de> | 2015-03-11 22:06:53 +0000 |
---|---|---|
committer | Joerg Sonnenberger <joerg@bec.de> | 2015-03-11 22:06:53 +0000 |
commit | 4ee4da8f2f817f390c13beffaea4711775ccadb8 (patch) | |
tree | 481131011ebedb001f5190a6f4f3f97a96e98be7 /lib/builtins/clear_cache.c | |
parent | b93f4018ffe3b84e1e69b9c562ee1db2fe2d941d (diff) |
Be nicer to C90 environments and avoid the declaration of variables in for
header.
From Alexander Esilevich.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@231975 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/builtins/clear_cache.c')
-rw-r--r-- | lib/builtins/clear_cache.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/builtins/clear_cache.c b/lib/builtins/clear_cache.c index d1826391d..ede7659a0 100644 --- a/lib/builtins/clear_cache.c +++ b/lib/builtins/clear_cache.c @@ -128,6 +128,7 @@ void __clear_cache(void *start, void *end) { #elif defined(__aarch64__) && !defined(__APPLE__) uint64_t xstart = (uint64_t)(uintptr_t) start; uint64_t xend = (uint64_t)(uintptr_t) end; + uint64_t addr; // Get Cache Type Info uint64_t ctr_el0; @@ -138,12 +139,12 @@ void __clear_cache(void *start, void *end) { * uintptr_t in case this runs in an IPL32 environment. */ const size_t dcache_line_size = 4 << ((ctr_el0 >> 16) & 15); - for (uint64_t addr = xstart; addr < xend; addr += dcache_line_size) + for (addr = xstart; addr < xend; addr += dcache_line_size) __asm __volatile("dc cvau, %0" :: "r"(addr)); __asm __volatile("dsb ish"); const size_t icache_line_size = 4 << ((ctr_el0 >> 0) & 15); - for (uint64_t addr = xstart; addr < xend; addr += icache_line_size) + for (addr = xstart; addr < xend; addr += icache_line_size) __asm __volatile("ic ivau, %0" :: "r"(addr)); __asm __volatile("isb sy"); #else |