xref: /qemu/linux-user/s390x/target_cpu.h (revision 07a6ecf4)
16291ad77SPeter Maydell /*
26291ad77SPeter Maydell  * S/390 specific CPU ABI and functions for linux-user
36291ad77SPeter Maydell  *
46291ad77SPeter Maydell  * Copyright (c) 2009 Ulrich Hecht
56291ad77SPeter Maydell  *
644699e1cSThomas Huth  * This program is free software; you can redistribute it and/or modify
744699e1cSThomas Huth  * it under the terms of the GNU General Public License as published by
844699e1cSThomas Huth  * the Free Software Foundation; either version 2 of the License, or
944699e1cSThomas Huth  * (at your option) any later version.
106291ad77SPeter Maydell  *
1144699e1cSThomas Huth  * This program is distributed in the hope that it will be useful,
126291ad77SPeter Maydell  * but WITHOUT ANY WARRANTY; without even the implied warranty of
136291ad77SPeter Maydell  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1444699e1cSThomas Huth  * General Public License for more details.
156291ad77SPeter Maydell  *
1644699e1cSThomas Huth  * You should have received a copy of the GNU General Public License
1744699e1cSThomas Huth  * along with this program; if not, see <http://www.gnu.org/licenses/>.
186291ad77SPeter Maydell  */
1955c5063cSMarkus Armbruster #ifndef S390X_TARGET_CPU_H
2055c5063cSMarkus Armbruster #define S390X_TARGET_CPU_H
216291ad77SPeter Maydell 
cpu_clone_regs_child(CPUS390XState * env,target_ulong newsp,unsigned flags)22608999d1SRichard Henderson static inline void cpu_clone_regs_child(CPUS390XState *env, target_ulong newsp,
23608999d1SRichard Henderson                                         unsigned flags)
246291ad77SPeter Maydell {
256291ad77SPeter Maydell     if (newsp) {
266291ad77SPeter Maydell         env->regs[15] = newsp;
276291ad77SPeter Maydell     }
286291ad77SPeter Maydell     env->regs[2] = 0;
296291ad77SPeter Maydell }
306291ad77SPeter Maydell 
cpu_clone_regs_parent(CPUS390XState * env,unsigned flags)31*07a6ecf4SRichard Henderson static inline void cpu_clone_regs_parent(CPUS390XState *env, unsigned flags)
32*07a6ecf4SRichard Henderson {
33*07a6ecf4SRichard Henderson }
34*07a6ecf4SRichard Henderson 
cpu_set_tls(CPUS390XState * env,target_ulong newtls)356291ad77SPeter Maydell static inline void cpu_set_tls(CPUS390XState *env, target_ulong newtls)
366291ad77SPeter Maydell {
376291ad77SPeter Maydell     env->aregs[0] = newtls >> 32;
386291ad77SPeter Maydell     env->aregs[1] = newtls & 0xffffffffULL;
396291ad77SPeter Maydell }
406291ad77SPeter Maydell 
get_sp_from_cpustate(CPUS390XState * state)419850f9f6SLaurent Vivier static inline abi_ulong get_sp_from_cpustate(CPUS390XState *state)
429850f9f6SLaurent Vivier {
439850f9f6SLaurent Vivier    return state->regs[15];
449850f9f6SLaurent Vivier }
456291ad77SPeter Maydell #endif
46