xref: /qemu/linux-user/mips/target_cpu.h (revision 55c5063c)
16291ad77SPeter Maydell /*
26291ad77SPeter Maydell  * MIPS specific CPU ABI and functions for linux-user
36291ad77SPeter Maydell  *
46291ad77SPeter Maydell  * Copyright (c) 2004-2005 Jocelyn Mayer
56291ad77SPeter Maydell  *
66291ad77SPeter Maydell  * This library is free software; you can redistribute it and/or
76291ad77SPeter Maydell  * modify it under the terms of the GNU Lesser General Public
86291ad77SPeter Maydell  * License as published by the Free Software Foundation; either
96291ad77SPeter Maydell  * version 2 of the License, or (at your option) any later version.
106291ad77SPeter Maydell  *
116291ad77SPeter Maydell  * This library 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
146291ad77SPeter Maydell  * Lesser General Public License for more details.
156291ad77SPeter Maydell  *
166291ad77SPeter Maydell  * You should have received a copy of the GNU Lesser General Public
176291ad77SPeter Maydell  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
186291ad77SPeter Maydell  */
19*55c5063cSMarkus Armbruster #ifndef MIPS_TARGET_CPU_H
20*55c5063cSMarkus Armbruster #define MIPS_TARGET_CPU_H
216291ad77SPeter Maydell 
226291ad77SPeter Maydell static inline void cpu_clone_regs(CPUMIPSState *env, target_ulong newsp)
236291ad77SPeter Maydell {
246291ad77SPeter Maydell     if (newsp) {
256291ad77SPeter Maydell         env->active_tc.gpr[29] = newsp;
266291ad77SPeter Maydell     }
276291ad77SPeter Maydell     env->active_tc.gpr[7] = 0;
286291ad77SPeter Maydell     env->active_tc.gpr[2] = 0;
296291ad77SPeter Maydell }
306291ad77SPeter Maydell 
316291ad77SPeter Maydell static inline void cpu_set_tls(CPUMIPSState *env, target_ulong newtls)
326291ad77SPeter Maydell {
33d279279eSPetar Jovanovic     env->active_tc.CP0_UserLocal = newtls;
346291ad77SPeter Maydell }
356291ad77SPeter Maydell 
366291ad77SPeter Maydell #endif
37