From ba7651fba54199e5dedbbd08157687291b9dbae3 Mon Sep 17 00:00:00 2001 From: Max Filippov Date: Wed, 25 Jan 2017 10:54:11 -0800 Subject: 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 Cc: Laurent Vivier Signed-off-by: Max Filippov --- linux-user/xtensa/target_cpu.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 linux-user/xtensa/target_cpu.h (limited to 'linux-user/xtensa/target_cpu.h') 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 -- cgit v1.2.3-55-g7522