1*ea1ab4cfSStacey Son /* 2*ea1ab4cfSStacey Son * arm sysarch() system call emulation 3*ea1ab4cfSStacey Son * 4*ea1ab4cfSStacey Son * Copyright (c) 2013 Stacey D. Son 5*ea1ab4cfSStacey Son * 6*ea1ab4cfSStacey Son * This program is free software; you can redistribute it and/or modify 7*ea1ab4cfSStacey Son * it under the terms of the GNU General Public License as published by 8*ea1ab4cfSStacey Son * the Free Software Foundation; either version 2 of the License, or 9*ea1ab4cfSStacey Son * (at your option) any later version. 10*ea1ab4cfSStacey Son * 11*ea1ab4cfSStacey Son * This program is distributed in the hope that it will be useful, 12*ea1ab4cfSStacey Son * but WITHOUT ANY WARRANTY; without even the implied warranty of 13*ea1ab4cfSStacey Son * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14*ea1ab4cfSStacey Son * GNU General Public License for more details. 15*ea1ab4cfSStacey Son * 16*ea1ab4cfSStacey Son * You should have received a copy of the GNU General Public License 17*ea1ab4cfSStacey Son * along with this program; if not, see <http://www.gnu.org/licenses/>. 18*ea1ab4cfSStacey Son */ 19*ea1ab4cfSStacey Son 20*ea1ab4cfSStacey Son #ifndef BSD_USER_ARCH_SYSARCH_H_ 21*ea1ab4cfSStacey Son #define BSD_USER_ARCH_SYSARCH_H_ 22*ea1ab4cfSStacey Son 23*ea1ab4cfSStacey Son #include "target_syscall.h" 24*ea1ab4cfSStacey Son #include "target_arch.h" 25*ea1ab4cfSStacey Son 26*ea1ab4cfSStacey Son static inline abi_long do_freebsd_arch_sysarch(CPUARMState *env, int op, 27*ea1ab4cfSStacey Son abi_ulong parms) 28*ea1ab4cfSStacey Son { 29*ea1ab4cfSStacey Son int ret = 0; 30*ea1ab4cfSStacey Son 31*ea1ab4cfSStacey Son switch (op) { 32*ea1ab4cfSStacey Son case TARGET_FREEBSD_ARM_SYNC_ICACHE: 33*ea1ab4cfSStacey Son case TARGET_FREEBSD_ARM_DRAIN_WRITEBUF: 34*ea1ab4cfSStacey Son break; 35*ea1ab4cfSStacey Son 36*ea1ab4cfSStacey Son case TARGET_FREEBSD_ARM_SET_TP: 37*ea1ab4cfSStacey Son target_cpu_set_tls(env, parms); 38*ea1ab4cfSStacey Son break; 39*ea1ab4cfSStacey Son 40*ea1ab4cfSStacey Son case TARGET_FREEBSD_ARM_GET_TP: 41*ea1ab4cfSStacey Son ret = target_cpu_get_tls(env); 42*ea1ab4cfSStacey Son break; 43*ea1ab4cfSStacey Son 44*ea1ab4cfSStacey Son default: 45*ea1ab4cfSStacey Son ret = -TARGET_EINVAL; 46*ea1ab4cfSStacey Son break; 47*ea1ab4cfSStacey Son } 48*ea1ab4cfSStacey Son return ret; 49*ea1ab4cfSStacey Son } 50*ea1ab4cfSStacey Son 51*ea1ab4cfSStacey Son static inline void do_freebsd_arch_print_sysarch( 52*ea1ab4cfSStacey Son const struct syscallname *name, abi_long arg1, abi_long arg2, 53*ea1ab4cfSStacey Son abi_long arg3, abi_long arg4, abi_long arg5, abi_long arg6) 54*ea1ab4cfSStacey Son { 55*ea1ab4cfSStacey Son 56*ea1ab4cfSStacey Son switch (arg1) { 57*ea1ab4cfSStacey Son case TARGET_FREEBSD_ARM_SYNC_ICACHE: 58*ea1ab4cfSStacey Son gemu_log("%s(ARM_SYNC_ICACHE, ...)", name->name); 59*ea1ab4cfSStacey Son break; 60*ea1ab4cfSStacey Son 61*ea1ab4cfSStacey Son case TARGET_FREEBSD_ARM_DRAIN_WRITEBUF: 62*ea1ab4cfSStacey Son gemu_log("%s(ARM_DRAIN_WRITEBUF, ...)", name->name); 63*ea1ab4cfSStacey Son break; 64*ea1ab4cfSStacey Son 65*ea1ab4cfSStacey Son case TARGET_FREEBSD_ARM_SET_TP: 66*ea1ab4cfSStacey Son gemu_log("%s(ARM_SET_TP, 0x" TARGET_ABI_FMT_lx ")", name->name, arg2); 67*ea1ab4cfSStacey Son break; 68*ea1ab4cfSStacey Son 69*ea1ab4cfSStacey Son case TARGET_FREEBSD_ARM_GET_TP: 70*ea1ab4cfSStacey Son gemu_log("%s(ARM_GET_TP, 0x" TARGET_ABI_FMT_lx ")", name->name, arg2); 71*ea1ab4cfSStacey Son break; 72*ea1ab4cfSStacey Son 73*ea1ab4cfSStacey Son default: 74*ea1ab4cfSStacey Son gemu_log("UNKNOWN OP: %d, " TARGET_ABI_FMT_lx ")", (int)arg1, arg2); 75*ea1ab4cfSStacey Son } 76*ea1ab4cfSStacey Son } 77*ea1ab4cfSStacey Son 78*ea1ab4cfSStacey Son #endif /*!BSD_USER_ARCH_SYSARCH_H_ */ 79