1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20#ifndef BSD_USER_ARCH_SYSARCH_H_
21#define BSD_USER_ARCH_SYSARCH_H_
22
23#include "target_syscall.h"
24#include "target_arch.h"
25
26static inline abi_long do_freebsd_arch_sysarch(CPUARMState *env, int op,
27 abi_ulong parms)
28{
29 int ret = 0;
30
31 switch (op) {
32 case TARGET_FREEBSD_ARM_SYNC_ICACHE:
33 case TARGET_FREEBSD_ARM_DRAIN_WRITEBUF:
34 break;
35
36 case TARGET_FREEBSD_ARM_SET_TP:
37 target_cpu_set_tls(env, parms);
38 break;
39
40 case TARGET_FREEBSD_ARM_GET_TP:
41 ret = target_cpu_get_tls(env);
42 break;
43
44 default:
45 ret = -TARGET_EINVAL;
46 break;
47 }
48 return ret;
49}
50
51static inline void do_freebsd_arch_print_sysarch(
52 const struct syscallname *name, abi_long arg1, abi_long arg2,
53 abi_long arg3, abi_long arg4, abi_long arg5, abi_long arg6)
54{
55
56 switch (arg1) {
57 case TARGET_FREEBSD_ARM_SYNC_ICACHE:
58 gemu_log("%s(ARM_SYNC_ICACHE, ...)", name->name);
59 break;
60
61 case TARGET_FREEBSD_ARM_DRAIN_WRITEBUF:
62 gemu_log("%s(ARM_DRAIN_WRITEBUF, ...)", name->name);
63 break;
64
65 case TARGET_FREEBSD_ARM_SET_TP:
66 gemu_log("%s(ARM_SET_TP, 0x" TARGET_ABI_FMT_lx ")", name->name, arg2);
67 break;
68
69 case TARGET_FREEBSD_ARM_GET_TP:
70 gemu_log("%s(ARM_GET_TP, 0x" TARGET_ABI_FMT_lx ")", name->name, arg2);
71 break;
72
73 default:
74 gemu_log("UNKNOWN OP: %d, " TARGET_ABI_FMT_lx ")", (int)arg1, arg2);
75 }
76}
77
78#endif
79