diff options
Diffstat (limited to 'drivers/gpu/nvgpu/include')
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/page_allocator.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/include/nvgpu/page_allocator.h b/drivers/gpu/nvgpu/include/nvgpu/page_allocator.h index fa586dba..92f48ac5 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/page_allocator.h +++ b/drivers/gpu/nvgpu/include/nvgpu/page_allocator.h | |||
@@ -22,6 +22,7 @@ | |||
22 | 22 | ||
23 | #include <nvgpu/allocator.h> | 23 | #include <nvgpu/allocator.h> |
24 | #include <nvgpu/kmem.h> | 24 | #include <nvgpu/kmem.h> |
25 | #include <nvgpu/list.h> | ||
25 | 26 | ||
26 | struct nvgpu_allocator; | 27 | struct nvgpu_allocator; |
27 | 28 | ||
@@ -78,19 +79,26 @@ struct page_alloc_slab_page { | |||
78 | }; | 79 | }; |
79 | 80 | ||
80 | struct page_alloc_chunk { | 81 | struct page_alloc_chunk { |
81 | struct list_head list_entry; | 82 | struct nvgpu_list_node list_entry; |
82 | 83 | ||
83 | u64 base; | 84 | u64 base; |
84 | u64 length; | 85 | u64 length; |
85 | }; | 86 | }; |
86 | 87 | ||
88 | static inline struct page_alloc_chunk * | ||
89 | page_alloc_chunk_from_list_entry(struct nvgpu_list_node *node) | ||
90 | { | ||
91 | return (struct page_alloc_chunk *) | ||
92 | ((uintptr_t)node - offsetof(struct page_alloc_chunk, list_entry)); | ||
93 | }; | ||
94 | |||
87 | /* | 95 | /* |
88 | * Struct to handle internal management of page allocation. It holds a list | 96 | * Struct to handle internal management of page allocation. It holds a list |
89 | * of the chunks of pages that make up the overall allocation - much like a | 97 | * of the chunks of pages that make up the overall allocation - much like a |
90 | * scatter gather table. | 98 | * scatter gather table. |
91 | */ | 99 | */ |
92 | struct nvgpu_page_alloc { | 100 | struct nvgpu_page_alloc { |
93 | struct list_head alloc_chunks; | 101 | struct nvgpu_list_node alloc_chunks; |
94 | 102 | ||
95 | int nr_chunks; | 103 | int nr_chunks; |
96 | u64 length; | 104 | u64 length; |