tap-win32: correctly recycle buffers
[qemu/kevin.git] / bsd-user / mips / target_arch_sysarch.h
blob6da803a408e7413166e7062a1493fff624004303
1 /*
2 * mips sysarch() system call emulation
4 * Copyright (c) 2013 Stacey D. Son
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, see <http://www.gnu.org/licenses/>.
20 #ifndef BSD_USER_ARCH_SYSARCH_H_
21 #define BSD_USER_ARCH_SYSARCH_H_
23 #include "target_syscall.h"
24 #include "target_arch.h"
26 static inline abi_long do_freebsd_arch_sysarch(CPUMIPSState *env, int op,
27 abi_ulong parms)
29 int ret = 0;
31 switch (op) {
32 case TARGET_MIPS_SET_TLS:
33 target_cpu_set_tls(env, parms);
34 break;
36 case TARGET_MIPS_GET_TLS:
37 if (put_user(target_cpu_get_tls(env), parms, abi_ulong)) {
38 ret = -TARGET_EFAULT;
40 break;
42 default:
43 ret = -TARGET_EINVAL;
44 break;
47 return ret;
50 static inline void do_freebsd_arch_print_sysarch(
51 const struct syscallname *name, abi_long arg1, abi_long arg2,
52 abi_long arg3, abi_long arg4, abi_long arg5, abi_long arg6)
55 switch (arg1) {
56 case TARGET_MIPS_SET_TLS:
57 gemu_log("%s(SET_TLS, 0x" TARGET_ABI_FMT_lx ")", name->name, arg2);
58 break;
60 case TARGET_MIPS_GET_TLS:
61 gemu_log("%s(GET_TLS, 0x" TARGET_ABI_FMT_lx ")", name->name, arg2);
62 break;
64 default:
65 gemu_log("UNKNOWN OP: %d, " TARGET_ABI_FMT_lx ")", (int)arg1, arg2);
69 #endif /*!BSD_USER_ARCH_SYSARCH_H_ */