Commit 6886b980 authored by Peter Maydell's avatar Peter Maydell
Browse files

cpu-exec: Rename cpu_resume_from_signal() to cpu_loop_exit_noexc()



The function cpu_resume_from_signal() is now always called with a
NULL puc argument, and is rather misnamed since it is never called
from a signal handler. It is essentially forcing an exit to the
top level cpu loop but without raising any exception, so rename
it to cpu_loop_exit_noexc() and drop the useless unused argument.

Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
Reviewed-by: default avatarSergey Fedorov <sergey.fedorov@linaro.org>
Acked-by: default avatarEduardo Habkost <ehabkost@redhat.com>
Acked-by: default avatarRiku Voipio <riku.voipio@linaro.org>
Message-id: 1463494687-25947-4-git-send-email-peter.maydell@linaro.org
parent f213e72f
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -26,10 +26,8 @@
bool exit_request;
CPUState *tcg_current_cpu;

/* exit the current TB from a signal handler. The host registers are
   restored in a state compatible with the CPU emulator
 */
void cpu_resume_from_signal(CPUState *cpu, void *puc)
/* exit the current TB, but without causing any exception to be raised */
void cpu_loop_exit_noexc(CPUState *cpu)
{
    /* XXX: restore cpu registers saved in host registers */

+1 −1
Original line number Diff line number Diff line
@@ -2091,7 +2091,7 @@ static void check_watchpoint(int offset, int len, MemTxAttrs attrs, int flags)
                } else {
                    cpu_get_tb_cpu_state(env, &pc, &cs_base, &cpu_flags);
                    tb_gen_code(cpu, pc, cs_base, cpu_flags, 1);
                    cpu_resume_from_signal(cpu, NULL);
                    cpu_loop_exit_noexc(cpu);
                }
            }
        } else {
+1 −1
Original line number Diff line number Diff line
@@ -450,7 +450,7 @@ static void patch_instruction(VAPICROMState *s, X86CPU *cpu, target_ulong ip)

    if (!kvm_enabled()) {
        tb_gen_code(cs, current_pc, current_cs_base, current_flags, 1);
        cpu_resume_from_signal(cs, NULL);
        cpu_loop_exit_noexc(cs);
    }
}

+1 −1
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@ void restore_state_to_opc(CPUArchState *env, struct TranslationBlock *tb,
void cpu_gen_init(void);
bool cpu_restore_state(CPUState *cpu, uintptr_t searched_pc);

void QEMU_NORETURN cpu_resume_from_signal(CPUState *cpu, void *puc);
void QEMU_NORETURN cpu_loop_exit_noexc(CPUState *cpu);
void QEMU_NORETURN cpu_io_recompile(CPUState *cpu, uintptr_t retaddr);
TranslationBlock *tb_gen_code(CPUState *cpu,
                              target_ulong pc, target_ulong cs_base,
+1 −1
Original line number Diff line number Diff line
@@ -218,7 +218,7 @@ void breakpoint_handler(CPUState *cs)
            if (check_hw_breakpoints(env, false)) {
                raise_exception(env, EXCP01_DB);
            } else {
                cpu_resume_from_signal(cs, NULL);
                cpu_loop_exit_noexc(cs);
            }
        }
    } else {
Loading