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 // Declares a Simulator for ARM64 instructions if we are not generating a native | 5 // Declares a Simulator for ARM64 instructions if we are not generating a native |
6 // ARM64 binary. This Simulator allows us to run and debug ARM64 code generation | 6 // ARM64 binary. This Simulator allows us to run and debug ARM64 code generation |
7 // on regular desktop machines. | 7 // on regular desktop machines. |
8 // Dart calls into generated code by "calling" the InvokeDartCode stub, | 8 // Dart calls into generated code by "calling" the InvokeDartCode stub, |
9 // which will start execution in the Simulator or forwards to the real entry | 9 // which will start execution in the Simulator or forwards to the real entry |
10 // on a ARM64 HW platform. | 10 // on a ARM64 HW platform. |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 static struct AddressTag { | 200 static struct AddressTag { |
201 Thread* thread; | 201 Thread* thread; |
202 uword addr; | 202 uword addr; |
203 } exclusive_access_state_[kNumAddressTags]; | 203 } exclusive_access_state_[kNumAddressTags]; |
204 static int next_address_tag_; | 204 static int next_address_tag_; |
205 | 205 |
206 // Synchronization primitives support. | 206 // Synchronization primitives support. |
207 void ClearExclusive(); | 207 void ClearExclusive(); |
208 intptr_t ReadExclusiveX(uword addr, Instr* instr); | 208 intptr_t ReadExclusiveX(uword addr, Instr* instr); |
209 intptr_t WriteExclusiveX(uword addr, intptr_t value, Instr* instr); | 209 intptr_t WriteExclusiveX(uword addr, intptr_t value, Instr* instr); |
| 210 // 32 bit versions. |
| 211 intptr_t ReadExclusiveW(uword addr, Instr* instr); |
| 212 intptr_t WriteExclusiveW(uword addr, intptr_t value, Instr* instr); |
210 | 213 |
211 // Set access to given address to 'exclusive state' for current thread. | 214 // Set access to given address to 'exclusive state' for current thread. |
212 static void SetExclusiveAccess(uword addr); | 215 static void SetExclusiveAccess(uword addr); |
213 | 216 |
214 // Returns true if the current thread has exclusive access to given address, | 217 // Returns true if the current thread has exclusive access to given address, |
215 // returns false otherwise. In either case, set access to given address to | 218 // returns false otherwise. In either case, set access to given address to |
216 // 'open state' for all threads. | 219 // 'open state' for all threads. |
217 // If given addr is NULL, set access to 'open state' for current | 220 // If given addr is NULL, set access to 'open state' for current |
218 // thread (CLREX). | 221 // thread (CLREX). |
219 static bool HasExclusiveAccessAndOpen(uword addr); | 222 static bool HasExclusiveAccessAndOpen(uword addr); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 } | 271 } |
269 | 272 |
270 friend class SimulatorDebugger; | 273 friend class SimulatorDebugger; |
271 friend class SimulatorSetjmpBuffer; | 274 friend class SimulatorSetjmpBuffer; |
272 DISALLOW_COPY_AND_ASSIGN(Simulator); | 275 DISALLOW_COPY_AND_ASSIGN(Simulator); |
273 }; | 276 }; |
274 | 277 |
275 } // namespace dart | 278 } // namespace dart |
276 | 279 |
277 #endif // RUNTIME_VM_SIMULATOR_ARM64_H_ | 280 #endif // RUNTIME_VM_SIMULATOR_ARM64_H_ |
OLD | NEW |