Skip to contentSkip to conversation

target/riscv: Align the data type of reset vector address

PATCH Superseded Dylan Jhong 1 participant 2 messages Mar 25, 2021 RISC-V

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 target/riscv: Align the data type of reset vector address

---
 target/riscv/cpu.c | 2 +-
 target/riscv/cpu.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
target/riscv/cpu.c +1 -1
index 7d6ed80f6b..4ac901245a 100644
@@ -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;
target/riscv/cpu.h +1 -1
index 0a33d387ba..d9d7891666 100644
@@ -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
#1 lore raw

Hi All,

Please ignore this patch.
There is a compile error while building 32bit qemu.

The error occurs in ./target/riscv/cpu.c:557
"DEFINE_PROP_UINT64("resetvec", RISCVCPU, cfg.resetvec, DEFAULT_RSTVEC)"

It should be written differently according to 32bit or 64bit machine.

I'll send patch v3 to fix this issue.
Sorry for my mistake.

Regards,
Dylan

Quoted 36 lines · Dylan Dai-Rong Jhong(鍾岱融)
---
 target/riscv/cpu.c | 2 +-
 target/riscv/cpu.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
target/riscv/cpu.c +1 -1
index 7d6ed80f6b..4ac901245a 100644
@@ -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;
target/riscv/cpu.h +1 -1
index 0a33d387ba..d9d7891666 100644
@@ -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