Max Filippov | ba7651f | 2017-01-25 10:54:11 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Xtensa-specific CPU ABI and functions for linux-user |
| 3 | */ |
| 4 | #ifndef XTENSA_TARGET_CPU_H |
| 5 | #define XTENSA_TARGET_CPU_H |
| 6 | |
Richard Henderson | 608999d | 2019-11-06 12:33:15 +0100 | [diff] [blame] | 7 | static inline void cpu_clone_regs_child(CPUXtensaState *env, |
| 8 | target_ulong newsp, |
| 9 | unsigned flags) |
Max Filippov | ba7651f | 2017-01-25 10:54:11 -0800 | [diff] [blame] | 10 | { |
| 11 | if (newsp) { |
| 12 | env->regs[1] = newsp; |
| 13 | env->sregs[WINDOW_BASE] = 0; |
| 14 | env->sregs[WINDOW_START] = 0x1; |
| 15 | } |
| 16 | env->regs[2] = 0; |
| 17 | } |
| 18 | |
Richard Henderson | 07a6ecf | 2019-11-06 12:33:16 +0100 | [diff] [blame] | 19 | static inline void cpu_clone_regs_parent(CPUXtensaState *env, unsigned flags) |
| 20 | { |
| 21 | } |
| 22 | |
Max Filippov | ba7651f | 2017-01-25 10:54:11 -0800 | [diff] [blame] | 23 | static inline void cpu_set_tls(CPUXtensaState *env, target_ulong newtls) |
| 24 | { |
| 25 | env->uregs[THREADPTR] = newtls; |
| 26 | } |
| 27 | |
Laurent Vivier | 9850f9f | 2018-05-29 21:42:00 +0200 | [diff] [blame] | 28 | static inline abi_ulong get_sp_from_cpustate(CPUXtensaState *state) |
| 29 | { |
| 30 | return state->regs[1]; |
| 31 | } |
Max Filippov | ba7651f | 2017-01-25 10:54:11 -0800 | [diff] [blame] | 32 | #endif |