master
h 66 lines 1.56 KB
Raw
1 /*
2 * arm sysarch() system call emulation
3 *
4 * Copyright (c) 2013 Stacey D. Son
5 *
6 * SPDX-License-Identifier: GPL-2.0-or-later
7 */
8 #ifndef TARGET_ARCH_SYSARCH_H
9 #define TARGET_ARCH_SYSARCH_H
10
11 #include "target_syscall.h"
12 #include "target_arch.h"
13
14 static inline abi_long do_freebsd_arch_sysarch(CPUARMState *env, int op,
15 abi_ulong parms)
16 {
17 int ret = 0;
18
19 switch (op) {
20 case TARGET_FREEBSD_ARM_SYNC_ICACHE:
21 case TARGET_FREEBSD_ARM_DRAIN_WRITEBUF:
22 break;
23
24 case TARGET_FREEBSD_ARM_SET_TP:
25 target_cpu_set_tls(env, parms);
26 break;
27
28 case TARGET_FREEBSD_ARM_GET_TP:
29 ret = target_cpu_get_tls(env);
30 break;
31
32 default:
33 ret = -TARGET_EINVAL;
34 break;
35 }
36 return ret;
37 }
38
39 static inline void do_freebsd_arch_print_sysarch(
40 const struct syscallname *name, abi_long arg1, abi_long arg2,
41 abi_long arg3, abi_long arg4, abi_long arg5, abi_long arg6)
42 {
43
44 switch (arg1) {
45 case TARGET_FREEBSD_ARM_SYNC_ICACHE:
46 gemu_log("%s(ARM_SYNC_ICACHE, ...)", name->name);
47 break;
48
49 case TARGET_FREEBSD_ARM_DRAIN_WRITEBUF:
50 gemu_log("%s(ARM_DRAIN_WRITEBUF, ...)", name->name);
51 break;
52
53 case TARGET_FREEBSD_ARM_SET_TP:
54 gemu_log("%s(ARM_SET_TP, 0x" TARGET_ABI_FMT_lx ")", name->name, arg2);
55 break;
56
57 case TARGET_FREEBSD_ARM_GET_TP:
58 gemu_log("%s(ARM_GET_TP, 0x" TARGET_ABI_FMT_lx ")", name->name, arg2);
59 break;
60
61 default:
62 gemu_log("UNKNOWN OP: %d, " TARGET_ABI_FMT_lx ")", (int)arg1, arg2);
63 }
64 }
65
66 #endif /* TARGET_ARCH_SYSARCH_H */