summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/regops_gk20a.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/regops_gk20a.h')
-rw-r--r--drivers/gpu/nvgpu/gk20a/regops_gk20a.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/regops_gk20a.h b/drivers/gpu/nvgpu/gk20a/regops_gk20a.h
new file mode 100644
index 00000000..e0496a75
--- /dev/null
+++ b/drivers/gpu/nvgpu/gk20a/regops_gk20a.h
@@ -0,0 +1,56 @@
1/*
2 * Tegra GK20A GPU Debugger Driver Register Ops
3 *
4 * Copyright (c) 2013-2017, NVIDIA CORPORATION. All rights reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 */
24#ifndef REGOPS_GK20A_H
25#define REGOPS_GK20A_H
26
27struct regop_offset_range {
28 u32 base:24;
29 u32 count:8;
30};
31
32int exec_regops_gk20a(struct dbg_session_gk20a *dbg_s,
33 struct nvgpu_dbg_gpu_reg_op *ops,
34 u64 num_ops);
35
36/* turn seriously unwieldy names -> something shorter */
37#define REGOP(x) NVGPU_DBG_GPU_REG_OP_##x
38
39static inline bool reg_op_is_gr_ctx(u8 type)
40{
41 return type == REGOP(TYPE_GR_CTX) ||
42 type == REGOP(TYPE_GR_CTX_TPC) ||
43 type == REGOP(TYPE_GR_CTX_SM) ||
44 type == REGOP(TYPE_GR_CTX_CROP) ||
45 type == REGOP(TYPE_GR_CTX_ZROP) ||
46 type == REGOP(TYPE_GR_CTX_QUAD);
47}
48static inline bool reg_op_is_read(u8 op)
49{
50 return op == REGOP(READ_32) ||
51 op == REGOP(READ_64) ;
52}
53
54bool is_bar0_global_offset_whitelisted_gk20a(struct gk20a *g, u32 offset);
55
56#endif /* REGOPS_GK20A_H */