]> git.ipfire.org Git - thirdparty/qemu.git/blob - accel/tcg/atomic_common.inc.c
atomic_template: add inline trace/plugin helpers
[thirdparty/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 }
29
30 static inline
31 void atomic_trace_ld_pre(CPUArchState *env, target_ulong addr, uint16_t info)
32 {
33 trace_guest_mem_before_exec(env_cpu(env), addr, info);
34 }
35
36 static inline
37 void atomic_trace_ld_post(CPUArchState *env, target_ulong addr, uint16_t info)
38 {
39 }
40
41 static inline
42 void atomic_trace_st_pre(CPUArchState *env, target_ulong addr, uint16_t info)
43 {
44 trace_guest_mem_before_exec(env_cpu(env), addr, info);
45 }
46
47 static inline
48 void atomic_trace_st_post(CPUArchState *env, target_ulong addr, uint16_t info)
49 {
50 }