forked from OSchip/llvm-project
Be nicer to C90 environments and avoid the declaration of variables in for
header. From Alexander Esilevich. llvm-svn: 231975
This commit is contained in:
parent
cd66be5dda
commit
c8f5c18714
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue