accel/tcg: Move cpu_exec() out of 'exec/cpu-common.h'

In order to keep TCG-specific functions under a TCG
API namespace, add the "accel/tcg/cpu-loop.h" header
and move cpu_exec() declaration to it. Add a bit of
documentation.

Include "accel/tcg/cpu-loop.h" where appropriate.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260617171438.75914-5-philmd@oss.qualcomm.com>
This commit is contained in:
Philippe Mathieu-Daudé
2026-06-16 18:23:35 +02:00
parent 7ca3f8a84b
commit 77bdae789a
7 changed files with 26 additions and 4 deletions

View File

@@ -22,6 +22,7 @@
#include "qapi/error.h"
#include "qapi/type-helpers.h"
#include "hw/core/cpu.h"
#include "accel/tcg/cpu-loop.h"
#include "accel/tcg/cpu-ops.h"
#include "accel/tcg/helper-retaddr.h"
#include "trace.h"

View File

@@ -28,6 +28,7 @@
#include "qemu/osdep.h"
#include "accel/accel-ops.h"
#include "accel/accel-cpu-ops.h"
#include "accel/tcg/cpu-loop.h"
#include "system/tcg.h"
#include "system/replay.h"
#include "exec/icount.h"

View File

@@ -14,6 +14,7 @@
#include <sys/procdesc.h>
#include <sys/wait.h>
#include "accel/tcg/cpu-loop.h"
#include "target_arch_cpu.h"
pid_t safe_wait4(pid_t wpid, int *status, int options, struct rusage *rusage);

View File

@@ -39,6 +39,7 @@
#include "user/guest-base.h"
#include "user/page-protection.h"
#include "accel/accel-ops.h"
#include "accel/tcg/cpu-loop.h"
#include "tcg/startup.h"
#include "qemu/timer.h"
#include "qemu/envlist.h"

View File

@@ -0,0 +1,21 @@
/*
* QEMU TCG CPU loop API
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef ACCEL_TCG_CPU_LOOP_COMMON_H
#define ACCEL_TCG_CPU_LOOP_COMMON_H
#ifndef CONFIG_TCG
#error Can only include this header with TCG
#endif
/**
* cpu_exec:
* @cpu: the cpu context
*
* Returns one of the EXCP_* definitions (see "exec/cpu-common.h").
*/
int cpu_exec(CPUState *cpu);
#endif

View File

@@ -111,9 +111,6 @@ G_NORETURN void cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc);
#endif /* CONFIG_TCG */
G_NORETURN void cpu_loop_exit(CPUState *cpu);
/* accel/tcg/cpu-exec.c */
int cpu_exec(CPUState *cpu);
/**
* env_archcpu(env)
* @env: The architecture environment

View File

@@ -22,7 +22,7 @@
#include "exec/vaddr.h"
#include "exec/mmu-access-type.h"
#include "accel/tcg/cpu-loop.h"
/**
* adjust_signal_pc: