[compiler-rt] 0f99bc2 - MIPS: clear_cache, use _flush_cache instead of cacheflush

Brad Smith via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 7 12:29:27 PDT 2023


Author: YunQiang Su
Date: 2023-08-07T15:25:34-04:00
New Revision: 0f99bc2d685c572c3b38fd0e1ca56be12d7e2f6a

URL: https://github.com/llvm/llvm-project/commit/0f99bc2d685c572c3b38fd0e1ca56be12d7e2f6a
DIFF: https://github.com/llvm/llvm-project/commit/0f99bc2d685c572c3b38fd0e1ca56be12d7e2f6a.diff

LOG: MIPS: clear_cache, use _flush_cache instead of cacheflush

The cacheflush is only defined with __USE_MISC, which depends on _DEFAULT_SOURCE,
_GNU_SOURCE or _BSD_SOURCE, or _SVID_SOURCE.

If CC is called with -std=c11, these macros won't be defined, Let's use
_flush_cache, which is defined always.

Reviewed By: brad, jrtc27

Differential Revision: https://reviews.llvm.org/D156072

Added: 
    

Modified: 
    compiler-rt/lib/builtins/clear_cache.c

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/builtins/clear_cache.c b/compiler-rt/lib/builtins/clear_cache.c
index 54cbda059315a7..2ac99b25c243f0 100644
--- a/compiler-rt/lib/builtins/clear_cache.c
+++ b/compiler-rt/lib/builtins/clear_cache.c
@@ -113,7 +113,7 @@ void __clear_cache(void *start, void *end) {
 #elif defined(__linux__) || defined(__OpenBSD__)
     // Pre-R6 may not be globalized. And some implementations may give strange
     // synci_step. So, let's use libc call for it.
-    cacheflush(start, end_int - start_int, BCACHE);
+    _flush_cache(start, end_int - start_int, BCACHE);
 #else
     (void)start_int;
     (void)end_int;


        


More information about the llvm-commits mailing list