diff options
author | Renato Golin <renato.golin@linaro.org> | 2016-12-23 21:58:39 +0000 |
---|---|---|
committer | Renato Golin <renato.golin@linaro.org> | 2016-12-23 21:58:39 +0000 |
commit | 054a09b3998670d99074bae79cf8b9d71711c1da (patch) | |
tree | 92edbdc63b46cdf2f51a66c99d86bd56eb6c9f06 /lib | |
parent | 7e0e37bd699e06c20dd5ba2adecbc8bffeacb3bd (diff) |
Revert "[XRay][AArch64] An attempt to fix test patching-unpatching.cc by flushing the instruction cache after code modification"
This reverts commit r290452, not quite there yet. We need to test this
offline.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@290453 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/xray/xray_AArch64.cc | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/xray/xray_AArch64.cc b/lib/xray/xray_AArch64.cc index 5547ef730..8f24610da 100644 --- a/lib/xray/xray_AArch64.cc +++ b/lib/xray/xray_AArch64.cc @@ -19,8 +19,6 @@ #include <atomic> #include <cassert> -extern void __clear_cache(void* start, void* end); - namespace __xray { uint64_t cycleFrequency() XRAY_NEVER_INSTRUMENT { @@ -77,8 +75,8 @@ inline static bool patchSled(const bool Enable, const uint32_t FuncId, // B #32 uint32_t *FirstAddress = reinterpret_cast<uint32_t *>(Sled.Address); - uint32_t *CurAddress = FirstAddress + 1; if (Enable) { + uint32_t *CurAddress = FirstAddress + 1; *CurAddress = uint32_t(PatchOpcodes::PO_LdrW0_12); CurAddress++; *CurAddress = uint32_t(PatchOpcodes::PO_LdrX16_12); @@ -90,7 +88,6 @@ inline static bool patchSled(const bool Enable, const uint32_t FuncId, *reinterpret_cast<void (**)()>(CurAddress) = TracingHook; CurAddress += 2; *CurAddress = uint32_t(PatchOpcodes::PO_LdpX0X30SP_16); - CurAddress++; std::atomic_store_explicit( reinterpret_cast<std::atomic<uint32_t> *>(FirstAddress), uint32_t(PatchOpcodes::PO_StpX0X30SP_m16e), std::memory_order_release); @@ -99,8 +96,6 @@ inline static bool patchSled(const bool Enable, const uint32_t FuncId, reinterpret_cast<std::atomic<uint32_t> *>(FirstAddress), uint32_t(PatchOpcodes::PO_B32), std::memory_order_release); } - __clear_cache(reinterpret_cast<char*>(FirstAddress), - reinterpret_cast<char*>(CurAddress)); return true; } |