2 * Tegra GK20A GPU Debugger Driver
4 * Copyright (c) 2013-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
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 #ifndef DBG_GPU_GK20A_H
19 #define DBG_GPU_GK20A_H
20 #include <linux/poll.h>
22 /* module debug driver interface */
23 int gk20a_dbg_gpu_dev_release(struct inode *inode, struct file *filp);
24 int gk20a_dbg_gpu_dev_open(struct inode *inode, struct file *filp);
25 long gk20a_dbg_gpu_dev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
26 unsigned int gk20a_dbg_gpu_dev_poll(struct file *filep, poll_table *wait);
28 /* used by profiler driver interface */
29 int gk20a_prof_gpu_dev_open(struct inode *inode, struct file *filp);
31 /* used by the interrupt handler to post events */
32 void gk20a_dbg_gpu_post_events(struct channel_gk20a *fault_ch);
34 struct dbg_gpu_session_ops {
35 int (*exec_reg_ops)(struct dbg_session_gk20a *dbg_s,
36 struct nvgpu_dbg_gpu_reg_op *ops,
40 struct dbg_gpu_session_events {
41 wait_queue_head_t wait_queue;
43 int num_pending_events;
46 struct dbg_session_gk20a {
47 /* dbg session id used for trace/prints */
50 /* profiler session, if any */
53 /* power enabled or disabled */
57 * There can be different versions of the whitelists
58 * between both global and per-context sets; as well
59 * as between debugger and profiler interfaces.
61 struct regops_whitelist *global;
62 struct regops_whitelist *per_context;
64 /* gpu module vagaries */
66 struct platform_device *pdev;
69 /* bound channel, if any */
71 struct channel_gk20a *ch;
73 /* session operations */
74 struct dbg_gpu_session_ops *ops;
77 struct dbg_gpu_session_events dbg_events;
78 struct list_head dbg_s_list_node;
81 extern struct dbg_gpu_session_ops dbg_gpu_session_ops_gk20a;
83 #endif /* DBG_GPU_GK20A_H */