xref: /openbmc/qemu/linux-user/riscv/target_cpu.h (revision 374b63590ec7ddfe5b3130ede79d14ca09b76d67)
143e0c351SMarkus Armbruster #ifndef RISCV_TARGET_CPU_H
243e0c351SMarkus Armbruster #define RISCV_TARGET_CPU_H
347ae93cdSMichael Clark 
cpu_clone_regs_child(CPURISCVState * env,target_ulong newsp,unsigned flags)4608999d1SRichard Henderson static inline void cpu_clone_regs_child(CPURISCVState *env, target_ulong newsp,
5608999d1SRichard Henderson                                         unsigned flags)
647ae93cdSMichael Clark {
747ae93cdSMichael Clark     if (newsp) {
847ae93cdSMichael Clark         env->gpr[xSP] = newsp;
947ae93cdSMichael Clark     }
1047ae93cdSMichael Clark 
1147ae93cdSMichael Clark     env->gpr[xA0] = 0;
1247ae93cdSMichael Clark }
1347ae93cdSMichael Clark 
cpu_clone_regs_parent(CPURISCVState * env,unsigned flags)14*07a6ecf4SRichard Henderson static inline void cpu_clone_regs_parent(CPURISCVState *env, unsigned flags)
15*07a6ecf4SRichard Henderson {
16*07a6ecf4SRichard Henderson }
17*07a6ecf4SRichard Henderson 
cpu_set_tls(CPURISCVState * env,target_ulong newtls)1847ae93cdSMichael Clark static inline void cpu_set_tls(CPURISCVState *env, target_ulong newtls)
1947ae93cdSMichael Clark {
2047ae93cdSMichael Clark     env->gpr[xTP] = newtls;
2147ae93cdSMichael Clark }
2247ae93cdSMichael Clark 
get_sp_from_cpustate(CPURISCVState * state)239850f9f6SLaurent Vivier static inline abi_ulong get_sp_from_cpustate(CPURISCVState *state)
249850f9f6SLaurent Vivier {
259850f9f6SLaurent Vivier    return state->gpr[xSP];
269850f9f6SLaurent Vivier }
2747ae93cdSMichael Clark #endif
28