1/*-
2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3 *
4 * Copyright (c) 2013 Dmitry Chagin
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 *    notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 *    notice, this list of conditions and the following disclaimer in the
14 *    documentation and/or other materials provided with the distribution.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 */
28
29#include <sys/cdefs.h>
30__FBSDID("$FreeBSD: stable/11/sys/amd64/linux/linux_dummy.c 346839 2019-04-28 14:19:31Z dchagin $");
31
32#include "opt_compat.h"
33
34#include <sys/param.h>
35#include <sys/kernel.h>
36#include <sys/sdt.h>
37#include <sys/systm.h>
38#include <sys/proc.h>
39
40#include <amd64/linux/linux.h>
41#include <amd64/linux/linux_proto.h>
42#include <compat/linux/linux_dtrace.h>
43#include <compat/linux/linux_util.h>
44
45/* DTrace init */
46LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE);
47
48UNIMPLEMENTED(afs_syscall);
49UNIMPLEMENTED(create_module);	/* Added in Linux 1.0 removed in 2.6. */
50UNIMPLEMENTED(epoll_ctl_old);
51UNIMPLEMENTED(epoll_wait_old);
52UNIMPLEMENTED(get_kernel_syms);	/* Added in Linux 1.0 removed in 2.6. */
53UNIMPLEMENTED(get_thread_area);
54UNIMPLEMENTED(getpmsg);
55UNIMPLEMENTED(nfsservctl);	/* Added in Linux 2.2 removed in 3.1. */
56UNIMPLEMENTED(putpmsg);
57UNIMPLEMENTED(query_module);	/* Added in Linux 2.2 removed in 2.6. */
58UNIMPLEMENTED(security);
59UNIMPLEMENTED(set_thread_area);
60UNIMPLEMENTED(tuxcall);
61UNIMPLEMENTED(uselib);
62UNIMPLEMENTED(vserver);
63
64DUMMY(sendfile);
65DUMMY(syslog);
66DUMMY(setfsuid);
67DUMMY(setfsgid);
68DUMMY(sysfs);
69DUMMY(vhangup);
70DUMMY(pivot_root);
71DUMMY(adjtimex);
72DUMMY(swapoff);
73DUMMY(init_module);
74DUMMY(delete_module);
75DUMMY(quotactl);
76DUMMY(lookup_dcookie);
77DUMMY(remap_file_pages);
78DUMMY(semtimedop);
79DUMMY(mbind);
80DUMMY(get_mempolicy);
81DUMMY(set_mempolicy);
82DUMMY(mq_open);
83DUMMY(mq_unlink);
84DUMMY(mq_timedsend);
85DUMMY(mq_timedreceive);
86DUMMY(mq_notify);
87DUMMY(mq_getsetattr);
88DUMMY(kexec_load);
89/* Linux 2.6.11: */
90DUMMY(add_key);
91DUMMY(request_key);
92DUMMY(keyctl);
93/* Linux 2.6.13: */
94DUMMY(ioprio_set);
95DUMMY(ioprio_get);
96DUMMY(inotify_init);
97DUMMY(inotify_add_watch);
98DUMMY(inotify_rm_watch);
99/* Linux 2.6.16: */
100DUMMY(migrate_pages);
101DUMMY(unshare);
102/* Linux 2.6.17: */
103DUMMY(splice);
104DUMMY(tee);
105DUMMY(sync_file_range);
106DUMMY(vmsplice);
107/* Linux 2.6.18: */
108DUMMY(move_pages);
109/* Linux 2.6.22: */
110DUMMY(signalfd);
111/* Linux 2.6.27: */
112DUMMY(signalfd4);
113DUMMY(inotify_init1);
114/* Linux 2.6.31: */
115DUMMY(perf_event_open);
116/* Linux 2.6.38: */
117DUMMY(fanotify_init);
118DUMMY(fanotify_mark);
119/* Linux 2.6.39: */
120DUMMY(name_to_handle_at);
121DUMMY(open_by_handle_at);
122DUMMY(clock_adjtime);
123/* Linux 3.0: */
124DUMMY(setns);
125DUMMY(getcpu);
126/* Linux 3.2: */
127DUMMY(process_vm_readv);
128DUMMY(process_vm_writev);
129/* Linux 3.5: */
130DUMMY(kcmp);
131/* Linux 3.8: */
132DUMMY(finit_module);
133DUMMY(sched_setattr);
134DUMMY(sched_getattr);
135/* Linux 3.14: */
136DUMMY(renameat2);
137/* Linux 3.15: */
138DUMMY(seccomp);
139DUMMY(memfd_create);
140DUMMY(kexec_file_load);
141/* Linux 3.18: */
142DUMMY(bpf);
143/* Linux 3.19: */
144DUMMY(execveat);
145/* Linux 4.2: */
146DUMMY(userfaultfd);
147/* Linux 4.3: */
148DUMMY(membarrier);
149/* Linux 4.4: */
150DUMMY(mlock2);
151/* Linux 4.5: */
152DUMMY(copy_file_range);
153/* Linux 4.6: */
154DUMMY(preadv2);
155DUMMY(pwritev2);
156/* Linux 4.8: */
157DUMMY(pkey_mprotect);
158DUMMY(pkey_alloc);
159DUMMY(pkey_free);
160/* Linux 4.11: */
161DUMMY(statx);
162/* Linux 4.18: */
163DUMMY(io_pgetevents);
164DUMMY(rseq);
165/* Linux 5.0: */
166DUMMY(pidfd_send_signal);
167DUMMY(io_uring_setup);
168DUMMY(io_uring_enter);
169DUMMY(io_uring_register);
170
171#define DUMMY_XATTR(s)						\
172int								\
173linux_ ## s ## xattr(						\
174    struct thread *td, struct linux_ ## s ## xattr_args *arg)	\
175{								\
176								\
177	return (EOPNOTSUPP);					\
178}
179DUMMY_XATTR(set);
180DUMMY_XATTR(lset);
181DUMMY_XATTR(fset);
182DUMMY_XATTR(get);
183DUMMY_XATTR(lget);
184DUMMY_XATTR(fget);
185DUMMY_XATTR(list);
186DUMMY_XATTR(llist);
187DUMMY_XATTR(flist);
188DUMMY_XATTR(remove);
189DUMMY_XATTR(lremove);
190DUMMY_XATTR(fremove);
191