@@ -86,7 +86,7 @@ static void rx_cpu_reset_hold(Object *obj, ResetType type)
resetvec = rom_ptr(0xfffffffc, 4);
if (resetvec) {
/* In the case of kernel, it is ignored because it is not set. */
- env->pc = ldl_p(resetvec);
+ env->pc = ldl_le_p(resetvec);
}
rx_cpu_unpack_psw(env, 0, 1);
env->regs[0] = env->isp = env->usp = 0;
@@ -56,7 +56,7 @@ int rx_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
uint32_t psw;
switch (n) {
case 0 ... 15:
- env->regs[n] = ldl_p(mem_buf);
+ env->regs[n] = ldl_le_p(mem_buf);
if (n == 0) {
if (env->psw_u) {
env->usp = env->regs[0];
@@ -66,38 +66,38 @@ int rx_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
}
break;
case 16:
- env->usp = ldl_p(mem_buf);
+ env->usp = ldl_le_p(mem_buf);
if (env->psw_u) {
- env->regs[0] = ldl_p(mem_buf);
+ env->regs[0] = ldl_le_p(mem_buf);
}
break;
case 17:
- env->isp = ldl_p(mem_buf);
+ env->isp = ldl_le_p(mem_buf);
if (!env->psw_u) {
- env->regs[0] = ldl_p(mem_buf);
+ env->regs[0] = ldl_le_p(mem_buf);
}
break;
case 18:
- psw = ldl_p(mem_buf);
+ psw = ldl_le_p(mem_buf);
rx_cpu_unpack_psw(env, psw, 1);
break;
case 19:
- env->pc = ldl_p(mem_buf);
+ env->pc = ldl_le_p(mem_buf);
break;
case 20:
- env->intb = ldl_p(mem_buf);
+ env->intb = ldl_le_p(mem_buf);
break;
case 21:
- env->bpsw = ldl_p(mem_buf);
+ env->bpsw = ldl_le_p(mem_buf);
break;
case 22:
- env->bpc = ldl_p(mem_buf);
+ env->bpc = ldl_le_p(mem_buf);
break;
case 23:
- env->fintv = ldl_p(mem_buf);
+ env->fintv = ldl_le_p(mem_buf);
break;
case 24:
- env->fpsw = ldl_p(mem_buf);
+ env->fpsw = ldl_le_p(mem_buf);
break;
case 25:
return 8;
The RX architecture uses little endianness. Directly use the little-endian LD/ST API. Mechanical change using: $ end=le; \ for acc in uw w l q tul; do \ sed -i -e "s/ld${acc}_p(/ld${acc}_${end}_p(/" \ -e "s/st${acc}_p(/st${acc}_${end}_p(/" \ $(git grep -wlE '(ld|st)t?u?[wlq]_p' target/rx/); \ done Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- target/rx/cpu.c | 2 +- target/rx/gdbstub.c | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-)