summaryrefslogtreecommitdiff
path: root/lib/builtins/clear_cache.c
Commit message (Collapse)AuthorAgeFilesLines
* [mips] [builtins] Remove clear_mips_cacheZoran Jovanovic2019-10-171-50/+0
| | | | | | | Differential Revision: https://reviews.llvm.org/D69021 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@375110 91177308-0d34-0410-b5e6-96231b3b80d8
* [builtins] Unbreak build on FreeBSD armv7 after D60351David Carlier2019-10-081-2/+6
| | | | | | | | | | | | headers include reordering. Reviewers: phosek, echristo Reviewed-By: phosek Differential Revsion: https://reviews.llvm.org/D68045 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@374070 91177308-0d34-0410-b5e6-96231b3b80d8
* [compiler-rt][builtins] Provide __clear_cache for SPARCRainer Orth2019-07-231-0/+10
| | | | | | | | | | | | | | | | While working on https://reviews.llvm.org/D40900, two tests were failing since __clear_cache aborted. While libgcc's __clear_cache is just empty, this only happens because gcc (in gcc/config/sparc/sparc.c (sparc32_initialize_trampoline, sparc64_initialize_trampoline)) emits flush insns directly. The following patch mimics that. Tested on sparcv9-sun-solaris2.11. Differential Revision: https://reviews.llvm.org/D64496 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@366822 91177308-0d34-0410-b5e6-96231b3b80d8
* [builtins] Use single line C++/C99 comment stylePetr Hosek2019-04-281-56/+45
| | | | | | | | | | | Use the uniform single line C++/99 style for code comments. This is part of the cleanup proposed in "[RFC] compiler-rt builtins cleanup and refactoring". Differential Revision: https://reviews.llvm.org/D60352 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@359411 91177308-0d34-0410-b5e6-96231b3b80d8
* [builtins] Reformat builtins with clang-formatPetr Hosek2019-04-281-109/+106
| | | | | | | | | | | Update formatting to use the LLVM style. This is part of the cleanup proposed in "[RFC] compiler-rt builtins cleanup and refactoring". Differential Revision: https://reviews.llvm.org/D60351 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@359410 91177308-0d34-0410-b5e6-96231b3b80d8
* Update more file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | | to reflect the new license. These used slightly different spellings that defeated my regular expressions. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@351648 91177308-0d34-0410-b5e6-96231b3b80d8
* [builtins] Align addresses to cache lines in __clear_cache for aarch64Martin Storsjo2018-01-241-2/+4
| | | | | | | | | | | | This makes sure that the last cache line gets invalidated properly. This matches the example code at http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.den0024a/BABJDBHI.html, and also matches what libgcc does. Differential Revision: https://reviews.llvm.org/D42196 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@323315 91177308-0d34-0410-b5e6-96231b3b80d8
* [compiler-rt] Implement __clear_cache() on OpenBSD/mips64Kamil Rytarowski2018-01-201-0/+7
| | | | | | | | | | | | | | | | Summary: Make __clear_cache() invoke the platform's cache flush function on OpenBSD/mips64. Reviewers: krytarowski Reviewed By: krytarowski Subscribers: sdardis, dberris, arichardson, krytarowski, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D42332 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@323039 91177308-0d34-0410-b5e6-96231b3b80d8
* [builtins] Use FlushInstructionCache on windows on aarch64 as wellMartin Storsjo2018-01-191-2/+2
| | | | | | | | | | Generalize this handling to a separate toplevel ifdef (since any windows case should use the same function), instead of indenting the aarch64 case one step further. Differential Revision: https://reviews.llvm.org/D42197 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@322928 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the MIPS baremetal buildAlexander Richardson2017-11-301-2/+2
| | | | | | | | | | | | | | | | Summary: Currently sys/cachectl.h is used unconditionally on MIPS although it is only available on Linux and will fail the build when targeting baremetal Reviewers: petarj Reviewed By: petarj Subscribers: sdardis, krytarowski Differential Revision: https://reviews.llvm.org/D40659 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@319455 91177308-0d34-0410-b5e6-96231b3b80d8
* [ARM] builtins: Replace abort by assert in clear_cache.Manoj Gupta2017-09-271-3/+2
| | | | | | | | | | | | | | | | | | | | Summary: __builtion___clear_cache maps to clear_cache function. On Linux, clear_cache functions makes a syscall and does an abort if syscall fails. Replace the abort by an assert so that non-debug builds do not abort if the syscall fails. Fixes PR34588. Reviewers: rengolin, compnerd, srhines, peter.smith, joerg Reviewed By: rengolin Subscribers: aemerson, kristof.beyls, llvm-commits Differential Revision: https://reviews.llvm.org/D37788 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@314322 91177308-0d34-0410-b5e6-96231b3b80d8
* This ppc64 implementation of clear_cache works for both big and little endian.Sterling Augustine2017-08-021-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309848 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert rL309634 until upstream buildbots have upgraded libc.Sterling Augustine2017-08-011-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309704 91177308-0d34-0410-b5e6-96231b3b80d8
* Add powerpc64 to compiler-rt build infrastructure.Sterling Augustine2017-07-311-1/+1
| | | | | | | | | | | | | | Summary: Add powerpc64 to compiler-rt build infrastructure. Reviewers: timshen Reviewed By: timshen Subscribers: nemanjai, dberris, mgorny, aheejin, cfe-commits Differential Revision: https://reviews.llvm.org/D36108 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309634 91177308-0d34-0410-b5e6-96231b3b80d8
* Add clear_cache implementation for ppc64. Fix buffer to meet ppc64 alignment.Sterling Augustine2017-07-281-1/+15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309423 91177308-0d34-0410-b5e6-96231b3b80d8
* [mips] Switch asm to __asm__ for non-GNU compiles.Stephen Hines2017-07-241-1/+1
| | | | | | | | | | | | | | | | | Summary: Using asm works fine for gnu11, but fails if the compiler uses C11. Switch to the more consistent __asm__, since that is what the rest of the source is using. Reviewers: petarj Reviewed By: petarj Subscribers: llvm-commits, sdardis, arichardson, pirama Differential Revision: https://reviews.llvm.org/D35756 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@308922 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove Bitrig: CompilerRT ChangesErich Keane2017-07-211-2/+2
| | | | | | | | | Bitrig code has been merged back to OpenBSD, thus the OS has been abandoned. Differential Revision: https://reviews.llvm.org/D35709 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@308798 91177308-0d34-0410-b5e6-96231b3b80d8
* [builtins] Make some ISA macro checks work with MSVCReid Kleckner2017-04-071-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@299786 91177308-0d34-0410-b5e6-96231b3b80d8
* [RT ARM] Avoid Linux include with a redefinitionRenato Golin2017-02-211-4/+9
| | | | | | | | | To avoid depending on kernel headers, we just repeat the single define we need, which is likely never going to change. Patch by Joakim Sindholt <opensource@zhasha.com> git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@295738 91177308-0d34-0410-b5e6-96231b3b80d8
* builtins: make sure that flags is setup properly for __clear_cacheSaleem Abdulrasool2016-09-071-1/+3
| | | | | | | | On Linux ARM, the syscall will take 3 arguments (start, end, flags). Ensure that we do not pass garbage to the flags, which can cause the cacheflush call to fail, and therefore cause an abort at runtime. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@280877 91177308-0d34-0410-b5e6-96231b3b80d8
* builtins: fix -Werror,-Wunused-variable warningSaleem Abdulrasool2016-04-201-1/+0
| | | | | | This removes the unused variable `flags`. NFC git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@266892 91177308-0d34-0410-b5e6-96231b3b80d8
* builtins: make __clear_cache work on Linux-ARMSaleem Abdulrasool2016-03-181-2/+2
| | | | | | | __clear_cache on Android is identical to the version on Linux. Use __linux__ instead of __ANDROID__ as __linux__ is defined for Linux and Android. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@263833 91177308-0d34-0410-b5e6-96231b3b80d8
* builtins: port __clear_cache to Windows ARMSaleem Abdulrasool2016-03-181-0/+11
| | | | | | | Support __clear_cache on Windows on ARM using the `FlushInstructionCache` library call. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@263832 91177308-0d34-0410-b5e6-96231b3b80d8
* builtins: adjust the clobbers list for android __clear_cacheSaleem Abdulrasool2016-02-251-2/+3
| | | | | | | | | Adjust the clobbers list. This use to work with older versions of gcc, but now will error on newer versions (tested against 5.3) (as well as clang). Patch by Tee Hao Wei! git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@261821 91177308-0d34-0410-b5e6-96231b3b80d8
* Be nicer to C90 environments and avoid the declaration of variables in forJoerg Sonnenberger2015-03-111-2/+3
| | | | | | | | | header. From Alexander Esilevich. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@231975 91177308-0d34-0410-b5e6-96231b3b80d8
* Always include stddef.h to make sure size_t exists.Joerg Sonnenberger2015-03-111-0/+1
| | | | | | | From Alexander Esilevich. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@231972 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow compiler-rt build on BitrigRenato Golin2015-03-021-2/+2
| | | | | | | | | This is the only patch Bitrig uses for compiler-rt. It adds support for Bitrig/arm in the clear cache code. Patch by Patrick Wildt. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@231012 91177308-0d34-0410-b5e6-96231b3b80d8
* [MIPS] Add missing header for syscallPetar Jovanovic2015-02-281-0/+1
| | | | | | | | | | | The syscall function itself is declared in <unistd.h> Compiling compiler-rt with -Werror-implicit-function-declaration will cause a build failure. This change fixes it. Differential Revision: http://reviews.llvm.org/D7949 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@230838 91177308-0d34-0410-b5e6-96231b3b80d8
* [mips] Add __clear_cache() definition for non-Android systemsPetar Jovanovic2015-02-101-4/+4
| | | | | | | | | | Make sure clear_cache() builtin has an appropriate definition for Linux. Call syscall(NR_cacheflush, ...). Differential Revision: http://reviews.llvm.org/D7205 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@228767 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove invalid const qualifier for r0, since it is written by svc.Stephen Hines2015-02-031-1/+1
| | | | | | | | | | | | | | Summary: This causes an invalid lvalue error when building for Android. Reviewers: danalbert Reviewed By: danalbert Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D7306 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@227907 91177308-0d34-0410-b5e6-96231b3b80d8
* [MIPS64] Make __clear_cache more optimalPetar Jovanovic2015-01-201-1/+56
| | | | | | | | | | Use synci implementation of clear_cache for short address ranges. For long address ranges, make a kernel call. Differential Revision: http://reviews.llvm.org/D6661 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@226567 91177308-0d34-0410-b5e6-96231b3b80d8
* Add FreeBSD support for __clear_cache.Roman Divacky2015-01-111-1/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@225610 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix checks for Android.Dan Albert2014-10-201-4/+4
| | | | | | | | | | | | | __ANDROID__ is a define that comes from the toolchain when building for Android targets. ANDROID has a different meaning. ANDROID is defined for _every_ Android build, including those done for host modules. For host modules, we want to build the regular Linux sanitizers and builtins, not the one for Android devices. This hasn't been a problem until now because we only just started building the sanitizers for the host. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@220203 91177308-0d34-0410-b5e6-96231b3b80d8
* builtins: remove unnecessary COMPILER_RT_EXPORTSaleem Abdulrasool2014-09-061-3/+1
| | | | | | | This macro did not do anything at this point, and is not particularly needed for Windows unless building the builtins as a shared library. NFC. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@217321 91177308-0d34-0410-b5e6-96231b3b80d8
* __clear_cache: decorate with COMPILER_RT_EXPORTSaleem Abdulrasool2014-05-121-1/+1
| | | | | | | | | Use COMPILER_RT_EXPORT rather than COMPILER_RT_ABI for this function. Adding an explicit PCS standard to the function causes a mismatch between the declarations. Furthermore, the function is implemented in C, and should take the CC based on the target triple. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@208591 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement Android versions of __clear_cache for arm32 & mips.Daniel Sanders2014-03-121-5/+31
| | | | | | | | | | The MIPS version was reviewed by myself. The ARM version was reviewed by JF Bastien. Patch by Narayan Kamath <narayan@google.com>. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@203674 91177308-0d34-0410-b5e6-96231b3b80d8
* Consistently use COMPILER_RT_ABI for all public symbols.Joerg Sonnenberger2014-03-011-1/+2
| | | | | | | Move prototypes into headers and fix a few inconsistencies. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@202591 91177308-0d34-0410-b5e6-96231b3b80d8
* Move original compiler-rt functions (libgcc replacement) to lib/builtins ↵Alexey Samsonov2014-02-141-0/+71
directory git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201393 91177308-0d34-0410-b5e6-96231b3b80d8