OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // CPU specific code for arm independent of OS goes here. | 5 // CPU specific code for arm independent of OS goes here. |
6 | 6 |
7 #include <sys/syscall.h> | 7 #include <sys/syscall.h> |
8 #include <unistd.h> | 8 #include <unistd.h> |
9 | 9 |
10 #ifdef __mips | 10 #ifdef __mips |
(...skipping 17 matching lines...) Expand all Loading... | |
28 if (size == 0) { | 28 if (size == 0) { |
29 return; | 29 return; |
30 } | 30 } |
31 | 31 |
32 #if defined(ANDROID) && !defined(__LP64__) | 32 #if defined(ANDROID) && !defined(__LP64__) |
33 // Bionic cacheflush can typically run in userland, avoiding kernel call. | 33 // Bionic cacheflush can typically run in userland, avoiding kernel call. |
34 char *end = reinterpret_cast<char *>(start) + size; | 34 char *end = reinterpret_cast<char *>(start) + size; |
35 cacheflush( | 35 cacheflush( |
36 reinterpret_cast<intptr_t>(start), reinterpret_cast<intptr_t>(end), 0); | 36 reinterpret_cast<intptr_t>(start), reinterpret_cast<intptr_t>(end), 0); |
37 #else // ANDROID | 37 #else // ANDROID |
38 int res; | 38 long res; // NOLINT(runtime/int) |
balazs.kilvady
2015/12/02 18:49:07
Do we need long at here? syscall returns with int.
ivica.bogosavljevic
2015/12/03 10:36:24
On MIPS64, if we leave int here than we cannot com
| |
39 // See http://www.linux-mips.org/wiki/Cacheflush_Syscall. | 39 // See http://www.linux-mips.org/wiki/Cacheflush_Syscall. |
40 res = syscall(__NR_cacheflush, start, size, ICACHE); | 40 res = syscall(__NR_cacheflush, start, size, ICACHE); |
41 if (res) { | 41 if (res) { |
42 V8_Fatal(__FILE__, __LINE__, "Failed to flush the instruction cache"); | 42 V8_Fatal(__FILE__, __LINE__, "Failed to flush the instruction cache"); |
43 } | 43 } |
44 #endif // ANDROID | 44 #endif // ANDROID |
45 #endif // !USE_SIMULATOR. | 45 #endif // !USE_SIMULATOR. |
46 } | 46 } |
47 | 47 |
48 } // namespace internal | 48 } // namespace internal |
49 } // namespace v8 | 49 } // namespace v8 |
50 | 50 |
51 #endif // V8_TARGET_ARCH_MIPS64 | 51 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |