Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(188)

Side by Side Diff: runtime/vm/cpu_arm64.cc

Issue 1539403003: Fix arm64 build. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 6
7 #if defined(TARGET_ARCH_ARM64) 7 #if defined(TARGET_ARCH_ARM64)
8 8
9 #include "vm/cpu.h" 9 #include "vm/cpu.h"
10 #include "vm/cpuinfo.h" 10 #include "vm/cpuinfo.h"
11 #include "vm/simulator.h" 11 #include "vm/simulator.h"
12 12
13 #if !defined(USING_SIMULATOR) 13 #if !defined(USING_SIMULATOR)
14 #include <sys/syscall.h> /* NOLINT */ 14 #include <sys/syscall.h> /* NOLINT */
15 #include <unistd.h> /* NOLINT */ 15 #include <unistd.h> /* NOLINT */
16 #endif 16 #endif
17 17
18 #if defined(__linux__) || defined(ANDROID)
19 extern "C" {
20 void __clear_cache(char*, char*);
21 }
22 #endif
23
18 namespace dart { 24 namespace dart {
19 25
20 void CPU::FlushICache(uword start, uword size) { 26 void CPU::FlushICache(uword start, uword size) {
21 #if TARGET_OS_IOS 27 #if TARGET_OS_IOS
22 // Precompilation never patches code so there should be no I cache flushes. 28 // Precompilation never patches code so there should be no I cache flushes.
23 UNREACHABLE(); 29 UNREACHABLE();
24 #endif 30 #endif
25 31
26 #if !defined(USING_SIMULATOR) && !TARGET_OS_IOS 32 #if !defined(USING_SIMULATOR) && !TARGET_OS_IOS
27 // Nothing to do. Flushing no instructions. 33 // Nothing to do. Flushing no instructions.
28 if (size == 0) { 34 if (size == 0) {
29 return; 35 return;
30 } 36 }
31 37
32 // ARM recommends using the gcc intrinsic __clear_cache on Linux and Android. 38 // ARM recommends using the gcc intrinsic __clear_cache on Linux and Android.
33 // blogs.arm.com/software-enablement/141-caches-and-self-modifying-code/ 39 // blogs.arm.com/software-enablement/141-caches-and-self-modifying-code/
34 #if defined(__linux__) || defined(ANDROID) 40 #if defined(__linux__) || defined(ANDROID)
35 extern void __clear_cache(char*, char*);
36 char* beg = reinterpret_cast<char*>(start); 41 char* beg = reinterpret_cast<char*>(start);
37 char* end = reinterpret_cast<char*>(start + size); 42 char* end = reinterpret_cast<char*>(start + size);
38 ::__clear_cache(beg, end); 43 __clear_cache(beg, end);
39 #else 44 #else
40 #error FlushICache only tested/supported on Linux and Android 45 #error FlushICache only tested/supported on Linux and Android
41 #endif 46 #endif
42 47
43 #endif 48 #endif
44 } 49 }
45 50
46 51
47 const char* CPU::Id() { 52 const char* CPU::Id() {
48 return 53 return
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 ASSERT(hardware_ != NULL); 104 ASSERT(hardware_ != NULL);
100 free(const_cast<char*>(hardware_)); 105 free(const_cast<char*>(hardware_));
101 hardware_ = NULL; 106 hardware_ = NULL;
102 CpuInfo::Cleanup(); 107 CpuInfo::Cleanup();
103 } 108 }
104 #endif // !defined(USING_SIMULATOR) 109 #endif // !defined(USING_SIMULATOR)
105 110
106 } // namespace dart 111 } // namespace dart
107 112
108 #endif // defined TARGET_ARCH_ARM64 113 #endif // defined TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698