[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 03/35] translate-all: Move tcg_handle_interrupt()
From: |
Peter Crosthwaite |
Subject: |
[Qemu-devel] [PATCH v3 03/35] translate-all: Move tcg_handle_interrupt() to -common |
Date: |
Sat, 18 Jul 2015 02:40:13 -0700 |
Move this function to common code. It has no arch specific
dependencies. Prepares support for multi-arch where the translate-all
interface needs to be virtualised. One less thing to virtualise.
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Peter Crosthwaite <address@hidden>
---
translate-all.c | 30 ------------------------------
translate-common.c | 35 +++++++++++++++++++++++++++++++++++
2 files changed, 35 insertions(+), 30 deletions(-)
diff --git a/translate-all.c b/translate-all.c
index 27f5d9c..fdb2aa8 100644
--- a/translate-all.c
+++ b/translate-all.c
@@ -1456,36 +1456,6 @@ void tb_check_watchpoint(CPUState *cpu)
}
#ifndef CONFIG_USER_ONLY
-/* mask must never be zero, except for A20 change call */
-static void tcg_handle_interrupt(CPUState *cpu, int mask)
-{
- int old_mask;
-
- old_mask = cpu->interrupt_request;
- cpu->interrupt_request |= mask;
-
- /*
- * If called from iothread context, wake the target cpu in
- * case its halted.
- */
- if (!qemu_cpu_is_self(cpu)) {
- qemu_cpu_kick(cpu);
- return;
- }
-
- if (use_icount) {
- cpu->icount_decr.u16.high = 0xffff;
- if (!cpu_can_do_io(cpu)
- && (mask & ~old_mask) != 0) {
- cpu_abort(cpu, "Raised interrupt while not in I/O function");
- }
- } else {
- cpu->tcg_exit_req = 1;
- }
-}
-
-CPUInterruptHandler cpu_interrupt_handler = tcg_handle_interrupt;
-
/* in deterministic execution mode, instructions doing device I/Os
must be at the end of the TB */
void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr)
diff --git a/translate-common.c b/translate-common.c
index 563ae5a..806b36e 100644
--- a/translate-common.c
+++ b/translate-common.c
@@ -1,6 +1,7 @@
/*
* Host code generation common components
*
+ * Copyright (c) 2003 Fabrice Bellard
* Copyright (c) 2015 Peter Crosthwaite <address@hidden>
*
* This library is free software; you can redistribute it and/or
@@ -18,6 +19,40 @@
*/
#include "qemu-common.h"
+#include "qom/cpu.h"
+
+#ifndef CONFIG_USER_ONLY
+/* mask must never be zero, except for A20 change call */
+static void tcg_handle_interrupt(CPUState *cpu, int mask)
+{
+ int old_mask;
+
+ old_mask = cpu->interrupt_request;
+ cpu->interrupt_request |= mask;
+
+ /*
+ * If called from iothread context, wake the target cpu in
+ * case its halted.
+ */
+ if (!qemu_cpu_is_self(cpu)) {
+ qemu_cpu_kick(cpu);
+ return;
+ }
+
+ if (use_icount) {
+ cpu->icount_decr.u16.high = 0xffff;
+ if (!cpu_can_do_io(cpu)
+ && (mask & ~old_mask) != 0) {
+ cpu_abort(cpu, "Raised interrupt while not in I/O function");
+ }
+ } else {
+ cpu->tcg_exit_req = 1;
+ }
+}
+
+CPUInterruptHandler cpu_interrupt_handler = tcg_handle_interrupt;
+
+#endif
typedef struct TCGExecInitFn {
void (*do_tcg_exec_init)(unsigned long tb_size);
--
1.9.1
- [Qemu-devel] [PATCH v3 00/35] Multi Architecture System Emulation, Peter Crosthwaite, 2015/07/18
- [Qemu-devel] [PATCH v3 01/35] cpu-exec: Migrate some generic fns to cpu-exec-common, Peter Crosthwaite, 2015/07/18
- [Qemu-devel] [PATCH v3 02/35] translate: Listify tcg_exec_init(), Peter Crosthwaite, 2015/07/18
- [Qemu-devel] [PATCH v3 03/35] translate-all: Move tcg_handle_interrupt() to -common,
Peter Crosthwaite <=
- [Qemu-devel] [PATCH v3 04/35] tcg: split tcg_op_defs to -common, Peter Crosthwaite, 2015/07/18
- [Qemu-devel] [PATCH v3 05/35] tcg: Move tcg_tb_ptr to -common, Peter Crosthwaite, 2015/07/18
- [Qemu-devel] [PATCH v3 06/35] translate: move real_host_page setting to -common, Peter Crosthwaite, 2015/07/18
- [Qemu-devel] [PATCH v3 07/35] cpus: Listify cpu_list() function, Peter Crosthwaite, 2015/07/18
- [Qemu-devel] [PATCH v3 08/35] translate-common: Listify tcg_enabled(), Peter Crosthwaite, 2015/07/18
- [Qemu-devel] [PATCH v3 09/35] core: Convert tcg_enabled() users to tcg_(any|all)_enabled(), Peter Crosthwaite, 2015/07/18
- [Qemu-devel] [PATCH v3 10/35] exec-all: Move cpu_can_do_io() to qom/cpu.h, Peter Crosthwaite, 2015/07/18
- [Qemu-devel] [PATCH v3 11/35] cputlb: move CPU_LOOP() for tlb_reset() to exec.c, Peter Crosthwaite, 2015/07/18
- [Qemu-devel] [PATCH v3 12/35] cputlb: Change tlb_set_dirty() arg to cpu, Peter Crosthwaite, 2015/07/18
- [Qemu-devel] [PATCH v3 13/35] include/exec: Move cputlb exec.c defs out, Peter Crosthwaite, 2015/07/18