ARM: tizen_tm1_defconfig: Enable missing features related with CGROUPS
[profile/mobile/platform/kernel/linux-3.10-sc7730.git] / kernel / swap / us_manager / sspt / sspt_page.h
1 #ifndef __SSPT_PAGE__
2 #define __SSPT_PAGE__
3
4 /**
5  * @file us_manager/sspt/sspt_page.h
6  * @author Vyacheslav Cherkashin <v.cherkashin@samsung.com>
7  *
8  * @section LICENSE
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22  *
23  * @section COPYRIGHT
24  * Copyright (C) Samsung Electronics, 2013
25  */
26
27 #include <linux/types.h>
28 #include <linux/spinlock.h>
29
30 struct us_ip;
31 struct sspt_file;
32 struct task_struct;
33 enum US_FLAGS;
34
35 /**
36  * @struct sspt_page
37  * @breaf Image of page for specified process
38  */
39 struct sspt_page {
40         struct list_head ip_list_inst;          /**< For installed ip */
41         struct list_head ip_list_no_inst;       /**< For don'tinstalled ip */
42         unsigned long offset;                   /**< File offset */
43         spinlock_t lock;                        /**< Lock page */
44
45         struct sspt_file *file;                 /**< Ptr to the file(parent)=*/
46         struct hlist_node hlist;                /**< For sspt_file */
47 };
48
49 struct sspt_page *sspt_page_create(unsigned long offset);
50 void sspt_page_free(struct sspt_page *page);
51
52 void sspt_add_ip(struct sspt_page *page, struct us_ip *ip);
53 void sspt_del_ip(struct us_ip *ip);
54
55 int sspt_page_is_installed(struct sspt_page *page);
56
57 int sspt_register_page(struct sspt_page *page, struct sspt_file *file);
58
59 int sspt_unregister_page(struct sspt_page *page,
60                          enum US_FLAGS flag,
61                          struct task_struct *task);
62
63 void sspt_page_on_each_ip(struct sspt_page *page,
64                           void (*func)(struct us_ip *, void *), void *data);
65
66 #endif /* __SSPT_PAGE__ */