Move elf_core_copy_regs to elfload.c.
Move ELF_NREG to target_elf.h.

Signed-off-by: Richard Henderson <richard.hender...@linaro.org>
---
 linux-user/arm/target_elf.h |  2 ++
 linux-user/arm/elfload.c    |  9 +++++++++
 linux-user/elfload.c        | 11 -----------
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/linux-user/arm/target_elf.h b/linux-user/arm/target_elf.h
index 856ca41b16..84c7950ace 100644
--- a/linux-user/arm/target_elf.h
+++ b/linux-user/arm/target_elf.h
@@ -12,4 +12,6 @@
 #define HAVE_ELF_HWCAP2         1
 #define HAVE_ELF_PLATFORM       1
 
+#define ELF_NREG                18
+
 #endif
diff --git a/linux-user/arm/elfload.c b/linux-user/arm/elfload.c
index 7de1f13f4b..b0d4dea591 100644
--- a/linux-user/arm/elfload.c
+++ b/linux-user/arm/elfload.c
@@ -199,3 +199,12 @@ const char *get_elf_platform(CPUState *cs)
 
 #undef END
 }
+
+void elf_core_copy_regs(target_ulong *regs, const CPUARMState *env)
+{
+    for (int i = 0; i < 16; i++) {
+        regs[i] = tswapl(env->regs[i]);
+    }
+    regs[16] = tswapl(cpsr_read((CPUARMState *)env));
+    regs[17] = tswapl(env->regs[0]); /* XXX */
+}
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 177741522c..3fb8106858 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -210,17 +210,6 @@ static bool init_guest_commpage(void)
 #define ELF_CLASS       ELFCLASS32
 #define EXSTACK_DEFAULT true
 
-#define ELF_NREG    18
-
-void elf_core_copy_regs(target_ulong *regs, const CPUARMState *env)
-{
-    for (int i = 0; i < 16; i++) {
-        regs[i] = tswapl(env->regs[i]);
-    }
-    regs[16] = tswapl(cpsr_read((CPUARMState *)env));
-    regs[17] = tswapl(env->regs[0]); /* XXX */
-}
-
 #define ELF_EXEC_PAGESIZE       4096
 
 /* The commpage only exists for 32 bit kernels */
-- 
2.43.0


Reply via email to