Merge branch 'tizen_2.4' into tizen_2.4_dev
[kernel/swap-modules.git] / us_manager / pf / pf_group.h
1 /**
2  * @file us_manager/pf/pf_group.h
3  * @author Vyacheslav Cherkashin <v.cherkashin@samsung.com>
4  *
5  * @section LICENSE
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19  *
20  * @section COPYRIGHT
21  * Copyright (C) Samsung Electronics, 2013
22  */
23
24
25 #ifndef _PF_GROUP_H
26 #define _PF_GROUP_H
27
28 #include <linux/types.h>
29
30 struct dentry;
31 struct pf_group;
32 struct sspt_proc;
33 struct probe_desc;
34
35
36 struct pfg_msg_cb {
37         void (*msg_info)(struct task_struct *task, struct dentry *dentry);
38         void (*msg_status_info)(struct task_struct *task);
39         void (*msg_term)(struct task_struct *task);
40         void (*msg_map)(struct vm_area_struct *vma);
41         void (*msg_unmap)(unsigned long start, unsigned long end);
42 };
43
44
45 /* FIXME: create and use get_dentry() and put_dentry() */
46 struct dentry *dentry_by_path(const char *path);
47
48 struct pf_group *get_pf_group_by_dentry(struct dentry *dentry, void *priv);
49 struct pf_group *get_pf_group_by_tgid(pid_t tgid, void *priv);
50 struct pf_group *get_pf_group_by_comm(char *comm, void *priv);
51 struct pf_group *get_pf_group_dumb(void *priv);
52 void put_pf_group(struct pf_group *pfg);
53
54 int pfg_msg_cb_set(struct pf_group *pfg, struct pfg_msg_cb *msg_cb);
55 void pfg_msg_cb_reset(struct pf_group *pfg);
56 struct pfg_msg_cb *pfg_msg_cb_get(struct pf_group *pfg);
57
58 int pf_register_probe(struct pf_group *pfg, struct dentry *dentry,
59                       unsigned long offset, struct probe_desc *pd);
60 int pf_unregister_probe(struct pf_group *pfg, struct dentry *dentry,
61                         unsigned long offset, struct probe_desc *pd);
62
63 void install_all(void);
64 void uninstall_all(void);
65
66 void get_all_procs(void);
67 void put_all_procs(void);
68
69 int check_task_on_filters(struct task_struct *task);
70 void call_page_fault(struct task_struct *task, unsigned long page_addr);
71 void call_mm_release(struct task_struct *task);
72 void check_task_and_install(struct task_struct *task);
73 void uninstall_proc(struct sspt_proc *proc);
74
75 void uninstall_page(unsigned long addr);
76
77 /* debug */
78 void pfg_print(struct pf_group *pfg);
79 /* debug */
80
81 #endif /* _PF_GROUP_H */