2 * ks_features/features_data.c
3 * @author Vyacheslav Cherkashin: SWAP ks_features implement
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 * Copyright (C) Samsung Electronics, 2013
25 * @section DESCRIPTION
27 * SWAP kernel features
31 #include "syscall_list.h"
32 #include <linux/mutex.h>
36 * Feature description.
39 * @var feature::feature_list
40 * Pointer to feature's syscall list.
41 * @var feature::sub_type
43 * @var feature::enable
48 enum syscall_id *feature_list;
56 * X-macros for syscall list.
58 #define X(name, args) id_##name
68 static enum syscall_id id_none[] = {};
70 static enum syscall_id id_file[] = {
134 id_sys_fanotify_mark,
136 id_sys_name_to_handle_at,
137 id_sys_open_by_handle_at
140 static enum syscall_id id_ipc[] = {
156 static enum syscall_id id_net[] = {
182 static enum syscall_id id_process[] = {
190 id_sys_rt_tgsigqueueinfo,
194 /* TODO: add support CONFIG_CLONE_BACKWARDS
201 static enum syscall_id id_signal[] = {
205 * id_sys_sigaltstack,
207 /* TODO: add support CONFIG_OLD_SIGSUSPEND and CONFIG_OLD_SIGSUSPEND3
211 id_sys_rt_sigsuspend,
214 id_sys_rt_sigprocmask,
215 id_sys_rt_sigtimedwait,
216 id_sys_rt_tgsigqueueinfo,
227 static enum syscall_id id_desc[] = {
238 id_sys_epoll_create1,
243 id_sys_inotify_init1,
244 id_sys_inotify_add_watch,
245 id_sys_inotify_rm_watch,
267 id_sys_timerfd_create,
268 id_sys_timerfd_settime,
269 id_sys_timerfd_gettime,
275 id_sys_fanotify_init,
276 id_sys_fanotify_mark,
280 id_sys_name_to_handle_at,
285 * @def CREATE_FEATURE
286 * Feature initialization.
288 #define CREATE_FEATURE(x, subtype) \
290 .cnt = sizeof(x) / sizeof(enum syscall_id), \
292 .sub_type = subtype, \
296 static struct feature features[] = {
297 CREATE_FEATURE(id_none, PST_NONE),
298 CREATE_FEATURE(id_file, PST_KS_FILE),
299 CREATE_FEATURE(id_ipc, PST_KS_IPC),
300 CREATE_FEATURE(id_process, PST_KS_PROCESS),
301 CREATE_FEATURE(id_signal, PST_KS_SIGNAL),
302 CREATE_FEATURE(id_net, PST_KS_NETWORK),
303 CREATE_FEATURE(id_desc, PST_KS_DESC)
308 * Defines feature_cnt.
311 feature_cnt = sizeof(features) / sizeof(struct feature)
314 static int feature_index(struct feature *f)