All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, afaerber@suse.de, aliguori@amazon.com
Subject: [Qemu-devel] [PATCH 09/23] target-m68k: Use cpu_exec_interrupt qom hook
Date: Sat, 13 Sep 2014 09:45:20 -0700	[thread overview]
Message-ID: <1410626734-3804-10-git-send-email-rth@twiddle.net> (raw)
In-Reply-To: <1410626734-3804-1-git-send-email-rth@twiddle.net>

Since do_interrupt_m68k_hardirq is no longer used outside
op_helper.c, make it static.

Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 cpu-exec.c              | 13 -------------
 target-m68k/cpu-qom.h   |  1 +
 target-m68k/cpu.c       |  1 +
 target-m68k/cpu.h       |  1 -
 target-m68k/op_helper.c | 22 ++++++++++++++++++++--
 5 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/cpu-exec.c b/cpu-exec.c
index 08be521..8ff85ba 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -650,19 +650,6 @@ int cpu_exec(CPUArchState *env)
                             next_tb = 0;
                         }
                     }
-#elif defined(TARGET_M68K)
-                    if (interrupt_request & CPU_INTERRUPT_HARD
-                        && ((env->sr & SR_I) >> SR_I_SHIFT)
-                            < env->pending_level) {
-                        /* Real hardware gets the interrupt vector via an
-                           IACK cycle at this point.  Current emulated
-                           hardware doesn't rely on this, so we
-                           provide/save the vector when the interrupt is
-                           first signalled.  */
-                        cpu->exception_index = env->pending_vector;
-                        do_interrupt_m68k_hardirq(env);
-                        next_tb = 0;
-                    }
 #endif
                     /* The target hook has 3 exit conditions:
                        False when the interrupt isn't processed,
diff --git a/target-m68k/cpu-qom.h b/target-m68k/cpu-qom.h
index 41b14ae..c28e55d 100644
--- a/target-m68k/cpu-qom.h
+++ b/target-m68k/cpu-qom.h
@@ -71,6 +71,7 @@ static inline M68kCPU *m68k_env_get_cpu(CPUM68KState *env)
 #define ENV_OFFSET offsetof(M68kCPU, env)
 
 void m68k_cpu_do_interrupt(CPUState *cpu);
+bool m68k_cpu_exec_interrupt(CPUState *cpu, int int_req);
 void m68k_cpu_dump_state(CPUState *cpu, FILE *f, fprintf_function cpu_fprintf,
                          int flags);
 hwaddr m68k_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
diff --git a/target-m68k/cpu.c b/target-m68k/cpu.c
index 5a58d51..4cfb725 100644
--- a/target-m68k/cpu.c
+++ b/target-m68k/cpu.c
@@ -196,6 +196,7 @@ static void m68k_cpu_class_init(ObjectClass *c, void *data)
     cc->class_by_name = m68k_cpu_class_by_name;
     cc->has_work = m68k_cpu_has_work;
     cc->do_interrupt = m68k_cpu_do_interrupt;
+    cc->cpu_exec_interrupt = m68k_cpu_exec_interrupt;
     cc->dump_state = m68k_cpu_dump_state;
     cc->set_pc = m68k_cpu_set_pc;
     cc->gdb_read_register = m68k_cpu_gdb_read_register;
diff --git a/target-m68k/cpu.h b/target-m68k/cpu.h
index 6e4001d..f67bbcc 100644
--- a/target-m68k/cpu.h
+++ b/target-m68k/cpu.h
@@ -120,7 +120,6 @@ void m68k_tcg_init(void);
 void m68k_cpu_init_gdb(M68kCPU *cpu);
 M68kCPU *cpu_m68k_init(const char *cpu_model);
 int cpu_m68k_exec(CPUM68KState *s);
-void do_interrupt_m68k_hardirq(CPUM68KState *env1);
 /* you can call this signal handler from your SIGBUS and SIGSEGV
    signal handlers to inform the virtual CPU of exceptions. non zero
    is returned if the signal was handled by the virtual CPU.  */
diff --git a/target-m68k/op_helper.c b/target-m68k/op_helper.c
index 9dd3e74..06661f5 100644
--- a/target-m68k/op_helper.c
+++ b/target-m68k/op_helper.c
@@ -27,7 +27,7 @@ void m68k_cpu_do_interrupt(CPUState *cs)
     cs->exception_index = -1;
 }
 
-void do_interrupt_m68k_hardirq(CPUM68KState *env)
+static inline void do_interrupt_m68k_hardirq(CPUM68KState *env)
 {
 }
 
@@ -141,12 +141,30 @@ void m68k_cpu_do_interrupt(CPUState *cs)
     do_interrupt_all(env, 0);
 }
 
-void do_interrupt_m68k_hardirq(CPUM68KState *env)
+static inline void do_interrupt_m68k_hardirq(CPUM68KState *env)
 {
     do_interrupt_all(env, 1);
 }
 #endif
 
+bool m68k_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
+{
+    M68kCPU *cpu = M68K_CPU(cs);
+    CPUM68KState *env = &cpu->env;
+
+    if (interrupt_request & CPU_INTERRUPT_HARD
+        && ((env->sr & SR_I) >> SR_I_SHIFT) < env->pending_level) {
+        /* Real hardware gets the interrupt vector via an IACK cycle
+           at this point.  Current emulated hardware doesn't rely on
+           this, so we provide/save the vector when the interrupt is
+           first signalled.  */
+        cs->exception_index = env->pending_vector;
+        do_interrupt_m68k_hardirq(env);
+        return true;
+    }
+    return false;
+}
+
 static void raise_exception(CPUM68KState *env, int tt)
 {
     CPUState *cs = CPU(m68k_env_get_cpu(env));
-- 
1.9.3

  parent reply	other threads:[~2014-09-13 16:46 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-13 16:45 [Qemu-devel] [PATCH 00/23] qom hooks to clean up cpu_exec Richard Henderson
2014-09-13 16:45 ` [Qemu-devel] [PATCH 01/23] qom: Add cpu_exec_enter and cpu_exec_exit hooks Richard Henderson
2014-09-14 19:35   ` Alex Bennée
2014-09-17 11:54   ` Andreas Färber
2014-09-17 15:22     ` Richard Henderson
2014-09-25 18:03       ` Peter Maydell
2014-09-13 16:45 ` [Qemu-devel] [PATCH 02/23] cpu-exec: Remove do-nothing ifdef chains Richard Henderson
2014-09-14 19:36   ` Alex Bennée
2014-09-13 16:45 ` [Qemu-devel] [PATCH 03/23] target-i386: Use cpu_exec_enter/exit qom hooks Richard Henderson
2014-09-14 19:38   ` Alex Bennée
2014-09-13 16:45 ` [Qemu-devel] [PATCH 04/23] target-m68k: " Richard Henderson
2014-09-14 19:40   ` Alex Bennée
2014-09-13 16:45 ` [Qemu-devel] [PATCH 05/23] target-ppc: Use cpu_exec_enter qom hook Richard Henderson
2014-09-14 19:43   ` Alex Bennée
2014-09-15  1:16     ` Peter Maydell
2014-09-13 16:45 ` [Qemu-devel] [PATCH 06/23] qom: Add cpu_exec_interrupt hook Richard Henderson
2014-09-16  4:14   ` Max Filippov
2014-09-16 18:09   ` Alex Bennée
2014-09-13 16:45 ` [Qemu-devel] [PATCH 07/23] target-xtensa: Use cpu_exec_interrupt qom hook Richard Henderson
2014-09-16  4:13   ` Max Filippov
2014-09-16 18:18   ` Alex Bennée
2014-09-16 19:11     ` Richard Henderson
2014-09-13 16:45 ` [Qemu-devel] [PATCH 08/23] target-s390x: " Richard Henderson
2014-09-16 18:41   ` Alex Bennée
2014-09-13 16:45 ` Richard Henderson [this message]
2014-09-16 18:41   ` [Qemu-devel] [PATCH 09/23] target-m68k: " Alex Bennée
2014-09-13 16:45 ` [Qemu-devel] [PATCH 10/23] target-cris: " Richard Henderson
2014-09-16 10:35   ` Edgar E. Iglesias
2014-09-13 16:45 ` [Qemu-devel] [PATCH 11/23] target-alpha: " Richard Henderson
2014-09-13 16:45 ` [Qemu-devel] [PATCH 12/23] target-sh4: " Richard Henderson
2014-09-13 16:45 ` [Qemu-devel] [PATCH 13/23] target-unicore32: " Richard Henderson
2014-09-13 16:45 ` [Qemu-devel] [PATCH 14/23] target-arm: " Richard Henderson
2014-09-13 16:45 ` [Qemu-devel] [PATCH 15/23] target-sparc: " Richard Henderson
2014-09-13 16:45 ` [Qemu-devel] [PATCH 16/23] target-openrisc: " Richard Henderson
2014-09-16  3:59   ` Jia Liu
2014-09-13 16:45 ` [Qemu-devel] [PATCH 17/23] target-tricore: Remove the dummy interrupt boilerplate Richard Henderson
2014-09-21  7:36   ` Bastian Koppelmann
2014-09-13 16:45 ` [Qemu-devel] [PATCH 18/23] target-mips: Use cpu_exec_interrupt qom hook Richard Henderson
2014-09-15 11:09   ` Leon Alrae
2014-09-13 16:45 ` [Qemu-devel] [PATCH 19/23] target-microblaze: " Richard Henderson
2014-09-13 16:45 ` [Qemu-devel] [PATCH 20/23] target-lm32: " Richard Henderson
2014-09-14 18:35   ` Michael Walle
2014-09-13 16:45 ` [Qemu-devel] [PATCH 21/23] target-ppc: " Richard Henderson
2014-09-13 16:45 ` [Qemu-devel] [PATCH 22/23] target-i386: " Richard Henderson
2014-09-13 16:45 ` [Qemu-devel] [PATCH 23/23] cpu-exec: Do CPU_INTERRUPT_HALT unconditionally Richard Henderson
2014-09-26 10:45 ` [Qemu-devel] [PATCH 00/23] qom hooks to clean up cpu_exec Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1410626734-3804-10-git-send-email-rth@twiddle.net \
    --to=rth@twiddle.net \
    --cc=afaerber@suse.de \
    --cc=aliguori@amazon.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.