3 * modules/ks_features/features_data.c
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, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 * Copyright (C) Samsung Electronics, 2013
21 * 2013 Vyacheslav Cherkashin: SWAP ks_features implement
26 #include "syscall_list.h"
27 #include <linux/mutex.h>
31 enum syscall_id *feature_list;
37 #define X(name, args) id_##name
43 static enum syscall_id id_none[] = {};
45 static enum syscall_id id_file[] = {
109 id_sys_fanotify_mark,
111 id_sys_name_to_handle_at,
112 id_sys_open_by_handle_at
115 static enum syscall_id id_ipc[] = {
131 static enum syscall_id id_net[] = {
157 static enum syscall_id id_process[] = {
165 id_sys_rt_tgsigqueueinfo,
169 /* TODO: add support CONFIG_CLONE_BACKWARDS
176 static enum syscall_id id_signal[] = {
180 * id_sys_sigaltstack,
182 /* TODO: add support CONFIG_OLD_SIGSUSPEND and CONFIG_OLD_SIGSUSPEND3
186 id_sys_rt_sigsuspend,
189 id_sys_rt_sigprocmask,
190 id_sys_rt_sigtimedwait,
191 id_sys_rt_tgsigqueueinfo,
202 static enum syscall_id id_desc[] = {
213 id_sys_epoll_create1,
218 id_sys_inotify_init1,
219 id_sys_inotify_add_watch,
220 id_sys_inotify_rm_watch,
242 id_sys_timerfd_create,
243 id_sys_timerfd_settime,
244 id_sys_timerfd_gettime,
250 id_sys_fanotify_init,
251 id_sys_fanotify_mark,
255 id_sys_name_to_handle_at,
259 #define CREATE_FEATURE(x, subtype) \
261 .cnt = sizeof(x) / sizeof(enum syscall_id), \
263 .sub_type = subtype, \
267 static struct feature features[] = {
268 CREATE_FEATURE(id_none, PST_NONE),
269 CREATE_FEATURE(id_file, PST_KS_FILE),
270 CREATE_FEATURE(id_ipc, PST_KS_IPC),
271 CREATE_FEATURE(id_process, PST_KS_PROCESS),
272 CREATE_FEATURE(id_signal, PST_KS_SIGNAL),
273 CREATE_FEATURE(id_net, PST_KS_NETWORK),
274 CREATE_FEATURE(id_desc, PST_KS_DESC)
278 feature_cnt = sizeof(features) / sizeof(struct feature)
281 static int feature_index(struct feature *f)