358e84b3502617899caa81de40584c3fcc6c1f40
[kernel/swap-modules.git] / us_manager / sspt / ip.h
1 #ifndef __IP__
2 #define __IP__
3
4 /*
5  *  Dynamic Binary Instrumentation Module based on KProbes
6  *  modules/driver/sspt/ip.h
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21  *
22  * Copyright (C) Samsung Electronics, 2013
23  *
24  * 2013         Vyacheslav Cherkashin <v.cherkashin@samsung.com>
25  *
26  */
27
28 #include <linux/list.h>
29 //#include "../../kprobe/dbi_kprobes.h"
30 #include <uprobe/swap_uprobes.h>
31
32 // TODO: tmp struct ip_data
33 struct ip_data {
34         unsigned long offset;
35         unsigned long got_addr;
36
37         kprobe_pre_entry_handler_t pre_handler;
38         unsigned long jp_handler;
39         uretprobe_handler_t rp_handler;
40
41         unsigned flag_retprobe:1;
42 };
43
44 struct sspt_page;
45 struct sspt_file;
46
47 struct us_ip {
48         struct list_head list;
49         struct sspt_page *page;
50
51         struct ujprobe jprobe;
52         struct uretprobe retprobe;
53
54         unsigned long offset;
55         unsigned long got_addr;
56
57         unsigned flag_retprobe:1;
58         unsigned flag_got:1;
59 };
60
61
62 struct us_ip *create_ip(unsigned long offset, const char *args);
63 void free_ip(struct us_ip *ip);
64
65 #endif /* __IP__ */