qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v5 15/21] target-arm: Implement cpu_set_tls() and cp


From: Peter Maydell
Subject: [Qemu-devel] [PATCH v5 15/21] target-arm: Implement cpu_set_tls() and cpu_clone_regs() for AArch64
Date: Mon, 1 Jul 2013 18:35:14 +0100

From: Alexander Graf <address@hidden>

[PMM: pulled out from another patch because this is going to need to
morph into a patch putting them into linux-user/aarch64/target_cpu.h
as soon as my patch doing that move for existing CPUs lands; also
use #ifdefs rather than is_a64().]

Signed-off-by: Alexander Graf <address@hidden>
Signed-off-by: John Rigby <address@hidden>
Signed-off-by: Peter Maydell <address@hidden>
---
 target-arm/cpu.h |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/target-arm/cpu.h b/target-arm/cpu.h
index 78614a4..f9288d1 100644
--- a/target-arm/cpu.h
+++ b/target-arm/cpu.h
@@ -303,10 +303,17 @@ int cpu_arm_handle_mmu_fault (CPUARMState *env, 
target_ulong address, int rw,
                               int mmu_idx);
 #define cpu_handle_mmu_fault cpu_arm_handle_mmu_fault
 
+#ifndef TARGET_AARCH64
 static inline void cpu_set_tls(CPUARMState *env, target_ulong newtls)
 {
   env->cp15.c13_tls2 = newtls;
 }
+#else
+static inline void cpu_set_tls(CPUARMState *env, target_ulong newtls)
+{
+    env->sr.tpidr_el0 = newtls;
+}
+#endif
 
 #define CPSR_M (0x1f)
 #define CPSR_T (1 << 5)
@@ -795,12 +802,22 @@ static inline int cpu_mmu_index (CPUARMState *env)
 }
 
 #if defined(CONFIG_USER_ONLY)
+#ifndef TARGET_AARCH64
 static inline void cpu_clone_regs(CPUARMState *env, target_ulong newsp)
 {
     if (newsp)
         env->regs[13] = newsp;
     env->regs[0] = 0;
 }
+#else
+static inline void cpu_clone_regs(CPUARMState *env, target_ulong newsp)
+{
+    if (newsp) {
+        env->xregs[31] = newsp;
+    }
+    env->xregs[0] = 0;
+}
+#endif
 #endif
 
 #include "exec/cpu-all.h"
-- 
1.7.9.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]