File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -37,13 +37,16 @@ void llvm::sys::Memory::InvalidateInstructionCache(const void *Addr,
37
37
38
38
// icache invalidation for PPC and ARM.
39
39
#if defined(__APPLE__)
40
- #if (defined(__POWERPC__) || defined (__ppc__) || \
40
+
41
+ # if (defined(__POWERPC__) || defined (__ppc__) || \
41
42
defined (_POWER) || defined (_ARCH_PPC)) || defined (__arm__)
42
43
sys_icache_invalidate (Addr, Len);
43
- #endif
44
+ # endif
45
+
44
46
#else
45
- #if (defined(__POWERPC__) || defined (__ppc__) || \
46
- defined (_POWER) || defined (_ARCH_PPC)) && defined (__GNUC__)
47
+
48
+ # if (defined(__POWERPC__) || defined (__ppc__) || \
49
+ defined (_POWER) || defined (_ARCH_PPC)) && defined (__GNUC__)
47
50
const size_t LineSize = 32 ;
48
51
49
52
const intptr_t Mask = ~(LineSize - 1 );
@@ -57,6 +60,12 @@ void llvm::sys::Memory::InvalidateInstructionCache(const void *Addr,
57
60
for (intptr_t Line = StartLine; Line < EndLine; Line += LineSize)
58
61
asm volatile (" icbi 0, %0" : : " r" (Line));
59
62
asm volatile (" isync" );
60
- #endif
63
+ # elif defined(__arm__) && defined(__GNUC__)
64
+ // FIXME: Can we safely always call this for __GNUC__ everywhere?
65
+ char *Start = (char *) Addr;
66
+ char *End = Start + Len;
67
+ __clear_cache (Start, End);
68
+ # endif
69
+
61
70
#endif // end apple
62
71
}
You can’t perform that action at this time.
0 commit comments