aboutsummaryrefslogtreecommitdiff
path: root/target-unicore32/cpu.c
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2012-03-29 18:03:18 +0200
committerAndreas Färber <afaerber@suse.de>2012-03-30 11:09:31 +0200
commit8df9082da6b7a24b299d37462bc3539c15f26135 (patch)
treed8ff071c6ceee97cd9b6dbbcfa5623815af27e34 /target-unicore32/cpu.c
parentae0f5e9ea80de923ae1c11289cf6ac468f657880 (diff)
target-unicore32: Move CPU-dependent init into initfn
Instead of setting values in a CPUID switch, do so in initfn functions. Signed-off-by: Andreas Färber <afaerber@suse.de> Acked-by: Guan Xuetao <gxt@mprc.pku.edu.cn>
Diffstat (limited to 'target-unicore32/cpu.c')
-rw-r--r--target-unicore32/cpu.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/target-unicore32/cpu.c b/target-unicore32/cpu.c
index 189b6f6b9d..de63f58dda 100644
--- a/target-unicore32/cpu.c
+++ b/target-unicore32/cpu.c
@@ -15,6 +15,11 @@
#include "cpu-qom.h"
#include "qemu-common.h"
+static inline void set_feature(CPUUniCore32State *env, int feature)
+{
+ env->features |= feature;
+}
+
/* CPU models */
typedef struct UniCore32CPUInfo {
@@ -28,6 +33,12 @@ static void unicore_ii_cpu_initfn(Object *obj)
CPUUniCore32State *env = &cpu->env;
env->cp0.c0_cpuid = 0x40010863;
+
+ set_feature(env, UC32_HWCAP_CMOV);
+ set_feature(env, UC32_HWCAP_UCF64);
+ env->ucf64.xregs[UC32_UCF64_FPSCR] = 0;
+ env->cp0.c0_cachetype = 0x1dd20d2;
+ env->cp0.c1_sys = 0x00090078;
}
static void uc32_any_cpu_initfn(Object *obj)
@@ -36,6 +47,9 @@ static void uc32_any_cpu_initfn(Object *obj)
CPUUniCore32State *env = &cpu->env;
env->cp0.c0_cpuid = 0xffffffff;
+
+ set_feature(env, UC32_HWCAP_CMOV);
+ set_feature(env, UC32_HWCAP_UCF64);
}
static const UniCore32CPUInfo uc32_cpus[] = {