16291ad77SPeter Maydell /* 26291ad77SPeter Maydell * SPARC specific CPU ABI and functions for linux-user 36291ad77SPeter Maydell * 46291ad77SPeter Maydell * Copyright (C) 2003 Thomas M. Ogrisegg <tom@fnord.at> 56291ad77SPeter Maydell * Copyright (C) 2003-2005 Fabrice Bellard 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 * 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 #ifndef TARGET_CPU_H 216291ad77SPeter Maydell #define TARGET_CPU_H 226291ad77SPeter Maydell 236291ad77SPeter Maydell static inline void cpu_clone_regs(CPUSPARCState *env, target_ulong newsp) 246291ad77SPeter Maydell { 256291ad77SPeter Maydell if (newsp) { 266291ad77SPeter Maydell env->regwptr[22] = newsp; 276291ad77SPeter Maydell } 28*f5147c93SPeter Maydell /* syscall return for clone child: 0, and clear CF since 29*f5147c93SPeter Maydell * this counts as a success return value. 30*f5147c93SPeter Maydell */ 316291ad77SPeter Maydell env->regwptr[0] = 0; 32*f5147c93SPeter Maydell #if defined(TARGET_SPARC64) && !defined(TARGET_ABI32) 33*f5147c93SPeter Maydell env->xcc &= ~PSR_CARRY; 34*f5147c93SPeter Maydell #else 35*f5147c93SPeter Maydell env->psr &= ~PSR_CARRY; 36*f5147c93SPeter Maydell #endif 376291ad77SPeter Maydell } 386291ad77SPeter Maydell 39*f5147c93SPeter Maydell static inline void cpu_set_tls(CPUSPARCState *env, target_ulong newtls) 40*f5147c93SPeter Maydell { 41*f5147c93SPeter Maydell env->gregs[7] = newtls; 42*f5147c93SPeter Maydell } 436291ad77SPeter Maydell 446291ad77SPeter Maydell #endif 45