tizen 2.4 release
[profile/mobile/platform/kernel/linux-3.10-sc7730.git] / kernel / swap / fbiprobe / fbiprobe.h
1 /*
2  * @file fbi_probe/fbi_probe.h
3  *
4  * @author Alexander Aksenov <a.aksenov@samsung.com>
5  * @author Vitaliy Cherepanov <v.cherepanov@samsung.com>
6  *
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.
11  *
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.
16  *
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.
20  *
21  * @section COPYRIGHT
22  *
23  * Copyright (C) Samsung Electronics, 2014
24  *
25  * 2014 Alexander Aksenov : FBI implement
26  * 2014 Vitaliy Cherepanov: FBI implement, portage
27  *
28  * @section DESCRIPTION
29  *
30  * Function body instrumentation.
31  *
32  */
33
34 #ifndef __FBI_PROBE_H__
35 #define __FBI_PROBE_H__
36
37 #include <linux/types.h>
38
39 /* FBI step */
40 struct fbi_step {
41         uint8_t ptr_order;         /* Specifies what is located on the address:
42                                     * ptr_order = 0  -  variable
43                                     * ptr_order = 1  -  pointer to variable
44                                     * ptr_order = 2  -  pointer to pointer
45                                     * etc. */
46
47         uint64_t data_offset;
48 } __packed;
49
50 /* FBI var data */
51 struct fbi_var_data {
52         /* Variable position is evaluated by the following rule:
53          * var_position = *(pointer_to_register) - reg_offset
54          * It is expected that the offset is not null only when we're taking
55          * var value from stack.
56          */
57         uint64_t var_id;           /* Variable identifier
58                                     * Used to specify var */
59         uint64_t reg_offset;       /* Offset relative to the registers value
60                                     * address, specified with reg_n */
61         uint8_t reg_n;             /* Register number. Hope times of cpu
62                                     * with more than 2 million ones are very
63                                     * far from us */
64         uint32_t data_size;        /* Data size to be read */
65
66         uint8_t steps_count;       /* Count of steps to extract variable
67                                     * value */
68         struct fbi_step *steps;    /* extract steps */
69 };
70
71 /* FBI info */
72 struct fbi_info {
73         uint8_t var_count;
74         struct fbi_var_data *vars;
75 };
76
77 #endif /* __FBI_PROBE_H__ */