]> git.proxmox.com Git - mirror_qemu.git/commitdiff
cpu-exec: Rename cpu_resume_from_signal() to cpu_loop_exit_noexc()
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 17 May 2016 14:18:04 +0000 (15:18 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 9 Jun 2016 14:55:02 +0000 (15:55 +0100)
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: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Sergey Fedorov <sergey.fedorov@linaro.org>
Acked-by: Eduardo Habkost <ehabkost@redhat.com>
Acked-by: Riku Voipio <riku.voipio@linaro.org>
Message-id: 1463494687-25947-4-git-send-email-peter.maydell@linaro.org

cpu-exec-common.c
exec.c
hw/i386/kvmvapic.c
include/exec/exec-all.h
target-i386/bpt_helper.c
target-lm32/helper.c
target-s390x/helper.c
target-xtensa/helper.c
translate-all.c
user-exec.c

index 0cb5b6381bcf3e64fbac24818cc5c2e9118fa7e1..0cb4ae60eff91c25dd2986e5d29bcc59e7f36fdf 100644 (file)
 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 */
 
diff --git a/exec.c b/exec.c
index f2c9e374f5f541f1ea882dbc2f1a9328cba76fb8..a9d465b289de7cae7128125cc67b2ef43aca715e 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -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 {
index 5b71b1ba46676398109283942b3bd3d557b75e27..3bf1ddd97612c55b9b56978f7cd7108ed6157f58 100644 (file)
@@ -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);
     }
 }
 
index b6a4a122da6648c61027ca1ef0054820c2408726..e076397e2f7bf501e781a35843c0c04138830af0 100644 (file)
@@ -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,
index 499a27756771954bde2776891523b125b8403e4b..6fd7fe04a05cd945e9ed63cca46d0ae59700654f 100644 (file)
@@ -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 {
index b8f4ed99600a196503d7601925713ffae0766faf..891da18c30fd201e58dfcc4b5cbaa7a753077b35 100644 (file)
@@ -141,7 +141,7 @@ void lm32_debug_excp_handler(CPUState *cs)
             if (check_watchpoints(env)) {
                 raise_exception(env, EXCP_WATCHPOINT);
             } else {
-                cpu_resume_from_signal(cs, NULL);
+                cpu_loop_exit_noexc(cs);
             }
         }
     } else {
index ad8f7978ea31002e3548aa972f73e50a9f8aa304..9a744df6c89a44b981a8fb7bac44dce8e79f3da0 100644 (file)
@@ -688,7 +688,7 @@ void s390x_cpu_debug_excp_handler(CPUState *cs)
            will be triggered, it will call load_psw which will recompute
            the watchpoints.  */
         cpu_watchpoint_remove_all(cs, BP_CPU);
-        cpu_resume_from_signal(cs, NULL);
+        cpu_loop_exit_noexc(cs);
     }
 }
 #endif /* CONFIG_USER_ONLY */
index 839f4a74a5286e7068bfc6e85a0fa34f631d7a2a..768b32c4172400ccdf61180e90e0139b6e8d4373 100644 (file)
@@ -108,7 +108,7 @@ void xtensa_breakpoint_handler(CPUState *cs)
             if (cause) {
                 debug_exception_env(env, cause);
             }
-            cpu_resume_from_signal(cs, NULL);
+            cpu_loop_exit_noexc(cs);
         }
     }
 }
index ff588f390fd5ee5ad127450204f1e574c8593b45..118e7d3c842282ed0e3eb52eea96f0ffd465bd1a 100644 (file)
@@ -1395,7 +1395,7 @@ void tb_invalidate_phys_page_range(tb_page_addr_t start, tb_page_addr_t end,
            modifying the memory. It will ensure that it cannot modify
            itself */
         tb_gen_code(cpu, current_pc, current_cs_base, current_flags, 1);
-        cpu_resume_from_signal(cpu, NULL);
+        cpu_loop_exit_noexc(cpu);
     }
 #endif
 }
@@ -1654,7 +1654,7 @@ void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr)
        repeating the fault, which is horribly inefficient.
        Better would be to execute just this insn uncached, or generate a
        second new TB.  */
-    cpu_resume_from_signal(cpu, NULL);
+    cpu_loop_exit_noexc(cpu);
 }
 
 void tb_flush_jmp_cache(CPUState *cpu, target_ulong addr)
index efd34a6ee401a34624cbd33225c0db1a9c4c682b..c5179a410c6ac05f91f4e63d46109b2b9c2e51e6 100644 (file)
@@ -74,7 +74,7 @@ static void cpu_exit_tb_from_sighandler(CPUState *cpu, void *puc)
     sigprocmask(SIG_SETMASK, &uc->sc_mask, NULL);
 #endif
 
-    cpu_resume_from_signal(cpu, NULL);
+    cpu_loop_exit_noexc(cpu);
 }
 
 /* 'pc' is the host PC at which the exception was raised. 'address' is