xref: /qemu/linux-user/m68k/target_cpu.h (revision a8d92fd869c601f723b82d9736a2d78ae640b8a2)
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 
246291ad77SPeter Maydell static inline void cpu_clone_regs(CPUM68KState *env, target_ulong newsp)
256291ad77SPeter Maydell {
266291ad77SPeter Maydell     if (newsp) {
276291ad77SPeter Maydell         env->aregs[7] = newsp;
286291ad77SPeter Maydell     }
296291ad77SPeter Maydell     env->dregs[0] = 0;
306291ad77SPeter Maydell }
316291ad77SPeter Maydell 
321ccd9374SPeter Maydell static inline void cpu_set_tls(CPUM68KState *env, target_ulong newtls)
331ccd9374SPeter Maydell {
34*a8d92fd8SRichard Henderson     CPUState *cs = env_cpu(env);
350429a971SAndreas Färber     TaskState *ts = cs->opaque;
360429a971SAndreas Färber 
371ccd9374SPeter Maydell     ts->tp_value = newtls;
381ccd9374SPeter Maydell }
396291ad77SPeter Maydell 
409850f9f6SLaurent Vivier static inline abi_ulong get_sp_from_cpustate(CPUM68KState *state)
419850f9f6SLaurent Vivier {
429850f9f6SLaurent Vivier     return state->aregs[7];
439850f9f6SLaurent Vivier }
446291ad77SPeter Maydell #endif
45