summary refs log tree commit diff stats
path: root/linux-user/openrisc/elfload.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux-user/openrisc/elfload.c')
-rw-r--r--linux-user/openrisc/elfload.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/linux-user/openrisc/elfload.c b/linux-user/openrisc/elfload.c
index b92442dfeb..6bf02bf58d 100644
--- a/linux-user/openrisc/elfload.c
+++ b/linux-user/openrisc/elfload.c
@@ -3,9 +3,19 @@
 #include "qemu/osdep.h"
 #include "qemu.h"
 #include "loader.h"
+#include "target_elf.h"
 
 
 const char *get_elf_cpu_model(uint32_t eflags)
 {
     return "any";
 }
+
+void elf_core_copy_regs(target_elf_gregset_t *r, const CPUOpenRISCState *env)
+{
+    for (int i = 0; i < 32; i++) {
+        r->pt.gpr[i] = tswapal(cpu_get_gpr(env, i));
+    }
+    r->pt.pc = tswapal(env->pc);
+    r->pt.sr = tswapal(cpu_get_sr(env));
+}