target/riscv: Align the data type of reset vector address
PATCH v4 1/1 target/riscv: Align the data type of reset vector address
Use target_ulong to instead of uint64_t on reset vector address to adapt on both 32/64 machine.
Signed-off-by Dylan Jhong <[email protected]>
Signed-off-by Ruinland ChuanTzu Tsai <[email protected]>
--- target/riscv/cpu.c | 5 +++-- target/riscv/cpu.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-)
target/riscv/cpu.c +3 -2
@@ -137,7 +137,7 @@ static void set_feature(CPURISCVState *env, int feature) env->features |= (1ULL << feature); } -static void set_resetvec (CPURISCVState *env,int resetvec) +static void set_resetvec (CPURISCVState *env,target_ulong resetvec) {#ifndef CONFIG_USER_ONLY env->resetvec = resetvec;
@@ -554,7 +554,8 @@ static Property riscv_cpu_properties[] = {DEFINE_PROP_UINT16 ("elen" ,RISCVCPU , cfg.elen,64 ),DEFINE_PROP_BOOL ("mmu" ,RISCVCPU , cfg.mmu, true),DEFINE_PROP_BOOL ("pmp" ,RISCVCPU , cfg.pmp, true), -DEFINE_PROP_UINT64 ("resetvec" ,RISCVCPU , cfg.resetvec,DEFAULT_RSTVEC ), +DEFINE_PROP_UNSIGNED ("resetvec" ,RISCVCPU , cfg.resetvec, +DEFAULT_RSTVEC , qdev_prop_uint64, target_ulong), DEFINE_PROP_END_OF_LIST(), };
target/riscv/cpu.h +1 -1
@@ -303,7 +303,7 @@ struct RISCVCPU {uint16_t elen;bool mmu;bool pmp; -uint64_t resetvec; +target_ulong resetvec; } cfg; };
Signature · 1 line
2.17.1
Alistair Francis
AppliedQuoted 6 lines · Dylan Jhong
Use
target_ulongto instead ofuint64_ton reset vector address to adapt on both 32/64 machine.Signed-off-by Dylan Jhong <[email protected]>Signed-off-by Ruinland ChuanTzu Tsai <[email protected]>
Thanks!
Applied to riscv-to-apply.next
Alistair
Quoted 45 lines
--- target/riscv/cpu.c | 5 +++-- target/riscv/cpu.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-)target/riscv/cpu.c +3
-2@@ -137,7 +137,7 @@ static void set_feature(CPURISCVState *env, int feature) env->features |= (1ULL << feature); } -static void set_resetvec (CPURISCVState *env,int resetvec) +static void set_resetvec (CPURISCVState *env,target_ulong resetvec) {#ifndef CONFIG_USER_ONLY env->resetvec = resetvec;@@ -554,7 +554,8 @@ static Property riscv_cpu_properties[] = {DEFINE_PROP_UINT16 ("elen" ,RISCVCPU , cfg.elen,64 ),DEFINE_PROP_BOOL ("mmu" ,RISCVCPU , cfg.mmu, true),DEFINE_PROP_BOOL ("pmp" ,RISCVCPU , cfg.pmp, true), -DEFINE_PROP_UINT64 ("resetvec" ,RISCVCPU , cfg.resetvec,DEFAULT_RSTVEC ), +DEFINE_PROP_UNSIGNED ("resetvec" ,RISCVCPU , cfg.resetvec, +DEFAULT_RSTVEC , qdev_prop_uint64, target_ulong), DEFINE_PROP_END_OF_LIST(), };target/riscv/cpu.h +1
-2@@ -303,7 +303,7 @@ struct RISCVCPU {uint16_t elen;bool mmu;bool pmp; -uint64_t resetvec; +target_ulong resetvec; } cfg; }; --2.17.1