aboutsummaryrefslogtreecommitdiff
path: root/linux-user/xtensa/target_cpu.h
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2017-01-25 10:54:11 -0800
committerMax Filippov <jcmvbkbc@gmail.com>2018-03-16 09:40:34 -0700
commitba7651fba54199e5dedbbd08157687291b9dbae3 (patch)
treef03b970e3cfdfde9040ff14c59dc0bf3acfb6fe3 /linux-user/xtensa/target_cpu.h
parentbf9c3a5a96dfabcdcb7964110866bb9bc06a43c1 (diff)
target/xtensa: add linux-user support
Import list of syscalls from the kernel source. Conditionalize code/data that is only used with softmmu. Implement exception handlers. Implement signal hander (only the core registers for now, no coprocessors or TIE). Cc: Riku Voipio <riku.voipio@iki.fi> Cc: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
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