xref: /openbmc/qemu/linux-user/m68k/target_cpu.h (revision 8f6330a807f2642dc2a3cdf33347aa28a4c00a87)
16291ad77SPeter Maydell /*
26291ad77SPeter Maydell  * m68k specific CPU ABI and functions for linux-user
36291ad77SPeter Maydell  *
46291ad77SPeter Maydell  * Copyright (c) 2005-2007 CodeSourcery
56291ad77SPeter Maydell  * Written by Paul Brook
66291ad77SPeter Maydell  *
76291ad77SPeter Maydell  * This library is free software; you can redistribute it and/or
86291ad77SPeter Maydell  * modify it under the terms of the GNU Lesser General Public
96291ad77SPeter Maydell  * License as published by the Free Software Foundation; either
10d749fb85SThomas Huth  * version 2.1 of the License, or (at your option) any later version.
116291ad77SPeter Maydell  *
126291ad77SPeter Maydell  * This library is distributed in the hope that it will be useful,
136291ad77SPeter Maydell  * but WITHOUT ANY WARRANTY; without even the implied warranty of
146291ad77SPeter Maydell  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15d749fb85SThomas Huth  * Lesser General Public License for more details.
166291ad77SPeter Maydell  *
176291ad77SPeter Maydell  * You should have received a copy of the GNU Lesser General Public
186291ad77SPeter Maydell  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
196291ad77SPeter Maydell  */
206291ad77SPeter Maydell 
2155c5063cSMarkus Armbruster #ifndef M68K_TARGET_CPU_H
2255c5063cSMarkus Armbruster #define M68K_TARGET_CPU_H
236291ad77SPeter Maydell 
cpu_clone_regs_child(CPUM68KState * env,target_ulong newsp,unsigned flags)24608999d1SRichard Henderson static inline void cpu_clone_regs_child(CPUM68KState *env, target_ulong newsp,
25608999d1SRichard Henderson                                         unsigned flags)
266291ad77SPeter Maydell {
276291ad77SPeter Maydell     if (newsp) {
286291ad77SPeter Maydell         env->aregs[7] = newsp;
296291ad77SPeter Maydell     }
306291ad77SPeter Maydell     env->dregs[0] = 0;
316291ad77SPeter Maydell }
326291ad77SPeter Maydell 
cpu_clone_regs_parent(CPUM68KState * env,unsigned flags)3307a6ecf4SRichard Henderson static inline void cpu_clone_regs_parent(CPUM68KState *env, unsigned flags)
3407a6ecf4SRichard Henderson {
3507a6ecf4SRichard Henderson }
3607a6ecf4SRichard Henderson 
cpu_set_tls(CPUM68KState * env,target_ulong newtls)371ccd9374SPeter Maydell static inline void cpu_set_tls(CPUM68KState *env, target_ulong newtls)
381ccd9374SPeter Maydell {
39a8d92fd8SRichard Henderson     CPUState *cs = env_cpu(env);
40*e4e5cb4aSIlya Leoshkevich     TaskState *ts = get_task_state(cs);
410429a971SAndreas Färber 
421ccd9374SPeter Maydell     ts->tp_value = newtls;
431ccd9374SPeter Maydell }
446291ad77SPeter Maydell 
get_sp_from_cpustate(CPUM68KState * state)459850f9f6SLaurent Vivier static inline abi_ulong get_sp_from_cpustate(CPUM68KState *state)
469850f9f6SLaurent Vivier {
479850f9f6SLaurent Vivier     return state->aregs[7];
489850f9f6SLaurent Vivier }
496291ad77SPeter Maydell #endif
50