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 | c8f5c18714e4a690ca14eef16c18d5a0f0362dc4 (patch) | |
| tree | 23a925e872c6cac6656909d91d42a99cf2b56b5d /compiler-rt/lib/builtins | |
| parent | cd66be5dda7b59f0009753fd1e63bfe595610f6d (diff) | |
| download | bcm5719-llvm-c8f5c18714e4a690ca14eef16c18d5a0f0362dc4.tar.gz bcm5719-llvm-c8f5c18714e4a690ca14eef16c18d5a0f0362dc4.zip | |
Be nicer to C90 environments and avoid the declaration of variables in for
header.
From Alexander Esilevich.
llvm-svn: 231975
Diffstat (limited to 'compiler-rt/lib/builtins')
| -rw-r--r-- | compiler-rt/lib/builtins/clear_cache.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler-rt/lib/builtins/clear_cache.c b/compiler-rt/lib/builtins/clear_cache.c index d1826391d59..ede7659a051 100644 --- a/compiler-rt/lib/builtins/clear_cache.c +++ b/compiler-rt/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 |

