mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 09:43:56 -06:00
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>
This commit is contained in:
parent
ae0f5e9ea8
commit
8df9082da6
2 changed files with 14 additions and 23 deletions
|
@ -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[] = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue