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 106291ad77SPeter Maydell * version 2 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 156291ad77SPeter Maydell * 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 216291ad77SPeter Maydell #ifndef TARGET_CPU_H 226291ad77SPeter Maydell #define 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*0429a971SAndreas Färber CPUState *cs = CPU(m68k_env_get_cpu(env)); 35*0429a971SAndreas Färber TaskState *ts = cs->opaque; 36*0429a971SAndreas Färber 371ccd9374SPeter Maydell ts->tp_value = newtls; 381ccd9374SPeter Maydell } 396291ad77SPeter Maydell 406291ad77SPeter Maydell #endif 41