]> git.proxmox.com Git - mirror_qemu.git/blob - accel/tcg/atomic_common.inc.c
target/i386: Use cpu_*_mmuidx_ra instead of templates
[mirror_qemu.git] / accel / tcg / atomic_common.inc.c
1 /*
2 * Common Atomic Helper Functions
3 *
4 * This file should be included before the various instantiations of
5 * the atomic_template.h helpers.
6 *
7 * Copyright (c) 2019 Linaro
8 * Written by Alex Bennée <alex.bennee@linaro.org>
9 *
10 * SPDX-License-Identifier: GPL-2.0-or-later
11 *
12 * This work is licensed under the terms of the GNU GPL, version 2 or later.
13 * See the COPYING file in the top-level directory.
14 */
15
16 static inline
17 void atomic_trace_rmw_pre(CPUArchState *env, target_ulong addr, uint16_t info)
18 {
19 CPUState *cpu = env_cpu(env);
20
21 trace_guest_mem_before_exec(cpu, addr, info);
22 trace_guest_mem_before_exec(cpu, addr, info | TRACE_MEM_ST);
23 }
24
25 static inline void
26 atomic_trace_rmw_post(CPUArchState *env, target_ulong addr, uint16_t info)
27 {
28 qemu_plugin_vcpu_mem_cb(env_cpu(env), addr, info);
29 qemu_plugin_vcpu_mem_cb(env_cpu(env), addr, info | TRACE_MEM_ST);
30 }
31
32 static inline
33 void atomic_trace_ld_pre(CPUArchState *env, target_ulong addr, uint16_t info)
34 {
35 trace_guest_mem_before_exec(env_cpu(env), addr, info);
36 }
37
38 static inline
39 void atomic_trace_ld_post(CPUArchState *env, target_ulong addr, uint16_t info)
40 {
41 qemu_plugin_vcpu_mem_cb(env_cpu(env), addr, info);
42 }
43
44 static inline
45 void atomic_trace_st_pre(CPUArchState *env, target_ulong addr, uint16_t info)
46 {
47 trace_guest_mem_before_exec(env_cpu(env), addr, info);
48 }
49
50 static inline
51 void atomic_trace_st_post(CPUArchState *env, target_ulong addr, uint16_t info)
52 {
53 qemu_plugin_vcpu_mem_cb(env_cpu(env), addr, info);
54 }