2 * drivers/misc/tegra-profiler/comm.h
4 * Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved.
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.
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
17 #ifndef __QUADD_COMM_H__
18 #define __QUADD_COMM_H__
20 #include <linux/types.h>
22 struct quadd_record_data;
23 struct quadd_comm_cap;
24 struct quadd_module_state;
26 struct quadd_parameters;
27 struct quadd_extables;
28 struct quadd_unwind_ctx;
30 struct quadd_ring_buffer {
38 size_t max_fill_count;
46 struct quadd_extabs_mmap {
47 struct vm_area_struct *mmap_vma;
50 struct list_head list;
51 struct list_head ex_entries;
54 struct quadd_comm_control_interface {
57 int (*set_parameters)(struct quadd_parameters *param,
58 uid_t *debug_app_uid);
59 void (*get_capabilities)(struct quadd_comm_cap *cap);
60 void (*get_state)(struct quadd_module_state *state);
61 int (*set_extab)(struct quadd_extables *extabs,
62 struct quadd_extabs_mmap *mmap);
63 void (*delete_mmap)(struct quadd_extabs_mmap *mmap);
66 struct quadd_comm_data_interface {
67 void (*put_sample)(struct quadd_record_data *data,
68 struct quadd_iovec *vec, int vec_count);
70 int (*is_active)(void);
73 struct quadd_comm_ctx {
74 struct quadd_comm_control_interface *control;
76 struct quadd_ring_buffer rb;
81 struct mutex io_mutex;
88 wait_queue_head_t read_wait;
90 struct miscdevice *misc_dev;
92 struct list_head ext_mmaps;
93 spinlock_t mmaps_lock;
96 struct quadd_comm_data_interface *
97 quadd_comm_events_init(struct quadd_comm_control_interface *control);
98 void quadd_comm_events_exit(void);
100 #endif /* __QUADD_COMM_H__ */