@@ -23,8 +23,13 @@
#include "qemu/plugin.h"
#include "qemu/main-loop.h"
#include "accel/tcg/cpu-loop.h"
+#include "exec/helper-proto-common.h"
#include "internal-common.h"
+#define HELPER_H "accel/tcg/cpu-exec-common.h"
+#include "exec/helper-info.c.inc"
+#undef HELPER_H
+
bool tcg_allowed;
/*
@@ -120,3 +125,8 @@ void cpu_loop_exit_atomic(CPUState *cpu, uintptr_t pc)
cpu->exception_index = EXCP_ATOMIC;
cpu_loop_exit_restore(cpu, pc);
}
+
+void HELPER(exit_atomic)(CPUArchState *env)
+{
+ cpu_loop_exit_atomic(env_cpu(env), GETPC());
+}
new file mode 100644
@@ -0,0 +1,2 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+DEF_HELPER_FLAGS_1(exit_atomic, TCG_CALL_NO_WG, noreturn, env)
@@ -23,10 +23,7 @@
*/
#include "qemu/osdep.h"
#include "qemu/host-utils.h"
-#include "exec/cpu-common.h"
#include "exec/helper-proto-common.h"
-#include "accel/tcg/cpu-loop.h"
-#include "accel/tcg/getpc.h"
#define HELPER_H "accel/tcg/tcg-runtime.h"
#include "exec/helper-info.c.inc"
@@ -129,8 +126,3 @@ uint64_t HELPER(ctpop_i64)(uint64_t arg)
{
return ctpop64(arg);
}
-
-void HELPER(exit_atomic)(CPUArchState *env)
-{
- cpu_loop_exit_atomic(env_cpu(env), GETPC());
-}
@@ -22,8 +22,6 @@ DEF_HELPER_FLAGS_1(ctpop_i64, TCG_CALL_NO_RWG_SE, i64, i64)
DEF_HELPER_FLAGS_1(lookup_tb_ptr, TCG_CALL_NO_WG_SE, cptr, env)
-DEF_HELPER_FLAGS_1(exit_atomic, TCG_CALL_NO_WG, noreturn, env)
-
#ifndef IN_HELPER_PROTO
/*
* Pass calls to memset directly to libc, without a thunk in qemu.
@@ -7,6 +7,10 @@
#ifndef HELPER_GEN_COMMON_H
#define HELPER_GEN_COMMON_H
+#define HELPER_H "accel/tcg/cpu-exec-common.h"
+#include "exec/helper-gen.h.inc"
+#undef HELPER_H
+
#define HELPER_H "accel/tcg/tcg-runtime.h"
#include "exec/helper-gen.h.inc"
#undef HELPER_H
@@ -9,6 +9,10 @@
#include "qemu/atomic128.h" /* for HAVE_CMPXCHG128 */
+#define HELPER_H "accel/tcg/cpu-exec-common.h"
+#include "exec/helper-proto.h.inc"
+#undef HELPER_H
+
#define HELPER_H "accel/tcg/tcg-runtime.h"
#include "exec/helper-proto.h.inc"
#undef HELPER_H
helper_exit_atomic only forwards to cpu_loop_exit_atomic. Define it in cpu-exec-common.c with that function, and move its DEF_HELPER line to cpu-exec-common.h. That file emits helper_info_exit_atomic. tcg-runtime.c keeps the integer helpers. Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> --- accel/tcg/cpu-exec-common.c | 10 ++++++++++ accel/tcg/cpu-exec-common.h | 2 ++ accel/tcg/tcg-runtime.c | 8 -------- accel/tcg/tcg-runtime.h | 2 -- include/exec/helper-gen-common.h | 4 ++++ include/exec/helper-proto-common.h | 4 ++++ 6 files changed, 20 insertions(+), 10 deletions(-) create mode 100644 accel/tcg/cpu-exec-common.h