summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/os/posix/os_posix.h
diff options
context:
space:
mode:
authorNicolas Benech <nbenech@nvidia.com>2018-06-27 17:45:03 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-09-24 18:52:29 -0400
commit127aa9735b07a2613bdbcfedbf741e44cf99ee9e (patch)
tree8dc7b7ef65b241ff6d81222715ca17c902d841bb /drivers/gpu/nvgpu/os/posix/os_posix.h
parentb7b107c1a19d0c9ca399c6a356a9d1adc4daac85 (diff)
gpu: nvgpu: posix: Add low level unit test IO mocking
Add an interface that the unit test modules can use to interact with nvgpu IO accessors. This interface is incredibly simple but not the easiest to use. More simple wrappers will be added later. JIRA NVGPU-1040 Change-Id: I325f09a1739a58ea6bcb1c74834037d6977ce0e8 Signed-off-by: Nicolas Benech <nbenech@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1741952 GVS: Gerrit_Virtual_Submit Reviewed-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/os/posix/os_posix.h')
-rw-r--r--drivers/gpu/nvgpu/os/posix/os_posix.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/os/posix/os_posix.h b/drivers/gpu/nvgpu/os/posix/os_posix.h
index 955186ef..ff8c9817 100644
--- a/drivers/gpu/nvgpu/os/posix/os_posix.h
+++ b/drivers/gpu/nvgpu/os/posix/os_posix.h
@@ -25,8 +25,34 @@
25 25
26#include "gk20a/gk20a.h" 26#include "gk20a/gk20a.h"
27 27
28struct nvgpu_posix_io_callbacks;
29
28struct nvgpu_os_posix { 30struct nvgpu_os_posix {
29 struct gk20a g; 31 struct gk20a g;
32
33
34 /*
35 * IO callbacks for handling the nvgpu IO accessors.
36 */
37 struct nvgpu_posix_io_callbacks *callbacks;
38
39 /*
40 * Memory-mapped register space for unit tests.
41 */
42 struct nvgpu_list_node reg_space_head;
43 int error_code;
44
45
46 /*
47 * List to record sequence of register writes.
48 */
49 struct nvgpu_list_node recorder_head;
50 bool recording;
30}; 51};
31 52
53static inline struct nvgpu_os_posix *nvgpu_os_posix_from_gk20a(struct gk20a *g)
54{
55 return container_of(g, struct nvgpu_os_posix, g);
56}
57
32#endif 58#endif