diff options
author | Debarshi Dutta <ddutta@nvidia.com> | 2017-08-03 06:04:44 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-08-17 17:26:47 -0400 |
commit | 98186ec2c2127c2af65a34f9e697e04f518a79ab (patch) | |
tree | 08ad87f3bf8c739e96b36f01728a8f7a30749a0e /drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c | |
parent | 49dc335cfe588179cbb42d8bab53bc76ba88b28f (diff) |
gpu: nvgpu: Add wrapper over atomic_t and atomic64_t
- added wrapper structs nvgpu_atomic_t and nvgpu_atomic64_t over
atomic_t and atomic64_t
- added nvgpu_atomic_* and nvgpu_atomic64_* APIs to access the above
wrappers.
JIRA NVGPU-121
Change-Id: I61667bb0a84c2fc475365abb79bffb42b8b4786a
Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1533044
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c b/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c index 1572ff48..00050850 100644 --- a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <nvgpu/kmem.h> | 26 | #include <nvgpu/kmem.h> |
27 | #include <nvgpu/log.h> | 27 | #include <nvgpu/log.h> |
28 | #include <nvgpu/vm.h> | 28 | #include <nvgpu/vm.h> |
29 | #include <nvgpu/atomic.h> | ||
29 | 30 | ||
30 | #include "gk20a.h" | 31 | #include "gk20a.h" |
31 | #include "gk20a/platform_gk20a.h" | 32 | #include "gk20a/platform_gk20a.h" |
@@ -74,10 +75,10 @@ nvgpu_dbg_gpu_get_session_channel(struct dbg_session_gk20a *dbg_s) | |||
74 | } | 75 | } |
75 | 76 | ||
76 | /* silly allocator - just increment id */ | 77 | /* silly allocator - just increment id */ |
77 | static atomic_t unique_id = ATOMIC_INIT(0); | 78 | static nvgpu_atomic_t unique_id = NVGPU_ATOMIC_INIT(0); |
78 | static int generate_unique_id(void) | 79 | static int generate_unique_id(void) |
79 | { | 80 | { |
80 | return atomic_add_return(1, &unique_id); | 81 | return nvgpu_atomic_add_return(1, &unique_id); |
81 | } | 82 | } |
82 | 83 | ||
83 | static int alloc_session(struct gk20a *g, struct dbg_session_gk20a **_dbg_s) | 84 | static int alloc_session(struct gk20a *g, struct dbg_session_gk20a **_dbg_s) |