Lines Matching +full:data +full:- +full:size
1 /* SPDX-License-Identifier: GPL-2.0-only */
5 * kmalloc/kfree interface. Uses for this includes on-device special
21 * On architectures that don't have NMI-safe cmpxchg implementation,
42 * @size: The bitmap size in bits
45 * @data: optional additional data used by the callback
49 unsigned long size,
52 void *data, struct gen_pool *pool,
64 void *data; member
76 void *owner; /* private data to retrieve at alloc time */
83 * gen_pool data descriptor for gen_pool_first_fit_align.
90 * gen_pool data descriptor for gen_pool_fixed_alloc.
102 phys_addr_t phys, size_t size, int nid) in gen_pool_add_virt() argument
104 return gen_pool_add_owner(pool, addr, phys, size, nid, NULL); in gen_pool_add_virt()
108 * gen_pool_add - add a new chunk of special memory to the pool
111 * @size: size in bytes of the memory chunk to add to pool
113 * allocated on, or -1
117 * Returns 0 on success or a -ve errno on failure.
120 size_t size, int nid) in gen_pool_add() argument
122 return gen_pool_add_virt(pool, addr, -1, size, nid); in gen_pool_add()
125 unsigned long gen_pool_alloc_algo_owner(struct gen_pool *pool, size_t size,
126 genpool_algo_t algo, void *data, void **owner);
129 size_t size, void **owner) in gen_pool_alloc_owner() argument
131 return gen_pool_alloc_algo_owner(pool, size, pool->algo, pool->data, in gen_pool_alloc_owner()
136 size_t size, genpool_algo_t algo, void *data) in gen_pool_alloc_algo() argument
138 return gen_pool_alloc_algo_owner(pool, size, algo, data, NULL); in gen_pool_alloc_algo()
142 * gen_pool_alloc - allocate special memory from the pool
144 * @size: number of bytes to allocate from the pool
147 * Uses the pool allocation function (with first-fit algorithm by default).
149 * NMI-safe cmpxchg implementation.
151 static inline unsigned long gen_pool_alloc(struct gen_pool *pool, size_t size) in gen_pool_alloc() argument
153 return gen_pool_alloc_algo(pool, size, pool->algo, pool->data); in gen_pool_alloc()
156 extern void *gen_pool_dma_alloc(struct gen_pool *pool, size_t size,
158 extern void *gen_pool_dma_alloc_algo(struct gen_pool *pool, size_t size,
159 dma_addr_t *dma, genpool_algo_t algo, void *data);
160 extern void *gen_pool_dma_alloc_align(struct gen_pool *pool, size_t size,
162 extern void *gen_pool_dma_zalloc(struct gen_pool *pool, size_t size, dma_addr_t *dma);
163 extern void *gen_pool_dma_zalloc_algo(struct gen_pool *pool, size_t size,
164 dma_addr_t *dma, genpool_algo_t algo, void *data);
165 extern void *gen_pool_dma_zalloc_align(struct gen_pool *pool, size_t size,
168 size_t size, void **owner);
170 size_t size) in gen_pool_free() argument
172 gen_pool_free_owner(pool, addr, size, NULL); in gen_pool_free()
181 void *data);
183 extern unsigned long gen_pool_first_fit(unsigned long *map, unsigned long size,
184 unsigned long start, unsigned int nr, void *data,
188 unsigned long size, unsigned long start, unsigned int nr,
189 void *data, struct gen_pool *pool, unsigned long start_addr);
192 unsigned long size, unsigned long start, unsigned int nr,
193 void *data, struct gen_pool *pool, unsigned long start_addr);
197 unsigned long size, unsigned long start, unsigned int nr,
198 void *data, struct gen_pool *pool, unsigned long start_addr);
200 extern unsigned long gen_pool_best_fit(unsigned long *map, unsigned long size,
201 unsigned long start, unsigned int nr, void *data,
210 size_t size);