summaryrefslogtreecommitdiffstats
path: root/include/linux/genalloc.h
diff options
context:
space:
mode:
authorFredrik Noring2019-06-25 17:05:58 +0200
committerChristoph Hellwig2019-06-28 07:56:50 +0200
commitcf394fc5f7155c24efb584979e81427575ab3539 (patch)
treeb0efff0a4653f217e8dc1a98231ff88575f27ea3 /include/linux/genalloc.h
parentnios2: use the generic uncached segment support in dma-direct (diff)
downloadkernel-qcow2-linux-cf394fc5f7155c24efb584979e81427575ab3539.tar.gz
kernel-qcow2-linux-cf394fc5f7155c24efb584979e81427575ab3539.tar.xz
kernel-qcow2-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.h10
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 *);