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 Hendersonstatic 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 Hendersonstatic 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 Clarkstatic 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 Vivierstatic inline abi_ulong get_sp_from_cpustate(CPURISCVState *state) 249850f9f6SLaurent Vivier { 259850f9f6SLaurent Vivier return state->gpr[xSP]; 269850f9f6SLaurent Vivier } 2747ae93cdSMichael Clark #endif 28