From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45161) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTEeS-0007Yf-5v for qemu-devel@nongnu.org; Sun, 14 Sep 2014 14:36:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XTEeM-0001AE-MO for qemu-devel@nongnu.org; Sun, 14 Sep 2014 14:35:56 -0400 Received: from ssl.serverraum.org ([88.198.40.39]:57857) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTEeM-00019y-BY for qemu-devel@nongnu.org; Sun, 14 Sep 2014 14:35:50 -0400 From: Michael Walle Date: Sun, 14 Sep 2014 20:35:12 +0200 Message-ID: <1474623.CHY2V1vmWr@thanatos> In-Reply-To: <1410626734-3804-21-git-send-email-rth@twiddle.net> References: <1410626734-3804-1-git-send-email-rth@twiddle.net> <1410626734-3804-21-git-send-email-rth@twiddle.net> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [Qemu-devel] [PATCH 20/23] target-lm32: Use cpu_exec_interrupt qom hook List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org, aliguori@amazon.com, afaerber@suse.de Am Samstag, 13. September 2014, 09:45:31 schrieb Richard Henderson: > Cc: Michael Walle > Signed-off-by: Richard Henderson Acked-by: Michael Walle > --- > cpu-exec.c | 7 ------- > target-lm32/cpu-qom.h | 1 + > target-lm32/cpu.c | 1 + > target-lm32/helper.c | 13 +++++++++++++ > 4 files changed, 15 insertions(+), 7 deletions(-) > > diff --git a/cpu-exec.c b/cpu-exec.c > index 5c93a5f..abffbe5 100644 > --- a/cpu-exec.c > +++ b/cpu-exec.c > @@ -498,13 +498,6 @@ int cpu_exec(CPUArchState *env) > } > next_tb = 0; > } > -#elif defined(TARGET_LM32) > - if ((interrupt_request & CPU_INTERRUPT_HARD) > - && (env->ie & IE_IE)) { > - cpu->exception_index = EXCP_IRQ; > - cc->do_interrupt(cpu); > - next_tb = 0; > - } > #endif > /* The target hook has 3 exit conditions: > False when the interrupt isn't processed, > diff --git a/target-lm32/cpu-qom.h b/target-lm32/cpu-qom.h > index 9f15093..77bc7b2 100644 > --- a/target-lm32/cpu-qom.h > +++ b/target-lm32/cpu-qom.h > @@ -82,6 +82,7 @@ extern const struct VMStateDescription vmstate_lm32_cpu; > #endif > > void lm32_cpu_do_interrupt(CPUState *cpu); > +bool lm32_cpu_exec_interrupt(CPUState *cs, int int_req); > void lm32_cpu_dump_state(CPUState *cpu, FILE *f, fprintf_function > cpu_fprintf, int flags); > hwaddr lm32_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); > diff --git a/target-lm32/cpu.c b/target-lm32/cpu.c > index 419d664..6c5de66 100644 > --- a/target-lm32/cpu.c > +++ b/target-lm32/cpu.c > @@ -261,6 +261,7 @@ static void lm32_cpu_class_init(ObjectClass *oc, void > *data) cc->class_by_name = lm32_cpu_class_by_name; > cc->has_work = lm32_cpu_has_work; > cc->do_interrupt = lm32_cpu_do_interrupt; > + cc->cpu_exec_interrupt = lm32_cpu_exec_interrupt; > cc->dump_state = lm32_cpu_dump_state; > cc->set_pc = lm32_cpu_set_pc; > cc->gdb_read_register = lm32_cpu_gdb_read_register; > diff --git a/target-lm32/helper.c b/target-lm32/helper.c > index ad724ae..7a41f29 100644 > --- a/target-lm32/helper.c > +++ b/target-lm32/helper.c > @@ -202,6 +202,19 @@ void lm32_cpu_do_interrupt(CPUState *cs) > } > } > > +bool lm32_cpu_exec_interrupt(CPUState *cs, int interrupt_request) > +{ > + LM32CPU *cpu = LM32_CPU(cs); > + CPULM32State *env = &cpu->env; > + > + if ((interrupt_request & CPU_INTERRUPT_HARD) && (env->ie & IE_IE)) { > + cs->exception_index = EXCP_IRQ; > + lm32_cpu_do_interrupt(cs); > + return true; > + } > + return false; > +} > + > LM32CPU *cpu_lm32_init(const char *cpu_model) > { > return LM32_CPU(cpu_generic_init(TYPE_LM32_CPU, cpu_model));