summary refs log tree commit diff stats
path: root/linux-user/s390x/elfload.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux-user/s390x/elfload.c')
-rw-r--r--linux-user/s390x/elfload.c28
1 files changed, 7 insertions, 21 deletions
diff --git a/linux-user/s390x/elfload.c b/linux-user/s390x/elfload.c
index 4113273b72..27109279e2 100644
--- a/linux-user/s390x/elfload.c
+++ b/linux-user/s390x/elfload.c
@@ -68,29 +68,15 @@ const char *elf_hwcap_str(uint32_t bit)
     return bit < ARRAY_SIZE(hwcap_str) ? hwcap_str[bit] : NULL;
 }
 
-#define tswapreg(ptr)   tswapal(ptr)
-
-enum {
-    TARGET_REG_PSWM = 0,
-    TARGET_REG_PSWA = 1,
-    TARGET_REG_GPRS = 2,
-    TARGET_REG_ARS = 18,
-    TARGET_REG_ORIG_R2 = 26,
-};
-
 void elf_core_copy_regs(target_elf_gregset_t *r, const CPUS390XState *env)
 {
-    int i;
-    uint32_t *aregs;
-
-    r->regs[TARGET_REG_PSWM] = tswapreg(env->psw.mask);
-    r->regs[TARGET_REG_PSWA] = tswapreg(env->psw.addr);
-    for (i = 0; i < 16; i++) {
-        r->regs[TARGET_REG_GPRS + i] = tswapreg(env->regs[i]);
+    r->pt.psw.mask = tswapal(env->psw.mask);
+    r->pt.psw.addr = tswapal(env->psw.addr);
+    for (int i = 0; i < 16; i++) {
+        r->pt.gprs[i] = tswapal(env->regs[i]);
     }
-    aregs = (uint32_t *)&(r->regs[TARGET_REG_ARS]);
-    for (i = 0; i < 16; i++) {
-        aregs[i] = tswap32(env->aregs[i]);
+    for (int i = 0; i < 16; i++) {
+        r->pt.acrs[i] = tswap32(env->aregs[i]);
     }
-    r->regs[TARGET_REG_ORIG_R2] = 0;
+    r->pt.orig_gpr2 = 0;
 }