summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2018-01-22 19:30:53 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2018-05-07 07:41:26 -0400
commit6e739d924fe9b778fa82396e0e941143f498acb8 (patch)
treef112ede8573c2f8bf76e0bdaadf33c6c71343820 /include
parente6b3bb4e6b3d4013f83ba6d31c780947f16cf410 (diff)
gpu: nvgpu: Userspace POSIX support
Add support for compiling nvgpu in a POSIX compliant userspace. This code adds all of the necessary abstraction interfaces (mostly stubbed) to enabled extremely limited and basic functionality in nvgpu. The goal of this code is to facilitate unit testing of the nvgpu common core. By doing this in userspace it is much easier to write tests that rely on very particular states within nvgpu since a user can very precisely control the state of nvgpu. JIRA NVGPU-525 Change-Id: I30e95016df14997d951075777e0585f912dc5960 Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1683914 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'include')
-rw-r--r--include/trace/events/gk20a.h25
-rw-r--r--include/uapi/linux/nvgpu.h1
2 files changed, 26 insertions, 0 deletions
diff --git a/include/trace/events/gk20a.h b/include/trace/events/gk20a.h
index 9600b201..99726e4c 100644
--- a/include/trace/events/gk20a.h
+++ b/include/trace/events/gk20a.h
@@ -13,6 +13,8 @@
13 * more details. 13 * more details.
14 */ 14 */
15 15
16#ifdef __KERNEL__
17
16#undef TRACE_SYSTEM 18#undef TRACE_SYSTEM
17#define TRACE_SYSTEM gk20a 19#define TRACE_SYSTEM gk20a
18 20
@@ -577,3 +579,26 @@ DEFINE_EVENT(gk20a_cde, gk20a_cde_finished_ctx_cb,
577 579
578/* This part must be outside protection */ 580/* This part must be outside protection */
579#include <trace/define_trace.h> 581#include <trace/define_trace.h>
582
583#else /* Not __KERNEL__ */
584
585#define trace_gk20a_mmu_fault(arg...) ((void)(NULL))
586#define trace_gk20a_release_used_channel(arg...) ((void)(NULL))
587#define trace_gk20a_free_channel(arg...) ((void)(NULL))
588#define trace_gk20a_channel_get(arg...) ((void)(NULL))
589#define trace_gk20a_channel_put(arg...) ((void)(NULL))
590#define trace_gk20a_open_new_channel(arg...) ((void)(NULL))
591#define trace_gk20a_channel_update(arg...) ((void)(NULL))
592
593#define trace_gk20a_mm_fb_flush(arg...) ((void)(NULL))
594#define trace_gk20a_mm_fb_flush_done(arg...) ((void)(NULL))
595#define trace_gk20a_mm_l2_invalidate(arg...) ((void)(NULL))
596#define trace_gk20a_mm_l2_invalidate_done(arg...) ((void)(NULL))
597#define trace_gk20a_mm_l2_flush(arg...) ((void)(NULL))
598#define trace_gk20a_mm_l2_flush_done(arg...) ((void)(NULL))
599#define trace_gk20a_mm_tlb_invalidate(arg...) ((void)(NULL))
600#define trace_gk20a_mm_tlb_invalidate_done(arg...) ((void)(NULL))
601#define trace_gk20a_ltc_cbc_ctrl_start(arg...) ((void)(NULL))
602#define trace_gk20a_ltc_cbc_ctrl_done(arg...) ((void)(NULL))
603
604#endif
diff --git a/include/uapi/linux/nvgpu.h b/include/uapi/linux/nvgpu.h
index 8a578102..d97f8fb6 100644
--- a/include/uapi/linux/nvgpu.h
+++ b/include/uapi/linux/nvgpu.h
@@ -21,6 +21,7 @@
21 21
22#if !defined(__KERNEL__) 22#if !defined(__KERNEL__)
23#define __user 23#define __user
24#define __packed __attribute__((packed))
24#endif 25#endif
25 26
26/* 27/*