]> git.proxmox.com Git - mirror_qemu.git/blobdiff - linux-user/arm/target_cpu.h
linux-user: Pass CPUState to MAX_RESERVED_VA
[mirror_qemu.git] / linux-user / arm / target_cpu.h
index 39d65b692b2adf59d28be4c07e7553a10c4d366f..279ea532d5b7a905120f9d5a6132cbf1301ca256 100644 (file)
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
-#ifndef TARGET_CPU_H
-#define TARGET_CPU_H
+#ifndef ARM_TARGET_CPU_H
+#define ARM_TARGET_CPU_H
+
+/* We need to be able to map the commpage.
+   See validate_guest_space in linux-user/elfload.c.  */
+#define MAX_RESERVED_VA(CPU)  0xffff0000ul
 
 static inline void cpu_clone_regs(CPUARMState *env, target_ulong newsp)
 {
@@ -29,7 +33,24 @@ static inline void cpu_clone_regs(CPUARMState *env, target_ulong newsp)
 
 static inline void cpu_set_tls(CPUARMState *env, target_ulong newtls)
 {
-    env->cp15.tpidrro_el0 = newtls;
+    if (access_secure_reg(env)) {
+        env->cp15.tpidruro_s = newtls;
+    } else {
+        env->cp15.tpidrro_el[0] = newtls;
+    }
+}
+
+static inline target_ulong cpu_get_tls(CPUARMState *env)
+{
+    if (access_secure_reg(env)) {
+        return env->cp15.tpidruro_s;
+    } else {
+        return env->cp15.tpidrro_el[0];
+    }
 }
 
+static inline abi_ulong get_sp_from_cpustate(CPUARMState *state)
+{
+   return state->regs[13];
+}
 #endif