aboutsummaryrefslogtreecommitdiff
path: root/target-cris
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2013-04-16 10:28:36 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2013-04-16 10:28:36 -0500
commit398973fe1f92e65f39f6a26dacc07baa0da632fc (patch)
tree5322bc672479a04956717b7502b8a72409e8647d /target-cris
parent095b9c4860b1351e4a0322e43708f39c79c1f34b (diff)
parentb21bfeead284cf212d88dfa25171fee122407bc2 (diff)
Merge remote-tracking branch 'afaerber/qom-cpu' into staging
# By Igor Mammedov (8) and others # Via Andreas Färber * afaerber/qom-cpu: target-cris: Override do_interrupt for pre-v32 CPU cores qdev: Set device's parent before calling realize() down inheritance chain cpu: Pass CPUState to *cpu_synchronize_post*() target-i386: Split out CPU creation and features parsing target-i386/cpu.c: Coding style fixes ioapic: Replace FROM_SYSBUS() with QOM type cast kvmvapic: Replace FROM_SYSBUS() with QOM type cast target-i386: Split APIC creation from initialization in x86_cpu_realizefn() target-i386: Consolidate error propagation in x86_cpu_realizefn() qdev: Add qdev property for bool type target-i386: Improve -cpu ? features output target-i386: Fix including "host" in -cpu ? output
Diffstat (limited to 'target-cris')
-rw-r--r--target-cris/cpu-qom.h1
-rw-r--r--target-cris/cpu.c8
-rw-r--r--target-cris/helper.c14
3 files changed, 17 insertions, 6 deletions
diff --git a/target-cris/cpu-qom.h b/target-cris/cpu-qom.h
index deea1d804b..03829bd243 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 95cbf399d9..67181e55a6 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 e1ef7bcc0b..466cc2f9d5 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);