aboutsummaryrefslogtreecommitdiff
path: root/linux-user/xtensa/target_cpu.h
diff options
context:
space:
mode:
Diffstat (limited to 'linux-user/xtensa/target_cpu.h')
-rw-r--r--linux-user/xtensa/target_cpu.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/linux-user/xtensa/target_cpu.h b/linux-user/xtensa/target_cpu.h
new file mode 100644
index 0000000000..747d828614
--- /dev/null
+++ b/linux-user/xtensa/target_cpu.h
@@ -0,0 +1,22 @@
+/*
+ * Xtensa-specific CPU ABI and functions for linux-user
+ */
+#ifndef XTENSA_TARGET_CPU_H
+#define XTENSA_TARGET_CPU_H
+
+static inline void cpu_clone_regs(CPUXtensaState *env, target_ulong newsp)
+{
+ if (newsp) {
+ env->regs[1] = newsp;
+ env->sregs[WINDOW_BASE] = 0;
+ env->sregs[WINDOW_START] = 0x1;
+ }
+ env->regs[2] = 0;
+}
+
+static inline void cpu_set_tls(CPUXtensaState *env, target_ulong newtls)
+{
+ env->uregs[THREADPTR] = newtls;
+}
+
+#endif