]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/blob - drivers/misc/tegra-profiler/quadd.h
9de52c773722c6088e9ed875456a1dedae186be7
[sojka/nv-tegra/linux-3.10.git] / drivers / misc / tegra-profiler / quadd.h
1 /*
2  * drivers/misc/tegra-profiler/quadd.h
3  *
4  * Copyright (c) 2014, NVIDIA CORPORATION.  All rights reserved.
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms and conditions of the GNU General Public License,
8  * version 2, as published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
13  * more details.
14  *
15  */
16
17 #ifndef __QUADD_H
18 #define __QUADD_H
19
20 #include <linux/tegra_profiler.h>
21
22 /* #define QUADD_USE_EMULATE_COUNTERS   1 */
23
24 struct event_data;
25 struct quadd_comm_data_interface;
26 struct quadd_hrt_ctx;
27 struct quadd_module_state;
28
29 struct quadd_event_source_interface {
30         int (*enable)(void);
31         void (*disable)(void);
32         void (*start)(void);
33         void (*stop)(void);
34         int (*read)(struct event_data *events, int max_events);
35         int (*set_events)(int *events, int size);
36         int (*get_supported_events)(int *events, int max_events);
37         int (*get_current_events)(int *events, int max_events);
38 };
39
40 struct source_info {
41         int supported_events[QUADD_MAX_COUNTERS];
42         int nr_supported_events;
43
44         int active;
45 };
46
47 struct quadd_ctx {
48         struct quadd_parameters param;
49         struct quadd_comm_cap cap;
50
51         struct quadd_event_source_interface *pmu;
52         struct source_info pmu_info;
53
54         struct quadd_event_source_interface *pl310;
55         struct source_info pl310_info;
56
57         struct quadd_comm_data_interface *comm;
58         struct quadd_hrt_ctx *hrt;
59
60         atomic_t started;
61         atomic_t tegra_profiler_lock;
62
63         int collect_kernel_ips;
64 };
65
66 void quadd_get_state(struct quadd_module_state *state);
67
68 #endif  /* __QUADD_H */