mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 16:53:55 -06:00
target/riscv: Set the CPU resetvec directly
Instead of using our properties to set a config value which then might be used to set the resetvec (depending on your timing), let's instead just set the resetvec directly in the env struct. This allows us to set the reset vec from the command line with: -global driver=riscv.hart_array,property=resetvec,value=0x20000400 Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20220914101108.82571-2-alistair.francis@wdc.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
parent
4c0f0b6619
commit
277b210dd8
3 changed files with 7 additions and 15 deletions
|
@ -228,13 +228,6 @@ static void set_vext_version(CPURISCVState *env, int vext_ver)
|
|||
env->vext_ver = vext_ver;
|
||||
}
|
||||
|
||||
static void set_resetvec(CPURISCVState *env, target_ulong resetvec)
|
||||
{
|
||||
#ifndef CONFIG_USER_ONLY
|
||||
env->resetvec = resetvec;
|
||||
#endif
|
||||
}
|
||||
|
||||
static void riscv_any_cpu_init(Object *obj)
|
||||
{
|
||||
CPURISCVState *env = &RISCV_CPU(obj)->env;
|
||||
|
@ -336,7 +329,6 @@ static void rv32_imafcu_nommu_cpu_init(Object *obj)
|
|||
|
||||
set_misa(env, MXL_RV32, RVI | RVM | RVA | RVF | RVC | RVU);
|
||||
set_priv_version(env, PRIV_VERSION_1_10_0);
|
||||
set_resetvec(env, DEFAULT_RSTVEC);
|
||||
cpu->cfg.mmu = false;
|
||||
}
|
||||
#endif
|
||||
|
@ -676,7 +668,6 @@ static void riscv_cpu_realize(DeviceState *dev, Error **errp)
|
|||
riscv_set_feature(env, RISCV_FEATURE_DEBUG);
|
||||
}
|
||||
|
||||
set_resetvec(env, cpu->cfg.resetvec);
|
||||
|
||||
#ifndef CONFIG_USER_ONLY
|
||||
if (cpu->cfg.ext_sstc) {
|
||||
|
@ -1079,7 +1070,9 @@ static Property riscv_cpu_properties[] = {
|
|||
DEFINE_PROP_UINT64("marchid", RISCVCPU, cfg.marchid, RISCV_CPU_MARCHID),
|
||||
DEFINE_PROP_UINT64("mimpid", RISCVCPU, cfg.mimpid, RISCV_CPU_MIMPID),
|
||||
|
||||
DEFINE_PROP_UINT64("resetvec", RISCVCPU, cfg.resetvec, DEFAULT_RSTVEC),
|
||||
#ifndef CONFIG_USER_ONLY
|
||||
DEFINE_PROP_UINT64("resetvec", RISCVCPU, env.resetvec, DEFAULT_RSTVEC),
|
||||
#endif
|
||||
|
||||
DEFINE_PROP_BOOL("short-isa-string", RISCVCPU, cfg.short_isa_string, false),
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue