@@ -88,7 +88,7 @@ static int cpu_write_ac_reg(CPUState *cs, uint8_t *mem_buf, int n)
switch (n) {
case S390_A0_REGNUM ... S390_A15_REGNUM:
- env->aregs[n] = ldl_p(mem_buf);
+ env->aregs[n] = ldl_be_p(mem_buf);
cpu_synchronize_post_init(env_cpu(env));
return 4;
default:
@@ -123,7 +123,7 @@ static int cpu_write_fp_reg(CPUState *cs, uint8_t *mem_buf, int n)
switch (n) {
case S390_FPC_REGNUM:
- env->fpc = ldl_p(mem_buf);
+ env->fpc = ldl_be_p(mem_buf);
return 4;
case S390_F0_REGNUM ... S390_F15_REGNUM:
*get_freg(env, n - S390_F0_REGNUM) = ldtul_p(mem_buf);
@@ -603,7 +603,7 @@ static int chsc_sei_nt2_have_event(void)
#define CHSC_SEI_NT2 (1ULL << 61)
static void ioinst_handle_chsc_sei(ChscReq *req, ChscResp *res)
{
- uint64_t selection_mask = ldq_p(&req->param1);
+ uint64_t selection_mask = ldq_be_p(&req->param1);
uint8_t *res_flags = (uint8_t *)res->data;
int have_event = 0;
int have_more = 0;
The S390 architecture uses big endianness. Directly use the big-endian LD/ST API. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- target/s390x/gdbstub.c | 4 ++-- target/s390x/ioinst.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)