diff options
author | Fredrik Noring <noring@nocrew.org> | 2019-06-25 17:05:58 +0200 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2019-06-28 07:56:50 +0200 |
commit | cf394fc5f7155c24efb584979e81427575ab3539 (patch) | |
tree | b0efff0a4653f217e8dc1a98231ff88575f27ea3 /include/linux/genalloc.h | |
parent | b1acd4b8a8942f614053e516c56c88e1716562d6 (diff) | |
download | blackbird-op-linux-cf394fc5f7155c24efb584979e81427575ab3539.tar.gz blackbird-op-linux-cf394fc5f7155c24efb584979e81427575ab3539.zip |
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>
Diffstat (limited to 'include/linux/genalloc.h')
-rw-r--r-- | include/linux/genalloc.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/include/linux/genalloc.h b/include/linux/genalloc.h index 6c62eeca754f..ed641337df87 100644 --- a/include/linux/genalloc.h +++ b/include/linux/genalloc.h @@ -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 *); |