diff options
Diffstat (limited to 'drivers/gpu/nvgpu/include')
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/allocator.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/include/nvgpu/allocator.h b/drivers/gpu/nvgpu/include/nvgpu/allocator.h index dee9b562..d5a90c87 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/allocator.h +++ b/drivers/gpu/nvgpu/include/nvgpu/allocator.h | |||
@@ -41,11 +41,15 @@ struct nvgpu_allocator_ops { | |||
41 | * regular and fixed allocations then free_fixed() does not need to | 41 | * regular and fixed allocations then free_fixed() does not need to |
42 | * be implemented. This behavior exists for legacy reasons and should | 42 | * be implemented. This behavior exists for legacy reasons and should |
43 | * not be propagated to new allocators. | 43 | * not be propagated to new allocators. |
44 | * | ||
45 | * For allocators where the @page_size field is not applicable it can | ||
46 | * be left as 0. Otherwise a valid page size should be passed (4k or | ||
47 | * what the large page size is). | ||
44 | */ | 48 | */ |
45 | u64 (*alloc_fixed)(struct nvgpu_allocator *allocator, | 49 | u64 (*alloc_fixed)(struct nvgpu_allocator *allocator, |
46 | u64 base, u64 len); | 50 | u64 base, u64 len, u32 page_size); |
47 | void (*free_fixed)(struct nvgpu_allocator *allocator, | 51 | void (*free_fixed)(struct nvgpu_allocator *allocator, |
48 | u64 base, u64 len); | 52 | u64 base, u64 len); |
49 | 53 | ||
50 | /* | 54 | /* |
51 | * Allow allocators to reserve space for carveouts. | 55 | * Allow allocators to reserve space for carveouts. |
@@ -213,7 +217,8 @@ int nvgpu_lockless_allocator_init(struct gk20a *g, struct nvgpu_allocator *a, | |||
213 | u64 nvgpu_alloc(struct nvgpu_allocator *allocator, u64 len); | 217 | u64 nvgpu_alloc(struct nvgpu_allocator *allocator, u64 len); |
214 | void nvgpu_free(struct nvgpu_allocator *allocator, u64 addr); | 218 | void nvgpu_free(struct nvgpu_allocator *allocator, u64 addr); |
215 | 219 | ||
216 | u64 nvgpu_alloc_fixed(struct nvgpu_allocator *allocator, u64 base, u64 len); | 220 | u64 nvgpu_alloc_fixed(struct nvgpu_allocator *allocator, u64 base, u64 len, |
221 | u32 page_size); | ||
217 | void nvgpu_free_fixed(struct nvgpu_allocator *allocator, u64 base, u64 len); | 222 | void nvgpu_free_fixed(struct nvgpu_allocator *allocator, u64 base, u64 len); |
218 | 223 | ||
219 | int nvgpu_alloc_reserve_carveout(struct nvgpu_allocator *a, | 224 | int nvgpu_alloc_reserve_carveout(struct nvgpu_allocator *a, |
@@ -298,5 +303,8 @@ void nvgpu_alloc_debugfs_init(struct device *dev); | |||
298 | } while (0) | 303 | } while (0) |
299 | 304 | ||
300 | #endif | 305 | #endif |
306 | #define balloc_pr(alloctor, format, arg...) \ | ||
307 | pr_info("%-25s %25s() " format, \ | ||
308 | alloctor->name, __func__, ##arg) | ||
301 | 309 | ||
302 | #endif /* NVGPU_ALLOCATOR_H */ | 310 | #endif /* NVGPU_ALLOCATOR_H */ |