lib/genalloc.c: Add algorithm, align and zeroed family of DMA allocators
Provide the algorithm option to DMA allocators as well, along with convenience variants for zeroed and aligned memory. The following four functions are added: - gen_pool_dma_alloc_algo() - gen_pool_dma_alloc_align() - gen_pool_dma_zalloc_algo() - gen_pool_dma_zalloc_align() Signed-off-by: Fredrik Noring <noring@nocrew.org> Tested-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:

committed by
Christoph Hellwig

parent
b1acd4b8a8
commit
cf394fc5f7
@@ -121,7 +121,15 @@ extern unsigned long gen_pool_alloc_algo(struct gen_pool *, size_t,
|
||||
genpool_algo_t algo, void *data);
|
||||
extern void *gen_pool_dma_alloc(struct gen_pool *pool, size_t size,
|
||||
dma_addr_t *dma);
|
||||
void *gen_pool_dma_zalloc(struct gen_pool *pool, size_t size, dma_addr_t *dma);
|
||||
extern void *gen_pool_dma_alloc_algo(struct gen_pool *pool, size_t size,
|
||||
dma_addr_t *dma, genpool_algo_t algo, void *data);
|
||||
extern void *gen_pool_dma_alloc_align(struct gen_pool *pool, size_t size,
|
||||
dma_addr_t *dma, int align);
|
||||
extern void *gen_pool_dma_zalloc(struct gen_pool *pool, size_t size, dma_addr_t *dma);
|
||||
extern void *gen_pool_dma_zalloc_algo(struct gen_pool *pool, size_t size,
|
||||
dma_addr_t *dma, genpool_algo_t algo, void *data);
|
||||
extern void *gen_pool_dma_zalloc_align(struct gen_pool *pool, size_t size,
|
||||
dma_addr_t *dma, int align);
|
||||
extern void gen_pool_free(struct gen_pool *, unsigned long, size_t);
|
||||
extern void gen_pool_for_each_chunk(struct gen_pool *,
|
||||
void (*)(struct gen_pool *, struct gen_pool_chunk *, void *), void *);
|
||||
|
Reference in New Issue
Block a user