OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
7 | 7 |
8 #ifndef NATIVE_CLIENT_SRC_INCLUDE_CONCURRENCY_OPS_H_ | 8 #ifndef NATIVE_CLIENT_SRC_INCLUDE_CONCURRENCY_OPS_H_ |
9 #define NATIVE_CLIENT_SRC_INCLUDE_CONCURRENCY_OPS_H_ 1 | 9 #define NATIVE_CLIENT_SRC_INCLUDE_CONCURRENCY_OPS_H_ 1 |
10 | 10 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
81 * We need to do this for writable_addr. | 81 * We need to do this for writable_addr. |
82 * 2) It clears the instruction cache for the address range. | 82 * 2) It clears the instruction cache for the address range. |
83 * We need to do this for executable_addr. | 83 * We need to do this for executable_addr. |
84 * | 84 * |
85 * We do not need apply (1) to executable_addr or apply (2) to | 85 * We do not need apply (1) to executable_addr or apply (2) to |
86 * writable_addr, but the Linux kernel does not expose (1) and (2) | 86 * writable_addr, but the Linux kernel does not expose (1) and (2) |
87 * as separate operations; it just provides a single syscall that | 87 * as separate operations; it just provides a single syscall that |
88 * does both. For background, see: | 88 * does both. For background, see: |
89 * http://code.google.com/p/nativeclient/issues/detail?id=2443 | 89 * http://code.google.com/p/nativeclient/issues/detail?id=2443 |
90 */ | 90 */ |
91 __builtin___clear_cache(writable_addr, writable_addr + size); | 91 __builtin___clear_cache((char*)writable_addr, (char*)writable_addr + size); |
Mark Seaborn
2014/07/23 19:13:41
What version of Clang did you test against?
It lo
Sam Clegg
2014/07/23 19:21:52
clang is coming from the chrome tree: third_party/
Mark Seaborn
2014/07/24 18:45:35
Ah, the issue is that __clear_cache() and __builti
| |
92 __builtin___clear_cache(executable_addr, executable_addr + size); | 92 __builtin___clear_cache((char*)executable_addr, |
93 (char*)executable_addr + size); | |
93 #else | 94 #else |
94 /* | 95 /* |
95 * Give an error in case we ever target a non-gcc compiler for ARM | 96 * Give an error in case we ever target a non-gcc compiler for ARM |
96 * or for some other architecture that we might support in the | 97 * or for some other architecture that we might support in the |
97 * future. | 98 * future. |
98 */ | 99 */ |
99 # error "Don't know how to clear the icache on this architecture" | 100 # error "Don't know how to clear the icache on this architecture" |
100 #endif | 101 #endif |
101 } | 102 } |
102 | 103 |
103 | 104 |
104 #endif /* NATIVE_CLIENT_SRC_INCLUDE_CONCURRENCY_OPS_H_ */ | 105 #endif /* NATIVE_CLIENT_SRC_INCLUDE_CONCURRENCY_OPS_H_ */ |
OLD | NEW |