2 * x86_64 sysarch() syscall emulation
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, see <http://www.gnu.org/licenses/>.
19 #ifndef BSD_USER_ARCH_SYSARCH_H_
20 #define BSD_USER_ARCH_SYSARCH_H_
22 #include "target_syscall.h"
24 static inline abi_long
do_freebsd_arch_sysarch(CPUX86State
*env
, int op
,
32 case TARGET_FREEBSD_AMD64_SET_GSBASE
:
33 case TARGET_FREEBSD_AMD64_SET_FSBASE
:
34 if (op
== TARGET_FREEBSD_AMD64_SET_GSBASE
) {
39 if (get_user(val
, parms
, abi_ulong
)) {
40 return -TARGET_EFAULT
;
42 cpu_x86_load_seg(env
, idx
, 0);
43 env
->segs
[idx
].base
= val
;
46 case TARGET_FREEBSD_AMD64_GET_GSBASE
:
47 case TARGET_FREEBSD_AMD64_GET_FSBASE
:
48 if (op
== TARGET_FREEBSD_AMD64_GET_GSBASE
) {
53 val
= env
->segs
[idx
].base
;
54 if (put_user(val
, parms
, abi_ulong
)) {
55 return -TARGET_EFAULT
;
59 /* XXX handle the others... */
67 static inline void do_freebsd_arch_print_sysarch(
68 const struct syscallname
*name
, abi_long arg1
, abi_long arg2
,
69 abi_long arg3
, abi_long arg4
, abi_long arg5
, abi_long arg6
)
72 gemu_log("%s(%d, " TARGET_ABI_FMT_lx
", " TARGET_ABI_FMT_lx
", "
73 TARGET_ABI_FMT_lx
")", name
->name
, (int)arg1
, arg2
, arg3
, arg4
);
76 #endif /*! BSD_USER_ARCH_SYSARCH_H_ */