@@ -106,12 +106,12 @@ struct TCGCPUOps {
#ifdef CONFIG_USER_ONLY
/**
- * @fake_user_interrupt: Callback for 'fake exception' handling.
+ * @fake_user_exception: Callback for 'fake exception' handling.
*
* Simulate 'fake exception' which will be handled outside the
* cpu execution loop (hack for x86 user mode).
*/
- void (*fake_user_interrupt)(CPUState *cpu);
+ void (*fake_user_exception)(CPUState *cpu);
/**
* record_sigsegv:
@@ -35,11 +35,13 @@
* x86_cpu_do_interrupt:
* @cpu: vCPU the interrupt is to be handled by.
*/
-void x86_cpu_do_interrupt(CPUState *cpu);
#ifndef CONFIG_USER_ONLY
+void x86_cpu_do_interrupt(CPUState *cpu);
bool x86_cpu_exec_halt(CPUState *cpu);
bool x86_need_replay_interrupt(int interrupt_request);
bool x86_cpu_exec_interrupt(CPUState *cpu, int int_req);
+#else
+void x86_cpu_fake_user_exception(CPUState *cs);
#endif
void breakpoint_handler(CPUState *cs);
@@ -717,8 +717,8 @@ static inline bool cpu_handle_exception(CPUState *cpu, int *ret)
* handled outside the cpu execution loop.
*/
const TCGCPUOps *tcg_ops = cpu->cc->tcg_ops;
- if (tcg_ops->fake_user_interrupt) {
- tcg_ops->fake_user_interrupt(cpu);
+ if (tcg_ops->fake_user_exception) {
+ tcg_ops->fake_user_exception(cpu);
}
*ret = cpu->exception_index;
cpu->exception_index = -1;
@@ -173,7 +173,7 @@ const TCGCPUOps x86_tcg_ops = {
.cpu_exec_enter = x86_cpu_exec_enter,
.cpu_exec_exit = x86_cpu_exec_exit,
#ifdef CONFIG_USER_ONLY
- .fake_user_interrupt = x86_cpu_do_interrupt,
+ .fake_user_exception = x86_cpu_fake_user_exception,
.record_sigsegv = x86_cpu_record_sigsegv,
.record_sigbus = x86_cpu_record_sigbus,
#else
@@ -42,7 +42,7 @@ void helper_syscall(CPUX86State *env, int next_eip_addend)
* instruction. It is only relevant if is_int is TRUE or if intno
* is EXCP_SYSCALL.
*/
-static void do_interrupt_user(CPUX86State *env, int intno, int is_int,
+static void do_exception_user(CPUX86State *env, int intno, int is_int,
int error_code, target_ulong next_eip)
{
if (is_int) {
@@ -76,7 +76,7 @@ static void do_interrupt_user(CPUX86State *env, int intno, int is_int,
}
}
-void x86_cpu_do_interrupt(CPUState *cs)
+void x86_cpu_fake_user_exception(CPUState *cs)
{
X86CPU *cpu = X86_CPU(cs);
CPUX86State *env = &cpu->env;
@@ -84,7 +84,7 @@ void x86_cpu_do_interrupt(CPUState *cs)
/* if user mode only, we simulate a fake exception
which will be handled outside the cpu execution
loop */
- do_interrupt_user(env, cs->exception_index,
+ do_exception_user(env, cs->exception_index,
env->exception_is_int,
env->error_code,
env->exception_next_eip);
The fake_user_exception hook handles exceptions in the outer exception loop (cpu_handle_exception), not inner loop interrupts (cpu_handle_interrupt). Rename to clarify the scope and intent. Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> --- include/accel/tcg/cpu-ops.h | 4 ++-- target/i386/tcg/helper-tcg.h | 4 +++- accel/tcg/cpu-exec.c | 4 ++-- target/i386/tcg/tcg-cpu.c | 2 +- target/i386/tcg/user/seg_helper.c | 6 +++--- 5 files changed, 11 insertions(+), 9 deletions(-)