diff options
| author | Dan Willemsen <dwillemsen@nvidia.com> | 2014-03-04 06:03:26 -0500 |
|---|---|---|
| committer | Dan Willemsen <dwillemsen@nvidia.com> | 2015-03-18 15:08:24 -0400 |
| commit | 97d8d581253f22fdb2c9585c19f3ae649f2cbe1f (patch) | |
| tree | ab59d4df3a6f2227cf7f4e0baa77b67603ba615d /include/linux/nvmap.h | |
| parent | d3b48dc64b671d15d563fd45c4b15b98e46d8ea0 (diff) | |
video: tegra: nvmap: Always use a __u32 for a handle
We were always using a 32-bit size already, but sometimes we were using
a pointer, sometimes an integer. Since these are always integers, use
__u32 everywhere.
This does not affect the userspace ABI.
Change-Id: I8f0e1dd98e87a34cd24c3a8d6e28c88a1d9fcdca
Signed-off-by: Dan Willemsen <dwillemsen@nvidia.com>
Reviewed-on: http://git-master/r/377233
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
Diffstat (limited to 'include/linux/nvmap.h')
| -rw-r--r-- | include/linux/nvmap.h | 31 |
1 files changed, 6 insertions, 25 deletions
diff --git a/include/linux/nvmap.h b/include/linux/nvmap.h index 72c162c94..0b2ad512a 100644 --- a/include/linux/nvmap.h +++ b/include/linux/nvmap.h | |||
| @@ -53,11 +53,11 @@ | |||
| 53 | #define NVMAP_HANDLE_COMPR_SPECIFIED (0x1ul << 4) | 53 | #define NVMAP_HANDLE_COMPR_SPECIFIED (0x1ul << 4) |
| 54 | #define NVMAP_HANDLE_ZEROED_PAGES (0x1ul << 5) | 54 | #define NVMAP_HANDLE_ZEROED_PAGES (0x1ul << 5) |
| 55 | 55 | ||
| 56 | #if defined(__KERNEL__) | ||
| 57 | |||
| 56 | struct nvmap_handle; | 58 | struct nvmap_handle; |
| 57 | struct nvmap_handle_ref; | 59 | struct nvmap_handle_ref; |
| 58 | 60 | ||
| 59 | #if defined(__KERNEL__) | ||
| 60 | |||
| 61 | struct nvmap_client; | 61 | struct nvmap_client; |
| 62 | struct nvmap_device; | 62 | struct nvmap_device; |
| 63 | 63 | ||
| @@ -131,23 +131,18 @@ struct nvmap_create_handle { | |||
| 131 | __u32 size; /* CreateHandle */ | 131 | __u32 size; /* CreateHandle */ |
| 132 | __s32 fd; /* DmaBufFd or FromFd */ | 132 | __s32 fd; /* DmaBufFd or FromFd */ |
| 133 | }; | 133 | }; |
| 134 | __u32 handle; /* returns nvmap handle */ | ||
| 135 | #else | 134 | #else |
| 136 | union { | 135 | union { |
| 137 | unsigned long id; /* FromId */ | 136 | unsigned long id; /* FromId */ |
| 138 | __u32 size; /* CreateHandle */ | 137 | __u32 size; /* CreateHandle */ |
| 139 | __s32 fd; /* DmaBufFd or FromFd */ | 138 | __s32 fd; /* DmaBufFd or FromFd */ |
| 140 | }; | 139 | }; |
| 141 | struct nvmap_handle *handle; /* returns nvmap handle */ | ||
| 142 | #endif | 140 | #endif |
| 141 | __u32 handle; /* returns nvmap handle */ | ||
| 143 | }; | 142 | }; |
| 144 | 143 | ||
| 145 | struct nvmap_alloc_handle { | 144 | struct nvmap_alloc_handle { |
| 146 | #ifdef CONFIG_COMPAT | ||
| 147 | __u32 handle; /* nvmap handle */ | 145 | __u32 handle; /* nvmap handle */ |
| 148 | #else | ||
| 149 | struct nvmap_handle *handle; /* nvmap handle */ | ||
| 150 | #endif | ||
| 151 | __u32 heap_mask; /* heaps to allocate from */ | 146 | __u32 heap_mask; /* heaps to allocate from */ |
| 152 | __u32 flags; /* wb/wc/uc/iwb etc. */ | 147 | __u32 flags; /* wb/wc/uc/iwb etc. */ |
| 153 | __u32 align; /* min alignment necessary */ | 148 | __u32 align; /* min alignment necessary */ |
| @@ -155,11 +150,7 @@ struct nvmap_alloc_handle { | |||
| 155 | 150 | ||
| 156 | 151 | ||
| 157 | struct nvmap_alloc_kind_handle { | 152 | struct nvmap_alloc_kind_handle { |
| 158 | #ifdef CONFIG_COMPAT | ||
| 159 | __u32 handle; /* nvmap handle */ | 153 | __u32 handle; /* nvmap handle */ |
| 160 | #else | ||
| 161 | struct nvmap_handle *handle; /* nvmap handle */ | ||
| 162 | #endif | ||
| 163 | __u32 heap_mask; | 154 | __u32 heap_mask; |
| 164 | __u32 flags; | 155 | __u32 flags; |
| 165 | __u32 align; | 156 | __u32 align; |
| @@ -168,11 +159,7 @@ struct nvmap_alloc_kind_handle { | |||
| 168 | }; | 159 | }; |
| 169 | 160 | ||
| 170 | struct nvmap_map_caller { | 161 | struct nvmap_map_caller { |
| 171 | #ifdef CONFIG_COMPAT | ||
| 172 | __u32 handle; /* nvmap handle */ | 162 | __u32 handle; /* nvmap handle */ |
| 173 | #else | ||
| 174 | struct nvmap_handle *handle; /* nvmap handle */ | ||
| 175 | #endif | ||
| 176 | __u32 offset; /* offset into hmem; should be page-aligned */ | 163 | __u32 offset; /* offset into hmem; should be page-aligned */ |
| 177 | __u32 length; /* number of bytes to map */ | 164 | __u32 length; /* number of bytes to map */ |
| 178 | __u32 flags; /* maps as wb/iwb etc. */ | 165 | __u32 flags; /* maps as wb/iwb etc. */ |
| @@ -186,11 +173,10 @@ struct nvmap_map_caller { | |||
| 186 | struct nvmap_rw_handle { | 173 | struct nvmap_rw_handle { |
| 187 | #ifdef CONFIG_COMPAT | 174 | #ifdef CONFIG_COMPAT |
| 188 | __u32 addr; /* user pointer */ | 175 | __u32 addr; /* user pointer */ |
| 189 | __u32 handle; /* nvmap handle */ | ||
| 190 | #else | 176 | #else |
| 191 | unsigned long addr; /* user pointer*/ | 177 | unsigned long addr; /* user pointer*/ |
| 192 | struct nvmap_handle *handle; /* nvmap handle */ | ||
| 193 | #endif | 178 | #endif |
| 179 | __u32 handle; /* nvmap handle */ | ||
| 194 | __u32 offset; /* offset into hmem */ | 180 | __u32 offset; /* offset into hmem */ |
| 195 | __u32 elem_size; /* individual atom size */ | 181 | __u32 elem_size; /* individual atom size */ |
| 196 | __u32 hmem_stride; /* delta in bytes between atoms in hmem */ | 182 | __u32 hmem_stride; /* delta in bytes between atoms in hmem */ |
| @@ -203,18 +189,14 @@ struct nvmap_pin_handle { | |||
| 203 | __u32 handles; /* array of handles to pin/unpin */ | 189 | __u32 handles; /* array of handles to pin/unpin */ |
| 204 | __u32 addr; /* array of addresses to return */ | 190 | __u32 addr; /* array of addresses to return */ |
| 205 | #else | 191 | #else |
| 206 | struct nvmap_handle **handles; /* array of handles to pin/unpin */ | 192 | __u32 *handles; /* array of handles to pin/unpin */ |
| 207 | unsigned long *addr; /* array of addresses to return */ | 193 | unsigned long *addr; /* array of addresses to return */ |
| 208 | #endif | 194 | #endif |
| 209 | __u32 count; /* number of entries in handles */ | 195 | __u32 count; /* number of entries in handles */ |
| 210 | }; | 196 | }; |
| 211 | 197 | ||
| 212 | struct nvmap_handle_param { | 198 | struct nvmap_handle_param { |
| 213 | #ifdef CONFIG_COMPAT | ||
| 214 | __u32 handle; /* nvmap handle */ | 199 | __u32 handle; /* nvmap handle */ |
| 215 | #else | ||
| 216 | struct nvmap_handle *handle; /* nvmap handle */ | ||
| 217 | #endif | ||
| 218 | __u32 param; /* size/align/base/heap etc. */ | 200 | __u32 param; /* size/align/base/heap etc. */ |
| 219 | #ifdef CONFIG_COMPAT | 201 | #ifdef CONFIG_COMPAT |
| 220 | __u32 result; /* returnes requested info*/ | 202 | __u32 result; /* returnes requested info*/ |
| @@ -226,11 +208,10 @@ struct nvmap_handle_param { | |||
| 226 | struct nvmap_cache_op { | 208 | struct nvmap_cache_op { |
| 227 | #ifdef CONFIG_COMPAT | 209 | #ifdef CONFIG_COMPAT |
| 228 | __u32 addr; /* user pointer*/ | 210 | __u32 addr; /* user pointer*/ |
| 229 | __u32 handle; /* nvmap handle */ | ||
| 230 | #else | 211 | #else |
| 231 | unsigned long addr; /* user pointer*/ | 212 | unsigned long addr; /* user pointer*/ |
| 232 | struct nvmap_handle *handle; /* nvmap handle */ | ||
| 233 | #endif | 213 | #endif |
| 214 | __u32 handle; /* nvmap handle */ | ||
| 234 | __u32 len; /* bytes to flush */ | 215 | __u32 len; /* bytes to flush */ |
| 235 | __s32 op; /* wb/wb_inv/inv */ | 216 | __s32 op; /* wb/wb_inv/inv */ |
| 236 | }; | 217 | }; |
