qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH qom-cpu v2 7/7] target-cris: Override do_interrupt for pre-v32 CPU cores
Date: Mon, 15 Apr 2013 21:50:09 +0200	[thread overview]
Message-ID: <516C59F1.2060209@suse.de> (raw)
In-Reply-To: <1361817954-8984-8-git-send-email-afaerber@suse.de>

Am 25.02.2013 19:45, schrieb Andreas Färber:
> Instead of forwarding from cris_cpu_do_interrupt() to do_interruptv10(),
> override CPUClass::do_interrupt with crisv10_cpu_do_interrupt() in the
> newly introduced class_init functions.
> 
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> ---
>  target-cris/cpu-qom.h |    1 +
>  target-cris/cpu.c     |    8 ++++++++
>  target-cris/helper.c  |   14 ++++++++------
>  3 Dateien geändert, 17 Zeilen hinzugefügt(+), 6 Zeilen entfernt(-)

Ping? Edgar, I haven't seen an ack or nack for this yet. If it's okay
with you, feel free to apply (rebased version available on my qom-cpu-9
branch that I could alternatively include in a pull if you prefer).

Thanks,
Andreas

> 
> diff --git a/target-cris/cpu-qom.h b/target-cris/cpu-qom.h
> index deea1d8..03829bd 100644
> --- a/target-cris/cpu-qom.h
> +++ b/target-cris/cpu-qom.h
> @@ -74,5 +74,6 @@ static inline CRISCPU *cris_env_get_cpu(CPUCRISState *env)
>  #define ENV_OFFSET offsetof(CRISCPU, env)
>  
>  void cris_cpu_do_interrupt(CPUState *cpu);
> +void crisv10_cpu_do_interrupt(CPUState *cpu);
>  
>  #endif
> diff --git a/target-cris/cpu.c b/target-cris/cpu.c
> index 95cbf39..67181e5 100644
> --- a/target-cris/cpu.c
> +++ b/target-cris/cpu.c
> @@ -169,30 +169,38 @@ static void cris_cpu_initfn(Object *obj)
>  
>  static void crisv8_cpu_class_init(ObjectClass *oc, void *data)
>  {
> +    CPUClass *cc = CPU_CLASS(oc);
>      CRISCPUClass *ccc = CRIS_CPU_CLASS(oc);
>  
>      ccc->vr = 8;
> +    cc->do_interrupt = crisv10_cpu_do_interrupt;
>  }
>  
>  static void crisv9_cpu_class_init(ObjectClass *oc, void *data)
>  {
> +    CPUClass *cc = CPU_CLASS(oc);
>      CRISCPUClass *ccc = CRIS_CPU_CLASS(oc);
>  
>      ccc->vr = 9;
> +    cc->do_interrupt = crisv10_cpu_do_interrupt;
>  }
>  
>  static void crisv10_cpu_class_init(ObjectClass *oc, void *data)
>  {
> +    CPUClass *cc = CPU_CLASS(oc);
>      CRISCPUClass *ccc = CRIS_CPU_CLASS(oc);
>  
>      ccc->vr = 10;
> +    cc->do_interrupt = crisv10_cpu_do_interrupt;
>  }
>  
>  static void crisv11_cpu_class_init(ObjectClass *oc, void *data)
>  {
> +    CPUClass *cc = CPU_CLASS(oc);
>      CRISCPUClass *ccc = CRIS_CPU_CLASS(oc);
>  
>      ccc->vr = 11;
> +    cc->do_interrupt = crisv10_cpu_do_interrupt;
>  }
>  
>  static void crisv32_cpu_class_init(ObjectClass *oc, void *data)
> diff --git a/target-cris/helper.c b/target-cris/helper.c
> index e1ef7bc..466cc2f 100644
> --- a/target-cris/helper.c
> +++ b/target-cris/helper.c
> @@ -45,6 +45,11 @@ void cris_cpu_do_interrupt(CPUState *cs)
>      env->pregs[PR_ERP] = env->pc;
>  }
>  
> +void crisv10_cpu_do_interrupt(CPUState *cs)
> +{
> +    cris_cpu_do_interrupt(cs);
> +}
> +
>  int cpu_cris_handle_mmu_fault(CPUCRISState * env, target_ulong address, int rw,
>                                int mmu_idx)
>  {
> @@ -109,9 +114,10 @@ int cpu_cris_handle_mmu_fault(CPUCRISState *env, target_ulong address, int rw,
>      return r;
>  }
>  
> -static void do_interruptv10(CPUCRISState *env)
> +void crisv10_cpu_do_interrupt(CPUState *cs)
>  {
> -    D(CPUState *cs = CPU(cris_env_get_cpu(env)));
> +    CRISCPU *cpu = CRIS_CPU(cs);
> +    CPUCRISState *env = &cpu->env;
>      int ex_vec = -1;
>  
>      D_LOG("exception index=%d interrupt_req=%d\n",
> @@ -171,10 +177,6 @@ void cris_cpu_do_interrupt(CPUState *cs)
>      CPUCRISState *env = &cpu->env;
>      int ex_vec = -1;
>  
> -    if (env->pregs[PR_VR] < 32) {
> -        return do_interruptv10(env);
> -    }
> -
>      D_LOG("exception index=%d interrupt_req=%d\n",
>            env->exception_index,
>            cs->interrupt_request);

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

  parent reply	other threads:[~2013-04-15 19:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1361817954-8984-1-git-send-email-afaerber@suse.de>
2013-03-05 18:27 ` [Qemu-devel] [PATCH qom-cpu v2 0/7] QOM CPUState, part 9: CPU_COMMON for interrupts Andreas Färber
     [not found] ` <1361817954-8984-8-git-send-email-afaerber@suse.de>
2013-04-15 19:50   ` Andreas Färber [this message]
2013-04-15 20:09     ` [Qemu-devel] [PATCH qom-cpu v2 7/7] target-cris: Override do_interrupt for pre-v32 CPU cores Edgar E. Iglesias

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=516C59F1.2060209@suse.de \
    --to=afaerber@suse.de \
    --cc=edgar.iglesias@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).