Rev 6082 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6082 | Rev 6102 | ||
---|---|---|---|
1 | /* |
1 | /* |
2 | * include/linux/dmapool.h |
2 | * include/linux/dmapool.h |
3 | * |
3 | * |
4 | * Allocation pools for DMAable (coherent) memory. |
4 | * Allocation pools for DMAable (coherent) memory. |
5 | * |
5 | * |
6 | * This file is licensed under the terms of the GNU General Public |
6 | * This file is licensed under the terms of the GNU General Public |
7 | * License version 2. This program is licensed "as is" without any |
7 | * License version 2. This program is licensed "as is" without any |
8 | * warranty of any kind, whether express or implied. |
8 | * warranty of any kind, whether express or implied. |
9 | */ |
9 | */ |
10 | 10 | ||
11 | #ifndef LINUX_DMAPOOL_H |
11 | #ifndef LINUX_DMAPOOL_H |
12 | #define LINUX_DMAPOOL_H |
12 | #define LINUX_DMAPOOL_H |
- | 13 | ||
- | 14 | #include |
|
- | 15 | #include |
|
- | 16 | ||
- | 17 | struct device; |
|
13 | 18 | ||
14 | struct dma_pool *dma_pool_create(const char *name, struct device *dev, |
19 | struct dma_pool *dma_pool_create(const char *name, struct device *dev, |
15 | size_t size, size_t align, size_t allocation); |
20 | size_t size, size_t align, size_t allocation); |
16 | 21 | ||
17 | void dma_pool_destroy(struct dma_pool *pool); |
22 | void dma_pool_destroy(struct dma_pool *pool); |
18 | 23 | ||
19 | void *dma_pool_alloc(struct dma_pool *pool, gfp_t mem_flags, |
24 | void *dma_pool_alloc(struct dma_pool *pool, gfp_t mem_flags, |
20 | dma_addr_t *handle); |
25 | dma_addr_t *handle); |
21 | 26 | ||
22 | static inline void *dma_pool_zalloc(struct dma_pool *pool, gfp_t mem_flags, |
27 | static inline void *dma_pool_zalloc(struct dma_pool *pool, gfp_t mem_flags, |
23 | dma_addr_t *handle) |
28 | dma_addr_t *handle) |
24 | { |
29 | { |
25 | return dma_pool_alloc(pool, mem_flags | __GFP_ZERO, handle); |
30 | return dma_pool_alloc(pool, mem_flags | __GFP_ZERO, handle); |
26 | } |
31 | } |
27 | 32 | ||
28 | void dma_pool_free(struct dma_pool *pool, void *vaddr, dma_addr_t addr); |
33 | void dma_pool_free(struct dma_pool *pool, void *vaddr, dma_addr_t addr); |
29 | 34 | ||
30 | /* |
35 | /* |
31 | * Managed DMA pool |
36 | * Managed DMA pool |
32 | */ |
37 | */ |
33 | struct dma_pool *dmam_pool_create(const char *name, struct device *dev, |
38 | struct dma_pool *dmam_pool_create(const char *name, struct device *dev, |
34 | size_t size, size_t align, size_t allocation); |
39 | size_t size, size_t align, size_t allocation); |
35 | void dmam_pool_destroy(struct dma_pool *pool); |
40 | void dmam_pool_destroy(struct dma_pool *pool); |
36 | 41 | ||
37 | #endif |
42 | #endif |