Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/globals.h" | 5 #include "vm/globals.h" |
| 6 #if defined(TARGET_ARCH_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
| 7 | 7 |
| 8 #include "vm/cpu.h" | 8 #include "vm/cpu.h" |
| 9 #include "vm/cpu_arm64.h" | 9 #include "vm/cpu_arm64.h" |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 27 #endif | 27 #endif |
| 28 | 28 |
| 29 #if !defined(USING_SIMULATOR) && !HOST_OS_IOS | 29 #if !defined(USING_SIMULATOR) && !HOST_OS_IOS |
| 30 // Nothing to do. Flushing no instructions. | 30 // Nothing to do. Flushing no instructions. |
| 31 if (size == 0) { | 31 if (size == 0) { |
| 32 return; | 32 return; |
| 33 } | 33 } |
| 34 | 34 |
| 35 // ARM recommends using the gcc intrinsic __clear_cache on Linux and Android. | 35 // ARM recommends using the gcc intrinsic __clear_cache on Linux and Android. |
| 36 // blogs.arm.com/software-enablement/141-caches-and-self-modifying-code/ | 36 // blogs.arm.com/software-enablement/141-caches-and-self-modifying-code/ |
| 37 #if defined(HOST_OS_ANDROID) || defined(HOST_OS_FUCHSIA) || \ | 37 #if defined(HOST_OS_ANDROID) || defined(HOST_OS_LINUX) |
| 38 defined(HOST_OS_LINUX) | |
| 39 extern void __clear_cache(char*, char*); | 38 extern void __clear_cache(char*, char*); |
| 40 char* beg = reinterpret_cast<char*>(start); | 39 char* beg = reinterpret_cast<char*>(start); |
| 41 char* end = reinterpret_cast<char*>(start + size); | 40 char* end = reinterpret_cast<char*>(start + size); |
| 42 ::__clear_cache(beg, end); | 41 ::__clear_cache(beg, end); |
| 42 #elif defined(HOST_OS_FUCHSIA) | |
| 43 // TODO(magenta): Use MX_CACHE_FLUSH_INSTR when implemented. | |
| 44 // mx_status result = mx_cache_flush(start, size, MX_CACHE_FLUSH_INSN); | |
|
Roland McGrath
2017/07/25 22:34:24
This should build now and the Magenta runtime supp
rmacnak
2017/07/25 22:38:15
I can't call it now because the current implementa
| |
| 45 // ASSERT(result == MX_OK); | |
| 43 #else | 46 #else |
| 44 #error FlushICache only tested/supported on Android, Fuchsia, and Linux | 47 #error FlushICache only tested/supported on Android, Fuchsia, and Linux |
| 45 #endif | 48 #endif |
| 46 | 49 |
| 47 #endif | 50 #endif |
| 48 } | 51 } |
| 49 | 52 |
| 50 const char* CPU::Id() { | 53 const char* CPU::Id() { |
| 51 return | 54 return |
| 52 #if defined(USING_SIMULATOR) | 55 #if defined(USING_SIMULATOR) |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 98 ASSERT(hardware_ != NULL); | 101 ASSERT(hardware_ != NULL); |
| 99 free(const_cast<char*>(hardware_)); | 102 free(const_cast<char*>(hardware_)); |
| 100 hardware_ = NULL; | 103 hardware_ = NULL; |
| 101 CpuInfo::Cleanup(); | 104 CpuInfo::Cleanup(); |
| 102 } | 105 } |
| 103 #endif // !defined(USING_SIMULATOR) | 106 #endif // !defined(USING_SIMULATOR) |
| 104 | 107 |
| 105 } // namespace dart | 108 } // namespace dart |
| 106 | 109 |
| 107 #endif // defined TARGET_ARCH_ARM64 | 110 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |