[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
- [Qemu-devel] [PATCH v5 00/21] AArch64 preparation patchset, Peter Maydell, 2013/07/01
- [Qemu-devel] [PATCH v5 05/21] target-arm: Pass DisasContext* to gen_set_pc_im(), Peter Maydell, 2013/07/01
- [Qemu-devel] [PATCH v5 15/21] target-arm: Implement cpu_set_tls() and cpu_clone_regs() for AArch64,
Peter Maydell <=
- [Qemu-devel] [PATCH v5 17/21] linux-user: Add AArch64 support, Peter Maydell, 2013/07/01
- [Qemu-devel] [PATCH v5 09/21] linux-user: Don't treat AArch64 cpu names specially, Peter Maydell, 2013/07/01
- [Qemu-devel] [PATCH v5 11/21] linux-user: Add syscall number definitions for AArch64, Peter Maydell, 2013/07/01
- [Qemu-devel] [PATCH v5 07/21] target-arm: Add AArch64 translation stub, Peter Maydell, 2013/07/01
- [Qemu-devel] [PATCH v5 08/21] gdbstub: Add AArch64 support, Peter Maydell, 2013/07/01
- [Qemu-devel] [PATCH v5 06/21] target-arm: Prepare translation for AArch64 code, Peter Maydell, 2013/07/01
- [Qemu-devel] [PATCH v5 20/21] default-configs: Add config for aarch64-linux-user, Peter Maydell, 2013/07/01
- [Qemu-devel] [PATCH v5 18/21] linux-user: AArch64 requires at least 3.8.0, Peter Maydell, 2013/07/01
- [Qemu-devel] [PATCH v5 10/21] linux-user: Add cpu loop for AArch64, Peter Maydell, 2013/07/01
- [Qemu-devel] [PATCH v5 13/21] linux-user: Add signal handling for AArch64, Peter Maydell, 2013/07/01